edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.match.basic
Class NumOfAttributeValuesMatchFunctor

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.match.basic.AbstractMatchFunctor
      extended by edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.match.basic.NumOfAttributeValuesMatchFunctor
All Implemented Interfaces:
MatchFunctor

public class NumOfAttributeValuesMatchFunctor
extends AbstractMatchFunctor

A match functor that checks if the given attribute has more than the minimum number of values but less than the maximum.


Constructor Summary
NumOfAttributeValuesMatchFunctor(String id, int min, int max)
          Constructor.
 
Method Summary
protected  boolean doEvaluatePolicyRequirement(ShibbolethFilteringContext filterContext)
          Evaluates this matching criteria.
protected  boolean doEvaluateValue(ShibbolethFilteringContext filterContext, String id, Object value)
          Evaluates this matching criteria.
protected  boolean isWithinRange(BaseAttribute attribute)
          Checks that the number of values for the given attribute is within the given range.
 
Methods inherited from class edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.match.basic.AbstractMatchFunctor
evaluateDenyRule, evaluatePermitValue, evaluatePolicyRequirement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumOfAttributeValuesMatchFunctor

public NumOfAttributeValuesMatchFunctor(String id,
                                        int min,
                                        int max)
Constructor.

Parameters:
id - ID of the attribute to be checked
min - minimum number of values allowed
max - maximum number of values allowed
Method Detail

doEvaluatePolicyRequirement

protected boolean doEvaluatePolicyRequirement(ShibbolethFilteringContext filterContext)
                                       throws FilterProcessingException
Evaluates this matching criteria. This evaluation is used while the filtering engine determines policy applicability.

Specified by:
doEvaluatePolicyRequirement in class AbstractMatchFunctor
Parameters:
filterContext - current filtering context
Returns:
true if the criteria for this matching function are meant
Throws:
FilterProcessingException - thrown if the function can not be evaluated

doEvaluateValue

protected boolean doEvaluateValue(ShibbolethFilteringContext filterContext,
                                  String id,
                                  Object value)
                           throws FilterProcessingException
Evaluates this matching criteria. This evaluation is used while the filtering engine is evaluating either a deny or permit value rule.

Specified by:
doEvaluateValue in class AbstractMatchFunctor
Parameters:
filterContext - the current filtering context
id - ID of the attribute being evaluated
value - value of the attribute being evaluated
Returns:
true if the criteria for this matching function are meant
Throws:
FilterProcessingException - thrown if the function can not be evaluated

isWithinRange

protected boolean isWithinRange(BaseAttribute attribute)
Checks that the number of values for the given attribute is within the given range.

Parameters:
attribute - attribute to check
Returns:
true if the attribute has more than the minimum number of values and less than the maximum.


Copyright © 2006-2010 Internet2. All Rights Reserved.