ca.bc.gov.webade
Class WebADEDatabaseDatastore

java.lang.Object
  extended byca.bc.gov.webade.WebADEDatabaseDatastore
All Implemented Interfaces:
java.io.Serializable, WebADEDatastore
Direct Known Subclasses:
DefaultWebADEDatabaseDatastore

public abstract class WebADEDatabaseDatastore
extends java.lang.Object
implements WebADEDatastore, java.io.Serializable

Author:
jross
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface ca.bc.gov.webade.WebADEDatastore
ID_BUSINESS_PARTNER_TYPE, ID_CITIZEN_TYPE, ID_GOVERNMENT_TYPE
 
Constructor Summary
WebADEDatabaseDatastore()
          Default Constructor.
 
Method Summary
 UserSearchQuery createUserSearchQuery(UserTypeCode userType)
          Returns the UserSearchQuery metadata object to perform user searching for this application on the provided user type.
 java.util.List findGroups(GroupSearchObject searchObject)
          Finds the set of Group objects that match the provided search criteria.
 java.util.List findUsers(UserSearchObject searchObject)
          Finds the set of User objects that match the provided search criteria.
 WebADEUserInfo[] findUsers(UserSearchQuery searchQuery)
          Finds the set of WebADEUserInfo objects that match the provided search criteria.
 WebADEUserInfo[] findWebADEUsers(UserSearchObject searchObject)
          Finds the set of WebADEUserInfo objects that match the provided search criteria.
 Action[] getApplicationActions()
          Returns the set of actions defined for the given application code, regardless of role assignment.
 java.lang.String getApplicationCode()
          Returns the current application code set for the WebADE datastore.
 Preferences getApplicationPreferences()
          Returns the application preferences defined for the current WebADE application.
 Role[] getApplicationRoles()
          Returns the set of roles for the given application code.
 UserCredentials[] getAuthorizedUsers(Role role, Organization organization, boolean ignoreIndeterminateAuthorizationsErrors)
          Loads all users from the datastore that are members the given roles via an authorization associated with the given organization.
 ADEConnectionProxy getConnectionProxy()
          Returns the ADEConnectionProxy used to connect to the datastore.
 java.lang.String getDatastoreEnvironment()
          Returns the environment code value for the datastore (DEV, TEST, or PROD).
 ElectronicAgreement getElectronicAgreement(java.lang.String agreementName)
          Returns the target agreement, based on the given agreement name.
 Preferences getGlobalPreferences()
          Returns the global preferences defined for all of WebADE.
 Group getGroupByGUID(java.lang.String guid)
          Returns the group identified by the given guid.
 java.util.List getGroupSearchMetadata()
          Returns a List of GroupSearchObject metadata objects for all configured directories for this application.
 java.lang.String getJavaEnvironment()
          Returns the environment code value for the Java API (DEV, TEST, or PROD).
 java.util.Properties getPooledResourceProperties(java.lang.String roleName)
          Retrieves the set of configuration properties for a pooled resource.
 WebADEUserPermissions getPublicWebADEPermissions()
          Returns the public permissions from the datastore.
 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()
           
 User getUserByEUserId(long euserId)
          Deprecated.  
 User getUserByGUID(java.lang.String guid)
          Returns the user identified by the given guid.
 User getUserById(java.lang.String userId)
          Returns the user identified by the given userid.
 Organization getUserDefaultOrganization(User user)
          Gets the user's default organization.
 Organization getUserDefaultOrganization(UserCredentials userCredentials)
          Gets the user's default organization.
 Preferences getUserPreferences(long euserId)
          Returns the user preferences for the given EUser id.
 Preferences getUserPreferences(UserCredentials userCredentials)
          Returns the set of user preferences for this user and this application.
 User[] getUsersByOrganization(long organizationId)
          Returns the set of users associated with this organization.
 User[] getUsersByRole(java.lang.String roleName)
          Returns the set of users associated with this role.
 User[] getUsersByRoleAndOrganization(java.lang.String roleName, long organizationId)
          Returns the set of users associated with the given role and organization.
 java.util.List getUserSearchMetadata()
          Returns a List of UserSearchObject metadata objects for all configured directories for this application.
 UserTypeCode getUserTypeForSourceDirectory(java.lang.String sourceDirectory)
          Returns the user type for the given source directory if it is supported by this provider.
 WebADEPreferences getWebADEApplicationPreferences()
          Returns the application preferences defined for the current WebADE application.
 WebADEPreferences getWebADEExtensionPreferences()
          Returns the application's WebADE extensions preferences defined for the current WebADE application.
 WebADEPreferences getWebADEGlobalPreferences()
          Returns the global preferences defined for all of WebADE.
 WebADEUserInfo getWebADEUserInfo(UserCredentials givenCredentials)
          Loads the target user's personal information from the datastore, or returns null if the user is not found.
 WebADEUserInfo getWebADEUserInfo(UserCredentials givenCredentials, boolean ignoreSessionCache)
          Loads the target user's personal information from the datastore, or returns null if the user is not found.
 WebADEUserPermissions getWebADEUserPermissions(UserCredentials givenCredentials)
          Loads the target user's permissions from the datastore, or returns null if the user is not found.
 WebADEUserPermissions getWebADEUserPermissions(UserCredentials givenCredentials, boolean ignoreSessionCache)
          Loads the target user's permissions from the datastore, or returns null if the user is not found.
 WebADEPreferences getWebADEUserPreferences(UserCredentials userCredentials)
          Returns the set of user preferences for this user and this application.
 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 hasIndeterminateAuthorizations(Role role, Organization organization)
          Checks to see if a call to getUsersByRole() will throw a IndeterminateAuthorizationsException for the given role and organization.
 boolean hasUserAcceptedAgreement(UserCredentials userCredentials, java.lang.String agreementName)
          Returns a flag indicating whether the user has previously agreed to the given agreement.
 boolean hasUserAcceptedAgreement(User user, java.lang.String agreementName)
          Returns a flag indicating whether the user has previously agreed to the given agreement.
 void init(java.lang.String appCode, ADEConnectionProxy proxy)
          Initializes the datastore with an externally provided connection proxy to the WebADE database.
 boolean isApplicationEnabled()
          Checks the enabled flag for the application.
 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.
 java.lang.String[] isUserInGroups(User user, java.lang.String[] groupGuids)
          Checks to see if the user is a member of the groups identified by the given array of GUID values.
 ApplicationConfig loadApplicationConfig()
          Takes the given application code and retrieves the configuration settings, roles, actions, and pooled resource settings.
 void loadExtension(java.lang.String extensionName, Application app)
          Loads the given Extension by loading the extensions preferences, loads an instance of the extension class, using the given class loader, and initializing the extension using the loaded preferences.
 WebADEPreferences saveWebADEUserPreferences(UserCredentials userCredentials, WebADEPreferences preferences)
          Saves the given user preferences for this user and this application.
 void setApplicationCode(java.lang.String appCode)
          Sets the current application code set for the WebADE datastore.
 void setApplicationEnabled(boolean enabled)
          Sets the application's enabled flag to the given value.
 void setUserAcceptedAgreement(UserCredentials userCredentials, java.lang.String agreementName, boolean agreeFlag)
          Sets the user's "accepted" flag on the given agreement to the given flag value.
 void setUserAcceptedAgreement(User user, java.lang.String agreementName, boolean agreeFlag)
          Sets the user's "accepted" flag on the given agreement to the given flag value.
 void setUserDefaultOrganization(UserCredentials userCredentials, Organization organization)
          Sets the user's default organization to the given organization.
 void setUserDefaultOrganization(User user, Organization organization)
          Sets the user's default organization to the given organization.
 void shutdown()
          Shuts down the datastore.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ca.bc.gov.webade.WebADEDatastore
