Class NumOfAttributeValuesPolicyRule
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractPolicyRule
net.shibboleth.idp.attribute.filter.policyrule.filtercontext.impl.NumOfAttributeValuesPolicyRule
- All Implemented Interfaces:
PolicyRequirementRule,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
A policy rule that checks if the given attribute has more than the minimum number of values but less than the
maximum.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.shibboleth.idp.attribute.filter.PolicyRequirementRule
PolicyRequirementRule.Tristate -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringID of the attribute that will be checked.private final org.slf4j.LoggerClass logger.private intMaximum allowed number of attribute values.private intMinimum allowed number of attribute values.Fields inherited from interface net.shibboleth.idp.attribute.filter.PolicyRequirementRule
MATCHES_ALL, MATCHES_NONE, REQUIREMENT_RULE_FAILS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidReturn the attribute whose value count is under question.intReturn the maximum allowed number of attribute values.intReturn the minimum allowed number of attribute values.matches(AttributeFilterContext filterContext) Evaluate what this rule means.voidsetAttributeId(String attribute) Set the attribute whose value count is under question.voidsetMaximum(int maxValues) Set the maximum allowed number of attribute values.voidsetMinimum(int minValues) Set the minimum allowed number of attribute values.Methods inherited from class net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractPolicyRule
getLogPrefixMethods 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. -
attributeId
ID of the attribute that will be checked. -
minimumValues
private int minimumValuesMinimum allowed number of attribute values. -
maximumValues
private int maximumValuesMaximum allowed number of attribute values.
-
-
Constructor Details
-
NumOfAttributeValuesPolicyRule
public NumOfAttributeValuesPolicyRule()Constructor.
-
-
Method Details
-
doInitialize
- Overrides:
doInitializein classAbstractPolicyRule- Throws:
ComponentInitializationException
-
matches
@Nonnull public PolicyRequirementRule.Tristate matches(@Nonnull AttributeFilterContext filterContext) Evaluate what this rule means.- Parameters:
filterContext- the context.- Returns:
- whether the rule holds
-
getAttributeId
Return the attribute whose value count is under question.- Returns:
- the attributeId.
-
setAttributeId
Set the attribute whose value count is under question.- Parameters:
attribute- The attributeId to set.
-
getMinimum
public int getMinimum()Return the minimum allowed number of attribute values.- Returns:
- Returns the minimumValues.
-
setMinimum
public void setMinimum(int minValues) Set the minimum allowed number of attribute values.- Parameters:
minValues- The minimumValues to set.
-
getMaximum
public int getMaximum()Return the maximum allowed number of attribute values.- Returns:
- Returns the maximumValues.
-
setMaximum
public void setMaximum(int maxValues) Set the maximum allowed number of attribute values.- Parameters:
maxValues- The maximumValues to set.
-