org.jasig.services.persondir.support.ldap
Class LdapPersonAttributeDao

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

public class LdapPersonAttributeDao
extends AbstractQueryPersonAttributeDao

LDAP implementation of org.jasig.portal.services.persondir.IPersonAttributeDao. In the case of multi valued attributes a List is set as the value.

Configuration:

Property Description Required Default
timeLimit Sets a time limit for LDAP Query execution time. See SearchControls.setTimeLimit(int) No 0
ldapAttributesToPortalAttributes The Map of String ldap attribute names to String or Sets of Strings to use as attribute names in the returned Map. If a ldap attribute name is not in the map the ldap attribute name will be used in as the returned attribute name. No Collections.EMPTY_MAP
query The LDAP filter query to use when finding the user attributes. Yes null
baseDN The base DistinguishedName to use when executing the query filter. No ""
contextSource A ContextSource from the Spring-LDAP framework. Provides a DataSource style object that this DAO can retrieve LDAP connections from. Yes null

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

Field Summary
 
Fields inherited from class org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
logger
 
Constructor Summary
LdapPersonAttributeDao()
           
 
Method Summary
 String getBaseDN()
           
 ContextSource getContextSource()
           
 Map getLdapAttributesToPortalAttributes()
          Get the mapping from LDAP attribute names to uPortal attribute names.
 Set getPossibleUserAttributeNames()
          Gets a Set of attribute names that may be returned by the IPersonAttributeDao.getUserAttributes(Map).
 String getQuery()
           
 int getTimeLimit()
           
protected  Map getUserAttributesIfNeeded(Object[] args)
          Checks for valid query and context source objects.
Executes the search.
Returns the attribute map results from the query.
 void setBaseDN(String baseDN)
           
 void setContextSource(ContextSource contextSource)
           
 void setLdapAttributesToPortalAttributes(Map ldapAttributesToPortalAttributesArg)
          Set the Map to use for mapping from a ldap attribute name to a portal attribute name or Set of portal attribute names.
 void setQuery(String uidQuery)
           
 void setTimeLimit(int timeLimit)
           
 
Methods inherited from class org.jasig.services.persondir.support.AbstractQueryPersonAttributeDao
getQueryAttributes, getUserAttributes, setQueryAttributes
 
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

LdapPersonAttributeDao

public LdapPersonAttributeDao()
Method Detail

getUserAttributesIfNeeded

protected Map getUserAttributesIfNeeded(Object[] args)
Checks for valid query and context source objects.
Executes the search.
Returns the attribute map results from the query.

Specified by:
getUserAttributesIfNeeded in class AbstractQueryPersonAttributeDao
Parameters:
args - The arguments to execute the query with.
Returns:
The results of the query, as specified by org.jasig.portal.services.persondir.IPersonAttributeDao#getUserAttributes(Map)
See Also:
org.jasig.portal.services.persondir.support.AbstractQueryPersonAttributeDao#getUserAttributesIfNeeded(java.lang.Object[])

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.

getLdapAttributesToPortalAttributes

public Map getLdapAttributesToPortalAttributes()
Get the mapping from LDAP attribute names to uPortal attribute names. Mapping type is from String to [String | Set of String].

Returns:
Returns the ldapAttributesToPortalAttributes.

setLdapAttributesToPortalAttributes

public void setLdapAttributesToPortalAttributes(Map ldapAttributesToPortalAttributesArg)
Set the Map to use for mapping from a ldap attribute name to a portal attribute name or Set of portal attribute names. Ldap attribute names that are specified but have null mappings will use the ldap attribute name for the portal attribute name. Ldap attribute names that are not specified as keys in this Map will be ignored.
The passed Map must have keys of type String and values of type String or a Set of String.

Parameters:
ldapAttributesToPortalAttributesArg - Map from ldap attribute names to portal attribute names.
Throws:
IllegalArgumentException - If the Map doesn't follow the rules stated above.
See Also:
MultivaluedPersonAttributeUtils.parseAttributeToAttributeMapping(Map)

getTimeLimit

public int getTimeLimit()
Returns:
Returns the timeLimit.

setTimeLimit

public void setTimeLimit(int timeLimit)
Parameters:
timeLimit - The timeLimit to set.

getQuery

public String getQuery()
Returns:
Returns the query.

setQuery

public void setQuery(String uidQuery)
Parameters:
uidQuery - The query to set.

getBaseDN

public String getBaseDN()
Returns:
Returns the ldapServer.

setBaseDN

public void setBaseDN(String baseDN)
Parameters:
baseDN - The ldapServer to set.

getContextSource

public ContextSource getContextSource()
Returns:
Returns the contextSource.

setContextSource

public void setContextSource(ContextSource contextSource)
Parameters:
contextSource - The contextSource to set.


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