edu.internet2.middleware.shibboleth.common.attribute.filtering.provider.match.saml
Class AbstractEntityAttributeMatchFunctor

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.saml.AbstractEntityAttributeMatchFunctor
All Implemented Interfaces:
MatchFunctor
Direct Known Subclasses:
AbstractEntityAttributeExactMatchFunctor, AbstractEntityAttributeRegexMatchFunctor

public abstract class AbstractEntityAttributeMatchFunctor
extends AbstractMatchFunctor

Base class for match functions that check whether a particular entity attribute is present and contains a given value.


Constructor Summary
AbstractEntityAttributeMatchFunctor()
           
 
Method Summary
protected  boolean doEvaluatePolicyRequirement(ShibbolethFilteringContext filterContext)
          Evaluates this matching criteria.
protected  boolean doEvaluateValue(ShibbolethFilteringContext filterContext, String attributeId, Object attributeValue)
          Evaluates this matching criteria.
protected abstract  boolean entityAttributeValueMatches(String entityAttributeValue)
          Checks whether the given entity attribute value matches the rules for particular implementation of this functor.
protected  org.opensaml.saml2.core.Attribute getEntityAttribute(org.opensaml.saml2.metadata.EntityDescriptor entityDescriptor)
          Gets the entity attribute from the given entity metadata.
protected abstract  org.opensaml.saml2.metadata.EntityDescriptor getEntityMetadata(ShibbolethFilteringContext filterContext)
          Gets the entity descriptor for the entity to check.
 String getName()
          Gets the name of the entity attribute the entity must have.
 String getNameFormat()
          Gets the name format of the entity attribute the entity must have.
protected  boolean hasEntityAttribute(ShibbolethFilteringContext filterContext)
          Checks to see if the entity returned by getEntityMetadata(ShibbolethFilteringContext) contains the entity attribute specified by this functor's configuration.
 void setName(String attributeName)
          Sets the name of the entity attribute the entity must have.
 void setNameFormat(String attributeNameFormat)
          Sets the name format of the entity attribute the entity must have.
 
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

AbstractEntityAttributeMatchFunctor

public AbstractEntityAttributeMatchFunctor()
Method Detail

getName

public String getName()
Gets the name of the entity attribute the entity must have.

Returns:
name of the entity attribute the entity must have

setName

public void setName(String attributeName)
Sets the name of the entity attribute the entity must have.

Parameters:
attributeName - name of the entity attribute the entity must have

getNameFormat

public String getNameFormat()
Gets the name format of the entity attribute the entity must have.

Returns:
name format of the entity attribute the entity must have

setNameFormat

public void setNameFormat(String attributeNameFormat)
Sets the name format of the entity attribute the entity must have.

Parameters:
attributeNameFormat - name format of the entity attribute the entity must have

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 attributeId,
                                  Object attributeValue)
                           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
attributeId - ID of the attribute being evaluated
attributeValue - 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

hasEntityAttribute

protected boolean hasEntityAttribute(ShibbolethFilteringContext filterContext)
Checks to see if the entity returned by getEntityMetadata(ShibbolethFilteringContext) contains the entity attribute specified by this functor's configuration.

Parameters:
filterContext - current request context
Returns:
true if the entity has the configured attribute, false otherwise

getEntityMetadata

protected abstract org.opensaml.saml2.metadata.EntityDescriptor getEntityMetadata(ShibbolethFilteringContext filterContext)
Gets the entity descriptor for the entity to check.

Parameters:
filterContext - current filter request context
Returns:
entity descriptor for the entity to check

getEntityAttribute

protected org.opensaml.saml2.core.Attribute getEntityAttribute(org.opensaml.saml2.metadata.EntityDescriptor entityDescriptor)
Gets the entity attribute from the given entity metadata. If both the attribute name and name format for this match functor is configured then both must match, otherwise only the attribute name must match.

Parameters:
entityDescriptor - the metadata for the entity
Returns:
the entity or null if the metadata does not contain such an entity attribute

entityAttributeValueMatches

protected abstract boolean entityAttributeValueMatches(String entityAttributeValue)
Checks whether the given entity attribute value matches the rules for particular implementation of this functor.

Parameters:
entityAttributeValue - the entity attribute value, never null
Returns:
true if the value matches, false if not


Copyright © 2006-2011 Internet2. All Rights Reserved.