Class AbstractAttributeContextUserIdentityStrategy<T>

Type Parameters:
T - the type of attribute value to return
All Implemented Interfaces:
Function<ProfileRequestContext,T>, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent
Direct Known Subclasses:
AttributeContextByteArrayLookupStrategy, AttributeContextStringLookupStrategy

public abstract class AbstractAttributeContextUserIdentityStrategy<T> extends AbstractIdentifiableInitializableComponent implements Function<ProfileRequestContext,T>
A base class for functions that retrieve a single attribute value from the attribute context.
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Class logger.
    • attributeContextLookupStrategy

      @Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextLookupStrategy
      Strategy used to locate the AttributeContext associated with a given ProfileRequestContext.
    • attributeId

      @Nullable @NotEmpty private String attributeId
      The attribute Id to extract the value from.
    • useUnfilteredAttributes

      private boolean useUnfilteredAttributes
      Whether to look at filtered or unfiltered attributes. Default is filtered.
  • Constructor Details

    • AbstractAttributeContextUserIdentityStrategy

      protected AbstractAttributeContextUserIdentityStrategy()
      Constructor.
  • Method Details

    • isUseUnfilteredAttributes

      public boolean isUseUnfilteredAttributes()
      Get whether to source the input attributes from the unfiltered set.
      Returns:
      whether to source the input attributes from the unfiltered set
    • setUseUnfilteredAttributes

      public void setUseUnfilteredAttributes(boolean flag)
      Set whether to source the input attributes from the unfiltered set.

      Defaults to true.

      Parameters:
      flag - flag to set
    • setAttributeId

      public void setAttributeId(@Nullable String id)
      Set the attribute Id to extract the value from.
      Parameters:
      id - the attributeId.
    • getAttributeId

      @Nullable @NotEmpty protected String getAttributeId()
      Get the attribute Id to extract the value from.
      Returns:
      the attributeId.
    • setAttributeContextLookupStrategy

      public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext,AttributeContext> strategy)
      Set the strategy used to locate the AttributeContext associated with a given ProfileRequestContext.
      Parameters:
      strategy - strategy used to locate the AttributeContext associated with a given ProfileRequestContext
    • getAttribute

      @Nullable protected IdPAttribute getAttribute(@Nonnull ProfileRequestContext profileRequestContext)
      Get the attribute from either the filtered or unfiltered set of attributes with the given attribute Id from the AttributeContext (if it exists).
      Parameters:
      profileRequestContext - the profile request context to locate the attribute context and the attribute from
      Returns:
      the IdPAttribute, or null if not found.