Interface UserProfileService
- All Superinterfaces:
ContextSensitiveSingletonService,Service
Provides the main functionality needed to create, update, delete, and
retrieve UserProfile objects from the Personalization service.
Methods of service classes can all throw the unchecked exception
ServiceException if any
system-level error (for example, server failure) occurs, and will in general
throw a checked exception (InvalidXXXException) when an entity
to be retrieved is inaccessible, instead of returning null.
Exceptions to this paradigm (including the use of ResultList as
described below) are noted. All checked exceptions extend
AppianException.
It may be necessary to retrieve a subset of results as opposed to an entire
collection, and also to sort the subset by some property of the returned
object. "Paging" methods which return a
ResultPage are provided in certain
instances for this purpose. The ResultPage will contain the
sorted subset of results
(via Result.getResults()), and the
total number of items in the available result set
(via ResultPage.getAvailableItems()).
It may also be necessary to retrieve some results, even if all results
cannot be retrieved (for instance, some of the entities corresponding
to a list of entity IDs may no longer exist). Methods which return a
ResultList are provided for this
purpose. The Result.getResults()
method in this case will return all results which can be retrieved. In
addition, there will be a list of result codes
(ResultList.getResultCodes()) that
represent the successful retrieval of an entity, or, if the entity could
not be retrieved, the reason for the failure. See the CODE_XXX
constants in ResultList for details.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.static final booleanDeprecated, for removal: This API element is subject to removal in a future version.Fields inherited from interface com.appiancorp.services.ContextSensitiveSingletonService
CONFIGURE_METHOD_NAME -
Method Summary
Modifier and TypeMethodDescriptionauthenticateUser(String username_, String password_) Deprecated.createUser(UserProfile userprofile_) Creates a new userString[]createUsers(UserProfile[] userprofiles_) Creates new users.findAllUsersPaging(boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Fast method that gets all users.findUsers(UserSearch userSearch_, boolean caseSensitive_) Deprecated.findUsersPaging(UserSearch userSearch_, boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Finds a list of users for a given search criteria.Gets the name of the application on which this service is running.Gets a single user by username.getUserByUuid(String uuid) Gets a single user by uuid.Returns current user's preferencesRetrieves a list of users by username.getUsersByUuid(String[] uuids) Retrieves a list of users by uuid.getUsersCreation(String[] usernames) Gets the users creation dategetUsersForGroupByRolePaging(Long groupId_, int role_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) String[]Gets the current memory profile for the workspace.searchUserProfilesPaging(String query_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Searches forUsers by first, last, and username and returns theUserProfileobjects for each foundUservoidsetUserPreferences(UserPreferences preferences_) Set current user's preferencesvoidupdateUser(UserProfile userprofile_) Updates a user.voidupdateUsers(UserProfile[] userprofiles_) Updates users.Methods inherited from interface com.appiancorp.services.ContextSensitiveSingletonService
configureContextSensitiveSingletonService
-
Field Details
-
getUser$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getUsers$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getUserByUuid$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getUsersByUuid$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getUsersCreation$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getUsersForGroupByRolePaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
authenticateUser$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
findUsers$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
findUsersPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
createUser$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
createUsers$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
updateUser$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
updateUsers$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
findAllUsersPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
searchUserProfilesPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getApplicationName$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getWorkspace$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getUserPreferences$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
setUserPreferences$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
-
Method Details
-
getUser
Gets a single user by username.- Parameters:
username_- the unique username of the user- Returns:
- a
UserProfilecorresponding to theusername_ - Throws:
InvalidUserException- if the given username does correspond to a valid user
-
getUsers
Retrieves a list of users by username.- Parameters:
usernames_- the unique usernames of the users objects- Returns:
- an array of
UserProfileobjects corresponding to theusernames_ - Throws:
InvalidUserException- if a given username does not exist
-
getUserByUuid
@Read(K_PERSONALIZATION) UserProfile getUserByUuid(@ConvertWith(com.appiancorp.kougar.mapper.parameters.UuidParameterConverter.class) String uuid) throws InvalidUserException Gets a single user by uuid.- Parameters:
uuid- the unique uuid of the user- Returns:
- a
UserProfilecorresponding to theuuid - Throws:
InvalidUserException- if the given uuid does correspond to a valid user
-
getUsersByUuid
@Read(K_PERSONALIZATION) UserProfile[] getUsersByUuid(@ConvertWith(com.appiancorp.kougar.mapper.parameters.UuidParameterConverter[][].class) String[] uuids) throws InvalidUserException Retrieves a list of users by uuid.- Parameters:
uuids- the unique uuids of the users objects- Returns:
- an array of
UserProfileobjects corresponding to theuuids - Throws:
InvalidUserException- if a given uuid does not correspond to a valid user
-
getUsersCreation
@Read(K_PERSONALIZATION) Timestamp[] getUsersCreation(String[] usernames) throws InvalidUserException Gets the users creation date- Parameters:
usernames- The list of users- Returns:
- An array of timestamps with the user creation date.
- Throws:
InvalidUserException
-
getUsersForGroupByRolePaging
@Deprecated @Read(K_PERSONALIZATION) UserProfile[] getUsersForGroupByRolePaging(Long groupId_, int role_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidGroupException, UnsupportedRoleException Retrieves a list of users for a given group by user role.- Parameters:
groupId_- ID of the group whose users should be retrievedrole_- the role for which to retrieve users. Valid roles are one of theUSER_ROLE_XXXconstants inUserstartIndex_- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_- the number of results to return. UseConstants.COUNT_ALLto return the entire collection, but this is STRONGLY discouraged.sortProperty_- the property by which the results will be sorted. This is one of theSORT_BY_XXXconstants inUserProfile.sortOrder_- the order in which to sort the results. This is one ofConstants.SORT_ORDER_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- an array of
UserProfileobjects corresponding to the users in the group with the given role - Throws:
InvalidGroupException- if the group given bygroupId_does not existUnsupportedRoleException- if the role is invalid
-
authenticateUser
@Deprecated @Read(K_PERSONALIZATION) UserProfile authenticateUser(String username_, String password_) throws InvalidLoginException Deprecated.Since 6.0.2, use#authenticate(String, byte[])Used to validate a user (the login mechanism).- Parameters:
username_- the unique username of a userpassword_- the password for the user- Returns:
- the
UserProfileof the user with the given username - Throws:
InvalidLoginException- if the givenusername_andpassword_are not those of a valid user
-
findUsers
@Deprecated @Read(K_PERSONALIZATION) UserProfile[] findUsers(UserSearch userSearch_, boolean caseSensitive_) throws UnsupportedOperatorException Deprecated.Finds a list of users for a given search criteria.The
userSearch_object should be populated with the user fields to be searched on, and the criteria to be used in performing the search. For example, theuserSearch_might have theusernamefield set to "john.doe", thelastNamefields set to "Doe", theoperatorUsernamefield set toOperator#EQUALSand theoperatorLastNamefield set toOperator#ENDS_WITH. Such a search will return all users whose username is "john.doe", and whose last name ends with "Doe".See
GroupTypeService.getOperatorsForDataType(int)to obtain a list of possible operators for a given data type.- Parameters:
userSearch_- the search criteriacaseSensitive_- whether the search is case-sensitive- Returns:
- the users that meet the given search criteria
- Throws:
UnsupportedOperatorException- ifuserSearch_contains an invalid operator
-
findUsersPaging
@Read(K_PERSONALIZATION) ResultPage findUsersPaging(UserSearch userSearch_, boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws UnsupportedOperatorException Finds a list of users for a given search criteria. This method will return the paged resultset corresponding tofindUsers(UserSearch, boolean)- Parameters:
userSearch_- criteria for the searchcaseSensitive_- whether the search is case sensitivestartIndex_- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_- the number of results to return. use ofConstants.COUNT_ALLwill result in the entire collection being returned, but this is STRONGLY discouraged.sortProperty_- the property by which the results will be sorted This is one of theSORT_BY_XXXconstants inUserProfilesortOrder_-Constants.SORT_ORDER_ASCENDINGfor sorting results in ascending order,Constants.SORT_ORDER_DESCENDINGfor sorting results in descending order- Returns:
- a
ResultPagecontaining an array ofUserProfileobjects correpsonding to users who match the search criteria - Throws:
UnsupportedOperatorException- ifuserSearch_contains an invalid operator
-
createUser
@Write(K_PERSONALIZATION) String createUser(UserProfile userprofile_) throws DuplicateNameException, PrivilegeException, InvalidSupervisorException, InvalidUserException, InvalidNameException Creates a new userThe
usernamefield of the created user must be unique. User fields required for creation are:username.NOTES:
1) Although this call will complete successfully if only the
usernamefield is populated, if thepasswordfield is not also populated the created user will not able to log into the application.2) The
passwordfield must be hashed to work properly with the the product interface.3)In order to minimize possible breaks with the user interface, it is HIGHLY recommended that the
usernamebe validated for illegal characters (only allow alphanumeric symbols, underscores, and periods).If, after a user is created, it is necessary to call any method using that user's
UserServiceContext, thenactivateUserSessionmust be called on the following services:- Parameters:
userprofile_- a user to create- Returns:
- the username of the user
- Throws:
DuplicateNameException- if the username already existsPrivilegeException- if the current user is not a System AdministratorInvalidSupervisorException- if the supervisor property is neithernullnor the login of a valid userInvalidUserException- if user_ is emptyInvalidNameException- Never thrown. Is only declared for backwards compatibility.
-
createUsers
@Write(K_PERSONALIZATION) String[] createUsers(UserProfile[] userprofiles_) throws DuplicateNameException, InvalidNameException, PrivilegeException, InvalidSupervisorException, InvalidUserException Creates new users.The
usernamefield of the created user must be unique. User fields required for creation are:username.NOTES:
1) Although this call will complete successfully if only the
usernamefield is populated, if thepasswordfield is not also populated the created user will not able to log into the application.2) The
passwordfield must be hashed to work properly with the the product interface.3)In order to minimize possible breaks with the user interface, it is HIGHLY recommended that the
usernamebe validated for illegal characters (only allow alphanumeric symbols, underscores, and periods).If, after a user is created, it is necessary to call any method using that user's
UserServiceContext, thenactivateUserSessionmust be called on the following services:- Parameters:
userprofiles_- users to create.- Returns:
- the usernames of the users
- Throws:
DuplicateNameException- if any of the usernames already existsInvalidNameException- if any username isnullPrivilegeException- if the user is not a System Administrator Must be a System Administrator to create a user.InvalidSupervisorException- if the supervisor property is not eithernullor the login of a valid userInvalidUserException- if one of users_ is empty
-
updateUser
@Write(K_PERSONALIZATION) void updateUser(UserProfile userprofile_) throws InvalidUserException, InvalidSupervisorException, PrivilegeException Updates a user. Does not modifyusernameorpasswordfields.In order to minimize possible breaks with the user interface, it is HIGHLY recommended that the
usernamefield be validated for illegal characters (only allow alphanumeric symbols and underscores).This method will ignore any changes to the properties
userTypeIdanduserTypeNamewhen applied to the 'Administrator' user.- Parameters:
userprofile_- the user to modify- Throws:
InvalidUserException- if a user with the given username does not existInvalidSupervisorException- if the supervisor property is neithernullnor the login of a valid userPrivilegeException
-
updateUsers
@Write(K_PERSONALIZATION) void updateUsers(UserProfile[] userprofiles_) throws InvalidUserException, InvalidSupervisorException, PrivilegeException Updates users. Does not modifyusernameorpasswordfields. In order to minimize possible breaks with the user interface, it is HIGHLY recommended that theusernamefield be validated for illegal characters (only allow alphanumeric symbols and underscores).This method will ignore any changes to the properties
userTypeIdanduserTypeNamewhen applied to the 'Administrator' user.- Parameters:
userprofiles_- users to update- Throws:
InvalidUserException- if any user with a given username does not existInvalidSupervisorException- if the supervisor property is neithernullnor the login of a valid userPrivilegeException- See Also:
-
findAllUsersPaging
@Read(K_PERSONALIZATION) ResultPage findAllUsersPaging(boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Fast method that gets all users. TheResultPagereturned containsUserProfileobjects sorted by the givensortProperty.- Parameters:
caseSensitive_- whether the results should be sorted in a case sensitive manner. Passfalseto sort in the common lexicographical order (e.g., a, A, b, B, c, C).startIndex_- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_- the number of results to return. use ofConstants.COUNT_ALLwill result in the entire collection being returned, but this is STRONGLY discouraged.sortProperty_- the property by which the results will be sorted This is one of theSORT_BY_XXXconstants inUserProfilesortOrder_-Constants.SORT_ORDER_ASCENDINGfor sorting results in ascending order,Constants.SORT_ORDER_DESCENDINGfor sorting results in descending order- Returns:
- a
ResultPagecontaining an array ofUserProfileobjects
-
searchUserProfilesPaging
@Read(K_PERSONALIZATION) ResultPage searchUserProfilesPaging(String query_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Searches forUsers by first, last, and username and returns theUserProfileobjects for each foundUser- Parameters:
query_- The query by which to search forUserProfiles.startIndex_- the index into the collection of total results at which to start. Negative numbers are treated as zeros.batchSize_- the number of results to return. UseConstants.COUNT_ALLto return the entire collection, but this is STRONGLY discouraged.sortProperty_- the property by which the results will be sorted. This is one of theSORT_BY_XXXconstants inUserProfilesortOrder_- the order in which to sort the results. This is one ofConstants.SORT_ORDER_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- A
ResultPageofUserProfileobjects which match the query.
-
getApplicationName
Gets the name of the application on which this service is running.- Returns:
- the name of the application
-
getWorkspace
Gets the current memory profile for the workspace.- Returns:
- array of Strings of length 4 describing memory usage:
- [0]Used - Memory Used by the Server so far for storage
- [1]Allocated - Memory allocated for use. Often if a large data item was allocated by a server and subsequently freed, this value will be large compared to "Used". If nearly all memory allocated is in use, this value will be close to (but always higher than) "Used"
- [2]Mapped - is the space used by memory-mapped files
- [3]Available - is the total available memory for the Server process
-
getUserPreferences
Returns current user's preferences- Returns:
- the
UserPreferences
-
setUserPreferences
Set current user's preferences- Parameters:
preferences_- TheUserPreferencesfor the current user
-
#authenticate(String, byte[])