net.geant.edugain.attributes.filters
Class AbstractFilter

java.lang.Object
  extended by net.geant.edugain.attributes.filters.AbstractFilter
All Implemented Interfaces:
Filter
Direct Known Subclasses:
AllowFilter, DenyFilter

public abstract class AbstractFilter
extends java.lang.Object
implements Filter

Abstract Attribute Filter. This class provides the infrastructure needed by AllowFilter and DenyFilter.

Author:
Adam Lantos

Field Summary
private  java.lang.String attributeName
          The ID of the attribute which this filter operates on.
private  org.apache.log4j.Logger log
           
private  boolean valueMatches
          Whether or not this filter is using regular expressions to determine attribute values.
private  java.util.List<java.util.regex.Pattern> valueRegexps
          The regular expressions set by the configuration.
 
Constructor Summary
AbstractFilter()
           
 
Method Summary
protected  void filterOut(AttributeSet set, AttributeValues values)
          Internal method to remove one AttributeValue from the AttributeSet.
protected  java.lang.String getAttributeName()
           
 void init(AttributeType configuration)
          Initializes this attribute filter with parsed configuration.
protected  boolean isValueMatches()
           
protected  AttributeValues selectAttributeValues(AttributeSet input)
          Internal method which makes the filtering and returns one AttributeValues which holds all the attribute values this filter will operate on.
protected  boolean valueMatches(java.lang.String attributeValue)
          Internal method to decide whether or not one single attribute value matches at least one regular expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.geant.edugain.attributes.filters.Filter
doFilter
 

Field Detail

attributeName

private java.lang.String attributeName
The ID of the attribute which this filter operates on.


valueMatches

private boolean valueMatches
Whether or not this filter is using regular expressions to determine attribute values.


valueRegexps

private java.util.List<java.util.regex.Pattern> valueRegexps
The regular expressions set by the configuration.


log

private org.apache.log4j.Logger log
Constructor Detail

AbstractFilter

public AbstractFilter()
Method Detail

init

public void init(AttributeType configuration)
Initializes this attribute filter with parsed configuration.

Specified by:
init in interface Filter
Parameters:
configuration -

isValueMatches

protected boolean isValueMatches()

getAttributeName

protected java.lang.String getAttributeName()

selectAttributeValues

protected AttributeValues selectAttributeValues(AttributeSet input)
Internal method which makes the filtering and returns one AttributeValues which holds all the attribute values this filter will operate on.

Parameters:
input -
Returns:

valueMatches

protected boolean valueMatches(java.lang.String attributeValue)
Internal method to decide whether or not one single attribute value matches at least one regular expression.

Parameters:
attributeValue -
Returns:

filterOut

protected void filterOut(AttributeSet set,
                         AttributeValues values)
Internal method to remove one AttributeValue from the AttributeSet.

Parameters:
set -
values -