findOrganizations, getOrganizationSearchMetadata, loadOrganization
 

Constructor Detail

WebADEDatabaseDatastore

public WebADEDatabaseDatastore()
Default Constructor.

Method Detail

init

public final void init(java.lang.String appCode,
                       ADEConnectionProxy proxy)
                throws WebADEException
Initializes the datastore with an externally provided connection proxy to the WebADE database.

Parameters:
appCode - The code of the application this datastore is associated with.
proxy - The externally-provided connection proxy.
Throws:
WebADEException - Thrown if the application code value is not valid.

setApplicationCode

public final void setApplicationCode(java.lang.String appCode)
                              throws WebADEException
Description copied from interface: WebADEDatastore
Sets the current application code set for the WebADE datastore.

Specified by:
setApplicationCode in interface WebADEDatastore
Parameters:
appCode - The application code value.
Throws:
WebADEException - Thrown if the appCode value is null or empty string.
See Also:
WebADEDatastore.setApplicationCode(java.lang.String)

getApplicationCode

public final java.lang.String getApplicationCode()
Description copied from interface: WebADEDatastore
Returns the current application code set for the WebADE datastore.

Specified by:
getApplicationCode in interface WebADEDatastore
Returns:
The application code value.
See Also:
WebADEDatastore.getApplicationCode()

