Interface UserGroupService
-
- All Superinterfaces:
CRUDService<java.lang.Long,UserGroup>
- All Known Implementing Classes:
UserGroupServiceImpl
public interface UserGroupService extends CRUDService<java.lang.Long,UserGroup>
Service for working withUserGroup
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UserGroupJoin
addUserToGroup(User user, UserGroup userGroup, UserGroupJoin.UserGroupRole role)
Add a user to the group with the specified role.UserGroupJoin
changeUserGroupRole(User user, UserGroup userGroup, UserGroupJoin.UserGroupRole role)
org.springframework.data.domain.Page<UserGroupJoin>
filterUsersByUsername(java.lang.String username, UserGroup userGroup, int page, int size, org.springframework.data.domain.Sort sort)
Filter the list of users in theUserGroup
by username.java.util.Collection<UserGroupProjectJoin>
getProjectsWithUserGroup(UserGroup userGroup)
Get all of the projects with group.org.springframework.data.domain.Page<UserGroupProjectJoin>
getUserGroupsForProject(java.lang.String searchName, Project project, int page, int size, org.springframework.data.domain.Sort sort)
Get a page ofUserGroupProjectJoin
for a specificProject
.java.util.List<UserGroup>
getUserGroupsNotOnProject(Project project, java.lang.String filter)
java.util.Collection<UserGroupJoin>
getUsersForGroup(UserGroup userGroup)
Get all of the users in the group.java.util.List<User>
getUsersNotInGroup(UserGroup userGroup, java.lang.String filter)
void
removeUserFromGroup(User user, UserGroup userGroup)
-
Methods inherited from interface ca.corefacility.bioinformatics.irida.service.CRUDService
count, create, delete, exists, findAll, findRevisions, findRevisions, list, list, list, read, readMultiple, search, search, update, updateFields, updateMultiple
-
-
-
-
Method Detail
-
getUsersForGroup
java.util.Collection<UserGroupJoin> getUsersForGroup(UserGroup userGroup)
Get all of the users in the group.- Parameters:
userGroup
- the group to get users for.- Returns:
- the users in the group.
-
getProjectsWithUserGroup
java.util.Collection<UserGroupProjectJoin> getProjectsWithUserGroup(UserGroup userGroup)
Get all of the projects with group.- Parameters:
userGroup
- the group to get projects for.- Returns:
- the projects linked to the group.
-
addUserToGroup
UserGroupJoin addUserToGroup(User user, UserGroup userGroup, UserGroupJoin.UserGroupRole role)
Add a user to the group with the specified role.- Parameters:
user
- the user to add to the groupuserGroup
- the group to add the user torole
- the role that the user should have in the group- Returns:
- the relationship created between the user and group.
-
changeUserGroupRole
UserGroupJoin changeUserGroupRole(User user, UserGroup userGroup, UserGroupJoin.UserGroupRole role) throws UserGroupWithoutOwnerException
- Parameters:
user
- the user to changeuserGroup
- the group to changerole
- the new role- Returns:
- the modified relationship
- Throws:
UserGroupWithoutOwnerException
- when the user group doesn't have an owner as a result of the role change.
-
removeUserFromGroup
void removeUserFromGroup(User user, UserGroup userGroup) throws UserGroupWithoutOwnerException
- Parameters:
user
- the user to removeuserGroup
- the group from which to remove the user.- Throws:
UserGroupWithoutOwnerException
- when the user group doesn't have an owner as a result of the removal.
-
filterUsersByUsername
org.springframework.data.domain.Page<UserGroupJoin> filterUsersByUsername(java.lang.String username, UserGroup userGroup, int page, int size, org.springframework.data.domain.Sort sort)
Filter the list of users in theUserGroup
by username.- Parameters:
username
- the username string to filter onuserGroup
- the user group to filter forpage
- the current pagesize
- the size of the pagesort
- the properties to sort on- Returns:
- a page of
UserGroupJoin
.
-
getUsersNotInGroup
java.util.List<User> getUsersNotInGroup(UserGroup userGroup, java.lang.String filter)
- Parameters:
userGroup
- the group to get the set of non-membersfilter
- the search string to filter users by- Returns:
- the list of users not in the group.
-
getUserGroupsForProject
org.springframework.data.domain.Page<UserGroupProjectJoin> getUserGroupsForProject(java.lang.String searchName, Project project, int page, int size, org.springframework.data.domain.Sort sort)
Get a page ofUserGroupProjectJoin
for a specificProject
.- Parameters:
searchName
- the name to search with.project
- the projectpage
- the current pagesize
- the size of the pagesort
- the properties to sort on- Returns:
- a page of
UserGroupProjectJoin
.
-
-