Interface GroupsManagerImplApi
- All Known Implementing Classes:
GroupsManagerImpl
- Author:
- Michal Prochazka, Slavek Licehammer
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addGroupToAutoRegistration
(PerunSession sess, Group group) Adds group to the list of groups which can be registered into during vo registration.void
addGroupToAutoRegistration
(PerunSession sess, Group group, ApplicationFormItem formItem) Adds group from list of groups which can be registered into during vo or group registration and are representing options of the specified application form item.addMember
(PerunSession perunSession, Group group, Member member, MembershipType type, boolean dualMember, int sourceGroupId) Adds member of the VO to the group in the same VO.void
allowGroupToHierarchicalVo
(PerunSession sess, Group group, Vo vo) Sets flag required for including group to parent vo in a vo hierarchy.void
checkGroupExists
(PerunSession perunSession, Group group) Check if group exists in underlaying data source.createGroup
(PerunSession perunSession, Vo vo, Group group) Creates a new top-level group and associates it with the VO from parameter.createGroup
(PerunSession perunSession, Vo vo, Group parentGroup, Group group) Creates a new subgroup of the existing group.void
deleteGroup
(PerunSession perunSession, Vo vo, Group group) Deletes group.void
deleteGroupFromAutoRegistration
(PerunSession sess, Group group) Deletes group from list of groups which can be registered into during vo registration.void
deleteGroupFromAutoRegistration
(PerunSession sess, Group group, ApplicationFormItem applicationFormItem) Deletes group from list of groups which can be registered into during vo or group registration and are representing options of the specified application form item.void
disallowGroupToHierarchicalVo
(PerunSession sess, Group group, Vo vo) Unsets flag required for including group to parent vo in a vo hierarchygetAdmins
(PerunSession perunSession, Group group) Gets list of all administrators of this group.Returns all groups which can be included to VO.getAllAllowedGroupsToHierarchicalVo
(PerunSession sess, Vo vo, Vo memberVo) Returns groups which can be included to VO from specific member VO.getAllGroups
(PerunSession sess) Get all groups from all vos.getAllGroups
(PerunSession perunSession, Vo vo) Get all groups of the VO.Returns all groups which can be registered into during any vo registration.getAllGroupsWhereMemberIsActive
(PerunSession sess, Member member) Returns all member's groups where member is in active state (is valid there) Included members group.getAllMemberGroups
(PerunSession sess, Member member) Return all members groups.getAssignedGroupsToFacility
(PerunSession perunSession, Facility facility) Return list of assigned groups from all facility resourcesgetAssignedGroupsToResource
(PerunSession perunSession, Resource resource) Return list of assigned groups on the resource.getAssignedGroupsToResource
(PerunSession perunSession, Resource resource, Member member) Return list of assigned groups on the resource with specified member.getAssociatedGroupsToFacility
(PerunSession perunSession, Facility facility) Return list of all associated groups from all facility resources (does not require ACTIVE group-resource status)getAssociatedGroupsToResource
(PerunSession perunSession, Resource resource) Return list of assigned groups on the resource.getAssociatedGroupsToResource
(PerunSession perunSession, Resource resource, Member member) Return list of groups associated with the resource with specified member.getDirectAdmins
(PerunSession perunSession, Group group) Gets list of direct user administrators of this group.getDirectMemberGroupStatus
(PerunSession session, Member member, Group group) Returns direct members status in given group.getFacilitiesWhereGroupIsAdmin
(PerunSession session, Group group) Returns all facilities where given group is FACILITYADMIN.getGroupAdmins
(PerunSession perunSession, Group group) Gets list of all group administrators of this group.getGroupApplicationIds
(PerunSession sess, Group group) Return list of IDs of all applications, which belongs to Group.getGroupById
(PerunSession perunSession, int id) Search for the group with specified id in all VOs.getGroupByName
(PerunSession perunSession, Vo vo, String name) Search for the group with specified name in specified VOgetGroupMembers
(PerunSession sess, Group group) Get all group members ignoring theirs status.getGroupMembers
(PerunSession sess, Group group, List<Status> statuses, boolean excludeStatusInsteadOfIncludeStatus) Return group members.getGroupMembersById
(PerunSession sess, Group group, int memberId) Get group members by member ID -> meaning we will get all (DIRECT/INDIRECT) group memberships for specified member (or user, since it will be the same).getGroupMembersByMembership
(PerunSession sess, Group group, MembershipType membershipType) Get only group members which has given membership type ignoring their status.getGroupResourcePairsByAttribute
(PerunSession sess, Attribute attribute) Returns all group-resource which have set the attribute with the value.getGroups
(PerunSession perunSession, Vo vo) Get all groups of users under the VO.getGroupsByAttribute
(PerunSession sess, Attribute attribute) Returns all groups which have set the attribute with the value.getGroupsByIds
(PerunSession perunSession, List<Integer> ids) Gets groups by their ids.int
getGroupsCount
(PerunSession perunSession) Get count of all groups.int
getGroupsCount
(PerunSession perunSession, Vo vo) getGroupsForAutoRegistration
(PerunSession sess, Group group, ApplicationFormItem formItem) Returns all groups which can be registered into during group registration and are representing options of the specified application form item.getGroupsForAutoRegistration
(PerunSession sess, Vo vo) Returns all groups which can be registered into during vo registration and are representing options of the specified application form item.getGroupsForAutoRegistration
(PerunSession sess, Vo vo, ApplicationFormItem formItem) Returns all groups which can be registered into during vo registration and are representing options of the specified application form item.getGroupsIds
(PerunSession sess, Vo vo) Get all groups ids for given vo.getGroupsPage
(PerunSession sess, Vo vo, GroupsPageQuery query) Get page of groups from the given vo.Gets all groups which have enabled group structure synchronization.Gets all groups which have enabled synchronization.getGroupsWhereGroupIsAdmin
(PerunSession session, Group group) Returns all groups where given group is GROUPADMIN.getGroupsWhereUserIsActiveMember
(PerunSession sess, User user, Vo vo) Returns groups in which the user is active member.getGroupsWithAssignedExtSourceInVo
(PerunSession sess, ExtSource source, Vo vo) Get all groups in specific vo with assigned extSourcegetGroupUsers
(PerunSession sess, Group group) Return group users sorted by name.getOperandGroups
(PerunSession sess, int groupId) Return all operand groups of requested result group.Get parent form for auto registration group where this group is involved in auto registration processgetParentGroup
(PerunSession sess, Group group) Get parent group.getResultGroups
(PerunSession sess, int groupId) Return all result groups of requested operand group.getResultGroupsIds
(PerunSession sess, int groupId) Return list of all result groups ids of requested operand group.getServiceGroupMembers
(PerunSession sess, Group group) Gets a list of Members, who are also service users, from a given group.getSubGroups
(PerunSession perunSession, Group parentGroup) Get all immediate subgroups of the parent group under the VO.int
getSubGroupsCount
(PerunSession perunSession, Group parentGroup) Returns number of immediate subgroups of the parent group.getSubgroupsPage
(PerunSession sess, Group group, GroupsPageQuery query) Get page of subgroups from the given parent group.getTotalGroupStatusForMembers
(PerunSession session, Group group, List<Member> members) Returns total member's status of given members in given group.getTotalMemberGroupStatus
(PerunSession session, Member member, Group group) Returns total member's status in given group.getUserGroups
(PerunSession sess, User user) Return groups where user is member.getUserGroups
(PerunSession sess, User user, List<Status> memberStatuses, List<MemberGroupStatus> memberGroupStatuses) Return groups where user is member with allowed statuses in vo and group.int
getVoId
(PerunSession perunSession, Group group) Get the id of the VO which is owner of the group.getVosWhereGroupIsAdmin
(PerunSession session, Group group) Returns all vos where given group si VOADMIN.boolean
groupExists
(PerunSession perunSession, Group group) Check if group exists in underlaying data source.boolean
hasGroupAnyManagerRole
(PerunSession session, Group group) Checks if the given group has any related manager rolesboolean
isAllowedGroupToHierarchicalVo
(PerunSession sess, Group group, Vo vo) Returns flag representing if the group can be included in the (parent) vo's groupsboolean
isDirectGroupMember
(PerunSession sess, Group group, Member member) Return true if Member is direct member of the Groupboolean
isGroupForAnyAutoRegistration
(PerunSession sess, Group group) Check if group has automatic registration enabled in any form item.boolean
isGroupForAutoRegistration
(PerunSession sess, Group group, List<Integer> formItems) Check if group has automatic registration enabled in the given form item.isGroupLastAdminInSomeFacility
(PerunSession sess, Group group) Check whether the group supplies the last FACILITYADMIN in some facility, return those facilities in which it does.isGroupLastAdminInSomeVo
(PerunSession sess, Group group) Check whether the group supplies the last VOADMIN in some vo, return those vos in which it does.boolean
isGroupMember
(PerunSession sess, Group group, Member member) Return true if Member is member of the Groupboolean
isOneWayRelationBetweenGroups
(Group resultGroup, Group operandGroup) Checks if relation exists between result group and operand group.boolean
isRelationBetweenGroups
(Group group1, Group group2) Checks if relation between groups exists.boolean
isRelationRemovable
(PerunSession sess, Group resultGroup, Group operandGroup) Check if the relation between given groups can be deleted.boolean
Check if synchronizing groups is suspended.boolean
isUserMemberOfGroup
(PerunSession sess, User user, Group group) Checks whether the user is member of the group.void
removeAllManagerRolesOfGroup
(PerunSession session, Group group) Removes all manager roles related to the given groupvoid
removeGroupUnion
(PerunSession sess, Group resultGroup, Group operandGroup) Removes a union between two groups.void
removeMember
(PerunSession perunSession, Group group, Member member) Removes member form the group.void
removeResultGroupRelations
(PerunSession sess, Group resultGroup) Removes all relations of this result group.void
saveGroupRelation
(PerunSession sess, Group resultGroup, Group operandGroup, boolean parentFlag) Saves union operation between result group and operand group.searchForGroups
(PerunSession sess, String searchString, boolean includeIDs) Similarity substring search in all groups based on name, shortname, description and optionally IDsearchForGroups
(PerunSession sess, String searchString, Set<Integer> groupIds, Set<Integer> voIds, boolean includeIDs) Similarity substring search in provided groups based on name, shortname, description and optionally ID.void
setDirectGroupStatus
(PerunSession sess, Member member, Group group, MemberGroupStatus status) Set direct status of the member to specified status in given group.void
setIndirectGroupStatus
(PerunSession sess, Member member, Group group, MemberGroupStatus status) Set status of the member to specified status for indirect relations where the given group is the source group.void
suspendGroupSynchronization
(PerunSession sess, boolean suspend) Suspend synchronizing groups and their structures.updateGroup
(PerunSession perunSession, Group group) Updates group by ID.updateGroupName
(PerunSession perunSession, Group group) Updates group by ID.updateParentGroupId
(PerunSession perunSession, Group group) Updates parentGroupId.
-
Method Details
-
addGroupToAutoRegistration
Adds group to the list of groups which can be registered into during vo registration.- Parameters:
sess
- sessiongroup
- group to add
-
addGroupToAutoRegistration
void addGroupToAutoRegistration(PerunSession sess, Group group, ApplicationFormItem formItem) throws FormItemNotExistsException Adds group from list of groups which can be registered into during vo or group registration and are representing options of the specified application form item.- Parameters:
sess
- sessiongroup
- group to add- Throws:
FormItemNotExistsException
-
addMember
Member addMember(PerunSession perunSession, Group group, Member member, MembershipType type, boolean dualMember, int sourceGroupId) throws AlreadyMemberException Adds member of the VO to the group in the same VO.- Parameters:
perunSession
-group
-member
-type
-dualMember
- whether member is going to be both direct and indirect after the operationsourceGroupId
-- Returns:
- Member with specific MembershipType
- Throws:
InternalErrorException
AlreadyMemberException
-
allowGroupToHierarchicalVo
Sets flag required for including group to parent vo in a vo hierarchy.- Parameters:
sess
- perun sessiongroup
- groupvo
- parent vo
-
checkGroupExists
Check if group exists in underlaying data source.- Parameters:
perunSession
-group
-- Throws:
InternalErrorException
GroupNotExistsException
-
createGroup
Creates a new top-level group and associates it with the VO from parameter.For this method the new group has always same shortName like Name. Important: voId in object group is ignored
This method sets ids and uuid to the given group object but returns a new group object loaded from the DB.
- Parameters:
perunSession
-vo
- to associates group withgroup
- new group with name without ":"- Returns:
- newly created top-level group
- Throws:
InternalErrorException
- if group.name contains ':' or other internal error occuredGroupExistsException
-
createGroup
Group createGroup(PerunSession perunSession, Vo vo, Group parentGroup, Group group) throws GroupExistsException Creates a new subgroup of the existing group. (Stores group to underlaying data source)- Parameters:
perunSession
-parentGroup
-group
- group.name must contain only shortName (without ":"). Hierarchy is defined by parentGroup parameter.- Returns:
- newly created sub group with full group.Name with ":"
- Throws:
InternalErrorException
- if group.name contains ':' or other internal error occuredGroupExistsException
-
deleteGroup
Deletes group. Delete it from table of parentgroups, table of groups_members and groups table.- Parameters:
perunSession
-vo
-group
- group to delete- Throws:
InternalErrorException
GroupAlreadyRemovedException
- if there are 0 rows affected by deleting from DB
-
deleteGroupFromAutoRegistration
Deletes group from list of groups which can be registered into during vo registration.- Parameters:
sess
- sessiongroup
- group to delete
-
deleteGroupFromAutoRegistration
void deleteGroupFromAutoRegistration(PerunSession sess, Group group, ApplicationFormItem applicationFormItem) throws FormItemNotExistsException Deletes group from list of groups which can be registered into during vo or group registration and are representing options of the specified application form item.- Parameters:
sess
- sessiongroup
- group to delete- Throws:
FormItemNotExistsException
-
disallowGroupToHierarchicalVo
Unsets flag required for including group to parent vo in a vo hierarchy- Parameters:
sess
- perun sessiongroup
- groupvo
- parent vo
-
getAdmins
Gets list of all administrators of this group. If some group is administrator of the given group, all VALID members are included in the list.- Parameters:
perunSession
-group
-- Returns:
- list of all administrators
- Throws:
InternalErrorException
-
getAllAllowedGroupsToHierarchicalVo
Returns all groups which can be included to VO.- Parameters:
sess
- sessionvo
- vo- Returns:
- list of allowed groups to hierarchical VO
-
getAllAllowedGroupsToHierarchicalVo
Returns groups which can be included to VO from specific member VO.- Parameters:
sess
- sessionvo
- parent VOmemberVo
- member VO- Returns:
- list of allowed groups to hierarchical VO
-
getAllGroups
Get all groups from all vos.- Parameters:
sess
- session- Returns:
- list of all groups
-
getAllGroups
Get all groups of the VO.- Parameters:
perunSession
-vo
-- Returns:
- list of groups
- Throws:
InternalErrorException
-
getAllGroupsForAutoRegistration
Returns all groups which can be registered into during any vo registration. This method serves only for migration to new functionality related to the new table.- Parameters:
sess
- session- Returns:
- list of groups
-
getAllGroupsWhereMemberIsActive
Returns all member's groups where member is in active state (is valid there) Included members group.- Parameters:
sess
- perun sessionmember
- member to get groups for- Returns:
- list of groups where member is in active state (valid)
- Throws:
InternalErrorException
-
getAllMemberGroups
Return all members groups. Included 'members' group.- Parameters:
sess
-member
-- Returns:
- Throws:
InternalErrorException
-
getAssignedGroupsToFacility
Return list of assigned groups from all facility resources- Parameters:
perunSession
-facility
-- Returns:
- list of groups, which are assigned on all facility resources
- Throws:
InternalErrorException
-
getAssignedGroupsToResource
Return list of assigned groups on the resource.- Parameters:
perunSession
-resource
-- Returns:
- list of groups, which are assigned on the resource
- Throws:
InternalErrorException
-
getAssignedGroupsToResource
List<Group> getAssignedGroupsToResource(PerunSession perunSession, Resource resource, Member member) Return list of assigned groups on the resource with specified member.- Parameters:
perunSession
-resource
-member
-- Returns:
- list of groups, which are assigned on the resource with specified member
- Throws:
InternalErrorException
-
getAssociatedGroupsToFacility
Return list of all associated groups from all facility resources (does not require ACTIVE group-resource status)- Parameters:
perunSession
-facility
-- Returns:
- list of groups, which are associated with all facility resources
- Throws:
InternalErrorException
-
getAssociatedGroupsToResource
Return list of assigned groups on the resource. Similar to assigned groups, but does not require ACTIVE group-resource status.- Parameters:
perunSession
-resource
-- Returns:
- list of groups, which are assigned on the resource
- Throws:
InternalErrorException
-
getAssociatedGroupsToResource
List<Group> getAssociatedGroupsToResource(PerunSession perunSession, Resource resource, Member member) Return list of groups associated with the resource with specified member. Does not require ACTIVE group-resource status.- Parameters:
perunSession
-resource
-member
-- Returns:
- list of groups, which are assigned on the resource with specified member
- Throws:
InternalErrorException
-
getDirectAdmins
Gets list of direct user administrators of this group. 'Direct' means, there aren't included users, who are members of group administrators, in the returned list.- Parameters:
perunSession
-group
-- Returns:
- list of direct administrators
- Throws:
InternalErrorException
-
getDirectMemberGroupStatus
Returns direct members status in given group. If there is no relation, null is returned.- Parameters:
session
- sessionmember
- membergroup
- group- Returns:
- status of member in given group, if there is no relation, null is returned
- Throws:
InternalErrorException
- internal error
-
getFacilitiesWhereGroupIsAdmin
Returns all facilities where given group is FACILITYADMIN.- Parameters:
session
- sessiongroup
- group- Returns:
- list of all facilities where given group is FACILITYADMIN
- Throws:
InternalErrorException
-
getGroupAdmins
Gets list of all group administrators of this group.- Parameters:
perunSession
-group
-- Returns:
- list of all group administrators
- Throws:
InternalErrorException
-
getGroupApplicationIds
Return list of IDs of all applications, which belongs to Group.- Parameters:
sess
-group
-- Returns:
- list of all group applications ids
- Throws:
InternalErrorException
-
getGroupById
Search for the group with specified id in all VOs.- Parameters:
perunSession
-id
-- Returns:
- group with specified id or throws GroupNotExistsException
- Throws:
GroupNotExistsException
InternalErrorException
-
getGroupByName
Search for the group with specified name in specified VOIMPORTANT: need to use full name of group (ex. 'toplevel:a:b', not the shortname which is in this example 'b')
- Parameters:
perunSession
-vo
-name
-- Returns:
- group with specified name or throws GroupNotExistsException in specified VO
- Throws:
GroupNotExistsException
InternalErrorException
-
getGroupMembers
List<Member> getGroupMembers(PerunSession sess, Group group, List<Status> statuses, boolean excludeStatusInsteadOfIncludeStatus) Return group members.- Parameters:
sess
-group
-statuses
- list of statuses, if status is null then return all membersexcludeStatusInsteadOfIncludeStatus
- does the list of statuses means exclude members or include members with these statuses- Returns:
- list of members
- Throws:
InternalErrorException
-
getGroupMembers
Get all group members ignoring theirs status.- Parameters:
sess
-group
-- Returns:
- list of members
- Throws:
InternalErrorException
-
getGroupMembersById
Get group members by member ID -> meaning we will get all (DIRECT/INDIRECT) group memberships for specified member (or user, since it will be the same).- Parameters:
sess
-group
-memberId
-- Returns:
- list of members
- Throws:
InternalErrorException
-
getGroupMembersByMembership
List<Member> getGroupMembersByMembership(PerunSession sess, Group group, MembershipType membershipType) Get only group members which has given membership type ignoring their status.- Parameters:
sess
- sessiongroup
- groupmembershipType
- type of membership- Returns:
- list of direct members
- Throws:
InternalErrorException
- internal error
-
getGroupResourcePairsByAttribute
Returns all group-resource which have set the attribute with the value. Searching only def and opt attributes.- Parameters:
sess
-attribute
-- Returns:
- Throws:
InternalErrorException
-
getGroupUsers
Return group users sorted by name.- Parameters:
sess
-group
-- Returns:
- list users sorted or empty list if there are no users on specified page
- Throws:
InternalErrorException
-
getGroups
Get all groups of users under the VO.- Parameters:
perunSession
-vo
-- Returns:
- list of groups
- Throws:
InternalErrorException
-
getGroupsByAttribute
Returns all groups which have set the attribute with the value. Searching only def and opt attributes.- Parameters:
sess
-attribute
-- Returns:
- list of groups
- Throws:
InternalErrorException
-
getGroupsByIds
Gets groups by their ids. Silently skips non-existing groups.- Parameters:
perunSession
-ids
-- Returns:
- list of groups with specified ids
- Throws:
InternalErrorException
-
getGroupsCount
- Parameters:
perunSession
-vo
-- Returns:
- count of VO's groups
- Throws:
InternalErrorException
-
getGroupsCount
Get count of all groups.- Parameters:
perunSession
-- Returns:
- count of all groups
- Throws:
InternalErrorException
-
getGroupsForAutoRegistration
Returns all groups which can be registered into during vo registration and are representing options of the specified application form item.- Parameters:
sess
- sessionvo
- vo- Returns:
- list of groups
-
getGroupsForAutoRegistration
Returns all groups which can be registered into during vo registration and are representing options of the specified application form item.- Parameters:
sess
- sessionvo
- voformItem
- application form item- Returns:
- list of groups
-
getGroupsForAutoRegistration
List<Group> getGroupsForAutoRegistration(PerunSession sess, Group group, ApplicationFormItem formItem) Returns all groups which can be registered into during group registration and are representing options of the specified application form item.- Parameters:
sess
- sessiongroup
- groupformItem
- application form item- Returns:
- list of groups
-
getGroupsIds
Get all groups ids for given vo.- Parameters:
sess
- perun sessionvo
- vo- Returns:
- list of groups ids
-
getGroupsPage
Get page of groups from the given vo.- Parameters:
sess
- sessionvo
- voquery
- query with page information- Returns:
- page of requested groups
-
getGroupsStructuresToSynchronize
Gets all groups which have enabled group structure synchronization.- Parameters:
sess
-- Returns:
- list of groups structures to synchronize
- Throws:
InternalErrorException
-
getGroupsToSynchronize
Gets all groups which have enabled synchronization.- Parameters:
sess
-- Returns:
- list of groups to synchronize
- Throws:
InternalErrorException
-
getGroupsWhereGroupIsAdmin
Returns all groups where given group is GROUPADMIN.- Parameters:
session
- sessiongroup
- group- Returns:
- list of all groups where given group is GROUPADMIN
- Throws:
InternalErrorException
-
getGroupsWhereUserIsActiveMember
Returns groups in which the user is active member. Groups are looked up only for the specified VO.- Parameters:
sess
- sessionuser
- user objectvo
- VO object- Returns:
- List of groups
-
getGroupsWithAssignedExtSourceInVo
Get all groups in specific vo with assigned extSource- Parameters:
sess
-source
-vo
-- Returns:
- l
- Throws:
InternalErrorException
-
getOperandGroups
Return all operand groups of requested result group.- Parameters:
sess
- perun sessiongroupId
- group id- Returns:
- list of Group objects
-
getParentApplicationFormForAutoRegistrationGroup
Get parent form for auto registration group where this group is involved in auto registration process- Parameters:
group
- auto registration group- Returns:
-
getParentGroup
Get parent group.- Parameters:
sess
-group
-- Returns:
- parent group
- Throws:
InternalErrorException
ParentGroupNotExistsException
-
getResultGroups
Return all result groups of requested operand group.- Parameters:
sess
- perun sessiongroupId
- group id- Returns:
- list of Group objects
- Throws:
InternalErrorException
-
getResultGroupsIds
Return list of all result groups ids of requested operand group.- Parameters:
sess
- perun sessiongroupId
- group id- Returns:
- list of group ids
- Throws:
InternalErrorException
-
getServiceGroupMembers
Gets a list of Members, who are also service users, from a given group.- Parameters:
sess
- perun sessiongroup
- group from which are the service users chosen- Returns:
- list of Members from given group who are service users
-
getSubGroups
Get all immediate subgroups of the parent group under the VO.- Parameters:
perunSession
-parentGroup
-- Returns:
- list of groups
- Throws:
InternalErrorException
-
getSubGroupsCount
Returns number of immediate subgroups of the parent group.- Parameters:
perunSession
-parentGroup
-- Returns:
- count of parent group immediate subgroups
- Throws:
InternalErrorException
-
getSubgroupsPage
Get page of subgroups from the given parent group.- Parameters:
sess
- sessiongroup
- parent groupquery
- query with page information- Returns:
- page of requested groups
-
getTotalGroupStatusForMembers
Map<Integer,MemberGroupStatus> getTotalGroupStatusForMembers(PerunSession session, Group group, List<Member> members) Returns total member's status of given members in given group.- Parameters:
session
- sessiongroup
- groupmembers
- members- Returns:
- total status of members in given group
-
getTotalMemberGroupStatus
Returns total member's status in given group. If there is no relation, null is returned.- Parameters:
session
- sessionmember
- membergroup
- group- Returns:
- total status of member in given group, if there is no relation, null is returned
- Throws:
InternalErrorException
- internal error
-
getUserGroups
Return groups where user is member.- Parameters:
sess
-user
-- Returns:
- list of groups
- Throws:
InternalErrorException
-
getUserGroups
List<Group> getUserGroups(PerunSession sess, User user, List<Status> memberStatuses, List<MemberGroupStatus> memberGroupStatuses) Return groups where user is member with allowed statuses in vo and group. If statuses are empty or null, all statuses are used.- Parameters:
sess
-user
-memberStatuses
- allowed statuses of member in VO- Returns:
- list of groups
- Throws:
InternalErrorException
-
getVoId
Get the id of the VO which is owner of the group.- Parameters:
perunSession
-group
-- Returns:
- id of the VO
- Throws:
InternalErrorException
-
getVosWhereGroupIsAdmin
Returns all vos where given group si VOADMIN.- Parameters:
session
- sessiongroup
- group- Returns:
- list of all vos where given group is VOADMIN
- Throws:
InternalErrorException
-
groupExists
Check if group exists in underlaying data source.- Parameters:
perunSession
-group
-- Returns:
- true if group exists in underlaying data source, false otherwise
- Throws:
InternalErrorException
-
hasGroupAnyManagerRole
Checks if the given group has any related manager roles- Parameters:
session
- sessiongroup
- group- Throws:
InternalErrorException
- for the SQL error
-
isAllowedGroupToHierarchicalVo
Returns flag representing if the group can be included in the (parent) vo's groups- Parameters:
sess
- perun sessiongroup
- groupvo
- parent vo- Returns:
- true if group can be included in vo's groups, false otherwise
-
isDirectGroupMember
Return true if Member is direct member of the Group- Parameters:
sess
-group
-member
-- Returns:
- true if Member is direct member of the Group
- Throws:
InternalErrorException
-
isGroupForAnyAutoRegistration
Check if group has automatic registration enabled in any form item.- Parameters:
sess
- sessiongroup
- group to check
-
isGroupForAutoRegistration
Check if group has automatic registration enabled in the given form item.- Parameters:
sess
- sessiongroup
- group to checkformItems
- form items for which the group can be configured
-
isGroupLastAdminInSomeFacility
Check whether the group supplies the last FACILITYADMIN in some facility, return those facilities in which it does. Such facilities could upon removal of the group be left without a person to manage them.- Parameters:
sess
- sessiongroup
- group- Returns:
- list of facilities which the group supplies last FACILITYADMIN to
-
isGroupLastAdminInSomeVo
Check whether the group supplies the last VOADMIN in some vo, return those vos in which it does. Such vos could upon removal of the group be left without a person to manage them.- Parameters:
sess
- sessiongroup
- group- Returns:
- list of vos which the group supplies last VOADMIN to
-
isGroupMember
Return true if Member is member of the Group- Parameters:
sess
-group
-member
-- Returns:
- true if Member is member of the Group
- Throws:
InternalErrorException
-
isOneWayRelationBetweenGroups
Checks if relation exists between result group and operand group. It matters which one is result group and which one is operand group.- Parameters:
resultGroup
- result groupoperandGroup
- operand group- Returns:
- true if there is a one-way relation, false otherwise
- Throws:
InternalErrorException
-
isRelationBetweenGroups
Checks if relation between groups exists. It checks both ways. Does not matter which one is result group and which one is operand group.- Parameters:
group1
- groupgroup2
- group- Returns:
- true if there is a relation, false otherwise
- Throws:
InternalErrorException
-
isRelationRemovable
Check if the relation between given groups can be deleted. Determined by parent flag (it flags relations created by hierarchical structure). It matters which group is resultGroup and which is operandGroup!!!- Returns:
- true if it can be deleted; false otherwise
- Throws:
InternalErrorException
-
isUserMemberOfGroup
Checks whether the user is member of the group.- Parameters:
sess
-user
-group
-- Returns:
- true if the user is member of the group
- Throws:
InternalErrorException
-
searchForGroups
Similarity substring search in all groups based on name, shortname, description and optionally ID- Parameters:
sess
- sessionsearchString
- string to search forincludeIDs
- whether to search in IDs as well, used for PERUNADMINs- Returns:
- list of matched groups
-
searchForGroups
List<Group> searchForGroups(PerunSession sess, String searchString, Set<Integer> groupIds, Set<Integer> voIds, boolean includeIDs) Similarity substring search in provided groups based on name, shortname, description and optionally ID. Performs the search also in all groups of the provided VOs. Returns an empty list if both groups/vo IDs are null or empty.- Parameters:
sess
- sessionsearchString
- string to search forgroupIds
- IDs of groups to perform the search in. Ignore if emptyvoIds
- IDs of VOs to perform the search in. Ignore if emptyincludeIDs
- whether to search in IDs as well, used for PERUNADMINs- Returns:
- list of matched groups
-
suspendGroupSynchronization
Suspend synchronizing groups and their structures.- Parameters:
sess
- sessionsuspend
- whether to suspend or unsuspend
-
isSuspendedGroupSynchronization
boolean isSuspendedGroupSynchronization()Check if synchronizing groups is suspended.- Returns:
- True if suspended, false if synchronizing
-
removeAllManagerRolesOfGroup
Removes all manager roles related to the given group- Parameters:
session
- sessiongroup
- group- Throws:
InternalErrorException
- for the SQL error
-
removeGroupUnion
void removeGroupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws GroupRelationDoesNotExist Removes a union between two groups.- Parameters:
sess
- perun sessionresultGroup
- result groupoperandGroup
- operand group- Throws:
InternalErrorException
GroupRelationDoesNotExist
- if the union between the two groups does not exist
-
removeMember
void removeMember(PerunSession perunSession, Group group, Member member) throws NotGroupMemberException Removes member form the group. The member object MUST have sourceGroupId parameter.- Parameters:
perunSession
- perun sessiongroup
- groupmember
- member- Throws:
InternalErrorException
NotGroupMemberException
-
removeResultGroupRelations
Removes all relations of this result group.- Parameters:
sess
- perun sessionresultGroup
- result group- Throws:
InternalErrorException
-
saveGroupRelation
void saveGroupRelation(PerunSession sess, Group resultGroup, Group operandGroup, boolean parentFlag) Saves union operation between result group and operand group.- Parameters:
sess
- perun sessionresultGroup
- group to which members are addedoperandGroup
- group from which members are takenparentFlag
- if true union cannot be deleted; false otherwise (it flags relations created by hierarchical structure)- Throws:
InternalErrorException
-
setDirectGroupStatus
Set direct status of the member to specified status in given group.- Parameters:
member
- member whose status will be changedgroup
- group where member's status will be changedstatus
- status that will be set- Throws:
InternalErrorException
- internal error
-
setIndirectGroupStatus
void setIndirectGroupStatus(PerunSession sess, Member member, Group group, MemberGroupStatus status) Set status of the member to specified status for indirect relations where the given group is the source group.- Parameters:
member
- member whose status will be changedgroup
- group where member's status will be changedstatus
- status that will be set- Throws:
InternalErrorException
- internal error
-
updateGroup
Updates group by ID.Update shortName and description. Return Group with correctly set parameters
- Parameters:
perunSession
-group
- to update (use only ID, shortName and description)- Returns:
- updated group with correctly set parameters
- Throws:
InternalErrorException
GroupExistsException
- if group with same name already exists in the same VO
-
updateGroupName
Updates group by ID.!! IMPORTANT This method allows to change group name the way it doesn't correspond with the groups hierarchy !! Meant for updating subgroups after parent group name is updated !!
Update name (with ":"). Return Group with correctly set parameters
- Parameters:
perunSession
-group
- to update (use only ID and name)- Returns:
- updated group with correctly set parameters
- Throws:
InternalErrorException
-
updateParentGroupId
Updates parentGroupId.!! IMPORTANT This method allows to change parentGroupId, but it doesn't update group and subGroup names !!
- Parameters:
perunSession
-group
- to update- Returns:
- group with updated parentGroupId
- Throws:
InternalErrorException
-