getGlobalPreferences

public final Preferences getGlobalPreferences()
                                       throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns the global preferences defined for all of WebADE.

Specified by:
getGlobalPreferences in interface WebADEDatastore
Returns:
A loaded Preferences object with the set of preference values.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getGlobalPreferences()

getWebADEGlobalPreferences

public WebADEPreferences getWebADEGlobalPreferences()
                                             throws WebADEException
Description copied from interface: WebADEDatastore
Returns the global preferences defined for all of WebADE.

Specified by:
getWebADEGlobalPreferences in interface WebADEDatastore
Returns:
A loaded WebADEPreferences object with the set of preference values.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getWebADEGlobalPreferences()

getApplicationPreferences

public final Preferences getApplicationPreferences()
                                            throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns the application preferences defined for the current WebADE application. Each time this method is called, it will reload the application preferences. Developers should cache this information, if they don't want this information to change during deployment of the application.

Specified by:
getApplicationPreferences in interface WebADEDatastore
Returns:
A loaded Preferences object with the set of preference values.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getApplicationPreferences()

getWebADEApplicationPreferences

public WebADEPreferences getWebADEApplicationPreferences()
                                                  throws WebADEException
Description copied from interface: WebADEDatastore
Returns the application preferences defined for the current WebADE application. Each time this method is called, it will reload the application preferences. Developers should cache this information, if they don't want this information to change during deployment of the application.

Specified by:
getWebADEApplicationPreferences in interface WebADEDatastore
Returns:
A loaded WebADEPreferences object with the set of preference values.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getWebADEApplicationPreferences()

getWebADEExtensionPreferences

public final WebADEPreferences getWebADEExtensionPreferences()
                                                      throws WebADEException
Description copied from interface: WebADEDatastore
Returns the application's WebADE extensions preferences defined for the current WebADE application. Each time this method is called, it will reload the extension preferences.

Specified by:
getWebADEExtensionPreferences in interface WebADEDatastore
Returns:
A loaded WebADEPreferences object with the set of preference values.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getWebADEExtensionPreferences()

getUserPreferences

public final Preferences getUserPreferences(UserCredentials userCredentials)
                                     throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns the set of user preferences for this user and this application.

Specified by:
getUserPreferences in interface WebADEDatastore
Parameters:
userCredentials - The user's identifying credentials.
Returns:
Returns the user's preferences.
Throws:
WebADEException - Thrown when a WebADE error occurs.
See Also:
WebADEDatastore.getUserPreferences(ca.bc.gov.webade.user.UserCredentials)

getWebADEUserPreferences

public WebADEPreferences getWebADEUserPreferences(UserCredentials userCredentials)
                                           throws WebADEException
Description copied from interface: WebADEDatastore
Returns the set of user preferences for this user and this application.

Specified by:
getWebADEUserPreferences in interface WebADEDatastore
Parameters:
userCredentials - The user's identifying credentials.
Returns:
Returns the user's preferences.
Throws:
WebADEException - Thrown when a WebADE error occurs.
See Also:
WebADEDatastore.getWebADEUserPreferences(ca.bc.gov.webade.user.UserCredentials)

saveWebADEUserPreferences

public WebADEPreferences saveWebADEUserPreferences(UserCredentials userCredentials,
                                                   WebADEPreferences preferences)
                                            throws WebADEException
Description copied from interface: WebADEDatastore
Saves the given user preferences for this user and this application.

Specified by:
saveWebADEUserPreferences in interface WebADEDatastore
Parameters:
userCredentials - The user's identifying credentials.
preferences - The user's User preferences.
Returns:
The user's preferences after the save is complete, reloaded from the datastore.
Throws:
WebADEException - Thrown when a WebADE error occurs.
See Also:
WebADEDatastore.saveWebADEUserPreferences(ca.bc.gov.webade.user.UserCredentials, ca.bc.gov.webade.preferences.WebADEPreferences)

getJavaEnvironment

public final java.lang.String getJavaEnvironment()
Description copied from interface: WebADEDatastore
Returns the environment code value for the Java API (DEV, TEST, or PROD).

Specified by:
getJavaEnvironment in interface WebADEDatastore
Returns:
Environment code value.
See Also:
WebADEDatastore.getJavaEnvironment()

getDatastoreEnvironment

public final java.lang.String getDatastoreEnvironment()
                                               throws WebADEException
Description copied from interface: WebADEDatastore
Returns the environment code value for the datastore (DEV, TEST, or PROD).

Specified by:
getDatastoreEnvironment in interface WebADEDatastore
Returns:
Environment code value.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getDatastoreEnvironment()

