Interface GroupService
- All Known Implementing Classes:
GroupServiceImpl
public interface GroupService
-
Method Summary
Modifier and TypeMethodDescriptionaddGroupMembers(long groupId, List<Long> userIds, List<String> usernames, boolean externallyManaged) Add users to the groupcreateGroup(String groupName, String groupDescription, boolean externallyManaged) Create groupvoiddeleteGroup(List<Long> groupIds) Delete group(s)getAllGroups(String keyword, int offset, int limit, String sort) Get all groupsintgetAllGroupsTotal(String keyword) Get total number of all groupsgetGroup(long groupId) Get groupgetGroupMembers(long groupId, int offset, int limit, String sort) Get group membersintgetGroupMembersTotal(long groupId) Get total number of group membersvoidremoveGroupMembers(long groupId, List<Long> userIds, List<String> usernames) Remove users from the groupupdateGroup(Group group) Update group
-
Method Details
-
getAllGroups
List<Group> getAllGroups(String keyword, int offset, int limit, String sort) throws ServiceLayerException Get all groups- Parameters:
keyword- keyword to filter groupsoffset- Result set offsetlimit- Result set limitsort- Sort order- Returns:
- List of groups
- Throws:
ServiceLayerException- general service error
-
getAllGroupsTotal
Get total number of all groups- Parameters:
keyword- keyword to filter groups- Returns:
- Number of groups
- Throws:
ServiceLayerException- general service error
-
createGroup
Group createGroup(String groupName, String groupDescription, boolean externallyManaged) throws GroupAlreadyExistsException, ServiceLayerException, AuthenticationException Create group- Parameters:
groupName- Group namegroupDescription- Group descriptionexternallyManaged- true if group is externally managed, false otherwise- Returns:
- the created group
- Throws:
GroupAlreadyExistsException- group already exist errorServiceLayerException- general service errorAuthenticationException- authentication error
-
updateGroup
Group updateGroup(Group group) throws ServiceLayerException, GroupNotFoundException, AuthenticationException, GroupExternallyManagedException Update group- Parameters:
group- Group to update- Returns:
- the updated group
- Throws:
ServiceLayerException- general service errorGroupNotFoundException- group not found errorAuthenticationException- authentication errorGroupExternallyManagedException- if group is externally managed
-
deleteGroup
void deleteGroup(List<Long> groupIds) throws ServiceLayerException, GroupNotFoundException, AuthenticationException, GroupExternallyManagedException Delete group(s)- Parameters:
groupIds- Group identifiers- Throws:
ServiceLayerException- general service errorGroupNotFoundException- group not foundAuthenticationException- authentication errorGroupExternallyManagedException- if group is externally managed
-
getGroup
Get group- Parameters:
groupId- Group identifier- Returns:
- Group
- Throws:
ServiceLayerException- general service errorGroupNotFoundException- group not found
-
getGroupMembers
List<UserResponse> getGroupMembers(long groupId, int offset, int limit, String sort) throws ServiceLayerException, GroupNotFoundException Get group members- Parameters:
groupId- Group identifieroffset- Result set offsetlimit- Result set limitsort- Sort order- Returns:
- List of users
- Throws:
ServiceLayerException- general service errorGroupNotFoundException- group not found
-
getGroupMembersTotal
Get total number of group members- Parameters:
groupId- Group identifier- Returns:
- Number of members
- Throws:
ServiceLayerException- general service errorGroupNotFoundException- group not found
-
addGroupMembers
List<UserResponse> addGroupMembers(long groupId, List<Long> userIds, List<String> usernames, boolean externallyManaged) throws ServiceLayerException, UserNotFoundException, GroupNotFoundException, AuthenticationException Add users to the group- Parameters:
groupId- Group identifieruserIds- List of user identifiersusernames- List of usernamesexternallyManaged- true if group is externally managed, false otherwise- Returns:
- users added to the group
- Throws:
ServiceLayerException- general service errorUserNotFoundException- user not foundGroupNotFoundException- group not foundAuthenticationException- authentication error
-
removeGroupMembers
void removeGroupMembers(long groupId, List<Long> userIds, List<String> usernames) throws ServiceLayerException, UserNotFoundException, GroupNotFoundException, AuthenticationException Remove users from the group- Parameters:
groupId- Group identifieruserIds- List of user identifiersusernames- List of usernames- Throws:
ServiceLayerException- general service errorUserNotFoundException- user not foundGroupNotFoundException- group not foundAuthenticationException- authentication error
-