T - the type of items processed by the stage@ThreadSafe public class PipelineMergeStage<T> extends BaseStage<T>
Stage allows the merging of multiple pipeline outputs into a single Collection that can then be
used as the input source for another pipeline.
This source works producing a Collection by means of the registered Supplier . Then each of its
registered Pipeline is invoked in turn (no ordering is guaranteed and pipelines may execute concurrently).
After each pipeline has completed the results are merged in to the Item collection given to this stage by means of
the an CollectionMergeStrategy.| Modifier and Type | Field and Description |
|---|---|
private com.google.common.base.Supplier<Collection<Item<T>>> |
collectionFactory
The factory used to create the item returned by this source.
|
private ExecutorService |
executorService
Service used to execute the pipelines whose results will be merged.
|
private List<Pipeline<T>> |
mergedPipelines
Pipelines whose results become the output of this source.
|
private CollectionMergeStrategy |
mergeStrategy
Strategy used to merge all the joined pipeline results in to the final Item collection.
|
| Constructor and Description |
|---|
PipelineMergeStage() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDestroy() |
protected void |
doExecute(Collection<Item<T>> itemCollection)
Performs the stage processing on the given Item collection.
|
protected void |
doInitialize() |
com.google.common.base.Supplier<Collection<Item<T>>> |
getCollectionFactory()
Gets the factory used to create the
Item collection produced by this source. |
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.
|
List<Pipeline<T>> |
getMergedPipelines()
Gets the unmodifiable set of pipelines used by this stage.
|
void |
setCollectionFactory(com.google.common.base.Supplier<Collection<Item<T>>> factory)
Sets the factory used to create the
Item collection produced by this source. |
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 |
setMergedPipelines(List<? extends Pipeline<T>> pipelines)
Sets the pipelines joined by this stage.
|
execute, getCollectionPredicate, setCollectionPredicatesetIdgetIddestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, isDestroyedprivate ExecutorService executorService
private com.google.common.base.Supplier<Collection<Item<T>>> collectionFactory
SimpleItemCollectionFactory.private CollectionMergeStrategy mergeStrategy
@Nonnull public ExecutorService getExecutorService()
public void setExecutorService(@Nonnull ExecutorService service)
service - executor service used to run the selected and non-selected item pipelines@Nonnull @NonnullElements @Unmodifiable public List<Pipeline<T>> getMergedPipelines()
public void setMergedPipelines(@Nullable@NullableElements List<? extends Pipeline<T>> pipelines)
pipelines - pipelines joined by this stage@Nonnull public com.google.common.base.Supplier<Collection<Item<T>>> getCollectionFactory()
Item collection produced by this source.Item collection produced by this sourcepublic void setCollectionFactory(@Nonnull com.google.common.base.Supplier<Collection<Item<T>>> factory)
Item collection produced by this source.factory - factory used to create the Item collection produced by this source@Nonnull public CollectionMergeStrategy getCollectionMergeStrategy()
public void setCollectionMergeStrategy(@Nonnull CollectionMergeStrategy strategy)
strategy - strategy used to merge all the joined pipeline results in to the final Item collection, never
nullprotected void doExecute(@Nonnull@NonnullElements Collection<Item<T>> itemCollection) throws StageProcessingException
The stage is guaranteed to be have been initialized and not destroyed when this is invoked.
doExecute in class BaseStage<T>itemCollection - collection to be processedStageProcessingException - thrown if there is an unrecoverable problem when processing the stageprotected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionCopyright © 1999–2016. All rights reserved.