org.jasig.services.persondir.support
Class ComplexStubPersonAttributeDao

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

public class ComplexStubPersonAttributeDao
extends AbstractDefaultAttributePersonAttributeDao

Looks up the user's attribute Map in the backingMap. If using the IPersonAttributeDao.getUserAttributes(Map) method the attribute value returned for the key AbstractDefaultAttributePersonAttributeDao.getDefaultAttributeName() will be used as the key for the backingMap.

Configuration:

Property Description Required Default
backingMap Sets the backing map to use to return user attributes from. The backing map should have keys of type String which are the uid for the user. The values should be of type Map which follow the Map restrictions decribed by IPersonAttributeDao.getUserAttributes(Map). No Collections.EMPTY_MAP

Version:
$Revision: 2892 $ $Date: 2006-12-19 13:25:03 -0600 (Tue, 19 Dec 2006) $

Field Summary
 
Fields inherited from class org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
logger
 
Constructor Summary
ComplexStubPersonAttributeDao()
          Creates a new, empty, dao.
ComplexStubPersonAttributeDao(Map backingMap)
          Creates a new DAO with the specified backing map.
 
Method Summary
 Map getBackingMap()
           
 Set getPossibleUserAttributeNames()
          Gets a Set of attribute names that may be returned by the IPersonAttributeDao.getUserAttributes(Map).
 Map getUserAttributes(Map seed)
          Obtains a mutable Map from attribute names to values for the given query seed which is an immutable Map.
 void setBackingMap(Map backingMap)
           
 
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

ComplexStubPersonAttributeDao

public ComplexStubPersonAttributeDao()
Creates a new, empty, dao.


ComplexStubPersonAttributeDao

public ComplexStubPersonAttributeDao(Map backingMap)
Creates a new DAO with the specified backing map.

Parameters:
backingMap - The backingMap to call setBackingMap(Map) with.
Method Detail

getBackingMap

public Map getBackingMap()
Returns:
Returns the backingMap.

setBackingMap

public void setBackingMap(Map backingMap)
Parameters:
backingMap - The backingMap to set.

getPossibleUserAttributeNames

public Set getPossibleUserAttributeNames()
Description copied from interface: IPersonAttributeDao
Gets a Set of attribute names that may be returned by the IPersonAttributeDao.getUserAttributes(Map). The names returned represent all possible names IPersonAttributeDao.getUserAttributes(Map) could return. If the dao doesn't have a way to know all possible attribute names this method should return null.
Returns an immutable Set.

Returns:
A {link Set} of possible attribute names for user queries.

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


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