loadApplicationConfig

public final ApplicationConfig loadApplicationConfig()
                                              throws WebADEException
Description copied from interface: WebADEDatastore
Takes the given application code and retrieves the configuration settings, roles, actions, and pooled resource settings.

Specified by:
loadApplicationConfig in interface WebADEDatastore
Returns:
Returns the application configuration settings.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.loadApplicationConfig()

loadExtension

public final void loadExtension(java.lang.String extensionName,
                                Application app)
                         throws WebADEException,
                                WebADEExtensionException
Description copied from interface: WebADEDatastore
Loads the given Extension by loading the extensions preferences, loads an instance of the extension class, using the given class loader, and initializing the extension using the loaded preferences.

Specified by:
loadExtension in interface WebADEDatastore
Parameters:
extensionName - The unique code of the extension.
app - The application owner to register the extension to.
Throws:
WebADEExtensionException - Thrown when an error occurs while trying to initialize the extension.
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.loadExtension(java.lang.String, ca.bc.gov.webade.Application)

isApplicationEnabled

public final boolean isApplicationEnabled()
                                   throws WebADEException
Description copied from interface: WebADEDatastore
Checks the enabled flag for the application.

Specified by:
isApplicationEnabled in interface WebADEDatastore
Returns:
Returns true if the application is enabled.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.isApplicationEnabled()

setApplicationEnabled

public final void setApplicationEnabled(boolean enabled)
                                 throws WebADEException
Description copied from interface: WebADEDatastore
Sets the application's enabled flag to the given value.

Specified by:
setApplicationEnabled in interface WebADEDatastore
Parameters:
enabled - Enabled flag.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.setApplicationEnabled(boolean)

getApplicationRoles

public final Role[] getApplicationRoles()
                                 throws WebADEException
Description copied from interface: WebADEDatastore
Returns the set of roles for the given application code.

Specified by:
getApplicationRoles in interface WebADEDatastore
Returns:
The array or Role objects defined for this application.
Throws:
WebADEException
See Also:
WebADEDatastore.getApplicationRoles()

getPooledResourceProperties

public final java.util.Properties getPooledResourceProperties(java.lang.String roleName)
                                                       throws WebADEException
Description copied from interface: WebADEDatastore
Retrieves the set of configuration properties for a pooled resource.

Specified by:
getPooledResourceProperties in interface WebADEDatastore
Parameters:
roleName - The role that the resource is assigned to.
Returns:
The complete set of configuration properties.
Throws:
WebADEException
See Also:
WebADEDatastore.getPooledResourceProperties(java.lang.String)

getApplicationActions

public final Action[] getApplicationActions()
                                     throws WebADEException
Description copied from interface: WebADEDatastore
Returns the set of actions defined for the given application code, regardless of role assignment.

Specified by:
getApplicationActions in interface WebADEDatastore
Returns:
An array of action names.
Throws:
WebADEException
See Also:
WebADEDatastore.getApplicationActions()

createUserSearchQuery

public UserSearchQuery createUserSearchQuery(UserTypeCode userType)
                                      throws WebADEException
Description copied from interface: WebADEDatastore
Returns the UserSearchQuery metadata object to perform user searching for this application on the provided user type.

Specified by:
createUserSearchQuery in interface WebADEDatastore
Parameters:
userType - The user type to perform searching for.
Returns:
A UserSearchQuery object.
Throws:
WebADEException - Thrown when an error occurs while trying to create the search query from the user provider for the given user type.
See Also:
WebADEDatastore.createUserSearchQuery(ca.bc.gov.webade.user.UserTypeCode)

findUsers

public WebADEUserInfo[] findUsers(UserSearchQuery searchQuery)
                           throws WebADEException
Description copied from interface: WebADEDatastore
Finds the set of WebADEUserInfo objects that match the provided search criteria.

Specified by:
findUsers in interface WebADEDatastore
Parameters:
searchQuery - The search query.
Returns:
A List of WebADEUserInfo objects.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.findUsers(ca.bc.gov.webade.user.search.UserSearchQuery)

getUserSearchMetadata

public final java.util.List getUserSearchMetadata()
Deprecated.  

Description copied from interface: WebADEDatastore
Returns a List of UserSearchObject metadata objects for all configured directories for this application.

Specified by:
getUserSearchMetadata in interface WebADEDatastore
Returns:
A List of UserSearchObject objects.
See Also:
WebADEDatastore.getUserSearchMetadata()

findWebADEUsers

public final WebADEUserInfo[] findWebADEUsers(UserSearchObject searchObject)
                                       throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Finds the set of WebADEUserInfo objects that match the provided search criteria.

