Class AttributeResolutionContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext
All Implemented Interfaces:
Iterable<BaseContext>

@NotThreadSafe
public final class AttributeResolutionContext
extends BaseContext
A context supplying input to the AttributeResolver interface.
  • Field Details

    • registryService

      @Nullable private ReloadableService<AttributeTranscoderRegistry> registryService
      Registry service to use to attach display metadata to resolved attributes.
    • requestedAttributeNames

      @Nonnull @NonnullElements private Set<String> requestedAttributeNames
      (internal) Names of the attributes that have been requested to be resolved.
    • principal

      @Nullable private String principal
      The principal associated with this resolution.
    • attributeIssuerID

      @Nullable private String attributeIssuerID
      The attribute source identity.
    • attributeRecipientID

      @Nullable private String attributeRecipientID
      The attribute recipient identity.
    • attributeRecipientGroupID

      @Nullable private String attributeRecipientGroupID
      The attribute recipient's group identity.
    • allowCachedResults

      private boolean allowCachedResults
      Whether the resolver should allow for results to come from cache.
    • resolutionLabel

      @Nullable private String resolutionLabel
      Label distinguishing different "types" of attribute resolution for use in resolver.
    • resolvedAttributes

      @Nonnull @NonnullElements private Map<String,​IdPAttribute> resolvedAttributes
      Attributes which were resolved and released by the attribute resolver.
  • Constructor Details

    • AttributeResolutionContext

      public AttributeResolutionContext()
      Constructor.
  • Method Details

    • getTranscoderRegistry

      @Nullable public ReloadableService<AttributeTranscoderRegistry> getTranscoderRegistry()
      Gets a transcoder registry service instance.
      Returns:
      registry service
      Since:
      4.0.0
    • setTranscoderRegistry

      @Nonnull public AttributeResolutionContext setTranscoderRegistry​(@Nullable ReloadableService<AttributeTranscoderRegistry> service)
      Sets a transcoder registry service instance.
      Parameters:
      service - registry service
      Returns:
      this context
      Since:
      4.0.0
    • getAllowCachedResults

      public boolean getAllowCachedResults()
      Get whether to allow for results from cache (defaults to true).
      Returns:
      whether to allow for results from cache
      Since:
      3.3.0
    • setAllowCachedResults

      @Nonnull public AttributeResolutionContext setAllowCachedResults​(boolean flag)
      Set whether to allow for results from cache.
      Parameters:
      flag - flag to set
      Returns:
      this context
      Since:
      3.3.0
    • getResolutionLabel

      @Nullable public String getResolutionLabel()
      Get the optional "contextual" label associated with this attribute resolution.

      Plugins/scripts/etc. can use this field to connect their behavior back to custom invocations of the resolver service.

      Returns:
      label
      Since:
      3.4.0
    • setResolutionLabel

      @Nonnull public AttributeResolutionContext setResolutionLabel​(@Nullable String label)
      Set the optional "contextual" label associated with this attribute resolution.
      Parameters:
      label - label to set
      Returns:
      this context
      Since:
      3.4.0
    • getAttributeIssuerID

      @Nullable public String getAttributeIssuerID()
      Get the attribute issuer (me) associated with this resolution.
      Returns:
      the attribute issuer associated with this resolution.
    • setAttributeIssuerID

      @Nullable public AttributeResolutionContext setAttributeIssuerID​(@Nullable String value)
      Set the attribute issuer (me) associated with this resolution.
      Parameters:
      value - the attribute issuer associated with this resolution.
      Returns:
      this context
    • getAttributeRecipientID

      @Nullable public String getAttributeRecipientID()
      Get the attribute recipient (her) associated with this resolution.
      Returns:
      the attribute recipient associated with this resolution.
    • setAttributeRecipientID

      @Nullable public AttributeResolutionContext setAttributeRecipientID​(@Nullable String value)
      Set the attribute recipient (her) associated with this resolution.
      Parameters:
      value - the attribute recipient associated with this resolution.
      Returns:
      this context
    • getAttributeRecipientGroupID

      @Nullable public String getAttributeRecipientGroupID()
      Get the attribute recipient grouping associated with this resolution.

      This is a protocol-independent way to represent an association between the attribute recipient and some larger group that may be relevant to attribute resolution.

      Returns:
      the attribute recipient group associated with this resolution
      Since:
      3.4.0
    • setAttributeRecipientGroupID

      @Nullable public AttributeResolutionContext setAttributeRecipientGroupID​(@Nullable String value)
      Set the attribute recipient grouping associated with this resolution.
      Parameters:
      value - the attribute recipient group associated with this resolution
      Returns:
      this context
      Since:
      3.4.0
    • getPrincipal

      @Nullable public String getPrincipal()
      Set the principal associated with this resolution.
      Returns:
      Returns the principal.
    • setPrincipal

      @Nullable public AttributeResolutionContext setPrincipal​(@Nullable String who)
      Get the principal associated with this resolution.
      Parameters:
      who - the principal to set.
      Returns:
      this context
    • getRequestedIdPAttributeNames

      @Nonnull @NonnullElements @Live public Collection<String> getRequestedIdPAttributeNames()
      Get a live collection of the (internal) names of the attributes requested to be resolved.
      Returns:
      live collection of attributes requested to be resolved
    • setRequestedIdPAttributeNames

      @Nullable public AttributeResolutionContext setRequestedIdPAttributeNames​(@Nonnull @NonnullElements Collection<String> names)
      Set the (internal) names of the attributes requested to be resolved.
      Parameters:
      names - the (internal) names of the attributes requested to be resolved
      Returns:
      this context
    • getResolvedIdPAttributes

      @Nonnull @NonnullElements @Unmodifiable @NotLive public Map<String,​IdPAttribute> getResolvedIdPAttributes()
      Get the collection of resolved attributes.
      Returns:
      set of resolved attributes
    • setResolvedIdPAttributes

      @Nullable public AttributeResolutionContext setResolvedIdPAttributes​(@Nonnull @NonnullElements Collection<IdPAttribute> attributes)
      Set the set of resolved attributes.
      Parameters:
      attributes - set of resolved attributes
      Returns:
      this context
    • resolveAttributes

      public void resolveAttributes​(@Nonnull ReloadableService<AttributeResolver> attributeResolverService)
      Helper method to invoke an AttributeResolver service using this context.
      Parameters:
      attributeResolverService - the service to invoke
      Since:
      3.3.0