示例#1
0
 public void DeleteJob(long submittedJobInfoId, string sessionCode)
 {
     try
     {
         using (IUnitOfWork unitOfWork = UnitOfWorkFactory.GetUnitOfWorkFactory().CreateUnitOfWork())
         {
             AdaptorUser         loggedUser = UserAndLimitationManagementService.GetValidatedUserForSessionCode(sessionCode, unitOfWork, UserRoleType.Submitter);
             IJobManagementLogic jobLogic   = LogicFactory.GetLogicFactory().CreateJobManagementLogic(unitOfWork);
             jobLogic.DeleteJob(submittedJobInfoId, loggedUser);
         }
     }
     catch (Exception exc)
     {
         ExceptionHandler.ThrowProperExternalException(exc);
     }
 }
示例#2
0
 public SubmittedJobInfoExt SubmitJob(long createdJobInfoId, string sessionCode)
 {
     try
     {
         using (IUnitOfWork unitOfWork = UnitOfWorkFactory.GetUnitOfWorkFactory().CreateUnitOfWork())
         {
             AdaptorUser         loggedUser = UserAndLimitationManagementService.GetValidatedUserForSessionCode(sessionCode, unitOfWork, UserRoleType.Submitter);
             IJobManagementLogic jobLogic   = LogicFactory.GetLogicFactory().CreateJobManagementLogic(unitOfWork);
             SubmittedJobInfo    jobInfo    = jobLogic.SubmitJob(createdJobInfoId, loggedUser);
             return(jobInfo.ConvertIntToExt());
         }
     }
     catch (Exception exc)
     {
         ExceptionHandler.ThrowProperExternalException(exc);
         return(null);
     }
 }
示例#3
0
 public IEnumerable <string> GetAllocatedNodesIPs(long submittedTaskInfoId, string sessionCode)
 {
     try
     {
         using (IUnitOfWork unitOfWork = UnitOfWorkFactory.GetUnitOfWorkFactory().CreateUnitOfWork())
         {
             AdaptorUser         loggedUser = UserAndLimitationManagementService.GetValidatedUserForSessionCode(sessionCode, unitOfWork, UserRoleType.Submitter);
             IJobManagementLogic jobLogic   = LogicFactory.GetLogicFactory().CreateJobManagementLogic(unitOfWork);
             var nodesIPs = jobLogic.GetAllocatedNodesIPs(submittedTaskInfoId, loggedUser);
             return(nodesIPs.ToArray());
         }
     }
     catch (Exception exc)
     {
         ExceptionHandler.ThrowProperExternalException(exc);
         return(null);
     }
 }
示例#4
0
 public SubmittedJobInfoExt[] ListJobsForCurrentUser(string sessionCode)
 {
     try
     {
         using (IUnitOfWork unitOfWork = UnitOfWorkFactory.GetUnitOfWorkFactory().CreateUnitOfWork())
         {
             AdaptorUser         loggedUser = UserAndLimitationManagementService.GetValidatedUserForSessionCode(sessionCode, unitOfWork, UserRoleType.Submitter);
             IJobManagementLogic jobLogic   = LogicFactory.GetLogicFactory().CreateJobManagementLogic(unitOfWork);
             var jobInfos = jobLogic.GetJobsForUser(loggedUser);
             return(jobInfos.Select(s => s.ConvertIntToExt()).ToArray());
         }
     }
     catch (Exception exc)
     {
         ExceptionHandler.ThrowProperExternalException(exc);
         return(null);
     }
 }
示例#5
0
 public SubmittedJobInfoExt CreateJob(JobSpecificationExt specification, string sessionCode)
 {
     try
     {
         using (IUnitOfWork unitOfWork = UnitOfWorkFactory.GetUnitOfWorkFactory().CreateUnitOfWork())
         {
             AdaptorUser         loggedUser = UserAndLimitationManagementService.GetValidatedUserForSessionCode(sessionCode, unitOfWork, UserRoleType.Submitter);
             IJobManagementLogic jobLogic   = LogicFactory.GetLogicFactory().CreateJobManagementLogic(unitOfWork);
             JobSpecification    js         = specification.ConvertExtToInt();
             SubmittedJobInfo    jobInfo    = jobLogic.CreateJob(js, loggedUser, specification.IsExtraLong.Value);
             return(jobInfo.ConvertIntToExt());
         }
     }
     catch (Exception exc)
     {
         ExceptionHandler.ThrowProperExternalException(exc);
         return(null);
     }
 }