public interface UserAPI
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.
|
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<User> |
getUsers(int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of users.
|
Map<Long,User> |
getUsers(List<Long> userIds)
Retrieves the users.
|
List<User> |
getUsersInGroup(long groupId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of groups.
|
List<User> |
getUsersInRole(long roleId,
int startIndex,
int maxResults,
UserCriterion criterion)
Retrieves the paginated list of roles.
|
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
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
userId
- the identifier of the userDeletionException
- If an exception occurs during the user deletionInvalidSessionException
- If the session is invalid (expired, unknown, ...)void deleteUser(String userName) throws DeletionException
userName
- the name of the userDeletionException
- If an exception occurs during the user deletionInvalidSessionException
- If the session is invalid (expired, unknown, ...)void deleteUsers(List<Long> userIds) throws DeletionException
userIds
- the identifiers of the usersDeletionException
- If an exception occurs during the user deletionInvalidSessionException
- If the session is invalid (expired, unknown, ...)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, ...)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, ...)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 rolescriterion
- the sorting criterionRetrieveException
- If an exception occurs during the role retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)long getNumberOfUsersInGroup(long groupId) throws BonitaException
groupId
- the identifier of the groupRetrieveException
- If an exception occurs during the count retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)BonitaException
List<User> getUsersInGroup(long groupId, int startIndex, int maxResults, UserCriterion criterion)
groupId
- the identifier of the groupstartIndex
- the start indexmaxResults
- the max number of groupscriterion
- the sorting criterionRetrieveException
- If an exception occurs during the group retrievingInvalidSessionException
- If the session is invalid (expired, unknown, ...)Copyright © 2013 BonitaSoft. All Rights Reserved.