public void EndFileTransfer(long submittedJobInfoId, FileTransferMethodExt usedTransferMethod, string sessionCode) { try { using (IUnitOfWork unitOfWork = UnitOfWorkFactory.GetUnitOfWorkFactory().CreateUnitOfWork()) { AdaptorUser loggedUser = UserAndLimitationManagementService.GetValidatedUserForSessionCode(sessionCode, unitOfWork, UserRoleType.Submitter); IFileTransferLogic fileTransferLogic = LogicFactory.GetLogicFactory().CreateFileTransferLogic(unitOfWork); fileTransferLogic.EndFileTransfer(submittedJobInfoId, FileTransferConverts.ConvertFileTransferMethodExtToIn(usedTransferMethod), loggedUser); } } catch (Exception exc) { ExceptionHandler.ThrowProperExternalException(exc); } }
public byte[] DownloadFileFromCluster(long submittedJobInfoId, string relativeFilePath, string sessionCode) { try { using (IUnitOfWork unitOfWork = UnitOfWorkFactory.GetUnitOfWorkFactory().CreateUnitOfWork()) { AdaptorUser loggedUser = UserAndLimitationManagementService.GetValidatedUserForSessionCode(sessionCode, unitOfWork, UserRoleType.Submitter); IFileTransferLogic fileTransferLogic = LogicFactory.GetLogicFactory().CreateFileTransferLogic(unitOfWork); return(fileTransferLogic.DownloadFileFromCluster(submittedJobInfoId, relativeFilePath, loggedUser)); } } catch (Exception exc) { ExceptionHandler.ThrowProperExternalException(exc); return(null); } }
public FileInformationExt[] ListChangedFilesForJob(long submittedJobInfoId, string sessionCode) { try { using (IUnitOfWork unitOfWork = UnitOfWorkFactory.GetUnitOfWorkFactory().CreateUnitOfWork()) { AdaptorUser loggedUser = UserAndLimitationManagementService.GetValidatedUserForSessionCode(sessionCode, unitOfWork, UserRoleType.Submitter); IFileTransferLogic fileTransferLogic = LogicFactory.GetLogicFactory().CreateFileTransferLogic(unitOfWork); ICollection <FileInformation> result = fileTransferLogic.ListChangedFilesForJob(submittedJobInfoId, loggedUser); return(result?.Select(s => s.ConvertIntToExt()).ToArray()); } } catch (Exception exc) { ExceptionHandler.ThrowProperExternalException(exc); return(null); } }
public FileTransferMethodExt GetFileTransferMethod(long submittedJobInfoId, string sessionCode) { try { using (IUnitOfWork unitOfWork = UnitOfWorkFactory.GetUnitOfWorkFactory().CreateUnitOfWork()) { AdaptorUser loggedUser = UserAndLimitationManagementService.GetValidatedUserForSessionCode(sessionCode, unitOfWork, UserRoleType.Submitter); IFileTransferLogic fileTransferLogic = LogicFactory.GetLogicFactory().CreateFileTransferLogic(unitOfWork); FileTransferMethod fileTransferMethod = fileTransferLogic.GetFileTransferMethod(submittedJobInfoId, loggedUser); return(fileTransferMethod.ConvertIntToExt()); } } catch (Exception exc) { ExceptionHandler.ThrowProperExternalException(exc); return(null); } }
public JobFileContentExt[] DownloadPartsOfJobFilesFromCluster(long submittedJobInfoId, TaskFileOffsetExt[] taskFileOffsets, string sessionCode) { try { using (IUnitOfWork unitOfWork = UnitOfWorkFactory.GetUnitOfWorkFactory().CreateUnitOfWork()) { AdaptorUser loggedUser = UserAndLimitationManagementService.GetValidatedUserForSessionCode(sessionCode, unitOfWork, UserRoleType.Submitter); IFileTransferLogic fileTransferLogic = LogicFactory.GetLogicFactory().CreateFileTransferLogic(unitOfWork); IList <JobFileContent> downloadedFileParts = fileTransferLogic.DownloadPartsOfJobFilesFromCluster( submittedJobInfoId, (from taskFileOffset in (new List <TaskFileOffsetExt>(taskFileOffsets).ToList()) select FileTransferConverts.ConvertTaskFileOffsetExtToIn(taskFileOffset)).ToArray(), loggedUser); return((from fileContent in downloadedFileParts select FileTransferConverts.ConvertJobFileContentToExt(fileContent)).ToArray()); } } catch (Exception exc) { ExceptionHandler.ThrowProperExternalException(exc); return(null); } }