org.jasig.services.persondir.support
Class AbstractFlatteningPersonAttributeDao

java.lang.Object
  extended by org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
All Implemented Interfaces:
org.jasig.services.persondir.IPersonAttributeDao
Direct Known Subclasses:
AbstractDefaultAttributePersonAttributeDao, StubPersonAttributeDao

public abstract class AbstractFlatteningPersonAttributeDao
extends Object
implements org.jasig.services.persondir.IPersonAttributeDao

Implements the getUserAttributes(Map) and getUserAttributes(String) methods to provide logic to flatten the attribute result maps from <String, List<Object>> to <String, Object>. The flattening logic resides in flattenResults(Map) which sub-classes can override if needed.

Version:
$Revision$
Author:
Eric Dalquist

Field Summary
protected  Log logger
           
 
Constructor Summary
AbstractFlatteningPersonAttributeDao()
           
 
Method Summary
protected  Map<String,Object> flattenResults(Map<String,List<Object>> multivaluedUserAttributes)
          Takes a <String, List<Object>> Map and coverts it to a <String, Object> Map.
 Map<String,Object> getUserAttributes(Map<String,Object> seed)
           
 Map<String,Object> getUserAttributes(String uid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jasig.services.persondir.IPersonAttributeDao
getMultivaluedUserAttributes, getMultivaluedUserAttributes, getPossibleUserAttributeNames
 

Field Detail

logger

protected final Log logger
Constructor Detail

AbstractFlatteningPersonAttributeDao

public AbstractFlatteningPersonAttributeDao()
Method Detail

getUserAttributes

public final Map<String,Object> getUserAttributes(Map<String,Object> seed)
Specified by:
getUserAttributes in interface org.jasig.services.persondir.IPersonAttributeDao

getUserAttributes

public final Map<String,Object> getUserAttributes(String uid)
Specified by:
getUserAttributes in interface org.jasig.services.persondir.IPersonAttributeDao

flattenResults

protected Map<String,Object> flattenResults(Map<String,List<Object>> multivaluedUserAttributes)
Takes a <String, List<Object>> Map and coverts it to a <String, Object> Map. This implementation takes the first value of each List to use as the value for the new Map.

Parameters:
multivaluedUserAttributes - The attribute map to flatten.
Returns:
A flattened version of the Map, null if the argument was null.


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