public interface MembershipAPI
OrganizationAPI and gives access to all the Administration operations available on UserMemberships:
creation, deletion, updating, retrieval, etc...UserMembership| Modifier and Type | Method and Description |
|---|---|
UserMembership |
addUserMembership(long userId,
long groupId,
long roleId)
Associates the user with the group and the role.
|
void |
addUserMemberships(List<Long> userIds,
long groupId,
long roleId)
Associates the users with the group and the role.
|
void |
deleteUserMembership(long userMembershipId)
Deletes the user membership.
|
void |
deleteUserMembership(long userId,
long groupId,
long roleId)
Deletes the user membership.
|
void |
deleteUserMemberships(List<Long> userIds,
long groupId,
long roleId)
Deletes the user memberships.
|
long |
getNumberOfUserMemberships(long userId)
Returns the total number of memberships of the user.
|
UserMembership |
getUserMembership(long membershipId)
Retrieves the user membership.
|
List<UserMembership> |
getUserMemberships(long userId,
int startIndex,
int maxResults,
UserMembershipCriterion criterion)
Retrieves the paginated list of user memberships of the user.
|
List<UserMembership> |
getUserMembershipsByGroup(long groupId,
int startIndex,
int maxResults)
Retrieves the paginated list of user memberships of the group.
|
List<UserMembership> |
getUserMembershipsByRole(long roleId,
int startIndex,
int maxResults)
Retrieves the paginated list of user memberships of the role.
|
UserMembership |
updateUserMembership(long userMembershipId,
long newGroupId,
long newRoleId)
Changes the association of the user membership.
|
UserMembership addUserMembership(long userId, long groupId, long roleId) throws AlreadyExistsException, CreationException
userId - the identifier of the usergroupId - the identifier of the grouproleId - the identifier of the roleAlreadyExistsException - If the triplet userId/groupId/roleId is already taken by an existing user membershipCreationException - If an exception occurs during the user membership creationInvalidSessionException - If the session is invalid (expired, unknown, ...)void addUserMemberships(List<Long> userIds, long groupId, long roleId) throws AlreadyExistsException, CreationException
userIds - the identifiers of the usersgroupId - the identifier of the grouproleId - the identifier of the roleAlreadyExistsException - If the triplet userId/groupId/roleId is already taken by an existing user membershipCreationException - If an exception occurs during the user membership creationInvalidSessionException - If the session is invalid (expired, unknown, ...)UserMembership updateUserMembership(long userMembershipId, long newGroupId, long newRoleId) throws MembershipNotFoundException, UpdateException
userMembershipId - the identifier of the user membershipnewGroupId - the identifier of the new groupnewRoleId - the identifier of the new roleMembershipNotFoundException - If the identifier of the user membership does not refer to an existing user membershipUpdateException - If an exception occurs during the user membership updateInvalidSessionException - If the session is invalid (expired, unknown, ...)void deleteUserMembership(long userMembershipId)
throws DeletionException
userMembershipId - the identifier of the user membershipDeletionException - If an exception occurs during the user membership deletionInvalidSessionException - If the session is invalid (expired, unknown, ...)void deleteUserMembership(long userId,
long groupId,
long roleId)
throws DeletionException
userId - the identifier of the usergroupId - the identifier of the grouproleId - the identifier of the roleDeletionException - If an exception occurs during the user membership deletionInvalidSessionException - If the session is invalid (expired, unknown, ...)void deleteUserMemberships(List<Long> userIds, long groupId, long roleId) throws DeletionException
userIds - the identifiers of the usersgroupId - the identifier of the grouproleId - the identifier of the roleDeletionException - If an exception occurs during the user membership deletionInvalidSessionException - If the session is invalid (expired, unknown, ...)UserMembership getUserMembership(long membershipId) throws MembershipNotFoundException
membershipId - the identifier of the user membership to retrieve.UserMembership with the provided idMembershipNotFoundException - If the identifier of the user membership does not refer to an existing user membershipRetrieveException - If an exception occurs during the user membership retrievingInvalidSessionException - If the session is invalid (expired, unknown, ...)long getNumberOfUserMemberships(long userId)
userId - the identifier of the userRetrieveException - If an exception occurs during the count retrievingInvalidSessionException - If the session is invalid (expired, unknown, ...)List<UserMembership> getUserMemberships(long userId, int startIndex, int maxResults, UserMembershipCriterion criterion)
userId - the identifier of the userstartIndex - the start indexmaxResults - the max number of user membershipscriterion - the sorting criterionRetrieveException - If an exception occurs during the count retrievingInvalidSessionException - If the session is invalid (expired, unknown, ...)List<UserMembership> getUserMembershipsByGroup(long groupId, int startIndex, int maxResults)
groupId - the identifier of the groupstartIndex - the start indexmaxResults - the max number of user membershipsRetrieveException - If an exception occurs during the count retrievingInvalidSessionException - If the session is invalid (expired, unknown, ...)List<UserMembership> getUserMembershipsByRole(long roleId, int startIndex, int maxResults)
roleId - the identifier of the rolestartIndex - the start indexmaxResults - the max number of user membershipsRetrieveException - If an exception occurs during the count retrievingInvalidSessionException - If the session is invalid (expired, unknown, ...)Copyright © 2018 Bonitasoft S.A.. All rights reserved.