Package net.sf.okapi.common.pipeline
Interface IPipeline
-
public interface IPipelineCommon set of methods to drive an event-driven process. A pipeline is made of a chain ofIPipelineStepobjects through which documents are processed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddStep(IPipelineStep step)Adds a step to this pipeline.voidcancel()Cancels processing on this pipeline.voidclearSteps()Remove all theIPipelineSteps from the pipeline.voiddestroy()Frees all resources from all steps in this pipeline.voidendBatch()Finishes a batch of inputs.StringgetId()Get the Pipelines identifier.PipelineReturnValuegetState()Gets the current pipeline state.List<IPipelineStep>getSteps()Gets the list of all steps in this pipeline.voidprocess(Event input)voidprocess(RawDocument input)StartsIPipelineprocessing with aRawDocumentas input.voidsetId(String id)Set the pipelines identifier.voidstartBatch()Starts a batch of inputs.
-
-
-
Method Detail
-
process
void process(RawDocument input)
StartsIPipelineprocessing with aRawDocumentas input. This is a convenience method that callsprocess(Event).- Parameters:
input- the RawDocument to process.
-
getState
PipelineReturnValue getState()
Gets the current pipeline state.- Returns:
- the current state of the pipeline.
-
cancel
void cancel()
Cancels processing on this pipeline.
-
addStep
void addStep(IPipelineStep step)
Adds a step to this pipeline. Steps are executed in the order they are added.- Parameters:
step- the step to add.
-
getSteps
List<IPipelineStep> getSteps()
Gets the list of all steps in this pipeline.- Returns:
- a list of all steps in this pipeline, the list may be empty.
-
startBatch
void startBatch()
Starts a batch of inputs.
-
endBatch
void endBatch()
Finishes a batch of inputs.
-
destroy
void destroy()
Frees all resources from all steps in this pipeline.
-
clearSteps
void clearSteps()
Remove all theIPipelineSteps from the pipeline. Also calls the destroy() method on each step.
-
setId
void setId(String id)
Set the pipelines identifier.- Parameters:
id- the new id of the pipeline.
-
getId
String getId()
Get the Pipelines identifier.- Returns:
- String identifier
-
-