Class AttributeRule
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.filter.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 Summary
FieldsModifier and TypeFieldDescriptionprivate String
Unique ID of the attribute this rule applies to.private boolean
Filter that denies the release of attribute values.private final org.slf4j.Logger
Class logger.private String
Log prefix.private Matcher
Filter that permits the release of attribute values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(IdPAttribute attribute, AttributeFilterContext filterContext) Applies this rule to the respective attribute in the filter context.protected void
Gets the ID of the attribute to which this rule applies.boolean
Gets whether the rule is a deny rule or not.protected String
Get the prefix for logging.Gets the matcher used to determine the attribute values filtered by this rule.void
setAttributeId
(String id) Sets the ID of the attribute to which this rule applies.void
setIsDenyRule
(boolean isDeny) Sets the rule used to determine denied attribute values filtered by this rule.void
setMatcher
(Matcher theMatcher) Sets the rule used to determine permitted attribute values filtered by this rule.Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
-
Field Details
-
log
private final org.slf4j.Logger logClass logger. -
logPrefix
Log prefix. -
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
Filter that permits the release of attribute values. -
isDenyRule
private boolean isDenyRuleFilter that denies the release of attribute values.
-
-
Constructor Details
-
AttributeRule
public AttributeRule()
-
-
Method Details
-
getAttributeId
Gets the ID of the attribute to which this rule applies.- Returns:
- ID of the attribute to which this rule applies
-
setAttributeId
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
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
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
Applies this rule to the respective attribute in the filter context.- Parameters:
attribute
- attribute whose values will be filtered by this policyfilterContext
- current filter context
-
doInitialize
- Overrides:
doInitialize
in classAbstractIdentifiedInitializableComponent
- Throws:
ComponentInitializationException
-
getLogPrefix
Get the prefix for logging.- Returns:
- Returns the logPrefix.
-