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
(long orgId, String groupName, String groupDescription, boolean externallyManaged) Create groupvoid
deleteGroup
(List<Long> groupIds) Delete group(s)getAllGroups
(long orgId, String keyword, int offset, int limit, String sort) Get all groupsint
getAllGroupsTotal
(long orgId, String keyword) Get total number of all groupsgetGroup
(long groupId) Get groupgetGroupMembers
(long groupId, int offset, int limit, String sort) Get group membersint
getGroupMembersTotal
(long groupId) Get total number of group membersvoid
removeGroupMembers
(long groupId, List<Long> userIds, List<String> usernames) Remove users from the groupupdateGroup
(long orgId, Group group) Update group
-
Method Details
-
getAllGroups
List<Group> getAllGroups(long orgId, String keyword, int offset, int limit, String sort) throws ServiceLayerException, OrganizationNotFoundException Get all groups- Parameters:
orgId
- Organization identifierkeyword
- keyword to filter groupsoffset
- Result set offsetlimit
- Result set limitsort
- Sort order- Returns:
- List of groups
- Throws:
ServiceLayerException
- general service errorOrganizationNotFoundException
- organization not found
-
getAllGroupsTotal
int getAllGroupsTotal(long orgId, String keyword) throws ServiceLayerException, OrganizationNotFoundException Get total number of all groups- Parameters:
orgId
- Organization identifierkeyword
- keyword to filter groups- Returns:
- Number of groups
- Throws:
ServiceLayerException
- general service errorOrganizationNotFoundException
- organization not found
-
createGroup
Group createGroup(long orgId, String groupName, String groupDescription, boolean externallyManaged) throws GroupAlreadyExistsException, ServiceLayerException, AuthenticationException Create group- Parameters:
orgId
- Organization identifiergroupName
- 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(long orgId, Group group) throws ServiceLayerException, GroupNotFoundException, AuthenticationException, GroupExternallyManagedException Update group- Parameters:
orgId
- Organization identifiergroup
- 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
-