Package mops.businesslogic.group
Class GroupServiceImpl
- java.lang.Object
-
- mops.businesslogic.group.GroupServiceImpl
-
- All Implemented Interfaces:
GroupService
@Service public class GroupServiceImpl extends java.lang.Object implements GroupService
Access to the group database.
-
-
Constructor Summary
Constructors Constructor Description GroupServiceImpl(GroupRepository groupRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteGroup(long groupId)Delete the given group.java.util.Optional<Group>findGroupByGroupId(java.util.UUID groupId)Get a group by its group uuid.java.util.List<Group>getAllGroups()Fetches all groups.DirectoryPermissionsgetDefaultPermissions(long groupId)Creates the default permissions.GroupgetGroup(long groupId)Get a group by id.java.util.Set<java.lang.String>getRoles(long groupId)Gets all roles that exist in a group.longgetTotalGroupCount()Get the total number of groups.java.util.List<Group>getUserGroups(Account account)Fetches all visible groups of one user.GroupsaveGroup(Group group)Save the given group.
-
-
-
Constructor Detail
-
GroupServiceImpl
public GroupServiceImpl(GroupRepository groupRepository)
-
-
Method Detail
-
getRoles
public java.util.Set<java.lang.String> getRoles(long groupId) throws MopsExceptionGets all roles that exist in a group.- Specified by:
getRolesin interfaceGroupService- Parameters:
groupId- the id of the group- Returns:
- gets all roles of that group
- Throws:
MopsException
-
getAllGroups
public java.util.List<Group> getAllGroups() throws MopsException
Fetches all groups.- Specified by:
getAllGroupsin interfaceGroupService- Returns:
- a list of groups
- Throws:
MopsException
-
getUserGroups
public java.util.List<Group> getUserGroups(Account account) throws MopsException
Fetches all visible groups of one user.- Specified by:
getUserGroupsin interfaceGroupService- Parameters:
account- the account the user- Returns:
- a list of groups
- Throws:
MopsException
-
getDefaultPermissions
public DirectoryPermissions getDefaultPermissions(long groupId)
Creates the default permissions.- Specified by:
getDefaultPermissionsin interfaceGroupService- Parameters:
groupId- group id- Returns:
- default directory permissions
-
getGroup
public Group getGroup(long groupId) throws MopsException
Get a group by id.- Specified by:
getGroupin interfaceGroupService- Parameters:
groupId- group id- Returns:
- group
- Throws:
MopsException
-
findGroupByGroupId
public java.util.Optional<Group> findGroupByGroupId(java.util.UUID groupId) throws MopsException
Get a group by its group uuid.- Specified by:
findGroupByGroupIdin interfaceGroupService- Parameters:
groupId- group uuid- Returns:
- group
- Throws:
MopsException
-
saveGroup
public Group saveGroup(Group group) throws MopsException
Save the given group.- Specified by:
saveGroupin interfaceGroupService- Parameters:
group- group to be saved- Returns:
- saved group
- Throws:
MopsException
-
deleteGroup
public void deleteGroup(long groupId) throws MopsExceptionDelete the given group.- Specified by:
deleteGroupin interfaceGroupService- Parameters:
groupId- id of the group to be deleted- Throws:
MopsException
-
getTotalGroupCount
public long getTotalGroupCount() throws MopsExceptionGet the total number of groups.- Specified by:
getTotalGroupCountin interfaceGroupService- Returns:
- group count
- Throws:
MopsException
-
-