ca.bc.gov.webade.user.provider.legacy
Class LegacyProviderProxy

java.lang.Object
  extended byca.bc.gov.webade.user.provider.legacy.LegacyProviderProxy
All Implemented Interfaces:
WebADEUserProvider

public final class LegacyProviderProxy
extends java.lang.Object
implements WebADEUserProvider

Author:
jross

Field Summary
 
Fields inherited from interface ca.bc.gov.webade.user.provider.WebADEUserProvider
PROVIDER_CLASS_NAME, PROVIDER_ENABLED, WEBADE_USER_PROVIDER_SUBTYPE
 
Constructor Summary
LegacyProviderProxy(UserInfoProvider provider)
          Proxy constructor, with legacy provider object to wrap around.
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegacyProviderProxy

public LegacyProviderProxy(UserInfoProvider provider)
Proxy constructor, with legacy provider object to wrap around.

Parameters:
provider - The legacy provider to provide a proxy for.
Method Detail

init

public void init(java.util.Properties properties)
          throws WebADEUserProviderException
Description copied from interface: WebADEUserProvider
Initializes the provider using the given preference set.

Specified by:
init in interface WebADEUserProvider
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).
See Also:
WebADEUserProvider.init(java.util.Properties)

handlesSourceDirectory

public boolean handlesSourceDirectory(java.lang.String sourceDirectory)
Description copied from interface: WebADEUserProvider
Returns true if the given sourceDirectory is one of the ones supported by this provider.

Specified by:
handlesSourceDirectory in interface WebADEUserProvider
Parameters:
sourceDirectory - The target sourceDirectory name.
Returns:
True if this provider provides support for the given domain.
See Also:
WebADEUserProvider.handlesSourceDirectory(java.lang.String)

handlesUserType

public boolean handlesUserType(UserTypeCode userType)
Description copied from interface: WebADEUserProvider
Returns true if the given user type is one of the ones supported by this provider.

Specified by:
handlesUserType in interface WebADEUserProvider
Parameters:
userType - The target user type.
Returns:
True if this provider provides support for the given user type.
See Also:
WebADEUserProvider.handlesUserType(ca.bc.gov.webade.user.UserTypeCode)

getSourceDirectoryForUserType

public java.lang.String getSourceDirectoryForUserType(UserTypeCode userType)
Description copied from interface: WebADEUserProvider
Returns the source directory for the given user type if it is supported by this provider.

Specified by:
getSourceDirectoryForUserType in interface WebADEUserProvider
Parameters:
userType - The target user type.
Returns:
The source directory name.
See Also:
WebADEUserProvider.getSourceDirectoryForUserType(ca.bc.gov.webade.user.UserTypeCode)

getUserTypeForSourceDirectory

public UserTypeCode getUserTypeForSourceDirectory(java.lang.String sourceDirectory)
Description copied from interface: WebADEUserProvider
Returns the user type for the given source directory if it is supported by this provider.

Specified by:
getUserTypeForSourceDirectory in interface WebADEUserProvider
Parameters:
sourceDirectory - The target sourceDirectory name.
Returns:
The user type code.
See Also:
WebADEUserProvider.getUserTypeForSourceDirectory(java.lang.String)

getSupportedSourceDirectories

public java.lang.String[] getSupportedSourceDirectories()
Specified by:
getSupportedSourceDirectories in interface WebADEUserProvider
Returns:
The array of source directory names this provider handles.
See Also:
WebADEUserProvider.getSupportedSourceDirectories()

getSupportedUserTypes

public UserTypeCode[] getSupportedUserTypes()
Specified by:
getSupportedUserTypes in interface WebADEUserProvider
Returns:
The array of user types this provider handles.
See Also:
WebADEUserProvider.getSupportedUserTypes()

getUser

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

Specified by:
getUser in interface WebADEUserProvider
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.
See Also:
WebADEUserProvider.getUser(ca.bc.gov.webade.user.UserCredentials, ca.bc.gov.webade.user.UserCredentials)

isUserInGroups

public GUID[] isUserInGroups(UserCredentials requestingUserCredentials,
                             UserCredentials targetUserCredentials,
                             GUID[] groupGuids)
                      throws WebADEUserProviderException
Description copied from interface: WebADEUserProvider
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.

Specified by:
isUserInGroups in interface WebADEUserProvider
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.
See Also:
WebADEUserProvider.isUserInGroups(ca.bc.gov.webade.user.UserCredentials, ca.bc.gov.webade.user.UserCredentials, ca.bc.gov.webade.user.GUID[])

createUserSearchQuery

public UserSearchQuery createUserSearchQuery(UserTypeCode userType)
                                      throws WebADEUserProviderException
Description copied from interface: WebADEUserProvider
Returns a UserSearchQuery metadata object for the given user type code.

Specified by:
createUserSearchQuery in interface WebADEUserProvider
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.
See Also:
WebADEUserProvider.createUserSearchQuery(ca.bc.gov.webade.user.UserTypeCode)

findUsers

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

Specified by:
findUsers in interface WebADEUserProvider
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.
See Also:
WebADEUserProvider.findUsers(ca.bc.gov.webade.user.UserCredentials, ca.bc.gov.webade.user.search.UserSearchQuery)