Package mops.businesslogic.group
Interface GroupService
-
- All Known Implementing Classes:
GroupServiceImpl
@Service public interface GroupService
Connects to our group database repository.
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
getRoles
java.util.Set<java.lang.String> getRoles(long groupId) throws MopsException
Gets all roles that exist in a group.- Parameters:
groupId
- the id of the group- Returns:
- gets all roles of that group
- Throws:
MopsException
-
getAllGroups
java.util.List<Group> getAllGroups() throws MopsException
Fetches all groups.- Returns:
- a list of groups
- Throws:
MopsException
-
getUserGroups
java.util.List<Group> getUserGroups(Account account) throws MopsException
Fetches all visible groups of one user.- Parameters:
account
- the account the user- Returns:
- a list of groups
- Throws:
MopsException
-
getDefaultPermissions
DirectoryPermissions getDefaultPermissions(long groupId)
Creates the default permissions.- Parameters:
groupId
- group id- Returns:
- default directory permissions
-
getGroup
Group getGroup(long groupId) throws MopsException
Get a group by id.- Parameters:
groupId
- group id- Returns:
- group
- Throws:
MopsException
-
findGroupByGroupId
java.util.Optional<Group> findGroupByGroupId(java.util.UUID groupId) throws MopsException
Get a group by its group uuid.- Parameters:
groupId
- group uuid- Returns:
- group
- Throws:
MopsException
-
saveGroup
Group saveGroup(Group group) throws MopsException
Save the given group.- Parameters:
group
- group to be saved- Returns:
- saved group
- Throws:
MopsException
-
deleteGroup
void deleteGroup(long groupId) throws MopsException
Delete the given group.- Parameters:
groupId
- id of the group to be deleted- Throws:
MopsException
-
getTotalGroupCount
long getTotalGroupCount() throws MopsException
Get the total number of groups.- Returns:
- group count
- Throws:
MopsException
-
-