public interface UserAPI
OrganizationAPI
and gives access to all the Administration operations available on Users: creation, deletion, certain
specific getXXX() methods, generic search methods, etc...
It also to retrieve user ContactData.ContactData
,
SearchResult for general knowledege on Search mechanism in Bonita.
Modifier and Type | Method and Description |
---|---|
User |
createUser(String userName,
String password)
Creates a user.
|
User |
createUser(String userName,
String password,
String firstName,
String lastName)
Creates a user.
|
User |
createUser(UserCreator creator)
Creates a user.
|
void |
deleteUser(long userId)
Deletes the user.
|
void |
deleteUser(String userName)
Deletes the user.
|
void |
deleteUsers(List<Long> userIds)
Deletes the users.
|
List<User> |
getActiveUsersInGroup(long groupId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of active users in groups.
|
List<User> |
getActiveUsersInRole(long roleId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of active users in role.
|
List<User> |
getActiveUsersWithManager(long managerId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of active users of a manager.
|
Icon |
getIcon(long id)
get the icon having specified id
|
List<User> |
getInactiveUsersInGroup(long groupId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of inactive users in groups.
|
List<User> |
getInactiveUsersInRole(long roleId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of inactive users in role.
|
List<User> |
getInactiveUsersWithManager(long managerId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of inactive users of a manager.
|
long |
getNumberOfUsers()
Returns the total number of users.
|
long |
getNumberOfUsersInGroup(long groupId)
Returns the total number of users of the group.
|
long |
getNumberOfUsersInRole(long roleId)
Returns the total number of users of the role.
|
User |
getUser(long userId)
Retrieves the user.
|
User |
getUserByUserName(String userName)
Retrieves the user.
|
ContactData |
getUserContactData(long userId,
boolean personal)
Retrieves the contact data (personal or professional) of the user.
|
List<Long> |
getUserIdsWithCustomUserInfo(String infoName,
String infoValue,
boolean usePartialMatch,
int startIndex,
int maxResults)
Retrieves the list of user identifiers containing the chosen custom user information with the given value.
|
List<User> |
getUsers(int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of users.
|
Map<Long,User> |
getUsers(List<Long> userIds)
Retrieves the users.
|
Map<String,User> |
getUsersByUsernames(List<String> userNames)
Retrieves the identifiers of the named users.
|
List<User> |
getUsersInGroup(long groupId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of users, both active and inactive, in a given group.
|
List<User> |
getUsersInRole(long roleId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of users, regardless if they are active or not, in a given role.
|
List<User> |
getUsersWithManager(long managerId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of users of a manager.
|
UserWithContactData |
getUserWithProfessionalDetails(long userId)
Retrieves the professional details of the user.
|
SearchResult<User> |
searchUsers(SearchOptions options)
Searches users according to the criteria containing in the options.
|
User |
updateUser(long userId,
UserUpdater updater)
Updates the user according to the updater values.
|
User createUser(String userName, String password) throws AlreadyExistsException, CreationException
userName
- The name of the userpassword
- The password of the userAlreadyExistsException
- If the name is already taken by an existing userCreationException
- If an exception occurs during the user creationInvalidSessionException
- If the session is invalid (expired, unknown, ...)User createUser(String userName, String password, String firstName, String lastName) throws AlreadyExistsException, CreationException
userName
- The name of the userpassword
- The password of the userfirstName
- The first name of the userlastName
- The last name of the userAlreadyExistsException
- If the name is already taken by an existing userCreationException
- If an exception occurs during the user creationInvalidSessionException
- If the session is invalid (expired, unknown, ...)User createUser(UserCreator creator) throws AlreadyExistsException, CreationException
creator
- The user to createAlreadyExistsException
- If the name is already taken by an existing userCreationException
- If an exception occurs during the user creationInvalidSessionException
- If the session is invalid (expired, unknown, ...)User updateUser(long userId, UserUpdater updater) throws UserNotFoundException, UpdateException
This method also allow to update the icon of the user.
When you update it, the iconId will be set on the user and you can later get it using getIcon(long)
.
Changing the content of the icon will create a new icon and change the iconId of the user.
userId
- The identifier of the userupdater
- The user updaterUserNotFoundException
- If the user identifier does not refer to an existing userUpdateException
- If an exception occurs during the user updateInvalidSessionException
- If the session is invalid (expired, unknown, ...)void deleteUser(long userId) throws DeletionException
Use this method with caution: some artifacts like Application
s and DesignProcessDefinition
s may present display problems in the Bonita
BPM Portal if the referenced user was deleted. Note that you can disable a user instead of deleting it. To do so, use the method
updateUser(long, UserUpdater)
to set the attribute 'enabled' to false
userId
- The identifier of the userDeletionException
- If an exception occurs during the user deletionInvalidSessionException
- If the session is invalid (expired, unknown, ...)updateUser(long, UserUpdater)
,
Application
,
DesignProcessDefinition
void deleteUser(String userName) throws DeletionException
Use this method with caution: some artifacts like Application
s and DesignProcessDefinition
s may present display problems in the Bonita
BPM Portal if the referenced user was deleted. Note that you can disable a user instead of deleting it. To do so, use the method
updateUser(long, UserUpdater)
to set the attribute 'enabled' to false
userName
- The name of the userDeletionException
- If an exception occurs during the user deletionInvalidSessionException
- If the session is invalid (expired, unknown, ...)updateUser(long, UserUpdater)
,
Application
,
DesignProcessDefinition
void deleteUsers(List<Long> userIds) throws DeletionException
Use this method with caution: some artifacts like Application
s and DesignProcessDefinition
s may present display problems in the Bonita
BPM Portal if the referenced user was deleted. Note that you can disable a user instead of deleting it. To do so, use the method
updateUser(long, UserUpdater)
to set the attribute 'enabled' to false
userIds
- The identifiers of the usersDeletionException
- If an exception occurs during the user deletionInvalidSessionException
- If the session is invalid (expired, unknown, ...)updateUser(long, UserUpdater)
,
Application
,
DesignProcessDefinition
User getUser(long userId) throws UserNotFoundException
UserNotFoundException
if the user identifier equals the technical user identifier (-1).userId
- The identifier of the userUserNotFoundException
- If the user identifier does not refer to an existing userRetrieveException
- If an exception occurs during the user retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)User getUserByUserName(String userName) throws UserNotFoundException
userName
- The name of the userUserNotFoundException
- If the user name does not refer to an existing userRetrieveException
- If an exception occurs during the role retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)UserWithContactData getUserWithProfessionalDetails(long userId) throws UserNotFoundException
userId
- The identifier of the userUserNotFoundException
- If the user identifier does not refer to an existing user, or is -1 (the technical user identifier)RetrieveException
- If an exception occurs while retrieving the userInvalidSessionException
- If the session is invalid (expired, unknown, ...)ContactData getUserContactData(long userId, boolean personal) throws UserNotFoundException
userId
- The identifier of the userpersonal
- true if the contact data is the personal oneUserNotFoundException
- If the user name does not refer to an existing userRetrieveException
- If an exception occurs during the role retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)long getNumberOfUsers()
RetrieveException
- If an exception occurs during the count retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<User> getUsers(int startIndex, int maxResults, UserCriterion criterion)
startIndex
- The start indexmaxResults
- The max number of userscriterion
- The sorting criterionRetrieveException
- If an exception occurs during the user retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)Map<Long,User> getUsers(List<Long> userIds)
userIds
- The identifiers of the usersRetrieveException
- If an exception occurs during the user retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)Map<String,User> getUsersByUsernames(List<String> userNames)
userNames
- The names of the usersRetrieveException
- If an exception occurs during the user retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)SearchResult<User> searchUsers(SearchOptions options) throws SearchException
options
- The search criteriaSearchException
- If an exception occurs during the user searchingInvalidSessionException
- If the session is invalid (expired, unknown, ...)long getNumberOfUsersInRole(long roleId)
roleId
- The identifier of the roleRetrieveException
- If an exception occurs during the count retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<User> getUsersInRole(long roleId, int startIndex, int maxResults, UserCriterion criterion)
roleId
- The identifier of the rolestartIndex
- The start indexmaxResults
- The max number of userscriterion
- The sorting criterionRetrieveException
- If an exception occurs during the retrieving of usersInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<User> getActiveUsersInRole(long roleId, int startIndex, int maxResults, UserCriterion criterion)
roleId
- The identifier of the rolestartIndex
- The start indexmaxResults
- The max number of userscriterion
- The sorting criterionRetrieveException
- If an exception occurs during the retrieving of usersInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<User> getInactiveUsersInRole(long roleId, int startIndex, int maxResults, UserCriterion criterion)
roleId
- The identifier of the rolestartIndex
- The start indexmaxResults
- The max number of userscriterion
- The sorting criterionRetrieveException
- If an exception occurs during the retrieving of usersInvalidSessionException
- If the session is invalid (expired, unknown, ...)long getNumberOfUsersInGroup(long groupId) throws BonitaException
groupId
- The identifier of the groupBonitaException
RetrieveException
- If an exception occurs during the count retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<User> getUsersInGroup(long groupId, int startIndex, int maxResults, UserCriterion criterion)
groupId
- The identifier of the groupstartIndex
- The start indexmaxResults
- The max number of userscriterion
- The sorting criterionRetrieveException
- If an exception occurs during the retrieving of usersInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<User> getActiveUsersInGroup(long groupId, int startIndex, int maxResults, UserCriterion criterion)
groupId
- The identifier of the groupstartIndex
- The start indexmaxResults
- The max number of userscriterion
- The sorting criterionRetrieveException
- If an exception occurs during the retrieving of usersInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<User> getInactiveUsersInGroup(long groupId, int startIndex, int maxResults, UserCriterion criterion)
groupId
- The identifier of the groupstartIndex
- The start indexmaxResults
- The max number of userscriterion
- The sorting criterionRetrieveException
- If an exception occurs during the retrieving of usersInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<User> getUsersWithManager(long managerId, int startIndex, int maxResults, UserCriterion criterion)
managerId
- The identifier of the managerstartIndex
- The start indexmaxResults
- The max number of userscriterion
- The sorting criterionRetrieveException
- If an exception occurs during the retrieving of usersInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<User> getActiveUsersWithManager(long managerId, int startIndex, int maxResults, UserCriterion criterion)
managerId
- The identifier of the managerstartIndex
- The start indexmaxResults
- The max number of userscriterion
- The sorting criterionRetrieveException
- If an exception occurs during the retrieving of usersInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<User> getInactiveUsersWithManager(long managerId, int startIndex, int maxResults, UserCriterion criterion)
managerId
- The identifier of the managerstartIndex
- The start indexmaxResults
- The max number of userscriterion
- The sorting criterionRetrieveException
- If an exception occurs during the retrieving of usersInvalidSessionException
- If the session is invalid (expired, unknown, ...)List<Long> getUserIdsWithCustomUserInfo(String infoName, String infoValue, boolean usePartialMatch, int startIndex, int maxResults)
infoName
- The custom user information nameinfoValue
- The custom user information valueusePartialMatch
- Defines whether the custom user information value should use a partial match.startIndex
- The start index (the first valid value is zero)maxResults
- The max number of user identifiers to be retrievedIcon getIcon(long id) throws NotFoundException
id
- the id of the iconNotFoundException
Copyright © 2018 Bonitasoft S.A.. All rights reserved.