net.shibboleth.metadata.pipeline
Class CompositeStage<ItemType extends Item<?>>

java.lang.Object
  extended by net.shibboleth.metadata.pipeline.AbstractComponent
      extended by net.shibboleth.metadata.pipeline.CompositeStage<ItemType>
Type Parameters:
ItemType - type of Items this stage, and its composed stages, operate upon
All Implemented Interfaces:
Component, Stage<ItemType>

public class CompositeStage<ItemType extends Item<?>>
extends AbstractComponent
implements Stage<ItemType>

A stage that is composed of other stages. This allows a collection of stages to be grouped together and for that composition to the be referenced and reused.


Field Summary
private  List<Stage<ItemType>> composedStages
          Stages which compose this stage.
 
Constructor Summary
CompositeStage()
           
 
Method Summary
protected  void doInitialize()
          Do the initialization of the component.
 void execute(Collection<ItemType> itemCollection)
          Transforms the given input data.
 List<Stage<ItemType>> getComposedStages()
          Gets an unmodifiable list the stages that compose this stage.
 void setComposedStages(List<Stage<ItemType>> stages)
          Sets the list the stages that compose this stage.
 
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

composedStages

private List<Stage<ItemType extends Item<?>>> composedStages
Stages which compose this stage.

Constructor Detail

CompositeStage

public CompositeStage()
Method Detail

getComposedStages

public List<Stage<ItemType>> getComposedStages()
Gets an unmodifiable list the stages that compose this stage.

Returns:
list the stages that compose this stage, never null nor containing null elements

setComposedStages

public void setComposedStages(List<Stage<ItemType>> stages)
Sets the list the stages that compose this stage.

Parameters:
stages - list the stages that compose this stage, may be null or contain null elements

execute

public void execute(Collection<ItemType> itemCollection)
             throws StageProcessingException
Transforms the given input data.

Specified by:
execute in interface Stage<ItemType extends Item<?>>
Parameters:
itemCollection - the data to be transformed
Throws:
StageProcessingException - thrown if there is a problem running this stage on the given input

doInitialize

protected void doInitialize()
                     throws ComponentInitializationException
Do the initialization of the component. Default implementation of this method is a no-op. Extending classes should override this method to perform any initialization logic necessary.

Overrides:
doInitialize in class AbstractComponent
Throws:
ComponentInitializationException - throw if there is a problem initializing the component


Copyright © 2009-2011. All Rights Reserved.