org.jasig.services.persondir.support
Class RegexGatewayPersonAttributeDao

java.lang.Object
  extended by org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
      extended by org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
          extended by org.jasig.services.persondir.support.RegexGatewayPersonAttributeDao
All Implemented Interfaces:
org.jasig.services.persondir.IPersonAttributeDao

public final class RegexGatewayPersonAttributeDao
extends AbstractDefaultAttributePersonAttributeDao

This DAO wraps another DAO and only executes the wrapped DAO if the data in the seed matches criteria set out by the configured patterns Map. Multiple seed attributes can be tested by specifying the attribute name as the key of the patterns Map and the regular expression pattern as the value.

Configuration:

Property Description Required Default
patterns A Map of String attribute names to String regular expression patterns. Yes null
targetPersonAttributeDao A the IPersonAttributeDao to delegate the call to if the pattern matching criteria is met. Yes null
matchAllPatterns If true all patterns in the patterns map must past the value mapping criteria for the targetPersonAttributeDao to be delegated to. If false only one of the patterns needs to pass the value mapping criteria. No false
matchAllValues If true all values for the attribute being tested must match the pattern testing it for the criteria to be met. If false only one of the values needs to match the pattern for the criteria to be met. No false


Field Summary
 
Fields inherited from class org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
logger
 
Constructor Summary
RegexGatewayPersonAttributeDao(String attributeName, String pattern, org.jasig.services.persondir.IPersonAttributeDao enclosed)
          Creates a RegexGatewayPersonAttributeDao that will test a single attribute.
 
Method Summary
 Map<String,List<Object>> getMultivaluedUserAttributes(Map<String,List<Object>> seed)
           
 Map<String,String> getPatterns()
           
 Set<String> getPossibleUserAttributeNames()
           
 org.jasig.services.persondir.IPersonAttributeDao getTargetPersonAttributeDao()
           
 boolean isMatchAllPatterns()
           
 boolean isMatchAllValues()
           
 void setMatchAllPatterns(boolean matchAllPatterns)
           
 void setMatchAllValues(boolean matchAllValues)
           
 void setPatterns(Map<String,String> patterns)
           
 void setTargetPersonAttributeDao(org.jasig.services.persondir.IPersonAttributeDao targetPersonAttributeDao)
           
 
Methods inherited from class org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
getDefaultAttributeName, getMultivaluedUserAttributes, setDefaultAttributeName
 
Methods inherited from class org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
flattenResults, getUserAttributes, getUserAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexGatewayPersonAttributeDao

public RegexGatewayPersonAttributeDao(String attributeName,
                                      String pattern,
                                      org.jasig.services.persondir.IPersonAttributeDao enclosed)
Creates a RegexGatewayPersonAttributeDao that will test a single attribute. The specified attribute is also configured as the AbstractDefaultAttributePersonAttributeDao.setDefaultAttributeName(String).

Parameters:
attributeName - The attribute to test, is also set as the defaultAttributeName.
pattern - The pattern to test the specified attribute with.
enclosed - The IPersonAttributeDao to delegate to if the pattern matches.
Method Detail

getPatterns

public Map<String,String> getPatterns()
Returns:
the patterns

setPatterns

public void setPatterns(Map<String,String> patterns)
Parameters:
patterns - the patterns to set

getTargetPersonAttributeDao

public org.jasig.services.persondir.IPersonAttributeDao getTargetPersonAttributeDao()
Returns:
the targetPersonAttributeDao

setTargetPersonAttributeDao

public void setTargetPersonAttributeDao(org.jasig.services.persondir.IPersonAttributeDao targetPersonAttributeDao)
Parameters:
targetPersonAttributeDao - the targetPersonAttributeDao to set

isMatchAllPatterns

public boolean isMatchAllPatterns()
Returns:
the matchAllPatterns

setMatchAllPatterns

public void setMatchAllPatterns(boolean matchAllPatterns)
Parameters:
matchAllPatterns - the matchAllPatterns to set

isMatchAllValues

public boolean isMatchAllValues()
Returns:
the matchAllValues

setMatchAllValues

public void setMatchAllValues(boolean matchAllValues)
Parameters:
matchAllValues - the matchAllValues to set

getMultivaluedUserAttributes

public Map<String,List<Object>> getMultivaluedUserAttributes(Map<String,List<Object>> seed)

getPossibleUserAttributeNames

public Set<String> getPossibleUserAttributeNames()


Copyright © 1998-2008 Java Architectures Special Interest Group. All Rights Reserved.