|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.metadata.pipeline.AbstractComponent
net.shibboleth.metadata.pipeline.BaseStage<ItemType>
net.shibboleth.metadata.pipeline.SplitMergeStage<ItemType>
ItemType - type of items upon which this stage operatespublic class SplitMergeStage<ItemType extends Item<?>>
A stage which splits a given collection and passes selected items to one pipeline and non-selected items to another.
The selected and non-selected item pipelines are executed via the set ExecutorService and operate on
collections that contains clones of the (non-)selected items.
This stage requires the following properties be set prior to initialization:
selectionStrategyselectedItemPipeline or nonselectedItemPipeline
If no ExecutorService is provided, one will be created using Executors.newFixedThreadPool(int) with 6
threads.
If no ItemCollectionFactory is given, then SimpleItemCollectionFactory is used.
If one or the other pipeline is null then no objects will be passed to it (obviously).
| Field Summary | |
|---|---|
private ItemCollectionFactory<ItemType> |
collectionFactory
Factory used to create the Item collection that is then given to the pipelines. |
private ExecutorService |
executorService
Service used to execute the selected and/or non-selected item pipelines. |
private Logger |
log
Class logger. |
private CollectionMergeStrategy |
mergeStrategy
Strategy used to merge all the joined pipeline results in to the final Item collection. |
private Pipeline<ItemType> |
nonselectedItemPipeline
Pipeline that receives the non-selected items. |
private Pipeline<ItemType> |
selectedItemPipeline
Pipeline that receives the selected items. |
private ItemSelectionStrategy<ItemType> |
selectionStrategy
Strategy used to split the given item collection. |
| Constructor Summary | |
|---|---|
SplitMergeStage()
|
|
| Method Summary | |
|---|---|
protected void |
doExecute(Collection<ItemType> itemCollection)
Performs the stage processing on the given Item collection. |
protected void |
doInitialize()
Do the initialization of the component. |
protected Future<Collection<? extends Item>> |
executePipeline(Pipeline<ItemType> pipeline,
Collection<ItemType> items)
Executes a pipeline. |
ItemCollectionFactory |
getCollectionFactory()
Gets the factory used to create the Item collection that is then given to the pipelines. |
CollectionMergeStrategy |
getCollectionMergeStrategy()
Gets the strategy used to merge all the joined pipeline results in to the final Item collection. |
ExecutorService |
getExecutorService()
Gets the executor service used to run the selected and non-selected item pipelines. |
Pipeline<ItemType> |
getNonselectedItemPipeline()
Gets the pipeline that receives the non-selected items. |
Pipeline<ItemType> |
getSelectedItemPipeline()
Gets the pipeline that receives the selected items. |
ItemSelectionStrategy<ItemType> |
getSelectionStrategy()
Gets the strategy used to split the given item collection. |
void |
setCollectionFactory(ItemCollectionFactory<ItemType> factory)
Sets the factory used to create the Item collection that is then given to the pipelines. |
void |
setCollectionMergeStrategy(CollectionMergeStrategy strategy)
Sets the strategy used to merge all the joined pipeline results in to the final Item collection. |
void |
setExecutorService(ExecutorService service)
Sets the executor service used to run the selected and non-selected item pipelines. |
void |
setNonselectedItemPipeline(Pipeline<ItemType> pipeline)
Sets the pipeline that receives the non-selected items. |
void |
setSelectedItemPipeline(Pipeline<ItemType> pipeline)
Sets the pipeline that receives the selected items. |
void |
setSelectionStrategy(ItemSelectionStrategy<ItemType> strategy)
Sets the strategy used to split the given item collection. |
| Methods inherited from class net.shibboleth.metadata.pipeline.BaseStage |
|---|
execute |
| Methods inherited from class net.shibboleth.metadata.pipeline.AbstractComponent |
|---|
equals, getId, getInitializationInstant, hashCode, initialize, isInitialized, setId |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.shibboleth.metadata.pipeline.Component |
|---|
getId, getInitializationInstant, initialize, isInitialized |
| Field Detail |
|---|
private final Logger log
private ExecutorService executorService
private ItemCollectionFactory<ItemType extends Item<?>> collectionFactory
private ItemSelectionStrategy<ItemType extends Item<?>> selectionStrategy
private Pipeline<ItemType extends Item<?>> selectedItemPipeline
private Pipeline<ItemType extends Item<?>> nonselectedItemPipeline
private CollectionMergeStrategy mergeStrategy
| Constructor Detail |
|---|
public SplitMergeStage()
| Method Detail |
|---|
public ExecutorService getExecutorService()
public void setExecutorService(ExecutorService service)
service - executor service used to run the selected and non-selected item pipelinespublic ItemCollectionFactory getCollectionFactory()
public void setCollectionFactory(ItemCollectionFactory<ItemType> factory)
factory - factory used to create the Item collection that is then given to the pipelinespublic ItemSelectionStrategy<ItemType> getSelectionStrategy()
public void setSelectionStrategy(ItemSelectionStrategy<ItemType> strategy)
strategy - strategy used to split the given item collection, never nullpublic Pipeline<ItemType> getSelectedItemPipeline()
public void setSelectedItemPipeline(Pipeline<ItemType> pipeline)
pipeline - pipeline that receives the selected itemspublic Pipeline<ItemType> getNonselectedItemPipeline()
public void setNonselectedItemPipeline(Pipeline<ItemType> pipeline)
pipeline - pipeline that receives the non-selected itemspublic CollectionMergeStrategy getCollectionMergeStrategy()
public void setCollectionMergeStrategy(CollectionMergeStrategy strategy)
strategy - strategy used to merge all the joined pipeline results in to the final Item collection, never
null
protected void doExecute(Collection<ItemType> itemCollection)
throws StageProcessingException
doExecute in class BaseStage<ItemType extends Item<?>>itemCollection - collection to be processed
StageProcessingException - thrown if there is an unrecoverable problem when processing the stage
protected Future<Collection<? extends Item>> executePipeline(Pipeline<ItemType> pipeline,
Collection<ItemType> items)
pipeline - the pipeline, may be nullitems - the collections of items
protected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractComponentComponentInitializationException - throw if there is a problem initializing the component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||