Interface GroupService
-
- All Known Implementing Classes:
GroupServiceImpl
public interface GroupService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<User>
addGroupMembers(long groupId, List<Long> userIds, List<String> usernames)
Add users to the groupGroup
createGroup(long orgId, String groupName, String groupDescription, boolean externallyManaged)
Create groupvoid
deleteGroup(List<Long> groupIds)
Delete group(s)List<Group>
getAllGroups(long orgId, String keyword, int offset, int limit, String sort)
Get all groupsint
getAllGroupsTotal(long orgId, String keyword)
Get total number of all groupsGroup
getGroup(long groupId)
Get groupList<User>
getGroupMembers(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 groupGroup
updateGroup(long orgId, Group group)
Update group
-
-
-
Method Detail
-
getAllGroups
List<Group> getAllGroups(long orgId, String keyword, int offset, int limit, String sort) throws ServiceLayerException, OrganizationNotFoundException
Get all groups- Parameters:
keyword
- keyword to filter groupsorgId
- Organization identifieroffset
- 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:
keyword
- keyword to filter groupsorgId
- Organization identifier- 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
Group getGroup(long groupId) throws ServiceLayerException, GroupNotFoundException
Get group- Parameters:
groupId
- Group identifier- Returns:
- Group
- Throws:
ServiceLayerException
- general service errorGroupNotFoundException
- group not found
-
getGroupMembers
List<User> 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
int getGroupMembersTotal(long groupId) throws ServiceLayerException, GroupNotFoundException
Get total number of group members- Parameters:
groupId
- Group identifier- Returns:
- Number of members
- Throws:
ServiceLayerException
- general service errorGroupNotFoundException
- group not found
-
addGroupMembers
List<User> addGroupMembers(long groupId, List<Long> userIds, List<String> usernames) throws ServiceLayerException, UserNotFoundException, GroupNotFoundException, AuthenticationException
Add users to the group- Parameters:
groupId
- Group identifieruserIds
- List of user identifiersusernames
- List of usernames- 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
-
-