net.shibboleth.metadata.pipeline
Class AbstractItemMetadataSelectionStage

java.lang.Object
  extended by net.shibboleth.metadata.pipeline.AbstractComponent
      extended by net.shibboleth.metadata.pipeline.BaseStage<Item<?>>
          extended by net.shibboleth.metadata.pipeline.AbstractItemMetadataSelectionStage
All Implemented Interfaces:
Component, Stage<Item<?>>
Direct Known Subclasses:
ItemMetadataFilterStage, ItemMetadataTerminationStage, StatusMetadataLoggingStage

public abstract class AbstractItemMetadataSelectionStage
extends BaseStage<Item<?>>

A Stage that selects Items for further processing if they have a specific type of ItemMetadata attached to them.


Field Summary
private  ItemIdentificationStrategy identifierStrategy
          Strategy used to generate Item identifiers for logging purposes.
private  Collection<Class<ItemMetadata>> selectionRequirements
          ItemMetadata classes that, if the an contains, will cause the Item to be selected.
 
Constructor Summary
AbstractItemMetadataSelectionStage()
           
 
Method Summary
protected  void doExecute(Collection<Item<?>> itemCollection)
          Performs the stage processing on the given Item collection.
protected abstract  void doExecute(Collection<Item<?>> itemCollection, Item<?> matchingItem, Map<Class<? extends ItemMetadata>,List<? extends ItemMetadata>> matchingMetadata)
          Performs the stage's logic on the given item that contained metadata of the given type.
 ItemIdentificationStrategy getItemIdentifierStrategy()
          Gets the strategy used to generate Item identifiers for logging purposes.
 Collection<Class<ItemMetadata>> getSelectionRequirements()
          Gets the ItemMetadata classes that, if the an contains, will cause the Item to be selected.
 void setIdentifierStrategy(ItemIdentificationStrategy strategy)
          Sets the strategy used to generate Item identifiers for logging purposes.
 void setSelectionRequirements(Collection<Class<ItemMetadata>> requirements)
          Sets the ItemMetadata classes that, if the an contains, will cause the Item to be selected.
 
Methods inherited from class net.shibboleth.metadata.pipeline.BaseStage
execute
 
Methods inherited from class net.shibboleth.metadata.pipeline.AbstractComponent
doInitialize, 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

selectionRequirements

private Collection<Class<ItemMetadata>> selectionRequirements
ItemMetadata classes that, if the an contains, will cause the Item to be selected.


identifierStrategy

private ItemIdentificationStrategy identifierStrategy
Strategy used to generate Item identifiers for logging purposes.

Constructor Detail

AbstractItemMetadataSelectionStage

public AbstractItemMetadataSelectionStage()
Method Detail

getSelectionRequirements

public Collection<Class<ItemMetadata>> getSelectionRequirements()
Gets the ItemMetadata classes that, if the an contains, will cause the Item to be selected.

Returns:
ItemMetadata classes that, if the an contains, will cause the Item to be selected, never null nor containing null elements

setSelectionRequirements

public void setSelectionRequirements(Collection<Class<ItemMetadata>> requirements)
Sets the ItemMetadata classes that, if the an contains, will cause the Item to be selected.

Parameters:
requirements - ItemMetadata classes that, if the an contains, will cause the Item to be selected, may be null or contain null elements

getItemIdentifierStrategy

public ItemIdentificationStrategy getItemIdentifierStrategy()
Gets the strategy used to generate Item identifiers for logging purposes.

Returns:
strategy used to generate Item identifiers for logging purposes

setIdentifierStrategy

public void setIdentifierStrategy(ItemIdentificationStrategy strategy)
Sets the strategy used to generate Item identifiers for logging purposes.

Parameters:
strategy - strategy used to generate Item identifiers for logging purposes, can not be null

doExecute

protected void doExecute(Collection<Item<?>> itemCollection)
                  throws StageProcessingException
Performs the stage processing on the given Item collection.

Specified by:
doExecute in class BaseStage<Item<?>>
Parameters:
itemCollection - collection to be processed
Throws:
StageProcessingException - thrown if there is an unrecoverable problem when processing the stage

doExecute

protected abstract void doExecute(Collection<Item<?>> itemCollection,
                                  Item<?> matchingItem,
                                  Map<Class<? extends ItemMetadata>,List<? extends ItemMetadata>> matchingMetadata)
                           throws StageProcessingException
Performs the stage's logic on the given item that contained metadata of the given type.

Parameters:
itemCollection - current item collection
matchingItem - matching item
matchingMetadata - all the ItemMetadata instances that match a selection criteria
Throws:
StageProcessingException - thrown if there is a problem processing the item


Copyright © 2009-2011. All Rights Reserved.