org.jasig.portal.services
Class PersonDirectory

java.lang.Object
  extended by org.jasig.portal.services.PersonDirectory

public class PersonDirectory
extends java.lang.Object

PersonDirectory is a static lookup mechanism for a singleton instance of IPersonAttributeDao. It is configurable via a Spring beans.dtd compliant configuration file in the properties directory called personDirectory.xml (as referenced by applicationContext.xml - that is, you could choose to declare the underlying IPersonAttributesDao backing your PersonDirectory directly in applicationContext.xml, or elsewhere. PersonDirectory looks for an IPersonAttributeDao instance named 'personAttributeDao'. This class serves as the lookup mechanism for clients to obtain a reference to the singleton IPersonAttributeDao instance. Via legacy methods, PersonDirectory also serves as the interface by which client code accesses user attributes. These deprecated legacy methods are a facade to the PersonAttributeDao. The default configuration of that file implements the legacy behavior of using the PersonDirs.xml file for configuration. It is expected that PersonDirs.xml offers the flexibility necessary to support most uPortal installations.

Version:
$Revision: 1.47 $ $Date: 2005/04/06 15:18:45 $
Author:
Howard Gilbert, andrew.petro@yale.edu, Eric Dalquist edalquist@unicon.net

Field Summary
private  IPersonAttributeDao impl
          Wrapped class which provides the functionality
private static PersonDirectory instance
          Singleton reference to PersonDirectory
private static org.apache.commons.logging.Log log
           
private static java.lang.String PADAO_BEAN_NAME
           
static java.util.HashSet propertynames
          Deprecated. you cannot get the list of attributes in the abstract, only for a particular user.
 
Constructor Summary
private PersonDirectory(IPersonAttributeDao impl)
          Private constructor to allow for singleton behavior.
 
Method Summary
static IPersonAttributeDao getPersonAttributeDao()
          Static lookup for a the configured IPersonAttributeDao implementation available from PortalApplicationContextFacade.
static java.util.Iterator getPropertyNamesIterator()
          Deprecated. Use IPersonAttributeDao.getPossibleUserAttributeNames()
static RestrictedPerson getRestrictedPerson(java.lang.String uid)
          Deprecated. Use PersonFactory.createRestrictedPerson() and IPersonAttributeDao.getUserAttributes(String) and RestrictedPerson.setAttributes(Map)
 java.util.Hashtable getUserDirectoryInformation(java.lang.String username)
          Deprecated. Use IPersonAttributeDao.getUserAttributes(String)
 void getUserDirectoryInformation(java.lang.String uid, IPerson person)
          Deprecated. Use IPersonAttributeDao.getUserAttributes(String) and IPerson.setAttributes(Map)
static PersonDirectory instance()
          Deprecated. Use getPersonAttributeDao()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PADAO_BEAN_NAME

private static final java.lang.String PADAO_BEAN_NAME
See Also:
Constant Field Values

log

private static final org.apache.commons.logging.Log log

propertynames

public static java.util.HashSet propertynames
Deprecated. you cannot get the list of attributes in the abstract, only for a particular user.
This instance variable used to contain the set of attributes mapped in PersonDir.xml. It now is merely an empty Set. It is no longer used by PersonDirectory and should be removed in a future release.


instance

private static PersonDirectory instance
Singleton reference to PersonDirectory


impl

private IPersonAttributeDao impl
Wrapped class which provides the functionality

Constructor Detail

PersonDirectory

private PersonDirectory(IPersonAttributeDao impl)
Private constructor to allow for singleton behavior.

Parameters:
impl - The IPersonAttributeDao instance to wrap.
Method Detail

getPersonAttributeDao

public static IPersonAttributeDao getPersonAttributeDao()
Static lookup for a the configured IPersonAttributeDao implementation available from PortalApplicationContextFacade.

Returns:
The PortalApplicationContextFacade configured IPersonAttributeDao implementation.
Throws:
java.lang.IllegalStateException - - if PortalApplicationContextFacade does not supply the IPersonAttributeDao instance.

instance

public static PersonDirectory instance()
Deprecated. Use getPersonAttributeDao()

Obtain the singleton instance of PersonDirectory.

Returns:
the singleton instance of PersonDirectory.

getPropertyNamesIterator

public static java.util.Iterator getPropertyNamesIterator()
Deprecated. Use IPersonAttributeDao.getPossibleUserAttributeNames()

This method returns an iterator over the names of attributes. The method behavior is not well defined because attribute sources may choose to return different attributes depending upon about whom they are asked. Therefore, you can only know the attributes for particular users, not the namespace of all possible attributes.

Returns:
an iterator over the attribute names declared by the underlying IPersonAttributeDao instance, if any.

getRestrictedPerson

public static RestrictedPerson getRestrictedPerson(java.lang.String uid)
Deprecated. Use PersonFactory.createRestrictedPerson() and IPersonAttributeDao.getUserAttributes(String) and RestrictedPerson.setAttributes(Map)

Returns a reference to a restricted IPerson represented by the supplied user ID. The restricted IPerson allows access to person attributes, but not the security context.

Parameters:
uid - the user ID
Returns:
the corresponding person, restricted so that its security context is inaccessible

getUserDirectoryInformation

public java.util.Hashtable getUserDirectoryInformation(java.lang.String username)
Deprecated. Use IPersonAttributeDao.getUserAttributes(String)

Obtain a HashTable of attributes for the given user.

Parameters:
username - the name of the user
Returns:
a Hashtable from user names to attributes.

getUserDirectoryInformation

public void getUserDirectoryInformation(java.lang.String uid,
                                        IPerson person)
Deprecated. Use IPersonAttributeDao.getUserAttributes(String) and IPerson.setAttributes(Map)

Populate an IPerson with the attributes from the user directory for the given uid.

Parameters:
uid - person for whom we are obtaining attributes
person - person object into which to store the attributes