Class DefaultFileProcessingChain
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain
-
- All Implemented Interfaces:
FileProcessingChain
public class DefaultFileProcessingChain extends java.lang.Object implements FileProcessingChain
Default implementation ofFileProcessingChain
. Simply iterates through a collection ofFileProcessor
.
-
-
Constructor Summary
Constructors Constructor Description DefaultFileProcessingChain(SequencingObjectRepository sequencingObjectRepository, QCEntryRepository qcRepository, FileProcessor... fileProcessors)
DefaultFileProcessingChain(SequencingObjectRepository sequencingObjectRepository, QCEntryRepository qcRepository, java.util.List<FileProcessor> fileProcessors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<FileProcessor>
getFileProcessors()
Get the collection ofFileProcessor
that thisFileProcessingChain
manages.java.util.List<java.lang.Exception>
launchChain(java.lang.Long sequencingObjectId)
Launch the chain ofFileProcessor
on the specificSequencingObject
.void
setFastFail(java.lang.Boolean fastFail)
Set whether or not theFileProcessingChain
should fail on *all* exceptions.void
setSleepDuration(java.lang.Integer sleepDuration)
Set the amount of time (in seconds) that the processor chain should sleep each time it sleeps.void
setTimeout(java.lang.Integer timeout)
Set the total amount of time (in seconds) that the processor chain should wait for theSequencingObject
to appear before failing.
-
-
-
Constructor Detail
-
DefaultFileProcessingChain
public DefaultFileProcessingChain(SequencingObjectRepository sequencingObjectRepository, QCEntryRepository qcRepository, FileProcessor... fileProcessors)
-
DefaultFileProcessingChain
public DefaultFileProcessingChain(SequencingObjectRepository sequencingObjectRepository, QCEntryRepository qcRepository, java.util.List<FileProcessor> fileProcessors)
-
-
Method Detail
-
launchChain
public java.util.List<java.lang.Exception> launchChain(java.lang.Long sequencingObjectId) throws FileProcessorTimeoutException
Launch the chain ofFileProcessor
on the specificSequencingObject
.- Specified by:
launchChain
in interfaceFileProcessingChain
- Parameters:
sequencingObjectId
- the id of theSequencingObject
to process.- Returns:
- any
Exception
thrown during chain processing (in the same order asFileProcessor
returned byFileProcessingChain.getFileProcessors()
). - Throws:
FileProcessorTimeoutException
- when the processor chain waits too long for the specifiedSequencingObject
to appear in the database.
-
getFileProcessors
public java.util.List<FileProcessor> getFileProcessors()
Get the collection ofFileProcessor
that thisFileProcessingChain
manages.- Specified by:
getFileProcessors
in interfaceFileProcessingChain
- Returns:
- the
FileProcessor
collection managed by thisFileProcessingChain
.
-
setFastFail
public void setFastFail(java.lang.Boolean fastFail)
Description copied from interface:FileProcessingChain
Set whether or not theFileProcessingChain
should fail on *all* exceptions.- Specified by:
setFastFail
in interfaceFileProcessingChain
- Parameters:
fastFail
- whether or not the chain should fail on exceptions.
-
setTimeout
public void setTimeout(java.lang.Integer timeout)
Set the total amount of time (in seconds) that the processor chain should wait for theSequencingObject
to appear before failing.- Specified by:
setTimeout
in interfaceFileProcessingChain
- Parameters:
timeout
- the total amount of time in seconds that the processor chain should wait.
-
setSleepDuration
public void setSleepDuration(java.lang.Integer sleepDuration)
Set the amount of time (in seconds) that the processor chain should sleep each time it sleeps.- Specified by:
setSleepDuration
in interfaceFileProcessingChain
- Parameters:
sleepDuration
- the amount of time in seconds that the processor chain should wait.
-
-