Class AttributeRule
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringUnique ID of the attribute this rule applies to.private booleanFilter that denies the release of attribute values.private final org.slf4j.LoggerClass logger.private StringLog prefix.private MatcherFilter that permits the release of attribute values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(IdPAttribute attribute, AttributeFilterContext filterContext) Applies this rule to the respective attribute in the filter context.protected voidGets the ID of the attribute to which this rule applies.booleanGets whether the rule is a deny rule or not.protected StringGet the prefix for logging.Gets the matcher used to determine the attribute values filtered by this rule.voidsetAttributeId(String id) Sets the ID of the attribute to which this rule applies.voidsetIsDenyRule(boolean isDeny) Sets the rule used to determine denied attribute values filtered by this rule.voidsetMatcher(Matcher theMatcher) Sets the rule used to determine permitted attribute values filtered by this rule.Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
logPrefix
Log prefix. -
attributeId
Unique ID of the attribute this rule applies to. -
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
public void apply(@Nonnull IdPAttribute attribute, @Nonnull AttributeFilterContext filterContext) throws AttributeFilterException 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- Throws:
AttributeFilterException- if an error occurs while applying the rule
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
getLogPrefix
Get the prefix for logging.- Returns:
- Returns the logPrefix.
-