Specified by:
findWebADEUsers in interface WebADEDatastore
Parameters:
searchObject - The search object.
Returns:
A List of WebADEUserInfo objects.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.findWebADEUsers(ca.bc.gov.webade.UserSearchObject)

hasUserAcceptedAgreement

public final boolean hasUserAcceptedAgreement(UserCredentials userCredentials,
                                              java.lang.String agreementName)
                                       throws WebADEException
Description copied from interface: WebADEDatastore
Returns a flag indicating whether the user has previously agreed to the given agreement.

Specified by:
hasUserAcceptedAgreement in interface WebADEDatastore
Parameters:
userCredentials - The user's credentials.
agreementName - The unique name of the target agreement.
Returns:
The set of application role names authorized to that user.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.hasUserAcceptedAgreement(ca.bc.gov.webade.user.UserCredentials, java.lang.String)

setUserAcceptedAgreement

public final void setUserAcceptedAgreement(UserCredentials userCredentials,
                                           java.lang.String agreementName,
                                           boolean agreeFlag)
                                    throws WebADEException
Description copied from interface: WebADEDatastore
Sets the user's "accepted" flag on the given agreement to the given flag value.

Specified by:
setUserAcceptedAgreement in interface WebADEDatastore
Parameters:
userCredentials - The user's credentials.
agreementName - The unique name of the target agreement.
agreeFlag - A flag indicating whether the user accepts or refuses the given agreement.
Throws:
WebADEException - Thrown when an error occurs while trying to save the flag to the datastore.
See Also:
WebADEDatastore.setUserAcceptedAgreement(ca.bc.gov.webade.user.UserCredentials, java.lang.String, boolean)

isUserInGroups

public final GUID[] isUserInGroups(UserCredentials userCredentials,
                                   GUID[] groupGuids)
                            throws WebADEException
Description copied from interface: WebADEDatastore
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 WebADEDatastore
Parameters:
userCredentials - The 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:
WebADEException - Thrown if an error occurs while processing the request.
See Also:
WebADEDatastore.isUserInGroups(ca.bc.gov.webade.user.UserCredentials, ca.bc.gov.webade.user.GUID[])

getPublicWebADEPermissions

public final WebADEUserPermissions getPublicWebADEPermissions()
                                                       throws WebADEException
Description copied from interface: WebADEDatastore
Returns the public permissions from the datastore. If no user can be identified with the request, this method will be userd to return a set of public authorizations.

Specified by:
getPublicWebADEPermissions in interface WebADEDatastore
Returns:
A WebADEUserPermissions object for the public unauthenticated user.
Throws:
WebADEException
See Also:
WebADEDatastore.getPublicWebADEPermissions()

getUserDefaultOrganization

public final Organization getUserDefaultOrganization(UserCredentials userCredentials)
                                              throws WebADEException
Description copied from interface: WebADEDatastore
Gets the user's default organization.

Specified by:
getUserDefaultOrganization in interface WebADEDatastore
Parameters:
userCredentials - The credentials of the user to load.
Returns:
The selected organization.
Throws:
WebADEException - Thrown if an error occurs while getting the default organization.
See Also:
WebADEDatastore.getUserDefaultOrganization(ca.bc.gov.webade.user.UserCredentials)

setUserDefaultOrganization

public final void setUserDefaultOrganization(UserCredentials userCredentials,
                                             Organization organization)
                                      throws WebADEException
Description copied from interface: WebADEDatastore
Sets the user's default organization to the given organization.

Specified by:
setUserDefaultOrganization in interface WebADEDatastore
Parameters:
userCredentials - The credentials of the user to load.
organization - The selected organization.
Throws:
WebADEException - Thrown if an error occurs while setting the default organization.
See Also:
WebADEDatastore.setUserDefaultOrganization(ca.bc.gov.webade.user.UserCredentials, ca.bc.gov.webade.Organization)

getWebADEUserPermissions

public final WebADEUserPermissions getWebADEUserPermissions(UserCredentials givenCredentials)
                                                     throws WebADEException
Description copied from interface: WebADEDatastore
Loads the target user's permissions from the datastore, or returns null if the user is not found. Will return the session user's cached permissions object, if the given credentials match the current user's credentials.

Specified by:
getWebADEUserPermissions in interface WebADEDatastore
Parameters:
givenCredentials - The user's identifying credentials.
Returns:
A WebADEUserPermissions object for the target user.
Throws:
WebADEException
See Also:
WebADEDatastore.getWebADEUserPermissions(ca.bc.gov.webade.user.UserCredentials)

