org.jasig.services.persondir.support.rule
Class DeclaredRulePersonAttributeDao

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

public final class DeclaredRulePersonAttributeDao
extends AbstractDefaultAttributePersonAttributeDao

Implementation of uPortal's IPersonAttributeDao that evaluates person directory information based on configurable rules. You may chain as many rules as you like, but this DAO will apply at most one rule, the first that triggers.

Configuration:

Property Description Required Default
rules The array of AttributeRules to use when Yes null


Field Summary
 
Fields inherited from class org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
logger
 
Constructor Summary
DeclaredRulePersonAttributeDao(String attributeName, List rules)
          Creates a new DeclaredRulePersonAttributeDao specifying the attributeName to pass to AbstractDefaultAttributePersonAttributeDao.setDefaultAttributeName(String) and the List of AttributeRules to pass to #setRules(AttributeRule[])
 
Method Summary
 Set getPossibleUserAttributeNames()
          Aggregates the results of calling AttributeRule.getPossibleUserAttributeNames() on each AttributeRule instance in the rules array.
 List getRules()
           
 Map getUserAttributes(Map seed)
          Obtains a mutable Map from attribute names to values for the given query seed which is an immutable Map.
 void setRules(List rules)
           
 
Methods inherited from class org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
getDefaultAttributeName, getUserAttributes, setDefaultAttributeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeclaredRulePersonAttributeDao

public DeclaredRulePersonAttributeDao(String attributeName,
                                      List rules)
Creates a new DeclaredRulePersonAttributeDao specifying the attributeName to pass to AbstractDefaultAttributePersonAttributeDao.setDefaultAttributeName(String) and the List of AttributeRules to pass to #setRules(AttributeRule[])

Parameters:
attributeName -
rules -
Method Detail

getRules

public List getRules()
Returns:
the rules

setRules

public void setRules(List rules)
Parameters:
rules - the rules to set

getUserAttributes

public Map getUserAttributes(Map seed)
Description copied from interface: IPersonAttributeDao
Obtains a mutable Map from attribute names to values for the given query seed which is an immutable Map. The values may be mutable objects but it is recommended that they be immutable.
For the returned Map; Keys must be String, Values can be any Object, they are typically Strings.
Values may also be multi-valued, in this case they are of type List and the list contents are the values of the attribute.
This method returns according to the following rules:

Unless otherwise specified by an implementation the returned Map will not be a union of the seed and query results. If your are given a Map that includes the attribute "phone" and value "555-1212" and the returned Map contains the attribute "phone" with the value "555-1212", this means that your implementation also believes that the "phone" attribute should have this value.

Parameters:
seed - immutable Map of attributes to values to seed the query
Returns:
Map from attribute names to values

getPossibleUserAttributeNames

public Set getPossibleUserAttributeNames()
Aggregates the results of calling AttributeRule.getPossibleUserAttributeNames() on each AttributeRule instance in the rules array.

Returns:
A {link Set} of possible attribute names for user queries.
See Also:
IPersonAttributeDao.getPossibleUserAttributeNames()


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