org.jasig.services.persondir
Interface IPersonAttributeDao


public interface IPersonAttributeDao

Defines methods for finding a IPersonAttributes or Set of IPersons based on a user ID or a Map of user attributes to query with.

Version:
$Revision$ $Date$
Author:
andrew.petro@yale.edu, Eric Dalquist

Field Summary
static String WILDCARD
           
static Pattern WILDCARD_PATTERN
           
 
Method Summary
 Set<String> getAvailableQueryAttributes()
          Gets a Set of attribute names that this implementation knows how to use in a query.
 Map<String,List<Object>> getMultivaluedUserAttributes(Map<String,List<Object>> seed)
          Deprecated. Use getPeople(Map) instead. This method will be removed in 1.6
 Map<String,List<Object>> getMultivaluedUserAttributes(String uid)
          Deprecated. Use getPerson(String) instead. This method will be removed in 1.6
 Set<IPersonAttributes> getPeople(Map<String,Object> query)
          Searches for IPersonAttributess that match the set of attributes provided in the query Map.
 Set<IPersonAttributes> getPeopleWithMultivaluedAttributes(Map<String,List<Object>> query)
          Searches for IPersonAttributess that match the set of attributes provided in the query Map.
 IPersonAttributes getPerson(String uid)
          Searches for a single IPersonAttributes using the specified uid (userName).
This method returns according to the following rules:
If the user exists and has attributes a populated IPersonAttributes is returned. If the user exists and has no attributes an IPersonAttributes with an empty attributes Map is returned. If the user doesn't exist null is returned. If an error occurs while find the person an appropriate exception will be thrown.
 Set<String> getPossibleUserAttributeNames()
          Gets a Set of attribute names that may be returned for an IPersonAttributes.
 Map<String,Object> getUserAttributes(Map<String,Object> seed)
          Deprecated. Use getPeople(Map) instead. This method will be removed in 1.6
 Map<String,Object> getUserAttributes(String uid)
          Deprecated. Use getPerson(String) instead. This method will be removed in 1.6
 

Field Detail

WILDCARD

static final String WILDCARD
See Also:
Constant Field Values

WILDCARD_PATTERN

static final Pattern WILDCARD_PATTERN
Method Detail

getPerson

IPersonAttributes getPerson(String uid)
Searches for a single IPersonAttributes using the specified uid (userName).
This method returns according to the following rules:

Parameters:
uid - The userName of the person to find.
Returns:
The populated IPersonAttributes for the specified uid, null if no person could be found for the uid.
Throws:
IllegalArgumentException - If uid is null.

getPeople

Set<IPersonAttributes> getPeople(Map<String,Object> query)
Searches for IPersonAttributess that match the set of attributes provided in the query Map. Each implementation is free to define what qualifies as a 'match' is on its own. The provided query Map contains String attribute names and single values which may be null.
If the implementation can not execute its query for an expected reason such as not enough information in the query Map null should be returned. For unexpected problems throw an exception.

Parameters:
query - A Map of name/value pair attributes to use in searching for IPersonAttributess
Returns:
A Set of IPersonAttributess that match the query Map. If no matches are found an empty Set is returned. If the query could not be run null is returned.
Throws:
IllegalArgumentException - If query is null.

getPeopleWithMultivaluedAttributes

Set<IPersonAttributes> getPeopleWithMultivaluedAttributes(Map<String,List<Object>> query)
Searches for IPersonAttributess that match the set of attributes provided in the query Map. Each implementation is free to define what qualifies as a 'match' is on its own. The provided query Map contains String attribute names and single values which may be null.
If the implementation can not execute its query for an expected reason such as not enough information in the query Map null should be returned. For unexpected problems throw an exception.

Parameters:
query - A Map of name/value pair attributes to use in searching for IPersonAttributess
Returns:
A Set of IPersonAttributess that match the query Map. If no matches are found an empty Set is returned. If the query could not be run null is returned.
Throws:
IllegalArgumentException - If query is null.

getPossibleUserAttributeNames

Set<String> getPossibleUserAttributeNames()
Gets a Set of attribute names that may be returned for an IPersonAttributes. The names returned represent all possible attributes names for the IPersonAttributes objects returned by the get methods. 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 Set of possible attribute names for user queries.

getAvailableQueryAttributes

Set<String> getAvailableQueryAttributes()
Gets a Set of attribute names that this implementation knows how to use in a query. The names returned represent all possible names for query attributes for this implmenentation. If the dao doesn't have a way to know all possible query attribute names this method should return null
Returns an immutable Set.

Returns:
The set of attributes that can be used to query for user ids in this dao, null if the set is unknown.

getMultivaluedUserAttributes

@Deprecated
Map<String,List<Object>> getMultivaluedUserAttributes(Map<String,List<Object>> seed)
Deprecated. Use getPeople(Map) instead. This method will be removed in 1.6

Returns a mutable Map of the attributes of the first IPersonAttributes returned by calling getPeople(Map)


getMultivaluedUserAttributes

@Deprecated
Map<String,List<Object>> getMultivaluedUserAttributes(String uid)
Deprecated. Use getPerson(String) instead. This method will be removed in 1.6

Returns a mutable Map of the attributes of the IPersonAttributes returned by calling getPerson(String)


getUserAttributes

@Deprecated
Map<String,Object> getUserAttributes(Map<String,Object> seed)
Deprecated. Use getPeople(Map) instead. This method will be removed in 1.6

Returns a mutable Map of the single-valued attributes of the first IPersonAttributes returned by calling getPeople(Map)


getUserAttributes

@Deprecated
Map<String,Object> getUserAttributes(String uid)
Deprecated. Use getPerson(String) instead. This method will be removed in 1.6

Returns a mutable Map of the single-valued attributes of the IPersonAttributes returned by calling getPerson(String)



Copyright © 2012 Jasig. All Rights Reserved.