ca.bc.gov.webade.user.provider.capws.v4
Class CAPWebServicesProvider

java.lang.Object
  extended byca.bc.gov.webade.user.provider.capws.v4.CAPWebServicesProvider
All Implemented Interfaces:
java.io.Serializable, WebADEUserProvider

public final class CAPWebServicesProvider
extends java.lang.Object
implements WebADEUserProvider, java.io.Serializable

Author:
jross
See Also:
Serialized Form

Field Summary
static java.lang.String CAP_WEB_SERVICES_CONNECT_PASSWORD
          The CAP web services connect password preference name.
static java.lang.String CAP_WEB_SERVICES_CONNECT_USERNAME
          The CAP web services connect username preference name.
static java.lang.String CAP_WEB_SERVICES_PROVIDER_SUPPORTED_TYPES
          The user-provider supported user types preference name.
static java.lang.String CAP_WEB_SERVICES_PROVIDER_URL
          The CAP web services provider url preference name.
static java.lang.String CAP_WEB_SERVICES_PROVIDER_USER_TYPE_DOMAIN_SUFFIX
          The user-provider supported user types domain mapping preference name suffix.
static java.lang.String CAP_WEB_SERVICES_SECONDS_TIMEOUT
          The CAP web services timeout value (in seconds) preference name.
static java.lang.String CAP_WEB_SERVICES_SYSTEM_USER_ACCOUNT
          The system user account name preference name.
static java.lang.String CAP_WEB_SERVICES_SYSTEM_USER_GUID
          The system user GUID preference name.
static java.lang.String CAP_WEB_SERVICES_SYSTEM_USER_TYPE_CODE
          The system user type code preference name.
 
Fields inherited from interface ca.bc.gov.webade.user.provider.WebADEUserProvider
PROVIDER_CLASS_NAME, PROVIDER_ENABLED, WEBADE_USER_PROVIDER_SUBTYPE
 
Constructor Summary
CAPWebServicesProvider()
          Default Constructor.
 
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()
           
 java.util.LinkedHashMap getSupportedTypesAndDomains()
           
 UserTypeCode[] getSupportedUserTypes()
           
 int getTimeout()
           
 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.
 java.lang.String getWebServiceUrl()
           
 java.lang.String getWebServiceUsername()
           
 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CAP_WEB_SERVICES_PROVIDER_SUPPORTED_TYPES

public static final java.lang.String CAP_WEB_SERVICES_PROVIDER_SUPPORTED_TYPES
The user-provider supported user types preference name.

See Also:
Constant Field Values

CAP_WEB_SERVICES_PROVIDER_USER_TYPE_DOMAIN_SUFFIX

public static final java.lang.String CAP_WEB_SERVICES_PROVIDER_USER_TYPE_DOMAIN_SUFFIX
The user-provider supported user types domain mapping preference name suffix.

See Also:
Constant Field Values

CAP_WEB_SERVICES_PROVIDER_URL

public static final java.lang.String CAP_WEB_SERVICES_PROVIDER_URL
The CAP web services provider url preference name.

See Also:
Constant Field Values

CAP_WEB_SERVICES_SECONDS_TIMEOUT

public static final java.lang.String CAP_WEB_SERVICES_SECONDS_TIMEOUT
The CAP web services timeout value (in seconds) preference name.

See Also:
Constant Field Values

CAP_WEB_SERVICES_CONNECT_USERNAME

public static final java.lang.String CAP_WEB_SERVICES_CONNECT_USERNAME
The CAP web services connect username preference name.

See Also:
Constant Field Values

CAP_WEB_SERVICES_CONNECT_PASSWORD

public static final java.lang.String CAP_WEB_SERVICES_CONNECT_PASSWORD
The CAP web services connect password preference name.

See Also:
Constant Field Values

CAP_WEB_SERVICES_SYSTEM_USER_TYPE_CODE

public static final java.lang.String CAP_WEB_SERVICES_SYSTEM_USER_TYPE_CODE
The system user type code preference name.

See Also:
Constant Field Values

CAP_WEB_SERVICES_SYSTEM_USER_GUID

public static final java.lang.String CAP_WEB_SERVICES_SYSTEM_USER_GUID
The system user GUID preference name.

See Also:
Constant Field Values

CAP_WEB_SERVICES_SYSTEM_USER_ACCOUNT

public static final java.lang.String CAP_WEB_SERVICES_SYSTEM_USER_ACCOUNT
The system user account name preference name.

See Also:
Constant Field Values
Constructor Detail

CAPWebServicesProvider

public CAPWebServicesProvider()
Default Constructor.

Method Detail

init

public final 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 final 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 final 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 final 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 final 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 final 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 final UserTypeCode[] getSupportedUserTypes()
Specified by:
getSupportedUserTypes in interface WebADEUserProvider
Returns:
The array of user types this provider handles.
See Also:
WebADEUserProvider.getSupportedUserTypes()

getUser

public final 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 final 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 final 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 final 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)

getSupportedTypesAndDomains

public final java.util.LinkedHashMap getSupportedTypesAndDomains()
Returns:
Returns the supportedTypesAndDomains.

getTimeout

public final int getTimeout()
Returns:
Returns the timeout, in milliseconds.

getWebServiceUrl

public final java.lang.String getWebServiceUrl()
Returns:
Returns the webServiceUrl.

getWebServiceUsername

public final java.lang.String getWebServiceUsername()
Returns:
Returns the webServiceUsername.

toString

public final java.lang.String toString()
See Also:
Object.toString()