Package net.sf.okapi.common.pipeline
Interface IPipeline
-
public interface IPipeline
Common set of methods to drive an event-driven process. A pipeline is made of a chain ofIPipelineStep
objects through which documents are processed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addStep(IPipelineStep step)
Adds a step to this pipeline.void
cancel()
Cancels processing on this pipeline.void
clearSteps()
Remove all theIPipelineStep
s from the pipeline.void
destroy()
Frees all resources from all steps in this pipeline.void
endBatch()
Finishes a batch of inputs.String
getId()
Get the Pipelines identifier.PipelineReturnValue
getState()
Gets the current pipeline state.List<IPipelineStep>
getSteps()
Gets the list of all steps in this pipeline.void
process(Event input)
void
process(RawDocument input)
StartsIPipeline
processing with aRawDocument
as input.void
setId(String id)
Set the pipelines identifier.void
startBatch()
Starts a batch of inputs.
-
-
-
Method Detail
-
process
void process(RawDocument input)
StartsIPipeline
processing with aRawDocument
as 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 theIPipelineStep
s 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
-
-