Interface UserService
- All Superinterfaces:
ContextSensitiveSingletonService,Service
Provides the main functionality needed to create, update, delete, and retrieve Users. Methods which retrieve users do not return deactivated users, unless noted otherwise.
For updating a user's password, authenticating a user, and creating a new
user, the password must be provided in a hashed and base64 encoded
byte[] using UTF-8 character-set. Use java.security.MessageDigest
and org.apache.commons.codec.binary.Base64, for instance,
to obtain the hashed form of a plaintext password in a base64 encoded byte[].
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 IntegerIndex in return array fromgetSystemActions(Integer[])which refers to the user's permissions to create a groupstatic final IntegerIndex in return array fromgetSystemActions(Integer[])which refers to the user's permissions to create a public groupstatic final IntegerIndex in return array fromgetSystemActions(Integer[])which refers to the user's permissions to set if a group delegated admin at group creationstatic final IntegerIndex in return array fromgetSystemActions(Integer[])which refers to the user's permissions to create a group typestatic final IntegerIndex in return array fromgetSystemActions(Integer[])which refers to the user's permissions to create a public group typestatic final IntegerIndex in return array fromgetSystemActions(Integer[])which refers to the user's permissions to create a userstatic final IntegerIndex in return array fromgetSystemActions(Integer[])which refers to the user's permissions to modify security settings of a group.static final IntegerIndex in return array fromgetSystemActions(Integer[])which refers to the user's permissions to view deactivated usersstatic final IntegerIndex in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to decativate a userstatic final IntegerIndex in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to delete a userstatic final IntegerIndex in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to edit all of a user's attributesstatic final IntegerIndex in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to edit a user's limited attributesstatic final IntegerIndex in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to reactivate a userstatic final IntegerIndex in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to view a user's attributesstatic final IntegerIndex in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to view a user's limited attributesstatic final IntegerIndex in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to see a user's existencestatic 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.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.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.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 TypeMethodDescriptionvoidaddUserToFavorites(String username_) Deprecated.favorites marking is deprecatedauthenticate(String username, byte[] password) Used to authenticate the user as part of the login mechanism.authenticateUser(String username_, String password_) Deprecated.Since 6.0.2, useauthenticate(String, byte[])voidchangeUserPassword(String username, byte[] newPassword, boolean temporary) Change the user's password to the new provided password.voidDeprecated.createTitle(UserRank title_) Creates a new rank (title).createUser(User user_) Creates a new userString[]createUsers(User[] users_) Creates new users.voiddeactivateUser(String userName_) Deactivates the given User.voiddeactivateUsers(String[] userNames_) Deactivates the given Users.booleandoesUserExist(String username_) Determines whether a user with the exact username exists by conducting a case-sensitive comparison of the given username to usernames in the system.findAllUsersPaging(boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Fast method that gets all users.User[]findUsers(UserSearch userSearch_, boolean caseSensitive_) Deprecated.use findUsersPagingfindUsersForGroupPaging(UserSearch searchCriteria_, boolean caseSensitive_, Long groupId_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Finds users who are members of a certain group for a given search criteria.User[]findUsersForGroupType(UserSearch userSearch_, boolean caseSensitive_, Long groupTypeId_) findUsersPaging(UserSearch userSearch_, boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Returns all users who match the search criteria.Gets the list of user type attributes - the fields which can be used in user rules.Gets the name of the application on which this service is running.getDeactivatedUsersPaging(int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Returns all the deactivated users.getFavoriteUsers(int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.favorites marking is deprecatedUserRank[]Gets the list of ranks (titles) used in the systemUserRank[]Gets the list of ranks (titles) used in the system for display purposes as well as a rank of "Any"getSecurityForUser(String username) Gets the security settings of the user.Boolean[]getSystemActions(Integer[] actionIds_) Gets boolean values indicating whether a system administrator user can perform the action with the given ID.Gets a single user by usernameBoolean[]getUserActions(String username_, Integer[] actionIds_) Gets boolean values indicating whether the user can perform the action with the given ID.getUserByUuid(String uuid) Gets a single user by uuidUser[]Gets a list of users by username.User[]getUsersByUuid(String[] uuids) Gets a list of users by uuid.getUsersForGroupByRolePaging(Long groupId_, Integer role_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Returns all users in the given group with the given role.getUsersList(String[] usernames) Retrieves the users by username without throwing exceptions.String[]Gets the current memory profile for the workspace.booleanDetermines whether the current user is deactivatedbooleanisPasswordUnique(String username, byte[] password) Checkes whether the given user's password is not one of their last N passwords, where N is a number determined by theconf.security.pw.NUMBER_PAST_PASSWORDS_TO_CHECKincustom.properties.booleanisPasswordValid(String username_, String password_) Deprecated.Since 6.0.2, useisUserPasswordValid(String, byte[])booleanisSocialSecurityNumberUnique(String socialSceurityNumber_) Determines whether a user with the given social security number already existsbooleanisUserInGroupByRole(String username_, Long groupId_, Integer role_) Checks if a user has the given role for the given groupbooleanisUsernameAvailable(String username) Determines whether the given username is available for use.booleanisUserPasswordValid(String username, byte[] password) Validates that the provided password matches that of the given user.booleanloginAttempt(boolean valid) Deprecated.UseloginAttempt(String, boolean)instead.booleanloginAttempt(String username, boolean valid) Increases the number of login attempts a user has tried.voidreactivateUsers(String[] userNames_) Reactivates the given Users.voidDeprecated.reloading properties is now automatic, so this call is now unnecessary and does nothing.voidremoveUserFromFavorites(String username_) Deprecated.favorites marking is deprecatedvoidrenameUsersByUuid(String[] usernameUuids, String[] newUsernames) Rename users at usernameUuids to newUsernames.voidDeprecated.searchUsersPaging(String query_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder) Searches forUsers by first, last, and username.voidsetSecurityForUser(String username, Security sec) Sets the security settings of the user.suggest(String query, int maxItems, SuggestParam[] params, Boolean groupResults) suggest(String query, int maxItems, SuggestParam[] params, Boolean groupResults, Long[] allowList) suggestUsers(String query_, int maxSuggestions_) Deprecated.usesuggest(String, int, SuggestParam[], Boolean)insteadSuggestion[][]suggestUsersBulk(String[] queries_, int maxSuggestionsPerQuery_) Deprecated.usesuggest(String, int, SuggestParam[], Boolean)insteadvoidunlockUser(String username) Unlocks a user that has reached the maximum number of attempts and the lockout duration has not expired yet.voidupdateTitle(UserRank title_) Updates the rank (title) name associated with the id of the object passed as a parametervoidupdateUser(User user_) Updates a user.voidupdateUsernames(String[] oldUsernames_, String[] newUsernames_, long maxExpirationTimeInSeconds_) Deprecated.voidupdateUsers(User[] users_) Updates users.validate()Runs validation tests against the database to check whether it is corrupt, and returns a line-separated list of validation resultsMethods inherited from interface com.appiancorp.services.ContextSensitiveSingletonService
configureContextSensitiveSingletonService
-
Field Details
-
ACTION_SYSTEM_USER_CREATE
Index in return array fromgetSystemActions(Integer[])which refers to the user's permissions to create a user -
ACTION_SYSTEM_USER_MODIFY_SECURITY_SETTINGS
Index in return array fromgetSystemActions(Integer[])which refers to the user's permissions to modify security settings of a group. This is not currently used. -
ACTION_SYSTEM_GROUP_CREATE_PUBLIC
Index in return array fromgetSystemActions(Integer[])which refers to the user's permissions to create a public group -
ACTION_SYSTEM_GROUP_CREATE
Index in return array fromgetSystemActions(Integer[])which refers to the user's permissions to create a group -
ACTION_SYSTEM_GROUPTYPE_CREATE_PUBLIC
Index in return array fromgetSystemActions(Integer[])which refers to the user's permissions to create a public group type -
ACTION_SYSTEM_GROUPTYPE_CREATE
Index in return array fromgetSystemActions(Integer[])which refers to the user's permissions to create a group type -
ACTION_SYSTEM_VIEW_DEACTIVATED_USERS
Index in return array fromgetSystemActions(Integer[])which refers to the user's permissions to view deactivated users -
ACTION_SYSTEM_GROUP_SET_DELEGATED_ADMIN_AT_GROUP_CREATION
Index in return array fromgetSystemActions(Integer[])which refers to the user's permissions to set if a group delegated admin at group creation -
ACTION_USER_DELETE_USER
Index in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to delete a user -
ACTION_USER_EDIT_ALL_USER_ATTRIBUTES
Index in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to edit all of a user's attributes -
ACTION_USER_EDIT_LIMITED_USER_ATTRIBUTES
Index in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to edit a user's limited attributes -
ACTION_USER_VIEW_ALL_USER_ATTRIBUTES
Index in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to view a user's attributes -
ACTION_USER_VIEW_LIMITED_USER_ATTRIBUTES
Index in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to view a user's limited attributes -
ACTION_USER_VIEW_USER_EXISTENCE
Index in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to see a user's existence -
ACTION_USER_DEACTIVATE_USER
Index in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to decativate a user -
ACTION_USER_REACTIVATE_USER
Index in return array fromgetUserActions(String,Integer[])which refers to the user's permissions to reactivate a user -
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:
-
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:
-
findUsers$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
findUsersForGroupType$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
findUsersForGroupPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
isUserInGroupByRole$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:
-
authenticate$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
changeUserPassword$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
doesUserExist$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
isUsernameAvailable$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getRankList$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getRankListForDisplay$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
createTitle$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
updateTitle$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getAllUserTypeAttributes$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getUserActions$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getSystemActions$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
isSocialSecurityNumberUnique$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
isPasswordValid$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
isUserPasswordValid$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
reactivateUsers$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
deactivateUser$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
deactivateUsers$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getDeactivatedUsersPaging$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:
-
getUsersForGroupByRolePaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
isCurrentUserDeactivated$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:
-
getUsersList$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:
-
updateUsernames$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
commitUpdateUsernames$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
rollbackUpdateUsernames$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
suggestUsers$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
searchUsersPaging$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
suggestUsersBulk$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
reloadProperties$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
validate$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
addUserToFavorites$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
removeUserFromFavorites$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getFavoriteUsers$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
suggest$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
loginAttempt$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
unlockUser$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
isPasswordUnique$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
setSecurityForUser$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
getSecurityForUser$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
renameUsersByUuid$UPDATES
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
-
Method Details
-
createUser
@Write(K_PERSONALIZATION) String createUser(User user_) throws DuplicateNameException, InvalidNameException, InvalidSupervisorException, PrivilegeException, InvalidUserException Creates a new userThe
usernamefield of the created user must be unique. User fields required for creation are:username,password.NOTES:
1) The
passwordfield must be hashed to work properly with the product interface.2)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:
user_- a user to create- Returns:
- the username of the user
- Throws:
DuplicateNameException- if the username already existsInvalidNameException- if the username isnullPrivilegeException- if the current user is not a System AdministratorInvalidSupervisorException- if the supervisor property is neithernullnor the login of a valid userInvalidUserException- if user_ is empty. This exception is also thrown if either the username or password field is empty.
-
createUsers
@Write(K_PERSONALIZATION) String[] createUsers(User[] users_) throws DuplicateNameException, InvalidNameException, InvalidSupervisorException, PrivilegeException, 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:
users_- 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 userInvalidSupervisorException- if the supervisor property is not eithernullor the login of a valid userInvalidUserException- if null is passed for the object or the username or password are null
-
updateUser
@Write(K_PERSONALIZATION) void updateUser(User user_) throws InvalidUserException, InvalidSupervisorException, PrivilegeException Updates a user. Does not modifyusernameorpasswordfields. You can also pass in aUserProfileto update fields not contained withinUser.If you do not pass in a
UserProfile, the additional fields that are inUserProfilebut not inUserwill be erased.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:
user_- the user to modify- Throws:
InvalidUserException- if null is passed for the object or the username or password are nullInvalidSupervisorException- if the supervisor property is neithernullnor the login of a valid userPrivilegeException- See Also:
-
updateUsers
@Write(K_PERSONALIZATION) void updateUsers(User[] users_) throws InvalidUserException, InvalidSupervisorException, PrivilegeException Updates users. Does not modifyusernameorpasswordfields. You can also pass in an array ofUserProfileobjects to update fields not contained withinUser.If you do not pass in
UserProfileobjects, the additional fields that are inUserProfilebut not inUserwill be erased.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:
users_- 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:
-
getUser
Gets a single user by username- Parameters:
username_- the primary key of a user- Returns:
- the
User - Throws:
InvalidUserException- if a user with the given username does not exist
-
getUsers
Gets a list of users by username.- Parameters:
usernames_- usernames of users to retrieve- Returns:
- a list of users corresponding to the given usernames
- Throws:
InvalidUserException- if any user with the a given username does not exist
-
getUserByUuid
@Read(K_PERSONALIZATION) User getUserByUuid(@ConvertWith(com.appiancorp.kougar.mapper.parameters.UuidParameterConverter.class) String uuid) throws InvalidUserException Gets a single user by uuid- Parameters:
uuid- the uuid of a user- Returns:
- the
User - Throws:
InvalidUserException- if a user with the given uuid does not exist
-
getUsersByUuid
@Read(K_PERSONALIZATION) User[] getUsersByUuid(@ConvertWith(com.appiancorp.kougar.mapper.parameters.UuidParameterConverter[][].class) String[] uuids) throws InvalidUserException Gets a list of users by uuid.- Parameters:
uuids- uuids of users to retrieve- Returns:
- a list of users corresponding to the given uuids
- Throws:
InvalidUserException- if any user with the a given uuid does not exist
-
findUsers
@Deprecated @Read(K_PERSONALIZATION) User[] findUsers(UserSearch userSearch_, boolean caseSensitive_) throws UnsupportedOperatorException Deprecated.use findUsersPagingFinds 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". To get all users, usefindAllUsersPaging.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
-
findUsersForGroupType
@Deprecated @Read(K_PERSONALIZATION) User[] findUsersForGroupType(UserSearch userSearch_, boolean caseSensitive_, Long groupTypeId_) throws UnsupportedOperatorException, InvalidGroupTypeException Finds a list of users who are members of groups of a certain group type, for a given search criteria.This method behaves in a similar fashion to
findUsers(UserSearch, boolean), except that it only searches for users in groups with the given group type.- Parameters:
userSearch_- the search criteriacaseSensitive_- whether the search is case-sensitivegroupTypeId_- groupType to find users who are members of- Returns:
- the users that meet the given search criteria
- Throws:
UnsupportedOperatorException- ifuserSearch_contains an invalid operatorInvalidGroupTypeException- if the group type does not exist
-
findUsersForGroupPaging
@Read(K_PERSONALIZATION) ResultPage findUsersForGroupPaging(UserSearch searchCriteria_, boolean caseSensitive_, Long groupId_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidGroupException, UnsupportedOperatorException Finds users who are members of a certain group for a given search criteria.This method behaves in a similar fashion to
findUsers(UserSearch, boolean), except that it only searches for users in the given group.- Parameters:
searchCriteria_- the search criteriacaseSensitive_- whether the search is case-sensitivegroupId_- the ID of the group in which to searchstartIndex_- 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:
ResultPageofUserobjects.- Throws:
InvalidGroupException- if the group does not existUnsupportedOperatorException- ifuserSearch_contains an invalid operator
-
isUserInGroupByRole
@Read(K_PERSONALIZATION) boolean isUserInGroupByRole(String username_, Long groupId_, Integer role_) throws InvalidUserException, InvalidGroupException, UnsupportedRoleException Checks if a user has the given role for the given group- Parameters:
username_- the login of the usergroupId_- the group whose membership is being checkedrole_- the role being checked. This must be one of theUSER_ROLE_XXXconstants inUser- Returns:
- whether the user has the given role for the group
- Throws:
InvalidUserException- if the user does not existInvalidGroupException- if the group 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, useauthenticate(String, byte[])Used to validate a user (the login mechanism). Note: If password is stored as hashed in database (stored as hashed by default in the product), the password passed in to this function must be hashed. For more details, see topic "Frequently Asked Questions" in the product Developer's Guide.- Parameters:
username_- the login of the userpassword_- the password of the user- Returns:
- the user matching the login
- Throws:
InvalidLoginException- if no user with the given username and password exists
-
authenticate
@Read(K_PERSONALIZATION) UserProfile authenticate(String username, byte[] password) throws InvalidLoginException Used to authenticate the user as part of the login mechanism. A user that provides the correct credentials, a username and password combination that match those stored in the system, is considered to be authenticated. Note: this method will successfully authenticate regardless of whether or not the password is temporary (seechangeUserPassword(String, byte[], boolean)).- Parameters:
username- the username of the user to authenticatepassword- the user's hashed password; see the interface descriptionabove.- Returns:
- the authenticated user
- Throws:
InvalidLoginException- if the authentication challenge fails with the provided credentials
-
changeUserPassword
@Write(K_PERSONALIZATION) void changeUserPassword(String username, byte[] newPassword, boolean temporary) throws InvalidUserException, PrivilegeException Change the user's password to the new provided password. The provided password must be in its hashed form. If thetemporaryflag is passed astrue, the user will be required to change their password on the next login.- Parameters:
username- the username of the user whose password is being changednewPassword- the new password, hashed; see interface descriptionabovefor more infotemporary- a flag to indicate whether this is a temporary password that should be reset the next time the user logs in- Throws:
InvalidUserException- if the provided username doesn't map to a user in the system or the user is deactivatedPrivilegeException- if the method is called by a user other than a System Administrator or the user whose password the method is attempting to change Used to change a user's password
-
doesUserExist
Determines whether a user with the exact username exists by conducting a case-sensitive comparison of the given username to usernames in the system. Users cannot be created with a username that matches an existing username in a case-insensitive comparison, so useisUsernameAvailable(String)instead to determine if a given username is available for use when creating a new user.- Parameters:
username_- the username- Returns:
true, if a user with this username exists.
-
isUsernameAvailable
Determines whether the given username is available for use. A username is available if it does not match any existing username in a case-insensitive comparison.- Parameters:
username- the username- Returns:
true, if a new user can be created with this username.
-
getRankList
Gets the list of ranks (titles) used in the system- Returns:
- the rank list
-
getRankListForDisplay
Gets the list of ranks (titles) used in the system for display purposes as well as a rank of "Any"- Returns:
- the rank list
-
createTitle
Creates a new rank (title). Only the name is required.- Returns:
- the new rank (title) id
- Throws:
PrivilegeException- if the user context is not a system administratorNullPointerException- if the argument itself is null (title_ is null)
-
updateTitle
@Write(K_PERSONALIZATION) void updateTitle(UserRank title_) throws PrivilegeException, InvalidTitleException Updates the rank (title) name associated with the id of the object passed as a parameter- Throws:
InvalidTitleException- if the passed title (rank) id does not exist or is nullPrivilegeException- if the user context is not a system administratorNullPointerException- if the argument itself is null (title_ is null)
-
getAllUserTypeAttributes
Gets the list of user type attributes - the fields which can be used in user rules.- Returns:
- the attribute list
-
getUserActions
@Read(K_PERSONALIZATION) Boolean[] getUserActions(String username_, Integer[] actionIds_) throws InvalidUserException, PrivilegeException Gets boolean values indicating whether the user can perform the action with the given ID. The user must be a basic user; to check the actions that a system administrator can perform, usegetSystemActions(Integer[])- Parameters:
username_- the username of the useractionIds_- IDs of actions for which to check the user's permissions. Each action ID must be one of theACTION_USER_XXXconstants- Returns:
- an array that is parallel to
actionIds_, with each element in the result set to true if the user can perform the associated action - Throws:
InvalidUserException- if the user does not existPrivilegeException
-
getSystemActions
Gets boolean values indicating whether a system administrator user can perform the action with the given ID.- Parameters:
actionIds_- IDs of system actions. Each action ID must be one of theACTION_SYSTEM_XXXconstants- Returns:
- an array parallel to
actionIds_, with each element in the result set to true if the user can perform the associated action
-
isSocialSecurityNumberUnique
Determines whether a user with the given social security number already exists- Parameters:
socialSceurityNumber_- a social security number, in XXXXXXXXX format- Returns:
trueif no current user has this social security number
-
isPasswordValid
@Deprecated @Read(K_PERSONALIZATION) boolean isPasswordValid(String username_, String password_) throws InvalidUserException, PrivilegeException Deprecated.Since 6.0.2, useisUserPasswordValid(String, byte[])Validates password for a given user. Simply checks if entered password for given user matches his stored password.- Parameters:
username_- the login of a userpassword_- the password of the user- Returns:
trueif password is valid- Throws:
InvalidUserException- if the user does not existPrivilegeException
-
isUserPasswordValid
@Read(K_PERSONALIZATION) boolean isUserPasswordValid(String username, byte[] password) throws InvalidUserException, PrivilegeException Validates that the provided password matches that of the given user. The password must be provided in its hashed form. See the interface descriptionabove.- Parameters:
username- the username of the user to checkpassword- the hashed password to check- Returns:
- true if the password is the user's current password, otherwise false
- Throws:
InvalidUserException- if the provided username doesn't map to a user in the system or the user is deactivatedPrivilegeException
-
reactivateUsers
@Write(K_PERSONALIZATION) void reactivateUsers(String[] userNames_) throws InvalidUserException, PrivilegeException Reactivates the given Users.- Parameters:
userNames_- the logins of users that are inactive- Throws:
InvalidUserException- if any of the logins does not correspond to a valid userPrivilegeException- if the current user is not an admin
-
deactivateUser
@Write(K_PERSONALIZATION) void deactivateUser(String userName_) throws InvalidUserException, PrivilegeException Deactivates the given User. Deactivating a user does NOT wipe the user from the system, but rather disables the user's ability to log into the system and other users' ability to view the user. A deactivated user can always be reactivated usingreactivateUsers(String[]).- Parameters:
userName_- the login of a user to deactivate- Throws:
InvalidUserException- if the login does not correspond to a valid user or the Administrator was providedPrivilegeException- if the current user is not an admin
-
deactivateUsers
@Write(K_PERSONALIZATION) void deactivateUsers(String[] userNames_) throws InvalidUserException, PrivilegeException Deactivates the given Users. Deactivating a user does NOT wipe the user from the system, but rather disables the user's ability to log into the system and other users' ability to view the user. A deactivated user can always be reactivated usingreactivateUsers(String[]).- Parameters:
userNames_- the logins of a users to deactivate- Throws:
InvalidUserException- if one of the logins does not correspond to a valid user or the Administrator is in the list of users to deactivatePrivilegeException- if the current user is not an admin
-
getDeactivatedUsersPaging
@Read(K_PERSONALIZATION) ResultPage getDeactivatedUsersPaging(int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Returns all the deactivated users.- Parameters:
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 ofUserobjects corresponding to inactive users
-
findUsersPaging
@Read(K_PERSONALIZATION) ResultPage findUsersPaging(UserSearch userSearch_, boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws UnsupportedOperatorException Returns all users who match the search criteria.This method will return the paged resultset corresponding to
findUsers(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 inUsersortOrder_-Constants.SORT_ORDER_ASCENDINGfor sorting results in ascending order,Constants.SORT_ORDER_DESCENDINGfor sorting results in descending order- Returns:
- a
ResultPagecontaining an array ofUserobjects correpsonding to users who match the search criteria - Throws:
UnsupportedOperatorException- ifuserSearch_contains an invalid operator
-
getUsersForGroupByRolePaging
@Read(K_PERSONALIZATION) ResultPage getUsersForGroupByRolePaging(Long groupId_, Integer role_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidGroupException, UnsupportedRoleException, PrivilegeException Returns all users in the given group with the given role.- Parameters:
groupId_- the ID of the grouprole_- the role. This is 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. 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 inUsersortOrder_-Constants.SORT_ORDER_ASCENDINGfor sorting results in ascending order,Constants.SORT_ORDER_DESCENDINGfor sorting results in descending order- Returns:
- a
ResultPagecontaining an array ofUserbeans corresponding to users who match the search criteria - Throws:
InvalidGroupException- if the group id does not existUnsupportedRoleException- if the role is invalidPrivilegeException- if the user calling this method does not have sufficient privileges to view the members of this group - that is, ifGroupService.getGroupActions(Long, Integer[])returns false for the actionGroupService.ACTION_GROUP_VIEW_GROUP_MEMBERS
-
isCurrentUserDeactivated
Determines whether the current user is deactivated- Returns:
trueif the current user is deactivated
-
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
-
getUsersList
Retrieves the users by username without throwing exceptions.The result codes returned in the
ResultListare in the same order and correspond to the usernames passed as the parameter. The following result codes are returned:ResultList.CODE_INVALID- the corresponding username does not belong to an existing userResultList.CODE_NO_PERMISSION- the context user does not have permission to view the user with the corresponding usernameResultList.CODE_VALID- the user is valid and the context user has permission to view it
Userarray returned in the results is neither the same length as the input array nor is it in the same order. Any invalid usernames have no corresponding item in the array and users that cannot be viewed by the context users are sorted to the end of the array for convenience.- Parameters:
usernames- the usernames of the users to retrieve- Returns:
- a
ResultListcontaining the an array ofUserobjects and result codes corresponding to the input array.
-
findAllUsersPaging
@Read(K_PERSONALIZATION) ResultPage findAllUsersPaging(boolean caseSensitive_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Fast method that gets all users.- Parameters:
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 ofUserobjects
-
updateUsernames
@Deprecated @Write(K_PERSONALIZATION) void updateUsernames(String[] oldUsernames_, String[] newUsernames_, long maxExpirationTimeInSeconds_) throws IllegalArgumentException, DuplicateNameException Deprecated.DEPRECATED: SeerenameUsersByUuid(java.lang.String[], java.lang.String[])Updates a list of old usernames to new usernames.If successful, this method must be followed by
commitUpdateUsernames(). AftercommitUpdateUsernameshas been called, the old usernames will still be active, but will expire after the interval specified bymaxExpirationTimeInSeconds_; ifupdateUsernamesis successful butcommitUpdateUsernamesis not called, the new usernames will not become active.If unsuccessful, this method should be followed by
rollbackUpdateUsernames(). This will simply free memory dedicated to mapping old usernames to new usernames.- Parameters:
oldUsernames_- the usernames to be updatednewUsernames_- the usernames to which the old usernames will be updatedmaxExpirationTimeInSeconds_- the interval, in seconds, aftercommitUpdateUsernameshas been called, after which the old usernames will expire. If this parameter is zero or a negative value the old usernames will expire instantly. After expiration, the old usernames will no longer be valid.- Throws:
IllegalArgumentException- if the length ofoldUsernames_is not the same as the length ofnewUsernames_DuplicateNameException- if anyoldUsernames_ornewUsernames_contain any duplicates, or if an old username is being updated to a username that already exists
-
commitUpdateUsernames
Deprecated.DEPRECATED: SeerenameUsersByUuid(java.lang.String[], java.lang.String[])Commits an update of usernames.This method should be preceded by a call to
updateUsernames(String[], String[], long). After the commit, the old usernames will be temporarily active, and will expire after the interval specified bymaxExpirationTimeInSeconds_; ifcommitUpdateUsernamesis not called, the new usernames will not become active. -
rollbackUpdateUsernames
Deprecated.DEPRECATED: SeerenameUsersByUuid(java.lang.String[], java.lang.String[])Rolls back an update of usernames.This method should be called if
updateUsernames(String[], String[], long)is unsuccessful. The rollback will simply free memory dedicated to mapping old usernames to new usernames. -
suggestUsers
Deprecated.usesuggest(String, int, SuggestParam[], Boolean)insteadReturns a String in a specified format that containsUsers whose first, last, or username match or partially match the query string. The number of suggestions is limited. Format (forUsers andGroups: [[4, 'john.user', John User],[5, 32, 'Finance']]- Parameters:
query_- The search query.maxSuggestions_- The maximum number of suggestions to return.- Returns:
- A String of suggestions in the specified format.
-
searchUsersPaging
@Read(K_PERSONALIZATION) ResultPage searchUsersPaging(String query_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder) Searches forUsers by first, last, and username.- Parameters:
query_- The query by which to search forUsers.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 inUser.sortOrder- the order in which to sort the results. This is one ofConstants.SORT_ORDER_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- A
ResultPageofUserobjects which match the search query.
-
suggestUsersBulk
@Deprecated @Read(K_PERSONALIZATION) Suggestion[][] suggestUsersBulk(String[] queries_, int maxSuggestionsPerQuery_) Deprecated.usesuggest(String, int, SuggestParam[], Boolean)insteadSuggestsUsers whose first, last, or username matches each query.- Parameters:
queries_- A list of queries by which to search forUsers.maxSuggestionsPerQuery_- The maximum number of suggestions to return for each query.- Returns:
- An array of
Suggestion[]which are the suggestions corresponding to each query string. The first dimension of the array is equal to the number of queries passed to the method. The second dimension is equal to or lesser than the max suggestion per query.
-
reloadProperties
Deprecated.reloading properties is now automatic, so this call is now unnecessary and does nothing.Reloads all database-level properties files (*.xml, *.properties) without interrupting API services -
validate
Runs validation tests against the database to check whether it is corrupt, and returns a line-separated list of validation results- Returns:
- the validation results
-
addUserToFavorites
@Write(K_PERSONALIZATION) @Deprecated void addUserToFavorites(String username_) throws InvalidUserException, PrivilegeException Deprecated.favorites marking is deprecatedAdds this user (username_) to the current user's favorites- Parameters:
username_- The username of the user that is to be added as favorites- Throws:
InvalidUserException- if username_ is empty, or the username_ does not existPrivilegeException
-
removeUserFromFavorites
@Write(K_PERSONALIZATION) @Deprecated void removeUserFromFavorites(String username_) throws InvalidUserException Deprecated.favorites marking is deprecatedRemoves this user (username_) from the current user's favorites- Parameters:
username_- The username of the user that is to be removed from favorites- Throws:
InvalidUserException- if username_ is empty or the username_ does not exist
-
getFavoriteUsers
@Read(K_PERSONALIZATION) @Deprecated ResultPage getFavoriteUsers(int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) Deprecated.favorites marking is deprecatedReturns favorite users of the current user- Parameters:
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 inUser.sortOrder_- the order in which to sort the results. This is one ofConstants.SORT_ORDER_ASCENDINGorConstants.SORT_ORDER_DESCENDING- Returns:
- A
ResultPageofUserobjects
-
suggest
@Read(K_PERSONALIZATION) String suggest(String query, int maxItems, SuggestParam[] params, Boolean groupResults) - Parameters:
query-maxItems-params- list of information on what is being suggested and what format the results should be in. valid types are user.groupResults- if specifying more than one SuggestParam, would you like to group the results by type, or mixed together and sorted? Default is true. If grouped, order of types matches the order of the suggestParams passed in.- Returns:
- a JSON formatted string
-
suggest
@Read(K_PERSONALIZATION) String suggest(String query, int maxItems, SuggestParam[] params, Boolean groupResults, Long[] allowList) - Parameters:
query-maxItems-params- list of information on what is being suggested and what format the results should be in. valid types are user.groupResults- if specifying more than one SuggestParam, would you like to group the results by type, or mixed together and sorted? Default is true. If grouped, order of types matches the order of the suggestParams passed in.allowList- list of IDs that will be automatically added to returned results, filtered by query. Ignored if null or empty.- Returns:
- a JSON formatted string
-
loginAttempt
Deprecated.UseloginAttempt(String, boolean)instead.Increases the number of login attempts a user has tried. The user making this call is the user which the attempts are increased to.- Parameters:
valid- Whether the login attempt is successful or not- Returns:
- true if the user is allowed to login. False if the user is locked
-
loginAttempt
Increases the number of login attempts a user has tried.- Parameters:
username- The user attempting the loginvalid- Whether the login attempt is successful or not- Returns:
- true if the user is allowed to login. False if the user is locked
-
unlockUser
@Write(K_PERSONALIZATION) void unlockUser(String username) throws InvalidUserException, PrivilegeException Unlocks a user that has reached the maximum number of attempts and the lockout duration has not expired yet.- Parameters:
username- the username- Throws:
InvalidUserException- if the provided username doesn't map to a user in the system or the user is deactivatedPrivilegeException- if the method is called by a user other than a System Administrator
-
isPasswordUnique
@Read(K_PERSONALIZATION) boolean isPasswordUnique(String username, byte[] password) throws PrivilegeException, InvalidUserException Checkes whether the given user's password is not one of their last N passwords, where N is a number determined by theconf.security.pw.NUMBER_PAST_PASSWORDS_TO_CHECKincustom.properties. This method should be used in conjunction withchangeUserPassword(String, byte[], boolean)for systems that need to enforce that a new password is not one of the previous passwords. The provided password must be hashed using the algorithm. See the interface descriptionabove.- Parameters:
username- the user whose password history should be checkedpassword- the hashed password to check against the history- Returns:
- true if the password is unique, otherwise false.
- Throws:
PrivilegeException- if the method is called by a user other than a System Administrator or the user for whom the method is attempting to verify the new password for uniquenessInvalidUserException
-
setSecurityForUser
@Write(K_PERSONALIZATION) void setSecurityForUser(String username, Security sec) throws PrivilegeException, InvalidUserException, InvalidGroupException Sets the security settings of the user. FieldscanInherit,inheritableanddoesInheritwill be ignored- Parameters:
username- the user whose security settings will be setsec- aSecurityobject which encapsulates the security settings for a user. The role map in theSecurityobject must be aRoleMapobject.- Throws:
PrivilegeException- if the current user does not have sufficient privileges to perform this operation or cannot see a group specified in the rolemapInvalidUserException- if the user specified in the rolemap is invalid or the current user does not have viewing privileges over that userInvalidGroupException- if the group specified in the rolemap is invalid
-
getSecurityForUser
Gets the security settings of the user.- Parameters:
username- the user whose security settings will be retrieved- Returns:
- the
Securityobject that contains the security for the user. The role map in theSecurityobject is aRoleMapobject. - Throws:
PrivilegeException- if the current user does not have sufficient privileges to perform this operation
-
renameUsersByUuid
@Write(K_PERSONALIZATION) void renameUsersByUuid(@ConvertWith(com.appiancorp.kougar.mapper.parameters.UuidParameterConverter[][].class) String[] usernameUuids, String[] newUsernames) throws AppianRuntimeException Rename users at usernameUuids to newUsernames. This replaces the previous updateUsernames/commitUpdateUsernames/rollbackUpdateUsernames for each engine. This generates a request to all enlisted components of the Appian system to do the rename. It is transactional, and will be retried as necessary if a component is down at the time. Renaming by UUID is idempotent, so it may be retried as necessary if a component is down during the attempt. The rename is done immediately on the Personalization K engine (which is the primary source of truth for users). It may or may not be done immediately on other engines and other persistent storage mechanisms attached in a structured manner to Appian. A timeout may be employed to allow the method to return quickly, even if an engine is down at the time of the attempt. Such engines may be retried later automatically. All user creation and user renames are sequenced, such that they occur in order even when components are down. Invoking user must have privilege to reactivate user.- Parameters:
usernameUuids- must be non-null, match newUsernames in length, be unique, contain no nulls (may use getUserUuids to obtain this information) The UUID is used to avoid ambiguous behaviors when renaming users in a loop, e.g., (a->b, b->c, c->a), which would have race conditions between distributed engines holding the data. Use of the user UUID avoids the ambiguity.newUsernames- must be non-null, match usernameUuids in length, be unique, contain no nulls, be valid usernames (see instead usecreateUser(User))- Throws:
DuplicateNameExceptionInvalidNameExceptionPrivilegeExceptionInvalidUserExceptionSelfRenameExceptionAppianRuntimeException
-