Class AttributeRule

All Implemented Interfaces:
Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent, UnmodifiableComponent

@ThreadSafe
public final class AttributeRule
extends AbstractIdentifiableInitializableComponent
implements UnmodifiableComponent
Represents a value filtering rule for a particular attribute.
 
 <element name="AttributeRule" type="afp:AttributeRuleType">
     <annotation>
         <documentation>A rule that describes how values of an attribute will be filtered.</documentation>
     </annotation>
 </element>
 
 
  • Field Details

    • log

      private final org.slf4j.Logger log
      Class logger.
    • logPrefix

      private String logPrefix
      Log prefix.
    • attributeId

      private String attributeId
      Unique ID of the attribute this rule applies to.
       
       <attribute name="attributeID" type="string" use="required">
           <annotation>
               <documentation>The ID of the attribute to which this rule applies.</documentation>
           </annotation>
       </attribute>
       
       
    • matcher

      private Matcher matcher
      Filter that permits the release of attribute values.
    • isDenyRule

      private boolean isDenyRule
      Filter that denies the release of attribute values.
  • Constructor Details

    • AttributeRule

      public AttributeRule()
  • Method Details

    • getAttributeId

      @NonnullAfterInit public String getAttributeId()
      Gets the ID of the attribute to which this rule applies.
      Returns:
      ID of the attribute to which this rule applies
    • setAttributeId

      public void setAttributeId​(@Nonnull @NotEmpty String id)
      Sets the ID of the attribute to which this rule applies. This property may not be changed after this component has been initialized.
      Parameters:
      id - ID of the attribute to which this rule applies
    • getMatcher

      @Nullable public Matcher getMatcher()
      Gets the matcher used to determine the attribute values filtered by this rule.
      Returns:
      matcher used to determine the attribute values filtered by this rule
    • setMatcher

      public void setMatcher​(@Nonnull Matcher theMatcher)
      Sets the rule used to determine permitted attribute values filtered by this rule.
      Parameters:
      theMatcher - matcher used to determine permitted attribute values filtered by this rule
    • getIsDenyRule

      public boolean getIsDenyRule()
      Gets whether the rule is a deny rule or not.
      Returns:
      whether the rule is a deny rule or not.
    • setIsDenyRule

      public void setIsDenyRule​(boolean isDeny)
      Sets the rule used to determine denied attribute values filtered by this rule.
      Parameters:
      isDeny - - whether the rule is deny or not.
    • apply

      public void apply​(@Nonnull IdPAttribute attribute, @Nonnull AttributeFilterContext filterContext)
      Applies this rule to the respective attribute in the filter context.
      Parameters:
      attribute - attribute whose values will be filtered by this policy
      filterContext - current filter context
    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      Overrides:
      doInitialize in class AbstractIdentifiedInitializableComponent
      Throws:
      ComponentInitializationException
    • getLogPrefix

      protected String getLogPrefix()
      Get the prefix for logging.
      Returns:
      Returns the logPrefix.