public class PipelineDriver extends Object implements IPipelineDriver
IPipelineDriver interface.| Constructor and Description |
|---|
PipelineDriver()
Creates an new PipelineDriver object with an empty pipeline.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBatchItem(IBatchItemContext item)
Adds an item to this batch.
|
void |
addBatchItem(RawDocument... rawDocs)
Adds an item to this batch, using one or more RawDocument objects.
|
void |
addBatchItem(RawDocument rawDoc,
URI outputURI,
String outputEncoding)
Adds an item to this batch, using a RawDocument object.
|
void |
addBatchItem(URI inputURI,
String defaultEncoding,
String filterConfigId,
LocaleId srcLoc,
LocaleId trgLoc)
Adds an item to this batch, using direct parameters.
|
void |
addStep(IPipelineStep step)
Adds a step to the pipeline currently associated with this driver.
|
void |
clearItems()
Removes all current batch items from this driver.
|
void |
clearSteps()
Remove all the
IPipelineSteps from the pipeline. |
void |
destroy()
Destroy the pipeline releasing all resources
|
protected void |
displayInput(IBatchItemContext item)
Logs the information about which batch item is about to be processed.
|
protected List<IBatchItemContext> |
getBatchItems() |
protected ExecutionContext |
getContext() |
protected IFilterConfigurationMapper |
getFcMapper() |
protected String |
getInputRootDir() |
protected String |
getOutputDir() |
protected LinkedList<List<ConfigurationParameter>> |
getParamList() |
IPipeline |
getPipeline()
Gets the
IPipeline currently associated with this driver. |
int |
getRequestedInputCount()
Gets the highest number of input documents needed to run the pipeline
for this driver.
|
protected String |
getRootDir() |
protected Object |
getUiParent() |
void |
processBatch()
Processes all the batch items currently in the driver.
|
void |
processBatch(List<IBatchItemContext> batchItems)
Sets a new set of batch items for this driver and processes them.
|
void |
setExecutionContext(ExecutionContext context)
Sets the execution context for this driver.
|
void |
setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
Sets the filter configuration mapper object for this driver.
|
void |
setOutputDirectory(String outputDir)
Sets the output directory according to the user's preferences.
|
void |
setPipeline(IPipeline pipeline)
Sets the
IPipeline to use with this driver. |
void |
setRootDirectories(String rootDir,
String inputRootDir)
Sets the root directories corresponding to the ${rootDir} and ${inputRootDir} variables for steps.
|
void |
setUIParent(Object uiParent)
Sets the UI parent object for this driver.
|
public PipelineDriver()
public void setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
IPipelineDriversetFilterConfigurationMapper in interface IPipelineDriverfcMapper - the filter configuration mapper to use.public void setRootDirectories(String rootDir, String inputRootDir)
IPipelineDriversetRootDirectories in interface IPipelineDriverrootDir - 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.public void setOutputDirectory(String outputDir)
IPipelineDriversetOutputDirectory in interface IPipelineDriveroutputDir - the output directory, possibly overridden to be different from the inputRootDir.public void setUIParent(Object uiParent)
IPipelineDriversetUIParent in interface IPipelineDriveruiParent - the UI parent object (window/shell/etc.). Its type depend
on the caller, for example for SWT you pass the shell of the caller.public void setExecutionContext(ExecutionContext context)
IPipelineDriversetExecutionContext in interface IPipelineDrivercontext - the execution context such as batch mode, CLI/GUI, etc.public void setPipeline(IPipeline pipeline)
IPipelineDriverIPipeline to use with this driver.setPipeline in interface IPipelineDriverpipeline - the new IPipeline to associate with this driver.public IPipeline getPipeline()
IPipelineDriverIPipeline currently associated with this driver.getPipeline in interface IPipelineDriverIPipeline currently associated with this driver.public void addStep(IPipelineStep step)
IPipelineDriveraddStep in interface IPipelineDriverstep - the step to add.public void processBatch(List<IBatchItemContext> batchItems)
IPipelineDriverprocessBatch in interface IPipelineDriverbatchItems - the list of the batch items to process.public void processBatch()
IPipelineDriverprocessBatch in interface IPipelineDriverpublic void addBatchItem(IBatchItemContext item)
IPipelineDriveraddBatchItem in interface IPipelineDriveritem - the item to add to this batch.public void addBatchItem(RawDocument... rawDocs)
IPipelineDriveraddBatchItem in interface IPipelineDriverrawDocs - one or more RawDocuments to include in this item.public void addBatchItem(RawDocument rawDoc, URI outputURI, String outputEncoding)
IPipelineDriveraddBatchItem in interface IPipelineDriverrawDoc - 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)public void addBatchItem(URI inputURI, String defaultEncoding, String filterConfigId, LocaleId srcLoc, LocaleId trgLoc)
IPipelineDriveraddBatchItem in interface IPipelineDriverinputURI - 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.public void clearItems()
IPipelineDriverclearItems in interface IPipelineDriverprotected void displayInput(IBatchItemContext item)
item - the batch item that is about to be processed.public void clearSteps()
IPipelineDriverIPipelineSteps from the pipeline. Also calls the
destroy() method on each step.clearSteps in interface IPipelineDriverpublic int getRequestedInputCount()
IPipelineDrivergetRequestedInputCount in interface IPipelineDriverpublic void destroy()
IPipelineDriverdestroy in interface IPipelineDriverprotected List<IBatchItemContext> getBatchItems()
protected LinkedList<List<ConfigurationParameter>> getParamList()
protected IFilterConfigurationMapper getFcMapper()
protected String getRootDir()
protected String getInputRootDir()
protected String getOutputDir()
protected Object getUiParent()
protected ExecutionContext getContext()
Copyright © 2021. All rights reserved.