Class ProjectSynchronizationService
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.service.remote.ProjectSynchronizationService
-
@Service public class ProjectSynchronizationService extends java.lang.ObjectService class to run a project synchornization task. Ths class will be responsible for communicating with Remote IRIDA installations and pulling metadata and sequencing data into the local installation.
-
-
Constructor Summary
Constructors Constructor Description ProjectSynchronizationService(ProjectService projectService, SampleService sampleService, SequencingObjectService objectService, MetadataTemplateService metadataTemplateService, GenomeAssemblyService assemblyService, ProjectRemoteService projectRemoteService, SampleRemoteService sampleRemoteService, SingleEndSequenceFileRemoteService singleEndRemoteService, SequenceFilePairRemoteService pairRemoteService, GenomeAssemblyRemoteService assemblyRemoteService, Fast5ObjectRemoteService fast5ObjectRemoteService, RemoteAPITokenService tokenService, EmailController emailController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfindMarkedProjectsToSync()Find projects which should be synchronized and launch a synchornization task.voidfindProjectsToMark()Method checking for remote projects that have passed their frequency time.voidsyncAssembly(UploadedAssembly assembly, Sample sample)Synchronize a givenUploadedAssemblyto the local installationvoidsyncFast5File(Fast5Object fast5Object, Sample sample)Synchronize a givenFast5Objectto the local installationjava.util.List<ProjectSynchronizationException>syncSample(Sample sample, Project project, java.util.Map<java.lang.String,Sample> existingSamples)Synchronize a givenSampleto the local installation.voidsyncSampleMetadata(Sample remoteSample, Sample localSample)Synchronize the given sample's metadatavoidsyncSequenceFilePair(SequenceFilePair pair, Sample sample)Synchronize a givenSequenceFilePairto the local installation.voidsyncSingleEndSequenceFile(SingleEndSequenceFile file, Sample sample)Synchronize a givenSingleEndSequenceFileto the local installation
-
-
-
Constructor Detail
-
ProjectSynchronizationService
@Autowired public ProjectSynchronizationService(ProjectService projectService, SampleService sampleService, SequencingObjectService objectService, MetadataTemplateService metadataTemplateService, GenomeAssemblyService assemblyService, ProjectRemoteService projectRemoteService, SampleRemoteService sampleRemoteService, SingleEndSequenceFileRemoteService singleEndRemoteService, SequenceFilePairRemoteService pairRemoteService, GenomeAssemblyRemoteService assemblyRemoteService, Fast5ObjectRemoteService fast5ObjectRemoteService, RemoteAPITokenService tokenService, EmailController emailController)
-
-
Method Detail
-
findProjectsToMark
public void findProjectsToMark()
Method checking for remote projects that have passed their frequency time. It will mark them asRemoteStatus.SyncStatus.MARKED
-
findMarkedProjectsToSync
public void findMarkedProjectsToSync()
Find projects which should be synchronized and launch a synchornization task.
-
syncSample
public java.util.List<ProjectSynchronizationException> syncSample(Sample sample, Project project, java.util.Map<java.lang.String,Sample> existingSamples)
Synchronize a givenSampleto the local installation.- Parameters:
sample- theSampleto synchronize. This should have been read from a remote api.project- TheProjecttheSamplebelongs in.existingSamples- A map of samples that have already been synchronized. These will be checked to see if they've been updated- Returns:
- A list of
ProjectSynchronizationExceptions, empty if no errors.
-
syncSampleMetadata
public void syncSampleMetadata(Sample remoteSample, Sample localSample)
Synchronize the given sample's metadata- Parameters:
remoteSample- the sample read from the remote apilocalSample- the local sample being saved
-
syncSingleEndSequenceFile
public void syncSingleEndSequenceFile(SingleEndSequenceFile file, Sample sample)
Synchronize a givenSingleEndSequenceFileto the local installation- Parameters:
file- theSingleEndSequenceFileto syncsample- theSampleto add the file to
-
syncFast5File
public void syncFast5File(Fast5Object fast5Object, Sample sample)
Synchronize a givenFast5Objectto the local installation- Parameters:
fast5Object- theFast5Objectto syncsample- theSampleto add the file to
-
syncAssembly
public void syncAssembly(UploadedAssembly assembly, Sample sample)
Synchronize a givenUploadedAssemblyto the local installation- Parameters:
assembly- theUploadedAssemblyto syncsample- theSampleto add the assembly to
-
syncSequenceFilePair
public void syncSequenceFilePair(SequenceFilePair pair, Sample sample)
Synchronize a givenSequenceFilePairto the local installation.- Parameters:
pair- theSequenceFilePairto sync. This should have been read from a remote api.sample- TheSampleto add the pair to.
-
-