org.jasig.services.persondir.support
Class RegexGatewayPersonAttributeDao
java.lang.Object
org.jasig.services.persondir.support.BasePersonAttributeDao
org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
org.jasig.services.persondir.support.RegexGatewayPersonAttributeDao
- All Implemented Interfaces:
- 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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegexGatewayPersonAttributeDao
public RegexGatewayPersonAttributeDao()
- Default constructor,
setPatterns(Map) and setTargetPersonAttributeDao(IPersonAttributeDao)
will need to be called if this is used.
RegexGatewayPersonAttributeDao
public RegexGatewayPersonAttributeDao(String attributeName,
String pattern,
IPersonAttributeDao enclosed)
- Creates a RegexGatewayPersonAttributeDao that will test a single attribute. The specified
attribute is also configured as the
#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.
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 IPersonAttributeDao getTargetPersonAttributeDao()
- Returns:
- the targetPersonAttributeDao
setTargetPersonAttributeDao
public void setTargetPersonAttributeDao(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
getPeopleWithMultivaluedAttributes
public Set<IPersonAttributes> getPeopleWithMultivaluedAttributes(Map<String,List<Object>> seed)
getPossibleUserAttributeNames
public Set<String> getPossibleUserAttributeNames()
getAvailableQueryAttributes
public Set<String> getAvailableQueryAttributes()
Copyright © 2012 Jasig. All Rights Reserved.