getWebADEUserPermissions

public WebADEUserPermissions getWebADEUserPermissions(UserCredentials givenCredentials,
                                                      boolean ignoreSessionCache)
                                               throws WebADEException
Description copied from interface: WebADEDatastore
Loads the target user's permissions from the datastore, or returns null if the user is not found.

Specified by:
getWebADEUserPermissions in interface WebADEDatastore
Parameters:
givenCredentials - The user's identifying credentials.
ignoreSessionCache - A flag indicating whether to ignore the session user permissions object, should it match the given user credentials.
Returns:
A WebADEUserPermissions object for the target user.
Throws:
WebADEException
See Also:
WebADEDatastore.getWebADEUserPermissions(ca.bc.gov.webade.user.UserCredentials, boolean)

getWebADEUserInfo

public final WebADEUserInfo getWebADEUserInfo(UserCredentials givenCredentials)
                                       throws WebADEException
Description copied from interface: WebADEDatastore
Loads the target user's personal information from the datastore, or returns null if the user is not found. Will return the session user's cached info object, if the given credentials match the current user's credentials.

Specified by:
getWebADEUserInfo in interface WebADEDatastore
Parameters:
givenCredentials - The user's identifying credentials.
Returns:
A WebADEUserInfo object for the target user.
Throws:
WebADEException
See Also:
WebADEDatastore.getWebADEUserInfo(ca.bc.gov.webade.user.UserCredentials)

getWebADEUserInfo

public final WebADEUserInfo getWebADEUserInfo(UserCredentials givenCredentials,
                                              boolean ignoreSessionCache)
                                       throws WebADEException
Description copied from interface: WebADEDatastore
Loads the target user's personal information from the datastore, or returns null if the user is not found.

Specified by:
getWebADEUserInfo in interface WebADEDatastore
Parameters:
givenCredentials - The user's identifying credentials.
ignoreSessionCache - A flag indicating whether to ignore the session user info object, should it match the given user credentials.
Returns:
A WebADEUserInfo object for the target user.
Throws:
WebADEException
See Also:
WebADEDatastore.getWebADEUserInfo(ca.bc.gov.webade.user.UserCredentials, boolean)

getElectronicAgreement

public final ElectronicAgreement getElectronicAgreement(java.lang.String agreementName)
                                                 throws WebADEException
Description copied from interface: WebADEDatastore
Returns the target agreement, based on the given agreement name.

Specified by:
getElectronicAgreement in interface WebADEDatastore
Parameters:
agreementName - The name of the target agreement.
Returns:
The target ElectronicAgreement.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getElectronicAgreement(java.lang.String)

getConnectionProxy

public final ADEConnectionProxy getConnectionProxy()
Returns the ADEConnectionProxy used to connect to the datastore.

Returns:
The ADEConnectionProxy with connection to the WebADE database.

hasIndeterminateAuthorizations

public boolean hasIndeterminateAuthorizations(Role role,
                                              Organization organization)
                                       throws WebADEException
Description copied from interface: WebADEDatastore
Checks to see if a call to getUsersByRole() will throw a IndeterminateAuthorizationsException for the given role and organization.

Specified by:
hasIndeterminateAuthorizations in interface WebADEDatastore
Parameters:
role - The WebADE role in this application (optional).
organization - The organization to load users of this application for (optional).
Returns:
True if there are authorizations that cannot be fully evaluated, when looking for users in this role.
Throws:
WebADEException - Thrown if an error occurs while performing this query.
See Also:
WebADEDatastore.hasIndeterminateAuthorizations(ca.bc.gov.webade.Role, ca.bc.gov.webade.Organization)

getAuthorizedUsers

public UserCredentials[] getAuthorizedUsers(Role role,
                                            Organization organization,
                                            boolean ignoreIndeterminateAuthorizationsErrors)
                                     throws IndeterminateAuthorizationsException,
                                            WebADEException
Description copied from interface: WebADEDatastore
Loads all users from the datastore that are members the given roles via an authorization associated with the given organization.

Specified by:
getAuthorizedUsers in interface WebADEDatastore
Parameters:
role - The role to load users for (optional).
organization - The organization to load users for (optional).
ignoreIndeterminateAuthorizationsErrors - If set to true, prevents the IndeterminateAuthorizationsException from being thrown, if it occurs.
Returns:
An array of member User objects.
Throws:
WebADEException - Throws a base WebADEException if an error occurs while performing this query.
IndeterminateAuthorizationsException - Throws IndeterminateAuthorizationsException if the list of users cannot be completely loaded.
See Also:
WebADEDatastore.getAuthorizedUsers(ca.bc.gov.webade.Role, ca.bc.gov.webade.Organization, boolean)

