Class ScopedAttributeDefinition

All Implemented Interfaces:
AttributeDefinition, ResolverPlugin<IdPAttribute>, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent, UnmodifiableComponent, DisposableBean

@ThreadSafe public class ScopedAttributeDefinition extends AbstractAttributeDefinition
An attribute definition that creates ScopedStringAttributeValues by taking a source attribute value and applying a static scope to each.
  • Field Details

    • log

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

      @Nullable private String scope
      Scope value. Mutually exclusive with scopeSource
    • scopeSource

      @Nullable private String scopeSource
      Scope source. Mutually exclusive with scope
    • nonScopeAttributeDependencies

      @NonnullAfterInit private Collection<ResolverAttributeDefinitionDependency> nonScopeAttributeDependencies
      The attribute dependencies mine the scopeSource attribute (if there is one).
  • Constructor Details

    • ScopedAttributeDefinition

      public ScopedAttributeDefinition()
  • Method Details

    • getScope

      @Nullable public String getScope()
      Get scope value.
      Returns the scope.
    • setScope

      public void setScope(@Nonnull @NotEmpty String newScope)
      Set the scope for this definition.
      newScope - what to set.
    • getScopeSource

      @Nullable public String getScopeSource()
      Get scope source (attribute id).
      Returns the scope.
    • setScopeSource

      public void setScopeSource(@Nonnull @NotEmpty String attributeId)
      Set the source of the scope for this definition.
      attributeId - what to set.
    • getScopeFromSource

      private String getScopeFromSource(@Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
      Lookup the source attribute in the resolved list.
      workContext - where to look
      the single string value contained in the attribute
      ResolutionException - if the attribute was not there or if it didn't have only one string value
    • doAttributeDefinitionResolve

      @Nonnull protected IdPAttribute doAttributeDefinitionResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
      Creates and populates the values for the resolved attribute. Implementations should not set, or otherwise manage, the resolved attribute's display name, description or encoders. Nor should the resultant attribute be recorded in the given resolution context.
      Specified by:
      doAttributeDefinitionResolve in class AbstractAttributeDefinition
      resolutionContext - current attribute resolution context
      workContext - current resolver work context
      resolved attribute or null if nothing to resolve.
      ResolutionException - thrown if there is a problem resolving and creating the attribute
    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      doInitialize in class AbstractAttributeDefinition