public interface UserService extends ContextSensitiveSingletonService
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.
Modifier and Type | Field and Description |
---|---|
static java.lang.Integer |
ACTION_SYSTEM_GROUP_CREATE
Index in return array from
getSystemActions(Integer[])
which refers to the user's permissions to create a group |
static java.lang.Integer |
ACTION_SYSTEM_GROUP_CREATE_PUBLIC
Index in return array from
getSystemActions(Integer[])
which refers to the user's permissions to create a public group |
static java.lang.Integer |
ACTION_SYSTEM_GROUP_SET_DELEGATED_ADMIN_AT_GROUP_CREATION
Index in return array from
getSystemActions(Integer[])
which refers to the user's permissions to set if a group delegated admin
at group creation |
static java.lang.Integer |
ACTION_SYSTEM_GROUPTYPE_CREATE
Index in return array from
getSystemActions(Integer[])
which refers to the user's permissions to create a group type |
static java.lang.Integer |
ACTION_SYSTEM_GROUPTYPE_CREATE_PUBLIC
Index in return array from
getSystemActions(Integer[])
which refers to the user's permissions to create a public group type |
static java.lang.Integer |
ACTION_SYSTEM_USER_CREATE
Index in return array from
getSystemActions(Integer[])
which refers to the user's permissions to create a user |
static java.lang.Integer |
ACTION_SYSTEM_USER_MODIFY_SECURITY_SETTINGS
Index in return array from
getSystemActions(Integer[])
which refers to the user's permissions to modify security settings of a group. |
static java.lang.Integer |
ACTION_SYSTEM_VIEW_DEACTIVATED_USERS
Index in return array from
getSystemActions(Integer[])
which refers to the user's permissions to view deactivated users |
static java.lang.Integer |
ACTION_USER_DEACTIVATE_USER
Index in return array from
getUserActions(String,Integer[])
which refers to the user's permissions to decativate a user |
static java.lang.Integer |
ACTION_USER_DELETE_USER
Index in return array from
getUserActions(String,Integer[])
which refers to the user's permissions to delete a user |
static java.lang.Integer |
ACTION_USER_EDIT_ALL_USER_ATTRIBUTES
Index in return array from
getUserActions(String,Integer[])
which refers to the user's permissions to edit all of a user's attributes |
static java.lang.Integer |
ACTION_USER_EDIT_LIMITED_USER_ATTRIBUTES
Index in return array from
getUserActions(String,Integer[])
which refers to the user's permissions to edit a user's limited attributes |
static java.lang.Integer |
ACTION_USER_REACTIVATE_USER
Index in return array from
getUserActions(String,Integer[])
which refers to the user's permissions to reactivate a user |
static java.lang.Integer |
ACTION_USER_VIEW_ALL_USER_ATTRIBUTES
Index in return array from
getUserActions(String,Integer[])
which refers to the user's permissions to view a user's attributes |
static java.lang.Integer |
ACTION_USER_VIEW_LIMITED_USER_ATTRIBUTES
Index in return array from
getUserActions(String,Integer[])
which refers to the user's permissions to view a user's limited attributes |
static java.lang.Integer |
ACTION_USER_VIEW_USER_EXISTENCE
Index in return array from
getUserActions(String,Integer[])
which refers to the user's permissions to see a user's existence |
static boolean |
addUserToFavorites$UPDATES |
static boolean |
authenticate$UPDATES |
static boolean |
authenticateUser$UPDATES |
static boolean |
changeUserPassword$UPDATES |
static boolean |
commitUpdateUsernames$UPDATES |
static boolean |
createTitle$UPDATES |
static boolean |
createUser$UPDATES |
static boolean |
createUsers$UPDATES |
static boolean |
deactivateUser$UPDATES |
static boolean |
deactivateUsers$UPDATES |
static boolean |
doesUserExist$UPDATES |
static boolean |
findAllUsersPaging$UPDATES |
static boolean |
findUsers$UPDATES |
static boolean |
findUsersForGroupPaging$UPDATES |
static boolean |
findUsersForGroupType$UPDATES |
static boolean |
findUsersPaging$UPDATES |
static boolean |
getAllUserTypeAttributes$UPDATES |
static boolean |
getApplicationName$UPDATES |
static boolean |
getDeactivatedUsersPaging$UPDATES |
static boolean |
getFavoriteUsers$UPDATES |
static boolean |
getRankList$UPDATES |
static boolean |
getRankListForDisplay$UPDATES |
static boolean |
getSecurityForUser$UPDATES |
static boolean |
getSystemActions$UPDATES |
static boolean |
getUser$UPDATES |
static boolean |
getUserActions$UPDATES |
static boolean |
getUserByUuid$UPDATES |
static boolean |
getUsers$UPDATES |
static boolean |
getUsersByUuid$UPDATES |
static boolean |
getUsersForGroupByRolePaging$UPDATES |
static boolean |
getUsersList$UPDATES |
static boolean |
getWorkspace$UPDATES |
static boolean |
isCurrentUserDeactivated$UPDATES |
static boolean |
isPasswordUnique$UPDATES |
static boolean |
isPasswordValid$UPDATES |
static boolean |
isSocialSecurityNumberUnique$UPDATES |
static boolean |
isUserInGroupByRole$UPDATES |
static boolean |
isUsernameAvailable$UPDATES |
static boolean |
isUserPasswordValid$UPDATES |
static boolean |
loginAttempt$UPDATES |
static boolean |
reactivateUsers$UPDATES |
static boolean |
reloadProperties$UPDATES |
static boolean |
removeUserFromFavorites$UPDATES |
static boolean |
renameUsersByUuid$UPDATES |
static boolean |
rollbackUpdateUsernames$UPDATES |
static boolean |
searchUsersPaging$UPDATES |
static boolean |
setSecurityForUser$UPDATES |
static boolean |
suggest$UPDATES |
static boolean |
suggestUsers$UPDATES |
static boolean |
suggestUsersBulk$UPDATES |
static boolean |
unlockUser$UPDATES |
static boolean |
updateTitle$UPDATES |
static boolean |
updateUser$UPDATES |
static boolean |
updateUsernames$UPDATES |
static boolean |
updateUsers$UPDATES |
static boolean |
validate$UPDATES |
CONFIGURE_METHOD_NAME
Modifier and Type | Method and Description |
---|---|
void |
addUserToFavorites(java.lang.String username_)
Adds this user (username_) to the current user's favorites
|
UserProfile |
authenticate(java.lang.String username,
byte[] password)
Used to authenticate the user as part of the login mechanism.
|
UserProfile |
authenticateUser(java.lang.String username_,
java.lang.String password_)
Deprecated.
Since 6.0.2, use
authenticate(String, byte[]) |
void |
changeUserPassword(java.lang.String username,
byte[] newPassword,
boolean temporary)
Change the user's password to the new provided password.
|
void |
commitUpdateUsernames()
Deprecated.
|
java.lang.Long |
createTitle(UserRank title_)
Creates a new rank (title).
|
java.lang.String |
createUser(User user_)
Creates a new user
The
username field of the created user
must be unique. |
java.lang.String[] |
createUsers(User[] users_)
Creates new users.
|
void |
deactivateUser(java.lang.String userName_)
Deactivates the given User.
|
void |
deactivateUsers(java.lang.String[] userNames_)
Deactivates the given Users.
|
boolean |
doesUserExist(java.lang.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.
|
ResultPage |
findAllUsersPaging(boolean caseSensitive_,
int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sortOrder_)
Fast method that gets all users.
|
User[] |
findUsers(UserSearch userSearch_,
boolean caseSensitive_)
Deprecated.
use findUsersPaging
|
ResultPage |
findUsersForGroupPaging(UserSearch searchCriteria_,
boolean caseSensitive_,
java.lang.Long groupId_,
int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sortOrder_)
Finds users who are members of a certain group for a given
search criteria.
|
User[] |
findUsersForGroupType(UserSearch userSearch_,
boolean caseSensitive_,
java.lang.Long groupTypeId_)
|
ResultPage |
findUsersPaging(UserSearch userSearch_,
boolean caseSensitive_,
int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sortOrder_)
Returns all users who match the search criteria.
|
Attribute[] |
getAllUserTypeAttributes()
Gets the list of user type attributes - the fields which can be
used in user rules.
|
java.lang.String |
getApplicationName()
Gets the name of the application on which this service is running.
|
ResultPage |
getDeactivatedUsersPaging(int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sortOrder_)
Returns all the deactivated users.
|
ResultPage |
getFavoriteUsers(int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sortOrder_)
Returns favorite users of the current user
|
UserRank[] |
getRankList()
Gets the list of ranks (titles) used in the system
|
UserRank[] |
getRankListForDisplay()
Gets the list of ranks (titles) used in the system for display purposes
as well as a rank of "Any"
|
Security |
getSecurityForUser(java.lang.String username)
Gets the security settings of the user.
|
java.lang.Boolean[] |
getSystemActions(java.lang.Integer[] actionIds_)
Gets boolean values indicating whether a system administrator user can
perform the action with the given ID.
|
User |
getUser(java.lang.String username_)
Gets a single user by username
|
java.lang.Boolean[] |
getUserActions(java.lang.String username_,
java.lang.Integer[] actionIds_)
Gets boolean values indicating whether the user can perform the action with
the given ID.
|
User |
getUserByUuid(java.lang.String uuid)
Gets a single user by uuid
|
User[] |
getUsers(java.lang.String[] usernames_)
Gets a list of users by username.
|
User[] |
getUsersByUuid(java.lang.String[] uuids)
Gets a list of users by uuid.
|
ResultPage |
getUsersForGroupByRolePaging(java.lang.Long groupId_,
java.lang.Integer role_,
int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sortOrder_)
Returns all users in the given group with the given role.
|
ResultList |
getUsersList(java.lang.String[] usernames)
Retrieves the users by username without throwing exceptions.
|
java.lang.String[] |
getWorkspace()
Gets the current memory profile for the workspace.
|
boolean |
isCurrentUserDeactivated()
Determines whether the current user is deactivated
|
boolean |
isPasswordUnique(java.lang.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 the
conf.security.pw.NUMBER_PAST_PASSWORDS_TO_CHECK in
custom.properties . |
boolean |
isPasswordValid(java.lang.String username_,
java.lang.String password_)
Deprecated.
Since 6.0.2, use
isUserPasswordValid(String, byte[]) |
boolean |
isSocialSecurityNumberUnique(java.lang.String socialSceurityNumber_)
Determines whether a user with the given social security number already
exists
|
boolean |
isUserInGroupByRole(java.lang.String username_,
java.lang.Long groupId_,
java.lang.Integer role_)
Checks if a user has the given role for the given group
|
boolean |
isUsernameAvailable(java.lang.String username)
Determines whether the given username is available for use.
|
boolean |
isUserPasswordValid(java.lang.String username,
byte[] password)
Validates that the provided password matches that of the given user.
|
boolean |
loginAttempt(boolean valid)
Deprecated.
Use
loginAttempt(String, boolean) instead. |
boolean |
loginAttempt(java.lang.String username,
boolean valid)
Increases the number of login attempts a user has tried.
|
void |
reactivateUsers(java.lang.String[] userNames_)
Reactivates the given Users.
|
void |
reloadProperties()
Deprecated.
reloading properties is now automatic, so this call is now unnecessary and does nothing.
|
void |
removeUserFromFavorites(java.lang.String username_)
Removes this user (username_) from the current user's favorites
|
void |
renameUsersByUuid(java.lang.String[] usernameUuids,
java.lang.String[] newUsernames)
Rename users at usernameUuids to newUsernames.
|
void |
rollbackUpdateUsernames()
Deprecated.
|
ResultPage |
searchUsersPaging(java.lang.String query_,
int startIndex_,
int batchSize_,
java.lang.Integer sortProperty_,
java.lang.Integer sorOrder_)
Searches for
User s by first, last, and username. |
void |
setSecurityForUser(java.lang.String username,
Security sec)
Sets the security settings of the user.
|
java.lang.String |
suggest(java.lang.String query,
int maxItems,
SuggestParam[] params,
java.lang.Boolean groupResults) |
java.lang.String |
suggest(java.lang.String query,
int maxItems,
SuggestParam[] params,
java.lang.Boolean groupResults,
java.lang.Long[] allowList) |
java.lang.String |
suggestUsers(java.lang.String query_,
int maxSuggestions_)
Deprecated.
use
suggest(String, int, SuggestParam[], Boolean) instead |
Suggestion[][] |
suggestUsersBulk(java.lang.String[] queries_,
int maxSuggestionsPerQuery_)
Deprecated.
use
suggest(String, int, SuggestParam[], Boolean) instead |
void |
unlockUser(java.lang.String username)
Unlocks a user that has reached the maximum number of attempts and the lockout duration has
not expired yet.
|
void |
updateTitle(UserRank title_)
Updates the rank (title) name associated with the id of
the object passed as a parameter
|
void |
updateUser(User user_)
Updates a user.
|
void |
updateUsernames(java.lang.String[] oldUsernames_,
java.lang.String[] newUsernames_,
long maxExpirationTimeInSeconds_)
Deprecated.
|
void |
updateUsers(User[] users_)
Updates users.
|
java.lang.String |
validate()
Runs validation tests against the database to check whether it is corrupt,
and returns a line-separated list of validation results
|
configureContextSensitiveSingletonService
static final java.lang.Integer ACTION_SYSTEM_USER_CREATE
getSystemActions(Integer[])
which refers to the user's permissions to create a userstatic final java.lang.Integer ACTION_SYSTEM_USER_MODIFY_SECURITY_SETTINGS
getSystemActions(Integer[])
which refers to the user's permissions to modify security settings of a group.
This is not currently used.static final java.lang.Integer ACTION_SYSTEM_GROUP_CREATE_PUBLIC
getSystemActions(Integer[])
which refers to the user's permissions to create a public groupstatic final java.lang.Integer ACTION_SYSTEM_GROUP_CREATE
getSystemActions(Integer[])
which refers to the user's permissions to create a groupstatic final java.lang.Integer ACTION_SYSTEM_GROUPTYPE_CREATE_PUBLIC
getSystemActions(Integer[])
which refers to the user's permissions to create a public group typestatic final java.lang.Integer ACTION_SYSTEM_GROUPTYPE_CREATE
getSystemActions(Integer[])
which refers to the user's permissions to create a group typestatic final java.lang.Integer ACTION_SYSTEM_VIEW_DEACTIVATED_USERS
getSystemActions(Integer[])
which refers to the user's permissions to view deactivated usersstatic final java.lang.Integer ACTION_SYSTEM_GROUP_SET_DELEGATED_ADMIN_AT_GROUP_CREATION
getSystemActions(Integer[])
which refers to the user's permissions to set if a group delegated admin
at group creationstatic final java.lang.Integer ACTION_USER_DELETE_USER
getUserActions(String,Integer[])
which refers to the user's permissions to delete a userstatic final java.lang.Integer ACTION_USER_EDIT_ALL_USER_ATTRIBUTES
getUserActions(String,Integer[])
which refers to the user's permissions to edit all of a user's attributesstatic final java.lang.Integer ACTION_USER_EDIT_LIMITED_USER_ATTRIBUTES
getUserActions(String,Integer[])
which refers to the user's permissions to edit a user's limited attributesstatic final java.lang.Integer ACTION_USER_VIEW_ALL_USER_ATTRIBUTES
getUserActions(String,Integer[])
which refers to the user's permissions to view a user's attributesstatic final java.lang.Integer ACTION_USER_VIEW_LIMITED_USER_ATTRIBUTES
getUserActions(String,Integer[])
which refers to the user's permissions to view a user's limited attributesstatic final java.lang.Integer ACTION_USER_VIEW_USER_EXISTENCE
getUserActions(String,Integer[])
which refers to the user's permissions to see a user's existencestatic final java.lang.Integer ACTION_USER_DEACTIVATE_USER
getUserActions(String,Integer[])
which refers to the user's permissions to decativate a userstatic final java.lang.Integer ACTION_USER_REACTIVATE_USER
getUserActions(String,Integer[])
which refers to the user's permissions to reactivate a userstatic final boolean createUser$UPDATES
static final boolean createUsers$UPDATES
static final boolean updateUser$UPDATES
static final boolean updateUsers$UPDATES
static final boolean getUser$UPDATES
static final boolean getUsers$UPDATES
static final boolean getUserByUuid$UPDATES
static final boolean getUsersByUuid$UPDATES
static final boolean findUsers$UPDATES
static final boolean findUsersForGroupType$UPDATES
static final boolean findUsersForGroupPaging$UPDATES
static final boolean isUserInGroupByRole$UPDATES
static final boolean authenticateUser$UPDATES
static final boolean authenticate$UPDATES
static final boolean changeUserPassword$UPDATES
static final boolean doesUserExist$UPDATES
static final boolean isUsernameAvailable$UPDATES
static final boolean getRankList$UPDATES
static final boolean getRankListForDisplay$UPDATES
static final boolean createTitle$UPDATES
static final boolean updateTitle$UPDATES
static final boolean getAllUserTypeAttributes$UPDATES
static final boolean getUserActions$UPDATES
static final boolean getSystemActions$UPDATES
static final boolean isSocialSecurityNumberUnique$UPDATES
static final boolean isPasswordValid$UPDATES
static final boolean isUserPasswordValid$UPDATES
static final boolean reactivateUsers$UPDATES
static final boolean deactivateUser$UPDATES
static final boolean deactivateUsers$UPDATES
static final boolean getDeactivatedUsersPaging$UPDATES
static final boolean findUsersPaging$UPDATES
static final boolean getUsersForGroupByRolePaging$UPDATES
static final boolean isCurrentUserDeactivated$UPDATES
static final boolean getApplicationName$UPDATES
static final boolean getWorkspace$UPDATES
static final boolean getUsersList$UPDATES
static final boolean findAllUsersPaging$UPDATES
static final boolean updateUsernames$UPDATES
static final boolean commitUpdateUsernames$UPDATES
static final boolean rollbackUpdateUsernames$UPDATES
static final boolean suggestUsers$UPDATES
static final boolean searchUsersPaging$UPDATES
static final boolean suggestUsersBulk$UPDATES
static final boolean reloadProperties$UPDATES
static final boolean validate$UPDATES
static final boolean addUserToFavorites$UPDATES
static final boolean removeUserFromFavorites$UPDATES
static final boolean getFavoriteUsers$UPDATES
static final boolean suggest$UPDATES
static final boolean loginAttempt$UPDATES
static final boolean unlockUser$UPDATES
static final boolean isPasswordUnique$UPDATES
static final boolean setSecurityForUser$UPDATES
static final boolean getSecurityForUser$UPDATES
static final boolean renameUsersByUuid$UPDATES
java.lang.String createUser(User user_) throws DuplicateNameException, InvalidNameException, InvalidSupervisorException, PrivilegeException, InvalidUserException
The username
field of the created user
must be unique. User fields required for creation are:
username
, password
.
NOTES:
1) The password
field must be hashed to work properly with the
the product interface.
2)In order to minimize possible breaks with the user interface, it is
HIGHLY recommended that the username
be 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
,
then activateUserSession
must be called on the following services:
user_
- a user to createDuplicateNameException
- if the username already existsInvalidNameException
- if the username is null
PrivilegeException
- if the current user is not a System
AdministratorInvalidSupervisorException
- if the supervisor property is
neither null
nor the login of a valid userInvalidUserException
- if user_ is empty. This exception is also
thrown if either the username or password field is empty.ServiceException
- if any system-level error occursjava.lang.String[] createUsers(User[] users_) throws DuplicateNameException, InvalidNameException, InvalidSupervisorException, PrivilegeException, InvalidUserException
The username
field 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
username
field is populated, if the password
field is not also populated the created user will not able to log into the
application.
2) The password
field 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 username
be 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
,
then activateUserSession
must be called on the following services:
users_
- users to create.DuplicateNameException
- if any of the usernames already existsInvalidNameException
- if any username is null
PrivilegeException
- if the user is not a System Administrator
Must be a System Administrator to create a userInvalidSupervisorException
- if the supervisor property is not
either null
or the login of a valid userInvalidUserException
- if null is passed for the object or the
username or password are nullServiceException
- if any system-level error occursvoid updateUser(User user_) throws InvalidUserException, InvalidSupervisorException, PrivilegeException
username
or
password
fields. You can also pass in a
UserProfile
to update fields not contained within
User
.
If you do not pass in a UserProfile
, the additional
fields that are in UserProfile
but not in
User
will be erased.
In order to minimize possible breaks with the user interface, it is HIGHLY
recommended that the username
field be validated for illegal
characters (only allow alphanumeric symbols and underscores).
This method will ignore any changes to the properties userTypeId
and userTypeName
when applied to the 'Administrator' user.
user_
- the user to modifyInvalidUserException
- if null is passed for the object or the
username or password are nullInvalidSupervisorException
- if the supervisor property is
neither null
nor the login of a valid userServiceException
- if any system-level error occursPrivilegeException
UserProfile
,
changeUserPassword(String, byte[], boolean)
void updateUsers(User[] users_) throws InvalidUserException, InvalidSupervisorException, PrivilegeException
username
or
password
fields. You can also pass in an array of
UserProfile
objects
to update fields not contained within
User
.
If you do not pass in UserProfile
objects, the additional
fields that are in UserProfile
but not in
User
will be erased.
In order to minimize possible breaks with the user interface, it is HIGHLY
recommended that the username
field be validated for illegal
characters (only allow alphanumeric symbols and underscores).
This method will ignore any changes to the properties userTypeId
and userTypeName
when applied to the 'Administrator' user.
users_
- users to updateInvalidUserException
- if any user with a given username does not
existInvalidSupervisorException
- if the supervisor property is
neither null
nor the login of a valid userServiceException
- if any system-level error occursPrivilegeException
UserProfile
,
changeUserPassword(String, byte[], boolean)
User getUser(java.lang.String username_) throws InvalidUserException
username_
- the primary key of a userUser
InvalidUserException
- if a user with the given username does not
existServiceException
- if any system-level error occursUser[] getUsers(java.lang.String[] usernames_) throws InvalidUserException
usernames_
- usernames of users to retrieveInvalidUserException
- if any user with the a given username does not
existServiceException
- if any system-level error occursUser getUserByUuid(@ConvertWith(value=com.appiancorp.kougar.mapper.parameters.UuidParameterConverter.class) java.lang.String uuid) throws InvalidUserException
uuid
- the uuid of a userUser
InvalidUserException
- if a user with the given uuid does not
existServiceException
- if any system-level error occursUser[] getUsersByUuid(@ConvertWith(value=com.appiancorp.kougar.mapper.parameters.UuidParameterConverter[].class[]) java.lang.String[] uuids) throws InvalidUserException
uuids
- uuids of users to retrieveInvalidUserException
- if any user with the a given uuid does not
existServiceException
- if any system-level error occurs@Deprecated User[] findUsers(UserSearch userSearch_, boolean caseSensitive_) throws UnsupportedOperatorException
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, the userSearch_
might have the
username
field set to "john.doe", the lastName
fields set to "Doe", the operatorUsername
field set to
Operator.EQUALS
and the operatorLastName
field
set to Operator.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, use findAllUsersPaging
.
See
GroupTypeService.getOperatorsForDataType(int)
to obtain a list of possible operators for a given data type.
userSearch_
- the search criteriacaseSensitive_
- whether the search is case sensitiveUnsupportedOperatorException
- if userSearch_
contains
an invalid operatorServiceException
- if any system-level error occurs@Deprecated User[] findUsersForGroupType(UserSearch userSearch_, boolean caseSensitive_, java.lang.Long groupTypeId_) throws UnsupportedOperatorException, InvalidGroupTypeException
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.
userSearch_
- the search criteriacaseSensitive_
- whether the search is case sensitivegroupTypeId_
- groupType to find users who are members ofUnsupportedOperatorException
- if userSearch_
contains
an invalid operatorInvalidGroupTypeException
- if the group type does not existServiceException
- if any system-level error occursResultPage findUsersForGroupPaging(UserSearch searchCriteria_, boolean caseSensitive_, java.lang.Long groupId_, int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sortOrder_) throws InvalidGroupException, UnsupportedOperatorException
This method behaves in a similar fashion to
findUsers(UserSearch, boolean)
, except that it only searches for
users in the given group.
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 of
Constants.COUNT_ALL
will
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 the SORT_BY_XXX
constants in
UserProfile
sortOrder_
- Constants.SORT_ORDER_ASCENDING
for sorting results in ascending order,
Constants.SORT_ORDER_DESCENDING
for sorting results in descending orderResultPage
of User
objects.InvalidGroupException
- if the group does not existUnsupportedOperatorException
- if userSearch_
contains
an invalid operatorServiceException
- if any system-level error occursboolean isUserInGroupByRole(java.lang.String username_, java.lang.Long groupId_, java.lang.Integer role_) throws InvalidUserException, InvalidGroupException, UnsupportedRoleException
username_
- the login of the usergroupId_
- the group whose membership is being checkedrole_
- the role being checked. This must be one of the
USER_ROLE_XXX
constants in User
InvalidUserException
- if the user does not existInvalidGroupException
- if the group does not existUnsupportedRoleException
- if the role is invalidServiceException
- if any system-level error occurs@Deprecated UserProfile authenticateUser(java.lang.String username_, java.lang.String password_) throws InvalidLoginException
authenticate(String, byte[])
username_
- the login of the userpassword_
- the password of the userInvalidLoginException
- if no user with the given username and
password existsServiceException
- if any system-level error occursUserProfile authenticate(java.lang.String username, byte[] password) throws InvalidLoginException
changeUserPassword(String, byte[], boolean)
).username
- the username of the user to authenticatepassword
- the user's hashed password; see the interface description
above
.InvalidLoginException
- if the authentication challenge fails with the provided
credentialsvoid changeUserPassword(java.lang.String username, byte[] newPassword, boolean temporary) throws InvalidUserException, PrivilegeException
temporary
flag is passed as true
, the
user will be required to change their password on the next login.username
- the username of the user whose password is being changednewPassword
- the new password, hashed; see interface description
above
for more infotemporary
- a flag to indicate whether this is a temporary password that should be reset
the next time the user logs inInvalidUserException
- 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 passwordboolean doesUserExist(java.lang.String username_)
isUsernameAvailable(String)
instead to determine if a given username is available for use when creating a new
user.username_
- the usernametrue
, if a user with this username exists.ServiceException
- if any system-level error occursboolean isUsernameAvailable(java.lang.String username)
username_
- the usernametrue
, if a new user can be created with this username.UserRank[] getRankList()
ServiceException
- if any system-level error occursUserRank[] getRankListForDisplay()
ServiceException
- if any system-level error occursjava.lang.Long createTitle(UserRank title_) throws PrivilegeException
PrivilegeException
- if the user context is not a system administratorjava.lang.NullPointerException
- if the argument itself is null (title_ is null)void updateTitle(UserRank title_) throws PrivilegeException, InvalidTitleException
InvalidTitleException
- if the passed title (rank) id
does not exist or is nullPrivilegeException
- if the user context is not a system administratorjava.lang.NullPointerException
- if the argument itself is null (title_ is null)Attribute[] getAllUserTypeAttributes()
ServiceException
- if any system-level error occursjava.lang.Boolean[] getUserActions(java.lang.String username_, java.lang.Integer[] actionIds_) throws InvalidUserException, PrivilegeException
getSystemActions(Integer[])
username_
- the username of the useractionIds_
- IDs of actions for which to check the user's permissions.
Each action ID must be one of the ACTION_USER_XXX
constantsactionIds_
, with each
element in the result set to true if the user can perform the associated
actionInvalidUserException
- if the user does not existPrivilegeException
ServiceException
- if any system-level error occursjava.lang.Boolean[] getSystemActions(java.lang.Integer[] actionIds_)
actionIds_
- IDs of system actions. Each action ID must be one of the
ACTION_SYSTEM_XXX
constantsactionIds_
, with each
element in the result set to true if the user can perform the associated
actionServiceException
- if any system-level error occursboolean isSocialSecurityNumberUnique(java.lang.String socialSceurityNumber_)
socialSceurityNumber_
- a social security number, in XXXXXXXXX formattrue
if no current user has this social security
numberServiceException
- if any system-level error occurs@Deprecated boolean isPasswordValid(java.lang.String username_, java.lang.String password_) throws InvalidUserException, PrivilegeException
isUserPasswordValid(String, byte[])
username_
- the login of a userpassword_
- the password of the usertrue
if password is validInvalidUserException
- if the user does not existServiceException
- if any system-level error occursPrivilegeException
boolean isUserPasswordValid(java.lang.String username, byte[] password) throws InvalidUserException, PrivilegeException
above
.username
- the username of the user to checkpassword
- the hashed password to checkInvalidUserException
- if the provided username doesn't map to a user in the system or
the user is deactivatedPrivilegeException
void reactivateUsers(java.lang.String[] userNames_) throws InvalidUserException, PrivilegeException
userNames_
- the logins of users that are inactiveInvalidUserException
- if any of the logins does not correspond to a
valid userPrivilegeException
- if the current user is not an adminServiceException
- if any system-level error occursvoid deactivateUser(java.lang.String userName_) throws InvalidUserException, PrivilegeException
reactivateUsers(String[])
.userName_
- the login of a user to deactivateInvalidUserException
- if the login does not correspond to a valid user
or the Administrator was providedPrivilegeException
- if the current user is not an adminServiceException
- if any system-level error occursvoid deactivateUsers(java.lang.String[] userNames_) throws InvalidUserException, PrivilegeException
reactivateUsers(String[])
.userNames_
- the logins of a users to deactivateInvalidUserException
- 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 adminServiceException
- if any system-level error occursResultPage getDeactivatedUsersPaging(int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sortOrder_)
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 of
Constants.COUNT_ALL
will
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 the SORT_BY_XXX
constants in
UserProfile
sortOrder_
- Constants.SORT_ORDER_ASCENDING
for sorting results in ascending order,
Constants.SORT_ORDER_DESCENDING
for sorting results in descending orderResultPage
containing an array of
User
objects corresponding to inactive usersServiceException
- if any system-level error occursResultPage findUsersPaging(UserSearch userSearch_, boolean caseSensitive_, int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sortOrder_) throws UnsupportedOperatorException
This method will return the paged resultset corresponding to
findUsers(UserSearch, boolean)
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 of
Constants.COUNT_ALL
will
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 the SORT_BY_XXX
constants in
User
sortOrder_
- Constants.SORT_ORDER_ASCENDING
for sorting results in ascending order,
Constants.SORT_ORDER_DESCENDING
for sorting results in descending orderResultPage
containing an array of
User
objects correpsonding to users who
match the search criteriaUnsupportedOperatorException
- if userSearch_
contains
an invalid operatorServiceException
- if any system-level error occursResultPage getUsersForGroupByRolePaging(java.lang.Long groupId_, java.lang.Integer role_, int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sortOrder_) throws InvalidGroupException, UnsupportedRoleException, PrivilegeException
groupId_
- the ID of the grouprole_
- the role. This is one of the
USER_ROLE_XXX
constants in User
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 of
Constants.COUNT_ALL
will
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 the SORT_BY_XXX
constants in
User
sortOrder_
- Constants.SORT_ORDER_ASCENDING
for sorting results in ascending order,
Constants.SORT_ORDER_DESCENDING
for sorting results in descending orderResultPage
containing an array of
User
beans corresponding to users who
match the search criteriaInvalidGroupException
- 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,
if GroupService.getGroupActions(Long, Integer[])
returns
false for the action
GroupService.ACTION_GROUP_VIEW_GROUP_MEMBERS
ServiceException
- if any system-level error occursboolean isCurrentUserDeactivated()
true
if the current user is deactivatedServiceException
- if any system-level error occursjava.lang.String getApplicationName()
ServiceException
- if any system-level error occursjava.lang.String[] getWorkspace()
ServiceException
- if any system-level error occursResultList getUsersList(java.lang.String[] usernames)
The result codes returned in the ResultList
are 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 itUser
array 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.usernames
- the usernames of the users to retrieveResultList
containing the an array of User
objects
and result codes corresponding to the input array.ServiceException
- if any system-level error occursResultPage findAllUsersPaging(boolean caseSensitive_, int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sortOrder_)
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 of
Constants.COUNT_ALL
will
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 the SORT_BY_XXX
constants in
UserProfile
sortOrder_
- Constants.SORT_ORDER_ASCENDING
for sorting results in ascending order,
Constants.SORT_ORDER_DESCENDING
for sorting results in descending orderResultPage
containing an array of
User
objectsServiceException
- if any system-level error occurs@Deprecated void updateUsernames(java.lang.String[] oldUsernames_, java.lang.String[] newUsernames_, long maxExpirationTimeInSeconds_) throws java.lang.IllegalArgumentException, DuplicateNameException
renameUsersByUuid(java.lang.String[], java.lang.String[])
renameUsersByUuid(java.lang.String[], java.lang.String[])
Updates a list of old usernames to new usernames.
If successful, this method must be followed by
commitUpdateUsernames()
. After commitUpdateUsernames
has been called, the old usernames will still be active, but will
expire after the interval specified by
maxExpirationTimeInSeconds_
; if updateUsernames
is successful but commitUpdateUsernames
is 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.
oldUsernames_
- the usernames to be updatednewUsernames_
- the usernames to which the old usernames will be
updatedmaxExpirationTimeInSeconds_
- the interval, in seconds, after
commitUpdateUsernames
has 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.java.lang.IllegalArgumentException
- if the length of
oldUsernames_
is not the same as the length of
newUsernames_
DuplicateNameException
- if any oldUsernames_
or
newUsernames_
contain any duplicates, or if an old
username is being updated to a username that already existsServiceException
- if any system-level error occurs@Deprecated void commitUpdateUsernames()
renameUsersByUuid(java.lang.String[], java.lang.String[])
renameUsersByUuid(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 by maxExpirationTimeInSeconds_
; if
commitUpdateUsernames
is not called, the
new usernames will not become active.
ServiceException
- if any system-level error occurs@Deprecated void rollbackUpdateUsernames()
renameUsersByUuid(java.lang.String[], java.lang.String[])
renameUsersByUuid(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.
ServiceException
- if any system-level error occurs@Deprecated java.lang.String suggestUsers(java.lang.String query_, int maxSuggestions_)
suggest(String, int, SuggestParam[], Boolean)
insteadUser
s whose first, last, or username match or partially
match the query string. The number of suggestions is limited.
Format (for User
s and Group
s:
[[4, 'john.user', John User],[5, 32, 'Finance']]query_
- The search query.maxSuggestions_
- The maximum number of suggestions to return.ResultPage searchUsersPaging(java.lang.String query_, int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sorOrder_)
User
s by first, last, and username.query_
- The query by which to search for User
s.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 Constants.COUNT_ALL
to return the entire collection, but this is STRONGLY discouraged.sortProperty_
- the property by which the results will be sorted.
This is one of the SORT_BY_XXX
constants in
User
.sortOrder_
- the order in which to sort the results.
This is one of
Constants.SORT_ORDER_ASCENDING
or Constants.SORT_ORDER_DESCENDING
ResultPage
of User
objects which match
the search query.@Deprecated Suggestion[][] suggestUsersBulk(java.lang.String[] queries_, int maxSuggestionsPerQuery_)
suggest(String, int, SuggestParam[], Boolean)
insteadUser
s whose first, last, or username matches each
query.queries_
- A list of queries by which to search for User
s.maxSuggestionsPerQuery_
- The maximum number of suggestions to return
for each query.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.@Deprecated void reloadProperties()
ServiceException
- if any system-level error occursjava.lang.String validate()
ServiceException
- if any system-level error occursvoid addUserToFavorites(java.lang.String username_) throws InvalidUserException, PrivilegeException
username_
- The username of the user that is to be added as favoritesInvalidUserException
- if username_ is empty, or the username_ does
not existPrivilegeException
void removeUserFromFavorites(java.lang.String username_) throws InvalidUserException
username_
- The username of the user that is to be removed from favoritesInvalidUserException
- if username_ is empty or the username_ does not
existResultPage getFavoriteUsers(int startIndex_, int batchSize_, java.lang.Integer sortProperty_, java.lang.Integer sortOrder_)
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 Constants.COUNT_ALL
to return the entire collection, but this is STRONGLY discouraged.sortProperty_
- the property by which the results will be sorted.
This is one of the SORT_BY_XXX
constants in
User
.sortOrder_
- the order in which to sort the results.
This is one of
Constants.SORT_ORDER_ASCENDING
or Constants.SORT_ORDER_DESCENDING
ResultPage
of User
objectsjava.lang.String suggest(java.lang.String query, int maxItems, SuggestParam[] params, java.lang.Boolean groupResults)
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.java.lang.String suggest(java.lang.String query, int maxItems, SuggestParam[] params, java.lang.Boolean groupResults, java.lang.Long[] allowList)
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.@Deprecated boolean loginAttempt(boolean valid)
loginAttempt(String, boolean)
instead.valid
- Whether the login attempt is successful or notboolean loginAttempt(java.lang.String username, boolean valid)
username
- The user attempting the loginvalid
- Whether the login attempt is successful or notvoid unlockUser(java.lang.String username) throws InvalidUserException, PrivilegeException
username
- the usernameInvalidUserException
- 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 Administratorboolean isPasswordUnique(java.lang.String username, byte[] password) throws PrivilegeException, InvalidUserException
conf.security.pw.NUMBER_PAST_PASSWORDS_TO_CHECK
in
custom.properties
. This method should be used in conjunction with
changeUserPassword(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 description above
.username
- the user whose password history should be checkedpassword
- the hashed password to check against the historyPrivilegeException
- 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
void setSecurityForUser(java.lang.String username, Security sec) throws PrivilegeException, InvalidUserException, InvalidGroupException
canInherit
, inheritable
and
doesInherit
will be ignoredusername
- the user whose security settings will be setsec
- a Security
object which encapsulates the security
settings for a user. The role map in the Security
object
must be a RoleMap
object.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 invalidSecurity getSecurityForUser(java.lang.String username) throws PrivilegeException
username
- the user whose security settings will be retrievedSecurity
object that contains the security
for the user. The role map in the Security
object is a
RoleMap
object.PrivilegeException
- if the current user does not have sufficient
privileges to perform this operationvoid renameUsersByUuid(@ConvertWith(value=com.appiancorp.kougar.mapper.parameters.UuidParameterConverter[].class[]) java.lang.String[] usernameUuids, java.lang.String[] newUsernames) throws AppianRuntimeException
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 use createUser(User)
)DuplicateNameException
InvalidNameException
PrivilegeException
InvalidUserException
SelfRenameException
AppianRuntimeException
Copyright © 2003-2024 Appian Corporation. All Rights Reserved.