net.shibboleth.metadata.pipeline
Class AbstractItemMetadataSelectionStage

java.lang.Object
  extended by net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent
      extended by net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent
          extended by net.shibboleth.metadata.pipeline.BaseStage<Item<?>>
              extended by net.shibboleth.metadata.pipeline.AbstractItemMetadataSelectionStage
All Implemented Interfaces:
Stage<Item<?>>, net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.IdentifiableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent
Direct Known Subclasses:
ItemMetadataFilterStage, ItemMetadataTerminationStage, StatusMetadataLoggingStage

@ThreadSafe
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 item contains, will cause the Item to be selected.
 
Constructor Summary
AbstractItemMetadataSelectionStage()
           
 
Method Summary
protected  void doDestroy()
          
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 item 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 item contains, will cause the Item to be selected.
 
Methods inherited from class net.shibboleth.metadata.pipeline.BaseStage
execute, setId
 
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent
doInitialize, getId
 
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent
destroy, initialize, isDestroyed, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
 
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiableComponent
getId
 
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
 

Field Detail

selectionRequirements

private Collection<Class<ItemMetadata>> selectionRequirements
ItemMetadata classes that, if the an item 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

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

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

setSelectionRequirements

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

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

getItemIdentifierStrategy

@Nonnull
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(@Nonnull
                                  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.

The stage is guaranteed to be have been initialized and not destroyed when this is invoked.

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

doDestroy

protected void doDestroy()

Overrides:
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent

doExecute

protected abstract void doExecute(@Nonnull@NonnullElements
                                  Collection<Item<?>> itemCollection,
                                  @Nonnull
                                  Item<?> matchingItem,
                                  @Nonnull@NonnullElements
                                  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 © 1999-2012. All Rights Reserved.