Interface TwoStepsExecutingExtractionComponent
-
- All Superinterfaces:
ExtractionComponent
- All Known Implementing Classes:
CountExtractionComponent
,QueryExtractionComponent
public interface TwoStepsExecutingExtractionComponent extends ExtractionComponent
ExtractionComponent
whose execution sometimes needs to be done in two times (in order to avoid callingexecute
n times for performance reasons):- by
computeFirstLevelResults(ExtractionExecutionContext)
for returning all the first level content results; - by
executeFor(ContentHandler, Iterable, ExtractionExecutionContext)
for SAXing with the givenContentHandler
and the given iterable on contents, subset of the one returned by the first method.
execute
n times,computeFirstLevelResults
is called one time andexecuteFor
is called n times with a different handler and iterable.
Important: The implementations must ensure that callingexecute
is equivalent to successively callcomputeFirstLevelResults
and thenexecuteFor
with that result.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Iterable<Content>
computeFirstLevelResults(ExtractionExecutionContext context)
Computes first level results for preparing multiple extraction executionsdefault void
execute(ContentHandler contentHandler, ExtractionExecutionContext context)
Execute the extraction of the componentvoid
executeFor(ContentHandler contentHandler, Iterable<Content> subsetResults, ExtractionExecutionContext context)
Execute the extraction of the component for the given first level results-
Methods inherited from interface org.ametys.plugins.extraction.component.ExtractionComponent
addSubComponent, getComponentDetailsForTree, getContentTypes, getSubComponents, prepareComponentExecution
-
-
-
-
Method Detail
-
computeFirstLevelResults
Iterable<Content> computeFirstLevelResults(ExtractionExecutionContext context) throws Exception
Computes first level results for preparing multiple extraction executions- Parameters:
context
- context of the extraction component- Returns:
- The first level content results
- Throws:
Exception
- if an error occurs
-
executeFor
void executeFor(ContentHandler contentHandler, Iterable<Content> subsetResults, ExtractionExecutionContext context) throws Exception
Execute the extraction of the component for the given first level results- Parameters:
contentHandler
- result documentsubsetResults
- A subset of the first level content results previously returned bycomputeFirstLevelResults(ExtractionExecutionContext)
context
- context of the extraction component- Throws:
Exception
- if an error occurs
-
execute
default void execute(ContentHandler contentHandler, ExtractionExecutionContext context) throws Exception
Description copied from interface:ExtractionComponent
Execute the extraction of the component- Specified by:
execute
in interfaceExtractionComponent
- Parameters:
contentHandler
- result documentcontext
- context of the extraction component- Throws:
Exception
- if an error occurs
-
-