handlesSourceDirectory

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

Specified by:
handlesSourceDirectory in interface WebADEDatastore
Parameters:
sourceDirectory - The target sourceDirectory name.
Returns:
True if this provider provides support for the given domain.
Throws:
WebADEException

handlesUserType

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

Specified by:
handlesUserType in interface WebADEDatastore
Parameters:
userType - The target user type.
Returns:
True if this provider provides support for the given user type.
Throws:
WebADEException

getSourceDirectoryForUserType

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

Specified by:
getSourceDirectoryForUserType in interface WebADEDatastore
Parameters:
userType - The target user type.
Returns:
The source directory name.
Throws:
WebADEException

getUserTypeForSourceDirectory

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

Specified by:
getUserTypeForSourceDirectory in interface WebADEDatastore
Parameters:
sourceDirectory - The target sourceDirectory name.
Returns:
The user type code.
Throws:
WebADEException

getSupportedSourceDirectories

public java.lang.String[] getSupportedSourceDirectories()
                                                 throws WebADEException
Specified by:
getSupportedSourceDirectories in interface WebADEDatastore
Returns:
The array of source directory names this provider handles.
Throws:
WebADEException

getSupportedUserTypes

public UserTypeCode[] getSupportedUserTypes()
                                     throws WebADEException
Specified by:
getSupportedUserTypes in interface WebADEDatastore
Returns:
The array of user types this provider handles.
Throws:
WebADEException

shutdown

public final void shutdown()
                    throws java.lang.SecurityException
Description copied from interface: WebADEDatastore
Shuts down the datastore.

Specified by:
shutdown in interface WebADEDatastore
Throws:
java.lang.SecurityException - Thrown if an unauthorized class calls this method.
See Also:
WebADEDatastore.shutdown()

findGroups

public java.util.List findGroups(GroupSearchObject searchObject)
                          throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Finds the set of Group objects that match the provided search criteria.

Specified by:
findGroups in interface WebADEDatastore
Parameters:
searchObject - The search object.
Returns:
A List of Group objects, without the organization and roles information.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.findGroups(ca.bc.gov.webade.GroupSearchObject)

findUsers

public java.util.List findUsers(UserSearchObject searchObject)
                         throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Finds the set of User objects that match the provided search criteria.

Specified by:
findUsers in interface WebADEDatastore
Parameters:
searchObject - The search object.
Returns:
A List of User objects, without the organization and roles information.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.findUsers(ca.bc.gov.webade.UserSearchObject)

getGroupByGUID

public Group getGroupByGUID(java.lang.String guid)
                     throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns the group identified by the given guid.

Specified by:
getGroupByGUID in interface WebADEDatastore
Parameters:
guid - The unique guid identifying the group.
Returns:
The Group object, including organizations and roles.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getGroupByGUID(java.lang.String)

getGroupSearchMetadata

public java.util.List getGroupSearchMetadata()
Deprecated.  

Description copied from interface: WebADEDatastore
Returns a List of GroupSearchObject metadata objects for all configured directories for this application.

Specified by:
getGroupSearchMetadata in interface WebADEDatastore
Returns:
A List of GroupSearchObject objects.
See Also:
WebADEDatastore.getGroupSearchMetadata()

getUserByGUID

public User getUserByGUID(java.lang.String guid)
                   throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns the user identified by the given guid. Deprecated and replaced by method of same name but accepting a GUID object.

Specified by:
getUserByGUID in interface WebADEDatastore
Parameters:
guid - The unique guid identifying the user.
Returns:
The user object, including organizations and user preferences.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getUserByGUID(java.lang.String)

getUserById

public User getUserById(java.lang.String userId)
                 throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns the user identified by the given userid.

Specified by:
getUserById in interface WebADEDatastore
Parameters:
userId - The full userid, including domain.
Returns:
The user object, including organizations and user preferences.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getUserById(java.lang.String)

getUserByEUserId

public User getUserByEUserId(long euserId)
                      throws WebADEException
Deprecated.  

Parameters:
euserId - The target euser database id.
Returns:
The matching user object.
Throws:
WebADEException - Thrown if an error occurs while loading the user.

getUserDefaultOrganization

public Organization getUserDefaultOrganization(User user)
                                        throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Gets the user's default organization.

