ca.bc.gov.webade.user.service
Interface UserInfoService


public interface UserInfoService

API that contains all functionality related to user information, including the retrieval and searching for user information, along with various supporting API calls.

Author:
jross

Method Summary
 UserSearchQuery createUserSearchQuery(UserTypeCode userType)
          Returns the UserSearchQuery meta-data object to perform user searching for this application on the provided user type.
 WebADEUserInfo[] findUsers(UserSearchQuery searchQuery)
          Finds the set of WebADEUserInfo objects that match the provided search criteria.
 java.lang.String getSourceDirectoryForUserType(UserTypeCode userType)
          Returns the source directory for the given user type if it is supported by this provider.
 java.lang.String[] getSupportedSourceDirectories()
          Returns the set of source directory names supported by this instance of the UserInfoService.
 UserTypeCode[] getSupportedUserTypes()
          Returns the set of user type codes supported by this instance of the UserInfoService.
 UserTypeCode getUserTypeForSourceDirectory(java.lang.String sourceDirectory)
          Returns the user type for the given source directory if it is supported by this provider.
 WebADEUserInfo getWebADEUserInfo(UserCredentials userCredentials)
          Loads the target user's personal information from the user provider, or returns null if the user is not found.
 WebADEUserInfo getWebADEUserInfo(UserCredentials userCredentials, boolean ignoreSessionCache)
          Loads the target user's personal information from the user provider, or returns null if the user is not found.
 boolean handlesSourceDirectory(java.lang.String sourceDirectory)
          Returns true if the given sourceDirectory is one of the ones supported by this provider.
 boolean handlesUserType(UserTypeCode userType)
          Returns true if the given user type is one of the ones supported by this provider.
 boolean isUserInGroup(UserCredentials userCredentials, GUID groupGuid)
          Checks to see if the user is a member of the group identified by the given GUID.
 GUID[] isUserInGroups(UserCredentials userCredentials, GUID[] groupGuids)
          Checks to see if the user is a member of the groups identified by the given array of GUID values.
 

Method Detail

handlesSourceDirectory

public boolean handlesSourceDirectory(java.lang.String sourceDirectory)
                               throws UserInfoServiceException
Returns true if the given sourceDirectory is one of the ones supported by this provider.

Parameters:
sourceDirectory - The target sourceDirectory name.
Returns:
True if this provider provides support for the given domain.
Throws:
UserInfoServiceException

handlesUserType

public boolean handlesUserType(UserTypeCode userType)
                        throws UserInfoServiceException
Returns true if the given user type is one of the ones supported by this provider.

Parameters:
userType - The target user type.
Returns:
True if this provider provides support for the given user type.
Throws:
UserInfoServiceException

getSourceDirectoryForUserType

public java.lang.String getSourceDirectoryForUserType(UserTypeCode userType)
                                               throws UserInfoServiceException
Returns the source directory for the given user type if it is supported by this provider.

Parameters:
userType - The target user type.
Returns:
The source directory name.
Throws:
UserInfoServiceException

getUserTypeForSourceDirectory

public UserTypeCode getUserTypeForSourceDirectory(java.lang.String sourceDirectory)
                                           throws UserInfoServiceException
Returns the user type for the given source directory if it is supported by this provider.

Parameters:
sourceDirectory - The target sourceDirectory name.
Returns:
The user type code.
Throws:
UserInfoServiceException

getSupportedSourceDirectories

public java.lang.String[] getSupportedSourceDirectories()
                                                 throws UserInfoServiceException
Returns the set of source directory names supported by this instance of the UserInfoService.

Returns:
The array of source directory names this provider handles.
Throws:
UserInfoServiceException

getSupportedUserTypes

public UserTypeCode[] getSupportedUserTypes()
                                     throws UserInfoServiceException
Returns the set of user type codes supported by this instance of the UserInfoService.

Returns:
The array of user types this provider handles.
Throws:
UserInfoServiceException

getWebADEUserInfo

public WebADEUserInfo getWebADEUserInfo(UserCredentials userCredentials)
                                 throws UserInfoServiceException
Loads the target user's personal information from the user provider, or returns null if the user is not found. Will return the internally cached info object, if the given credentials match the current user's credentials.

Parameters:
userCredentials - The user's identifying credentials.
Returns:
A WebADEUserInfo object for the target user.
Throws:
UserInfoServiceException

getWebADEUserInfo

public WebADEUserInfo getWebADEUserInfo(UserCredentials userCredentials,
                                        boolean ignoreSessionCache)
                                 throws UserInfoServiceException
Loads the target user's personal information from the user provider, or returns null if the user is not found.

Parameters:
userCredentials - The user's identifying credentials.
ignoreSessionCache - A flag indicating whether to ignore the internally cached user info object, should it match the given user credentials.
Returns:
A WebADEUserInfo object for the target user.
Throws:
UserInfoServiceException

isUserInGroup

public boolean isUserInGroup(UserCredentials userCredentials,
                             GUID groupGuid)
                      throws UserInfoServiceException
Checks to see if the user is a member of the group identified by the given GUID. This method will also traverse the group's member groups recursively until it has either found the user or exhausted the set of member groups.

Parameters:
userCredentials - The target user's credentials.
groupGuid - The unique GUID of the target group.
Returns:
True if the user was found as a member, otherwise false.
Throws:
UserInfoServiceException - Thrown if the group is not found or an error occurs while processing the request.

isUserInGroups

public GUID[] isUserInGroups(UserCredentials userCredentials,
                             GUID[] groupGuids)
                      throws UserInfoServiceException
Checks to see if the user is a member of the groups identified by the given array of GUID values. This method will also traverse the groups' member groups recursively until it has either found the user or exhausted the set of member groups.

Parameters:
userCredentials - The target user's credentials.
groupGuids - The unique GUID values of the target groups.
Returns:
The array of all GUID values for groups in the set that the user is a member of (Returns a size-0 array if the user is not a member of any of the given groups).
Throws:
UserInfoServiceException - Thrown if ant of the groups are not found or an error occurs while processing the request.

createUserSearchQuery

public UserSearchQuery createUserSearchQuery(UserTypeCode userType)
                                      throws UserInfoServiceException
Returns the UserSearchQuery meta-data object to perform user searching for this application on the provided user type.

Parameters:
userType - The user type to perform searching for.
Returns:
A UserSearchQuery object.
Throws:
UserInfoServiceException - Thrown when an error occurs while trying to create the search query from the user provider for the given user type.

findUsers

public WebADEUserInfo[] findUsers(UserSearchQuery searchQuery)
                           throws UserInfoServiceException
Finds the set of WebADEUserInfo objects that match the provided search criteria.

Parameters:
searchQuery - The search query.
Returns:
A List of WebADEUserInfo objects.
Throws:
UserInfoServiceException - Thrown when an error occurs while trying to retrieve the information from the user provider.