ca.bc.gov.webade.user.provider
Interface WebADEUserProvider

All Known Implementing Classes:
CAPWebServicesProvider

public interface WebADEUserProvider

Interface for remote systems that provide the WebADE with user details for users in the WebADE system.

Author:
jross

Field Summary
static java.lang.String PROVIDER_CLASS_NAME
          The user-provider class name preference name.
static java.lang.String PROVIDER_ENABLED
          The user-provider enabled preference name.
static java.lang.String WEBADE_USER_PROVIDER_SUBTYPE
          The WebADE user provider preference sub-type.
 
Method Summary
 UserSearchQuery createUserSearchQuery(UserTypeCode userType)
          Returns a UserSearchQuery metadata object for the given user type code.
 java.util.List findUsers(UserCredentials requestingUserCredentials, UserSearchQuery query)
          Returns the user information of the users from the LDAP directory matching the given 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()
           
 UserTypeCode[] getSupportedUserTypes()
           
 WebADEUserInfo getUser(UserCredentials requestingUserCredentials, UserCredentials targetUserCredentials)
          Returns the user information from the LDAP directory hosting the user identified by the given credentials.
 UserTypeCode getUserTypeForSourceDirectory(java.lang.String sourceDirectory)
          Returns the user type for the given source directory if it is supported by this provider.
 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.
 void init(java.util.Properties properties)
          Initializes the provider using the given preference set.
 GUID[] isUserInGroups(UserCredentials requestingUserCredentials, UserCredentials targetUserCredentials, GUID[] groupGuids)
          Checks to see if the user is a member of the groups identified by the given array of GUID values.
 

Field Detail

WEBADE_USER_PROVIDER_SUBTYPE

public static final java.lang.String WEBADE_USER_PROVIDER_SUBTYPE
The WebADE user provider preference sub-type.

See Also:
Constant Field Values

PROVIDER_CLASS_NAME

public static final java.lang.String PROVIDER_CLASS_NAME
The user-provider class name preference name.

See Also:
Constant Field Values

PROVIDER_ENABLED

public static final java.lang.String PROVIDER_ENABLED
The user-provider enabled preference name.

See Also:
Constant Field Values
Method Detail

init

public void init(java.util.Properties properties)
          throws WebADEUserProviderException
Initializes the provider using the given preference set.

Parameters:
properties - Configuration settings for the user info provider hosting user information for this WebADE application.
Throws:
WebADEUserProviderException - Thrown if the configuration settings are not properly configured (Missing parameters, etc).

handlesSourceDirectory

public boolean handlesSourceDirectory(java.lang.String sourceDirectory)
                               throws WebADEUserProviderException
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:
WebADEUserProviderException

handlesUserType

public boolean handlesUserType(UserTypeCode userType)
                        throws WebADEUserProviderException
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:
WebADEUserProviderException

getSourceDirectoryForUserType

public java.lang.String getSourceDirectoryForUserType(UserTypeCode userType)
                                               throws WebADEUserProviderException
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:
WebADEUserProviderException

getUserTypeForSourceDirectory

public UserTypeCode getUserTypeForSourceDirectory(java.lang.String sourceDirectory)
                                           throws WebADEUserProviderException
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:
WebADEUserProviderException

getSupportedSourceDirectories

public java.lang.String[] getSupportedSourceDirectories()
                                                 throws WebADEUserProviderException
Returns:
The array of source directory names this provider handles.
Throws:
WebADEUserProviderException

getSupportedUserTypes

public UserTypeCode[] getSupportedUserTypes()
                                     throws WebADEUserProviderException
Returns:
The array of user types this provider handles.
Throws:
WebADEUserProviderException

getUser

public WebADEUserInfo getUser(UserCredentials requestingUserCredentials,
                              UserCredentials targetUserCredentials)
                       throws WebADEUserProviderException
Returns the user information from the LDAP directory hosting the user identified by the given credentials.

Parameters:
requestingUserCredentials - The requesting user's credentials.
targetUserCredentials - The user's credentials to look up.
Returns:
The loaded user object, or null if the user is not found.
Throws:
WebADEUserProviderException - Thrown if a connection cannot be made to the application's LDAP directories or an error occurs.

isUserInGroups

public GUID[] isUserInGroups(UserCredentials requestingUserCredentials,
                             UserCredentials targetUserCredentials,
                             GUID[] groupGuids)
                      throws WebADEUserProviderException
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:
requestingUserCredentials - The requesting user's credentials.
targetUserCredentials - The user's credentials to look up.
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:
WebADEUserProviderException - Thrown if ant of the groups are not found or an error occurs while processing the request.

createUserSearchQuery

public UserSearchQuery createUserSearchQuery(UserTypeCode userType)
                                      throws WebADEUserProviderException
Returns a UserSearchQuery metadata object for the given user type code.

Parameters:
userType - The user type to create a query object for.
Returns:
A UserSearchQuery object for searching for users of the given user type.
Throws:
WebADEUserProviderException - Thrown if searching for the given user type is not supported.

findUsers

public java.util.List findUsers(UserCredentials requestingUserCredentials,
                                UserSearchQuery query)
                         throws WebADEUserProviderException
Returns the user information of the users from the LDAP directory matching the given search criteria.

Parameters:
requestingUserCredentials - The requesting user's credentials.
query - The user search query containing the search parameters.
Returns:
The List of loaded user objects.
Throws:
WebADEUserProviderException - Thrown if a connection cannot be made to the application's LDAP directories or an error occurs.