Interface IPipelineDriver
-
- All Known Implementing Classes:
PipelineDriver
public interface IPipelineDriverCommon set of methods for setting up and running a pipeline.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddBatchItem(URI inputURI, String defaultEncoding, String filterConfigId, LocaleId srcLoc, LocaleId trgLoc)Adds an item to this batch, using direct parameters.voidaddBatchItem(IBatchItemContext item)Adds an item to this batch.voidaddBatchItem(RawDocument... rawDocs)Adds an item to this batch, using one or more RawDocument objects.voidaddBatchItem(RawDocument rawDoc, URI outputURI, String outputEncoding)Adds an item to this batch, using a RawDocument object.voidaddStep(IPipelineStep step)Adds a step to the pipeline currently associated with this driver.voidclearItems()Removes all current batch items from this driver.voidclearSteps()Remove all theIPipelineSteps from the pipeline.voiddestroy()Destroy the pipeline releasing all resourcesIPipelinegetPipeline()Gets theIPipelinecurrently associated with this driver.intgetRequestedInputCount()Gets the highest number of input documents needed to run the pipeline for this driver.voidprocessBatch()Processes all the batch items currently in the driver.voidprocessBatch(List<IBatchItemContext> batchItems)Sets a new set of batch items for this driver and processes them.voidsetExecutionContext(ExecutionContext context)Sets the execution context for this driver.voidsetFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)Sets the filter configuration mapper object for this driver.voidsetOutputDirectory(String outputDir)Sets the output directory according to the user's preferences.voidsetPipeline(IPipeline pipeline)Sets theIPipelineto use with this driver.voidsetRootDirectories(String rootDir, String inputRootDir)Sets the root directories corresponding to the ${rootDir} and ${inputRootDir} variables for steps.voidsetUIParent(Object uiParent)Sets the UI parent object for this driver.
-
-
-
Method Detail
-
setPipeline
void setPipeline(IPipeline pipeline)
Sets theIPipelineto use with this driver.- Parameters:
pipeline- the newIPipelineto associate with this driver.
-
setFilterConfigurationMapper
void setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
Sets the filter configuration mapper object for this driver.- Parameters:
fcMapper- the filter configuration mapper to use.
-
setRootDirectories
void setRootDirectories(String rootDir, String inputRootDir)
Sets the root directories corresponding to the ${rootDir} and ${inputRootDir} variables for steps.- Parameters:
rootDir- the root directory of the project. If it is null, the fall-back is expected to be the user home directory.inputRootDir- the root directory of the first set of input files. If it is null, the fall-back is expected to be an empty string.
-
setOutputDirectory
void setOutputDirectory(String outputDir)
Sets the output directory according to the user's preferences.- Parameters:
outputDir- the output directory, possibly overridden to be different from the inputRootDir.
-
setUIParent
void setUIParent(Object uiParent)
Sets the UI parent object for this driver.- Parameters:
uiParent- the UI parent object (window/shell/etc.). Its type depend on the caller, for example for SWT you pass the shell of the caller.
-
setExecutionContext
void setExecutionContext(ExecutionContext context)
Sets the execution context for this driver.- Parameters:
context- the execution context such as batch mode, CLI/GUI, etc.
-
getPipeline
IPipeline getPipeline()
Gets theIPipelinecurrently associated with this driver.- Returns:
- the
IPipelinecurrently associated with this driver.
-
addStep
void addStep(IPipelineStep step)
Adds a step to the pipeline currently associated with this driver.- Parameters:
step- the step to add.
-
processBatch
void processBatch(List<IBatchItemContext> batchItems)
Sets a new set of batch items for this driver and processes them. Any batch item that was already in the driver is removed and replaced by the ones provided to this method.- Parameters:
batchItems- the list of the batch items to process.
-
processBatch
void processBatch()
Processes all the batch items currently in the driver.
-
addBatchItem
void addBatchItem(IBatchItemContext item)
Adds an item to this batch.- Parameters:
item- the item to add to this batch.
-
addBatchItem
void addBatchItem(RawDocument... rawDocs)
Adds an item to this batch, using one or more RawDocument objects. The added batch item will have as many input documents as provided.- Parameters:
rawDocs- one or more RawDocuments to include in this item.
-
addBatchItem
void addBatchItem(RawDocument rawDoc, URI outputURI, String outputEncoding)
Adds an item to this batch, using a RawDocument object. The added item will have a single input document.- Parameters:
rawDoc- the RawDocument object from which to create an entry.outputURI- path of the output document (can be null if no used)outputEncoding- encoding of the output (can be null if no used)
-
addBatchItem
void addBatchItem(URI inputURI, String defaultEncoding, String filterConfigId, LocaleId srcLoc, LocaleId trgLoc)
Adds an item to this batch, using direct parameters. The added item will have a single input document.- Parameters:
inputURI- the URI of the input document.defaultEncoding- the default encoding of the document.filterConfigId- the filter configuration ID of the document (can be null if not used).srcLoc- the source locale.trgLoc- the target locale.
-
clearSteps
void clearSteps()
Remove all theIPipelineSteps from the pipeline. Also calls the destroy() method on each step.
-
clearItems
void clearItems()
Removes all current batch items from this driver.
-
getRequestedInputCount
int getRequestedInputCount()
Gets the highest number of input documents needed to run the pipeline for this driver.- Returns:
- the higher number of input document needed.
-
destroy
void destroy()
Destroy the pipeline releasing all resources
-
-