Interface MembershipService
public interface MembershipService
Represents a component which manages memberships for groups as per available permission
- Since:
- 3.3.0
-
Method Summary
Modifier and TypeMethodDescriptionaddUsersToGroup(long directoryId, List<String> usernames, String groupName) Adds multiple users to single supplied groupaddUserToGroups(long directoryId, String username, List<String> groupNames) Adds single supplied user to multiple groupsgetDirectUsersFromGroup(long directoryId, String groupName, int startIndex, int maxResults) Returns direct members of a group (excluding nested members)getGroupDetails(long directoryId, String groupName) Returns details of specific groupremoveUserFromGroups(long directoryId, String username, List<String> groupNames) Removes single supplied user from multiple groupsremoveUsersFromGroup(long directoryId, List<String> usernames, String groupName) Removes multiple users from the supplied group
-
Method Details
-
addUsersToGroup
BatchResult<BatchResultEntityWithCause> addUsersToGroup(long directoryId, List<String> usernames, String groupName) throws GroupNotFoundException, DirectoryNotFoundException, DirectoryPermissionException, OperationFailedException, FeatureInaccessibleException Adds multiple users to single supplied group- Parameters:
directoryId- ID of the directory, where supplied users and group are placedusernames- List of usernames to add to groupgroupName- Name of the target group- Returns:
- Failures occurred while adding. Does not count users, which are already assigned to the group
- Throws:
GroupNotFoundException- if the group cannot be foundDirectoryNotFoundException- if the directory cannot be found * @throws DirectoryPermissionException ifDirectoryPermissionException- if the directory is not allowed to perform operations of typeOperationType.UPDATE_GROUP.OperationFailedException- if underlying directory implementation failed to execute the operation.FeatureInaccessibleException- If the feature is not available under the current license
-
addUserToGroups
BatchResult<BatchResultEntityWithCause> addUserToGroups(long directoryId, String username, List<String> groupNames) throws UserNotFoundException, DirectoryNotFoundException, OperationFailedException, FeatureInaccessibleException Adds single supplied user to multiple groups- Parameters:
directoryId- ID of the directory, where supplied user and groups are placedusername- Name of the user to addgroupNames- List of target group names- Returns:
- Failures occurred while adding. Does not count users, which are already assigned to the group
- Throws:
UserNotFoundException- if the user cannot be foundDirectoryNotFoundException- if the directory cannot be foundOperationFailedException- if underlying directory implementation failed to execute the operation.FeatureInaccessibleException- If the feature is not available under the current license
-
removeUsersFromGroup
BatchResult<BatchResultEntityWithCause> removeUsersFromGroup(long directoryId, List<String> usernames, String groupName) throws GroupNotFoundException, DirectoryNotFoundException, OperationFailedException, FeatureInaccessibleException Removes multiple users from the supplied group- Parameters:
directoryId- ID of the directory, where the supplied users and group are placedusernames- List of usernames to remove from groupgroupName- Name of the target group- Returns:
- Failures occurred while removing users from the group. Does not count users, which are not assigned to the group
- Throws:
GroupNotFoundException- if the group cannot be foundDirectoryNotFoundException- if the directory cannot be foundOperationFailedException- if underlying directory implementation failed to execute the operation.\FeatureInaccessibleException- If the feature is not available under the current license
-
removeUserFromGroups
BatchResult<BatchResultEntityWithCause> removeUserFromGroups(long directoryId, String username, List<String> groupNames) throws UserNotFoundException, DirectoryNotFoundException, OperationFailedException, FeatureInaccessibleException Removes single supplied user from multiple groups- Parameters:
directoryId- ID of directory, where supplied user and groups are placedusername- Name of the user to remove from the groupgroupNames- List of the target group names- Returns:
- Failures occurred while removing user from groups. Does not count groups, which are not associated with user
- Throws:
UserNotFoundException- if the user cannot be foundDirectoryNotFoundException- if the directory cannot be foundOperationFailedException- if underlying directory implementation failed to execute the operation.FeatureInaccessibleException- If the feature is not available under the current license
-
getGroupDetails
DirectoryGroup getGroupDetails(long directoryId, String groupName) throws DirectoryNotFoundException, GroupNotFoundException, OperationFailedException, FeatureInaccessibleException Returns details of specific group- Parameters:
directoryId- ID of directory, where group is placedgroupName- Name of group to look for- Throws:
DirectoryNotFoundException- if the directory cannot be foundGroupNotFoundException- if the group cannot be foundOperationFailedException- if underlying directory implementation failed to execute the operation.FeatureInaccessibleException- If the feature is not available under the current license
-
getDirectUsersFromGroup
Collection<User> getDirectUsersFromGroup(long directoryId, String groupName, int startIndex, int maxResults) throws DirectoryNotFoundException, OperationFailedException, GroupNotFoundException, FeatureInaccessibleException Returns direct members of a group (excluding nested members)- Parameters:
directoryId- ID of directory, where group is placedgroupName- The group name to look for usersstartIndex- Starting index of the resultsmaxResults- Maximum number of results returned- Throws:
DirectoryNotFoundException- if the directory cannot be foundOperationFailedException- if underlying directory implementation failed to execute the operation.GroupNotFoundException- if the group cannot be foundFeatureInaccessibleException- If the feature is not available under the current license
-