Class ExportUploadService
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.service.export.ExportUploadService
-
@Service public class ExportUploadService extends java.lang.Object
Class which handles uploading aNcbiExportSubmission
to NCBI
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NCBI_ACCESSION_METADATA_LABEL
-
Constructor Summary
Constructors Constructor Description ExportUploadService(NcbiExportSubmissionService exportSubmissionService, SampleService sampleService, MetadataTemplateService metadataTemplateService, org.thymeleaf.TemplateEngine templateEngine, EmailController emailController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
createXml(NcbiExportSubmission submission)
Create the XML for anNcbiExportSubmission
void
launchUpload()
Check for newNcbiExportSubmission
s to be uploaded and begin their uploadvoid
setConnectionDetails(java.lang.String ftpHost, int ftpPort, java.lang.String ftpUser, java.lang.String ftpPassword, java.lang.String baseDirectory)
Manually configure connection details for this servicevoid
updateRunningUploads()
Check local database for submissions which may have updates on the NCBI server and update them as necessary.NcbiExportSubmission
uploadSubmission(NcbiExportSubmission submission, java.lang.String xml)
Upload anNcbiExportSubmission
's files and submission xml to the configured ftp site
-
-
-
Field Detail
-
NCBI_ACCESSION_METADATA_LABEL
public static final java.lang.String NCBI_ACCESSION_METADATA_LABEL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExportUploadService
@Autowired public ExportUploadService(NcbiExportSubmissionService exportSubmissionService, SampleService sampleService, MetadataTemplateService metadataTemplateService, @Qualifier("exportUploadTemplateEngine") org.thymeleaf.TemplateEngine templateEngine, EmailController emailController)
-
-
Method Detail
-
setConnectionDetails
public void setConnectionDetails(java.lang.String ftpHost, int ftpPort, java.lang.String ftpUser, java.lang.String ftpPassword, java.lang.String baseDirectory)
Manually configure connection details for this service- Parameters:
ftpHost
- The hostname to connect toftpPort
- the ftp port to connect toftpUser
- the username to authenticate withftpPassword
- the password to authenticate withbaseDirectory
- the base directory to upload new runs into
-
launchUpload
public void launchUpload()
Check for newNcbiExportSubmission
s to be uploaded and begin their upload
-
updateRunningUploads
public void updateRunningUploads()
Check local database for submissions which may have updates on the NCBI server and update them as necessary.
-
createXml
public java.lang.String createXml(NcbiExportSubmission submission)
Create the XML for anNcbiExportSubmission
- Parameters:
submission
- theNcbiExportSubmission
to create submission xml for- Returns:
- String content of the xml
-
uploadSubmission
public NcbiExportSubmission uploadSubmission(NcbiExportSubmission submission, java.lang.String xml) throws UploadException
Upload anNcbiExportSubmission
's files and submission xml to the configured ftp site- Parameters:
submission
- TheNcbiExportSubmission
to uploadxml
- The submission xml to upload- Returns:
- true/false if upload was successful
- Throws:
UploadException
- if the upload failed
-
-