org.jasig.services.persondir.support
Class AbstractDefaultAttributePersonAttributeDao

java.lang.Object
  extended by org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
All Implemented Interfaces:
IPersonAttributeDao
Direct Known Subclasses:
AbstractAggregatingDefaultQueryPersonAttributeDao, AbstractQueryPersonAttributeDao, CachingPersonAttributeDaoImpl, ComplexStubPersonAttributeDao, DeclaredRulePersonAttributeDao, EchoPersonAttributeDaoImpl, RegexGatewayPersonAttributeDao

public abstract class AbstractDefaultAttributePersonAttributeDao
extends Object
implements IPersonAttributeDao

Abstract class implementing the IPersonAttributeDao method IPersonAttributeDao.getUserAttributes(String) by delegation to IPersonAttributeDao.getUserAttributes(Map) using a configurable default attribute name.

Configuration:

Property Description Required Default
defaultAttribute The attribute to use for the key in the Map passed to IPersonAttributeDao.getUserAttributes(Map) when getUserAttributes(String) is called. The value is the uid passed to the method. No "username"

Since:
uPortal 2.5
Version:
$Revision: 2892 $ $Date: 2006-12-19 13:25:03 -0600 (Tue, 19 Dec 2006) $
Author:
Eric Dalquist edalquist@unicon.net

Field Summary
protected  Log logger
           
 
Constructor Summary
AbstractDefaultAttributePersonAttributeDao()
           
 
Method Summary
 String getDefaultAttributeName()
          Returns the attribute set by setDefaultAttributeName(String) or if it has not been called the default value "uid" is returned.
 Map getUserAttributes(String uid)
          Implements this interface method by creating a seed Map from the uid argument and delegating to getUserAttributes() on that Map.
 void setDefaultAttributeName(String name)
          Sets the attribute to use for getUserAttributes(String) queries.
 
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
getPossibleUserAttributeNames, getUserAttributes
 

Field Detail

logger

protected final Log logger
Constructor Detail

AbstractDefaultAttributePersonAttributeDao

public AbstractDefaultAttributePersonAttributeDao()
Method Detail

getUserAttributes

public final Map getUserAttributes(String uid)
Implements this interface method by creating a seed Map from the uid argument and delegating to getUserAttributes() on that Map. Uses Collections.singletonMap(java.lang.Object, java.lang.Object) to create a seed with the value rerturned by getDefaultAttributeName() as the key and uid as the value. Returns the result of invoking IPersonAttributeDao.getUserAttributes(Map) with the new Map as the argument.

Specified by:
getUserAttributes in interface IPersonAttributeDao
Parameters:
uid - The string to use as the value in the seed
Returns:
Map from attribute names to values
See Also:
org.jasig.portal.services.persondir.IPersonAttributeDao#getUserAttributes(java.lang.String)

getDefaultAttributeName

public final String getDefaultAttributeName()
Returns the attribute set by setDefaultAttributeName(String) or if it has not been called the default value "uid" is returned.

Returns:
The default single string query attribute, will never be null.

setDefaultAttributeName

public final void setDefaultAttributeName(String name)
Sets the attribute to use for getUserAttributes(String) queries. It cannot be null.

Parameters:
name - The attribute name to set as default.
Throws:
IllegalArgumentException - if name is null.


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