Class GroupServiceImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.security.GroupServiceImpl
- All Implemented Interfaces:
GroupService
-
Constructor Summary
ConstructorsConstructorDescriptionGroupServiceImpl(GroupServiceInternal groupServiceInternal, OrganizationServiceInternal organizationServiceInternal, UserServiceInternal userServiceInternal, GeneralLockService generalLockService, StudioConfiguration studioConfiguration, AuditServiceInternal auditServiceInternal, SiteService siteService) -
Method Summary
Modifier and TypeMethodDescriptionaddGroupMembers(long groupId, List<Long> userIds, List<String> usernames) Add users to the groupcreateGroup(long orgId, String groupName, String groupDescription, boolean externallyManaged) Create groupvoiddeleteGroup(List<Long> groupIds) Delete group(s)getAllGroups(long orgId, String keyword, int offset, int limit, String sort) Get all groupsintgetAllGroupsTotal(long orgId, 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(long orgId, Group group) Update group
-
Constructor Details
-
GroupServiceImpl
@ConstructorProperties({"groupServiceInternal","organizationServiceInternal","userServiceInternal","generalLockService","studioConfiguration","auditServiceInternal","siteService"}) public GroupServiceImpl(GroupServiceInternal groupServiceInternal, OrganizationServiceInternal organizationServiceInternal, UserServiceInternal userServiceInternal, GeneralLockService generalLockService, StudioConfiguration studioConfiguration, AuditServiceInternal auditServiceInternal, SiteService siteService)
-
-
Method Details
-
getAllGroups
public List<Group> getAllGroups(long orgId, String keyword, int offset, int limit, String sort) throws ServiceLayerException, OrganizationNotFoundException Description copied from interface:GroupServiceGet all groups- Specified by:
getAllGroupsin interfaceGroupService- 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
public int getAllGroupsTotal(long orgId, String keyword) throws ServiceLayerException, OrganizationNotFoundException Description copied from interface:GroupServiceGet total number of all groups- Specified by:
getAllGroupsTotalin interfaceGroupService- Parameters:
orgId- Organization identifierkeyword- keyword to filter groups- Returns:
- Number of groups
- Throws:
ServiceLayerException- general service errorOrganizationNotFoundException- organization not found
-
createGroup
public Group createGroup(long orgId, String groupName, String groupDescription, boolean externallyManaged) throws GroupAlreadyExistsException, ServiceLayerException, AuthenticationException Description copied from interface:GroupServiceCreate group- Specified by:
createGroupin interfaceGroupService- 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
public Group updateGroup(long orgId, Group group) throws ServiceLayerException, GroupNotFoundException, AuthenticationException, GroupExternallyManagedException Description copied from interface:GroupServiceUpdate group- Specified by:
updateGroupin interfaceGroupService- 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
public void deleteGroup(List<Long> groupIds) throws ServiceLayerException, GroupNotFoundException, AuthenticationException, GroupExternallyManagedException Description copied from interface:GroupServiceDelete group(s)- Specified by:
deleteGroupin interfaceGroupService- Parameters:
groupIds- Group identifiers- Throws:
ServiceLayerException- general service errorGroupNotFoundException- group not foundAuthenticationException- authentication errorGroupExternallyManagedException- if group is externally managed
-
getGroup
Description copied from interface:GroupServiceGet group- Specified by:
getGroupin interfaceGroupService- Parameters:
groupId- Group identifier- Returns:
- Group
- Throws:
ServiceLayerException- general service errorGroupNotFoundException- group not found
-
getGroupMembers
public List<UserResponse> getGroupMembers(long groupId, int offset, int limit, String sort) throws ServiceLayerException, GroupNotFoundException Description copied from interface:GroupServiceGet group members- Specified by:
getGroupMembersin interfaceGroupService- 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
Description copied from interface:GroupServiceGet total number of group members- Specified by:
getGroupMembersTotalin interfaceGroupService- Parameters:
groupId- Group identifier- Returns:
- Number of members
- Throws:
ServiceLayerException- general service errorGroupNotFoundException- group not found
-
addGroupMembers
public List<UserResponse> addGroupMembers(long groupId, List<Long> userIds, List<String> usernames) throws ServiceLayerException, UserNotFoundException, GroupNotFoundException, AuthenticationException Description copied from interface:GroupServiceAdd users to the group- Specified by:
addGroupMembersin interfaceGroupService- 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
public void removeGroupMembers(long groupId, List<Long> userIds, List<String> usernames) throws ServiceLayerException, UserNotFoundException, GroupNotFoundException, AuthenticationException Description copied from interface:GroupServiceRemove users from the group- Specified by:
removeGroupMembersin interfaceGroupService- Parameters:
groupId- Group identifieruserIds- List of user identifiersusernames- List of usernames- Throws:
ServiceLayerException- general service errorUserNotFoundException- user not foundGroupNotFoundException- group not foundAuthenticationException- authentication error
-