Class AbstractItemMetadataSelectionStage<T,B>

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.metadata.pipeline.AbstractStage<T>
net.shibboleth.metadata.pipeline.AbstractItemMetadataSelectionStage<T,B>
Type Parameters:
T - the type of data included in the items being processed
B - the type bound for the selection requirements set
All Implemented Interfaces:
Stage<T>, net.shibboleth.shared.component.Component, net.shibboleth.shared.component.DestructableComponent, net.shibboleth.shared.component.IdentifiableComponent, net.shibboleth.shared.component.IdentifiedComponent, net.shibboleth.shared.component.InitializableComponent
Direct Known Subclasses:
ItemMetadataFilterStage, ItemMetadataTerminationStage, StatusMetadataLoggingStage

@ThreadSafe public abstract class AbstractItemMetadataSelectionStage<T,B> extends AbstractStage<T>
An abstract Stage that selects Items for further processing if they have a specific type of ItemMetadata attached to them.
  • Field Details

    • selectionRequirements

      @Nonnull @NonnullElements @Unmodifiable private Set<Class<? extends B>> selectionRequirements
      ItemMetadata classes that, if an item contains them, will cause the Item to be selected.
    • identificationStrategy

      @Nonnull private ItemIdentificationStrategy<T> identificationStrategy
      Strategy used to generate item identifiers for logging purposes.
  • Constructor Details

    • AbstractItemMetadataSelectionStage

      public AbstractItemMetadataSelectionStage()
  • Method Details

    • getSelectionRequirements

      @Nonnull @NonnullElements @Unmodifiable public final Collection<Class<? extends B>> getSelectionRequirements()
      Gets the ItemMetadata classes that, if an item contains them, will cause the Item to be selected.
      Returns:
      ItemMetadata classes that, if an item contains them, will cause the Item to be selected, never null nor containing null elements
    • setSelectionRequirements

      public void setSelectionRequirements(@Nonnull @NonnullElements @Unmodifiable Collection<Class<? extends B>> requirements)
      Sets the ItemMetadata classes that, if an item contains them, will cause the Item to be selected.
      Parameters:
      requirements - ItemMetadata classes that, if an item contains them, will cause the Item to be selected
    • getItemIdentificationStrategy

      @Nonnull public final ItemIdentificationStrategy<T> getItemIdentificationStrategy()
      Gets the strategy used to generate Item identifiers for logging purposes.
      Returns:
      strategy used to generate Item identifiers for logging purposes
    • setIdentificationStrategy

      public void setIdentificationStrategy(@Nonnull ItemIdentificationStrategy<T> 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(@Nonnull List<Item<T>> items) throws StageProcessingException
      Description copied from class: AbstractStage
      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 AbstractStage<T>
      Parameters:
      items - collection to be processed
      Throws:
      StageProcessingException - thrown if there is an unrecoverable problem when processing the stage
    • doExecute

      protected abstract void doExecute(@Nonnull @NonnullElements List<Item<T>> items, @Nonnull Item<T> matchingItem, @Nonnull @NonnullElements net.shibboleth.shared.collection.ClassToInstanceMultiMap<B> matchingMetadata) throws StageProcessingException
      Performs the stage's logic on the given item that contained metadata of the given type.
      Parameters:
      items - 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