Class NumOfAttributeValuesPolicyRule
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.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 String
ID of the attribute that will be checked.private final org.slf4j.Logger
Class logger.private int
Maximum allowed number of attribute values.private int
Minimum 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 void
Return the attribute whose value count is under question.int
Return the maximum allowed number of attribute values.int
Return the minimum allowed number of attribute values.matches
(AttributeFilterContext filterContext) Evaluate what this rule means.void
setAttributeId
(String attribute) Set the attribute whose value count is under question.void
setMaximum
(int maxValues) Set the maximum allowed number of attribute values.void
setMinimum
(int minValues) Set the minimum allowed number of attribute values.Methods inherited from class net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractPolicyRule
getLogPrefix
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
@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:
doInitialize
in 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.
-