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 void
deleteGroup(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.DirectoryPermissions
getDefaultPermissions(long groupId)
Creates the default permissions.Group
getGroup(long groupId)
Get a group by id.java.util.Set<java.lang.String>
getRoles(long groupId)
Gets all roles that exist in a group.long
getTotalGroupCount()
Get the total number of groups.java.util.List<Group>
getUserGroups(Account account)
Fetches all visible groups of one user.Group
saveGroup(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 MopsException
Gets all roles that exist in a group.- Specified by:
getRoles
in 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:
getAllGroups
in 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:
getUserGroups
in 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:
getDefaultPermissions
in interfaceGroupService
- Parameters:
groupId
- group id- Returns:
- default directory permissions
-
getGroup
public Group getGroup(long groupId) throws MopsException
Get a group by id.- Specified by:
getGroup
in 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:
findGroupByGroupId
in interfaceGroupService
- Parameters:
groupId
- group uuid- Returns:
- group
- Throws:
MopsException
-
saveGroup
public Group saveGroup(Group group) throws MopsException
Save the given group.- Specified by:
saveGroup
in interfaceGroupService
- Parameters:
group
- group to be saved- Returns:
- saved group
- Throws:
MopsException
-
deleteGroup
public void deleteGroup(long groupId) throws MopsException
Delete the given group.- Specified by:
deleteGroup
in interfaceGroupService
- Parameters:
groupId
- id of the group to be deleted- Throws:
MopsException
-
getTotalGroupCount
public long getTotalGroupCount() throws MopsException
Get the total number of groups.- Specified by:
getTotalGroupCount
in interfaceGroupService
- Returns:
- group count
- Throws:
MopsException
-
-