Specified by:
getUserDefaultOrganization in interface WebADEDatastore
Parameters:
user - The target user.
Returns:
The selected organization.
Throws:
WebADEException - Thrown if an error occurs while getting the default organization.
See Also:
WebADEDatastore.getUserDefaultOrganization(ca.bc.gov.webade.User)

getUserPreferences

public Preferences getUserPreferences(long euserId)
                               throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns the user preferences for the given EUser id.

Specified by:
getUserPreferences in interface WebADEDatastore
Parameters:
euserId - The unique id of the target user.
Returns:
A loaded Preferences object with the set of preference values.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.getUserPreferences(long)

getUsersByOrganization

public User[] getUsersByOrganization(long organizationId)
                              throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns the set of users associated with this organization. Deprecated as this type of access to the WebADE authorization infrastructure will no longer return accurate results, as any user granted authorization via a group will not be returned by this call.

Specified by:
getUsersByOrganization in interface WebADEDatastore
Parameters:
organizationId - The target organizationId.
Returns:
The set of users associated with that organization.
Throws:
WebADEException
See Also:
WebADEDatastore.getUsersByOrganization(long)

getUsersByRole

public User[] getUsersByRole(java.lang.String roleName)
                      throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns the set of users associated with this role. Deprecated as this type of access to the WebADE authorization infrastructure will no longer return accurate results, as any user granted authorization via a group will not be returned by this call.

Specified by:
getUsersByRole in interface WebADEDatastore
Parameters:
roleName - The target role name.
Returns:
The set of users associated with that role.
Throws:
WebADEException
See Also:
WebADEDatastore.getUsersByRole(java.lang.String)

getUsersByRoleAndOrganization

public User[] getUsersByRoleAndOrganization(java.lang.String roleName,
                                            long organizationId)
                                     throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns the set of users associated with the given role and organization. Deprecated as this type of access to the WebADE authorization infrastructure will no longer return accurate results, as any user granted authorization via a group will not be returned by this call.

Specified by:
getUsersByRoleAndOrganization in interface WebADEDatastore
Parameters:
roleName - The target role name.
organizationId - The target organizationId.
Returns:
The set of users associated with that organization.
Throws:
WebADEException
See Also:
WebADEDatastore.getUsersByRoleAndOrganization(java.lang.String, long)

hasUserAcceptedAgreement

public boolean hasUserAcceptedAgreement(User user,
                                        java.lang.String agreementName)
                                 throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Returns a flag indicating whether the user has previously agreed to the given agreement.

Specified by:
hasUserAcceptedAgreement in interface WebADEDatastore
Parameters:
user - The user.
agreementName - The unique name of the target agreement.
Returns:
The set of application role names authorized to that user.
Throws:
WebADEException - Thrown when an error occurs while trying to retrieve the information from the datastore.
See Also:
WebADEDatastore.hasUserAcceptedAgreement(ca.bc.gov.webade.User, java.lang.String)

isUserInGroups

public java.lang.String[] isUserInGroups(User user,
                                         java.lang.String[] groupGuids)
                                  throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
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. Deprecated and replaced with method of same name, but using GUID objects.

Specified by:
isUserInGroups in interface WebADEDatastore
Parameters:
user - The target user object.
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:
WebADEException - Thrown if ant of the groups are not found or an error occurs while processing the request.
See Also:
WebADEDatastore.isUserInGroups(ca.bc.gov.webade.User, java.lang.String[])

setUserAcceptedAgreement

public void setUserAcceptedAgreement(User user,
                                     java.lang.String agreementName,
                                     boolean agreeFlag)
                              throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Sets the user's "accepted" flag on the given agreement to the given flag value.

Specified by:
setUserAcceptedAgreement in interface WebADEDatastore
Parameters:
user - The user.
agreementName - The unique name of the target agreement.
agreeFlag - A flag indicating whether the user accepts or refuses the given agreement.
Throws:
WebADEException - Thrown when an error occurs while trying to save the flag to the datastore.
See Also:
WebADEDatastore.setUserAcceptedAgreement(ca.bc.gov.webade.User, java.lang.String, boolean)

setUserDefaultOrganization

public void setUserDefaultOrganization(User user,
                                       Organization organization)
                                throws WebADEException
Deprecated.  

Description copied from interface: WebADEDatastore
Sets the user's default organization to the given organization.

Specified by:
setUserDefaultOrganization in interface WebADEDatastore
Parameters:
user - The target user.
organization - The selected organization.
Throws:
WebADEException - Thrown if an error occurs while setting the default organization.
See Also:
WebADEDatastore.setUserDefaultOrganization(ca.bc.gov.webade.User, ca.bc.gov.webade.Organization)