Class AbstractCompositeItemIdentificationStrategy<T>

java.lang.Object
net.shibboleth.metadata.AbstractCompositeItemIdentificationStrategy<T>
Type Parameters:
T - type of Item to be identified
All Implemented Interfaces:
ItemIdentificationStrategy<T>
Direct Known Subclasses:
FirstItemIdItemIdentificationStrategy

@ThreadSafe public abstract class AbstractCompositeItemIdentificationStrategy<T> extends Object implements ItemIdentificationStrategy<T>
Abstract class implementing a generic two-part strategy for item identification. Generating the two components of the identifier is delegated to subclasses. The basic and extra identifiers are then combined into a composite identifier for display. If the basic identifier is null, a configured default is used. If the extra identifier is null, only the basic identifier is used.
Since:
0.9.0
  • Field Details

    • noItemIdIdentifier

      @Nonnull @NotEmpty private String noItemIdIdentifier
      Identifier to use if an Item does not have an ItemId. Default value: "unidentified"
  • Constructor Details

    • AbstractCompositeItemIdentificationStrategy

      public AbstractCompositeItemIdentificationStrategy()
  • Method Details

    • getNoItemIdIdentifier

      @Nonnull @NotEmpty public final String getNoItemIdIdentifier()
      Gets the identifier to use if an Item does not have an ItemId.
      Returns:
      identifier to use if an Item does not have an ItemId
    • setNoItemIdIdentifier

      public void setNoItemIdIdentifier(@Nonnull @NotEmpty String identifier)
      Sets the identifier to use if an Item does not have an ItemId.
      Parameters:
      identifier - identifier to use if an Item does not have an ItemId
    • getBasicIdentifier

      @Nullable abstract String getBasicIdentifier(@Nonnull Item<T> item)
      Get a basic identifier for the Item.
      Parameters:
      item - Item to extract a basic identifier from
      Returns:
      a basic identifier for the Item, or null
    • getExtraIdentifier

      @Nullable abstract String getExtraIdentifier(@Nonnull Item<T> item)
      Get an extra identifier for the Item.
      Parameters:
      item - Item to extract an extra identifier from
      Returns:
      an extra identifier for the Item, or null
    • getItemIdentifier

      @Nonnull public String getItemIdentifier(@Nonnull Item<T> item)
      Description copied from interface: ItemIdentificationStrategy
      Gets an identifier for the item.
      Specified by:
      getItemIdentifier in interface ItemIdentificationStrategy<T>
      Parameters:
      item - the item
      Returns:
      the identifier, never null