Class GroupsManagerImpl
- All Implemented Interfaces:
GroupsManagerImplApi
- Author:
- Michal Prochazka michalp@ics.muni.cz, Slavek Licehammer glory@ics.muni.cz
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected static final RowMapper<AssignedGroup> protected static final Stringprotected static final Stringprotected static final Stringstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGroupToAutoRegistration(PerunSession sess, Group group) Adds group to the list of groups which can be registered into during vo registration.voidaddGroupToAutoRegistration(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 sess, Group group, Member member, MembershipType type, boolean dualMember, int sourceGroupId) Adds member of the VO to the group in the same VO.voidallowGroupToHierarchicalVo(PerunSession sess, Group group, Vo vo) Sets flag required for including group to parent vo in a vo hierarchy.voidcheckGroupExists(PerunSession sess, Group group) Check if group exists in underlaying data source.createGroup(PerunSession sess, Vo vo, Group group) Creates a new top-level group and associates it with the VO from parameter.createGroup(PerunSession sess, Vo vo, Group parentGroup, Group group) Creates a new subgroup of the existing group.voiddeleteGroup(PerunSession sess, Vo vo, Group group) Deletes group.voiddeleteGroupFromAutoRegistration(PerunSession sess, Group group) Deletes group from list of groups which can be registered into during vo registration.voiddeleteGroupFromAutoRegistration(PerunSession sess, Group group, ApplicationFormItem formItem) 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.voiddisallowGroupToHierarchicalVo(PerunSession sess, Group group, Vo vo) Unsets flag required for including group to parent vo in a vo hierarchygetAdmins(PerunSession sess, 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 sess, 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 sess, 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 sess, 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 sess, int id) Search for the group with specified id in all VOs.getGroupByName(PerunSession sess, 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 excludeStatus) Return group members.getGroupMembersById(PerunSession sess, Group group, int id) 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 sess, 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.intgetGroupsCount(PerunSession sess) Get count of all groups.intgetGroupsCount(PerunSession sess, 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.getName(int id) 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 sess, Group parentGroup) Get all immediate subgroups of the parent group under the VO.intgetSubGroupsCount(PerunSession sess, 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.intgetVoId(PerunSession sess, 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.booleangroupExists(PerunSession sess, Group group) Check if group exists in underlaying data source.booleanhasGroupAnyManagerRole(PerunSession session, Group group) Checks if the given group has any related manager rolesbooleanisAllowedGroupToHierarchicalVo(PerunSession sess, Group group, Vo vo) Returns flag representing if the group can be included in the (parent) vo's groupsbooleanisDirectGroupMember(PerunSession sess, Group group, Member member) Return true if Member is direct member of the GroupbooleanisGroupForAnyAutoRegistration(PerunSession sess, Group group) Check if group has automatic registration enabled in any form item.booleanisGroupForAutoRegistration(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.booleanisGroupMember(PerunSession sess, Group group, Member member) Return true if Member is member of the GroupbooleanisOneWayRelationBetweenGroups(Group resultGroup, Group operandGroup) Checks if relation exists between result group and operand group.booleanisRelationBetweenGroups(Group group1, Group group2) Checks if relation between groups exists.booleanisRelationRemovable(PerunSession sess, Group resultGroup, Group operandGroup) Check if the relation between given groups can be deleted.booleanCheck if synchronizing groups is suspended.booleanisUserMemberOfGroup(PerunSession sess, User user, Group group) Checks whether the user is member of the group.voidremoveAllManagerRolesOfGroup(PerunSession session, Group group) Removes all manager roles related to the given groupvoidremoveGroupUnion(PerunSession sess, Group resultGroup, Group operandGroup) Removes a union between two groups.voidremoveMember(PerunSession sess, Group group, Member member) Removes member form the group.voidremoveResultGroupRelations(PerunSession sess, Group resultGroup) Removes all relations of this result group.voidsaveGroupRelation(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.voidsetDirectGroupStatus(PerunSession sess, Member member, Group group, MemberGroupStatus status) Set direct status of the member to specified status in given group.voidsetIndirectGroupStatus(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.voidsuspendGroupSynchronization(PerunSession sess, boolean suspend) Suspend synchronizing groups and their structures.updateGroup(PerunSession sess, Group group) Updates group by ID.updateGroupName(PerunSession sess, Group group) Updates group by ID.updateParentGroupId(PerunSession sess, Group group) Updates parentGroupId.
-
Field Details
-
MEMBERSGROUP
public static final int MEMBERSGROUP- See Also:
-
ADMINSGROUP
public static final int ADMINSGROUP- See Also:
-
SUBGROUP
public static final int SUBGROUP- See Also:
-
GROUP_MAPPING_SELECT_QUERY
- See Also:
-
MEMBER_GROUPS_MAPPING_SELECT_QUERY
- See Also:
-
ASSIGNED_GROUP_MAPPING_SELECT_QUERY
- See Also:
-
GROUP_MAPPER
-
ASSIGNED_GROUP_MAPPER
-
-
Constructor Details
-
GroupsManagerImpl
Create new instance of this class.
-
-
Method Details
-
addGroupToAutoRegistration
Description copied from interface:GroupsManagerImplApiAdds group to the list of groups which can be registered into during vo registration.- Specified by:
addGroupToAutoRegistrationin interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- group to add
-
addGroupToAutoRegistration
public void addGroupToAutoRegistration(PerunSession sess, Group group, ApplicationFormItem formItem) throws FormItemNotExistsException Description copied from interface:GroupsManagerImplApiAdds 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.- Specified by:
addGroupToAutoRegistrationin interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- group to add- Throws:
FormItemNotExistsException
-
addMember
public Member addMember(PerunSession sess, Group group, Member member, MembershipType type, boolean dualMember, int sourceGroupId) throws AlreadyMemberException Description copied from interface:GroupsManagerImplApiAdds member of the VO to the group in the same VO.- Specified by:
addMemberin interfaceGroupsManagerImplApi- Parameters:
sess-group-member-type-dualMember- whether member is going to be both direct and indirect after the operationsourceGroupId-- Returns:
- Member with specific MembershipType
- Throws:
AlreadyMemberException
-
allowGroupToHierarchicalVo
Description copied from interface:GroupsManagerImplApiSets flag required for including group to parent vo in a vo hierarchy.- Specified by:
allowGroupToHierarchicalVoin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessiongroup- groupvo- parent vo
-
checkGroupExists
Description copied from interface:GroupsManagerImplApiCheck if group exists in underlaying data source.- Specified by:
checkGroupExistsin interfaceGroupsManagerImplApi- Parameters:
sess-group-- Throws:
GroupNotExistsException
-
createGroup
Description copied from interface:GroupsManagerImplApiCreates 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.
- Specified by:
createGroupin interfaceGroupsManagerImplApi- Parameters:
sess-vo- to associates group withgroup- new group with name without ":"- Returns:
- newly created top-level group
- Throws:
GroupExistsException
-
createGroup
public Group createGroup(PerunSession sess, Vo vo, Group parentGroup, Group group) throws GroupExistsException Description copied from interface:GroupsManagerImplApiCreates a new subgroup of the existing group. (Stores group to underlaying data source)- Specified by:
createGroupin interfaceGroupsManagerImplApi- Parameters:
sess-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:
GroupExistsException
-
deleteGroup
Description copied from interface:GroupsManagerImplApiDeletes group. Delete it from table of parentgroups, table of groups_members and groups table.- Specified by:
deleteGroupin interfaceGroupsManagerImplApi- Parameters:
sess-vo-group- group to delete- Throws:
GroupAlreadyRemovedException- if there are 0 rows affected by deleting from DB
-
deleteGroupFromAutoRegistration
Description copied from interface:GroupsManagerImplApiDeletes group from list of groups which can be registered into during vo registration.- Specified by:
deleteGroupFromAutoRegistrationin interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- group to delete
-
deleteGroupFromAutoRegistration
public void deleteGroupFromAutoRegistration(PerunSession sess, Group group, ApplicationFormItem formItem) throws FormItemNotExistsException Description copied from interface:GroupsManagerImplApiDeletes 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.- Specified by:
deleteGroupFromAutoRegistrationin interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- group to delete- Throws:
FormItemNotExistsException
-
disallowGroupToHierarchicalVo
Description copied from interface:GroupsManagerImplApiUnsets flag required for including group to parent vo in a vo hierarchy- Specified by:
disallowGroupToHierarchicalVoin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessiongroup- groupvo- parent vo
-
getAdmins
Description copied from interface:GroupsManagerImplApiGets list of all administrators of this group. If some group is administrator of the given group, all VALID members are included in the list.- Specified by:
getAdminsin interfaceGroupsManagerImplApi- Parameters:
sess-group-- Returns:
- list of all administrators
-
isGroupLastAdminInSomeFacility
Description copied from interface:GroupsManagerImplApiCheck 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.- Specified by:
isGroupLastAdminInSomeFacilityin interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- group- Returns:
- list of facilities which the group supplies last FACILITYADMIN to
-
isGroupLastAdminInSomeVo
Description copied from interface:GroupsManagerImplApiCheck 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.- Specified by:
isGroupLastAdminInSomeVoin interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- group- Returns:
- list of vos which the group supplies last VOADMIN to
-
getAllAllowedGroupsToHierarchicalVo
Description copied from interface:GroupsManagerImplApiReturns all groups which can be included to VO.- Specified by:
getAllAllowedGroupsToHierarchicalVoin interfaceGroupsManagerImplApi- Parameters:
sess- sessionvo- vo- Returns:
- list of allowed groups to hierarchical VO
-
getAllAllowedGroupsToHierarchicalVo
Description copied from interface:GroupsManagerImplApiReturns groups which can be included to VO from specific member VO.- Specified by:
getAllAllowedGroupsToHierarchicalVoin interfaceGroupsManagerImplApi- Parameters:
sess- sessionvo- parent VOmemberVo- member VO- Returns:
- list of allowed groups to hierarchical VO
-
getAllGroups
Description copied from interface:GroupsManagerImplApiGet all groups from all vos.- Specified by:
getAllGroupsin interfaceGroupsManagerImplApi- Parameters:
sess- session- Returns:
- list of all groups
-
getAllGroups
Description copied from interface:GroupsManagerImplApiGet all groups of the VO.- Specified by:
getAllGroupsin interfaceGroupsManagerImplApi- Parameters:
sess-vo-- Returns:
- list of groups
-
getAllGroupsForAutoRegistration
Description copied from interface:GroupsManagerImplApiReturns 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.- Specified by:
getAllGroupsForAutoRegistrationin interfaceGroupsManagerImplApi- Parameters:
sess- session- Returns:
- list of groups
-
getAllGroupsWhereMemberIsActive
Description copied from interface:GroupsManagerImplApiReturns all member's groups where member is in active state (is valid there) Included members group.- Specified by:
getAllGroupsWhereMemberIsActivein interfaceGroupsManagerImplApi- Parameters:
sess- perun sessionmember- member to get groups for- Returns:
- list of groups where member is in active state (valid)
-
getAllMemberGroups
Description copied from interface:GroupsManagerImplApiReturn all members groups. Included 'members' group.- Specified by:
getAllMemberGroupsin interfaceGroupsManagerImplApi- Parameters:
sess-member-- Returns:
-
getAssignedGroupsToFacility
Description copied from interface:GroupsManagerImplApiReturn list of assigned groups from all facility resources- Specified by:
getAssignedGroupsToFacilityin interfaceGroupsManagerImplApi- Parameters:
perunSession-facility-- Returns:
- list of groups, which are assigned on all facility resources
-
getAssignedGroupsToResource
Description copied from interface:GroupsManagerImplApiReturn list of assigned groups on the resource.- Specified by:
getAssignedGroupsToResourcein interfaceGroupsManagerImplApi- Parameters:
perunSession-resource-- Returns:
- list of groups, which are assigned on the resource
-
getAssignedGroupsToResource
public List<Group> getAssignedGroupsToResource(PerunSession perunSession, Resource resource, Member member) Description copied from interface:GroupsManagerImplApiReturn list of assigned groups on the resource with specified member.- Specified by:
getAssignedGroupsToResourcein interfaceGroupsManagerImplApi- Parameters:
perunSession-resource-member-- Returns:
- list of groups, which are assigned on the resource with specified member
-
getAssociatedGroupsToFacility
Description copied from interface:GroupsManagerImplApiReturn list of all associated groups from all facility resources (does not require ACTIVE group-resource status)- Specified by:
getAssociatedGroupsToFacilityin interfaceGroupsManagerImplApi- Parameters:
perunSession-facility-- Returns:
- list of groups, which are associated with all facility resources
-
getAssociatedGroupsToResource
Description copied from interface:GroupsManagerImplApiReturn list of assigned groups on the resource. Similar to assigned groups, but does not require ACTIVE group-resource status.- Specified by:
getAssociatedGroupsToResourcein interfaceGroupsManagerImplApi- Parameters:
perunSession-resource-- Returns:
- list of groups, which are assigned on the resource
-
getAssociatedGroupsToResource
public List<Group> getAssociatedGroupsToResource(PerunSession perunSession, Resource resource, Member member) Description copied from interface:GroupsManagerImplApiReturn list of groups associated with the resource with specified member. Does not require ACTIVE group-resource status.- Specified by:
getAssociatedGroupsToResourcein interfaceGroupsManagerImplApi- Parameters:
perunSession-resource-member-- Returns:
- list of groups, which are assigned on the resource with specified member
-
getDirectAdmins
Description copied from interface:GroupsManagerImplApiGets 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.- Specified by:
getDirectAdminsin interfaceGroupsManagerImplApi- Parameters:
sess-group-- Returns:
- list of direct administrators
-
getDirectMemberGroupStatus
public MemberGroupStatus getDirectMemberGroupStatus(PerunSession session, Member member, Group group) Description copied from interface:GroupsManagerImplApiReturns direct members status in given group. If there is no relation, null is returned.- Specified by:
getDirectMemberGroupStatusin interfaceGroupsManagerImplApi- Parameters:
session- sessionmember- membergroup- group- Returns:
- status of member in given group, if there is no relation, null is returned
-
getFacilitiesWhereGroupIsAdmin
Description copied from interface:GroupsManagerImplApiReturns all facilities where given group is FACILITYADMIN.- Specified by:
getFacilitiesWhereGroupIsAdminin interfaceGroupsManagerImplApi- Parameters:
session- sessiongroup- group- Returns:
- list of all facilities where given group is FACILITYADMIN
-
getGroupAdmins
Description copied from interface:GroupsManagerImplApiGets list of all group administrators of this group.- Specified by:
getGroupAdminsin interfaceGroupsManagerImplApi- Parameters:
sess-group-- Returns:
- list of all group administrators
-
getGroupApplicationIds
Description copied from interface:GroupsManagerImplApiReturn list of IDs of all applications, which belongs to Group.- Specified by:
getGroupApplicationIdsin interfaceGroupsManagerImplApi- Parameters:
sess-group-- Returns:
- list of all group applications ids
-
getGroupById
Description copied from interface:GroupsManagerImplApiSearch for the group with specified id in all VOs.- Specified by:
getGroupByIdin interfaceGroupsManagerImplApi- Parameters:
sess-id-- Returns:
- group with specified id or throws GroupNotExistsException
- Throws:
GroupNotExistsException
-
getGroupByName
Description copied from interface:GroupsManagerImplApiSearch 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')
- Specified by:
getGroupByNamein interfaceGroupsManagerImplApi- Parameters:
sess-vo-name-- Returns:
- group with specified name or throws GroupNotExistsException in specified VO
- Throws:
GroupNotExistsException
-
getGroupMembers
public List<Member> getGroupMembers(PerunSession sess, Group group, List<Status> statuses, boolean excludeStatus) Description copied from interface:GroupsManagerImplApiReturn group members.- Specified by:
getGroupMembersin interfaceGroupsManagerImplApi- Parameters:
sess-group-statuses- list of statuses, if status is null then return all membersexcludeStatus- does the list of statuses means exclude members or include members with these statuses- Returns:
- list of members
-
getGroupMembers
Description copied from interface:GroupsManagerImplApiGet all group members ignoring theirs status.- Specified by:
getGroupMembersin interfaceGroupsManagerImplApi- Parameters:
sess-group-- Returns:
- list of members
-
getGroupMembersById
Description copied from interface:GroupsManagerImplApiGet 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).- Specified by:
getGroupMembersByIdin interfaceGroupsManagerImplApi- Parameters:
sess-group-id-- Returns:
- list of members
-
getGroupMembersByMembership
public List<Member> getGroupMembersByMembership(PerunSession sess, Group group, MembershipType membershipType) Description copied from interface:GroupsManagerImplApiGet only group members which has given membership type ignoring their status.- Specified by:
getGroupMembersByMembershipin interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- groupmembershipType- type of membership- Returns:
- list of direct members
-
getGroupResourcePairsByAttribute
public List<Pair<Group,Resource>> getGroupResourcePairsByAttribute(PerunSession sess, Attribute attribute) Description copied from interface:GroupsManagerImplApiReturns all group-resource which have set the attribute with the value. Searching only def and opt attributes.- Specified by:
getGroupResourcePairsByAttributein interfaceGroupsManagerImplApi- Parameters:
sess-attribute-- Returns:
-
getGroupUsers
Description copied from interface:GroupsManagerImplApiReturn group users sorted by name.- Specified by:
getGroupUsersin interfaceGroupsManagerImplApi- Parameters:
sess-group-- Returns:
- list users sorted or empty list if there are no users on specified page
-
getGroups
Description copied from interface:GroupsManagerImplApiGet all groups of users under the VO.- Specified by:
getGroupsin interfaceGroupsManagerImplApi- Parameters:
sess-vo-- Returns:
- list of groups
-
getGroupsByAttribute
Description copied from interface:GroupsManagerImplApiReturns all groups which have set the attribute with the value. Searching only def and opt attributes.- Specified by:
getGroupsByAttributein interfaceGroupsManagerImplApi- Parameters:
sess-attribute-- Returns:
- list of groups
-
getGroupsByIds
Description copied from interface:GroupsManagerImplApiGets groups by their ids. Silently skips non-existing groups.- Specified by:
getGroupsByIdsin interfaceGroupsManagerImplApi- Parameters:
perunSession-ids-- Returns:
- list of groups with specified ids
-
getGroupsCount
- Specified by:
getGroupsCountin interfaceGroupsManagerImplApi- Parameters:
sess-vo-- Returns:
- count of VO's groups
-
getGroupsCount
Description copied from interface:GroupsManagerImplApiGet count of all groups.- Specified by:
getGroupsCountin interfaceGroupsManagerImplApi- Parameters:
sess-- Returns:
- count of all groups
-
getGroupsForAutoRegistration
Description copied from interface:GroupsManagerImplApiReturns all groups which can be registered into during vo registration and are representing options of the specified application form item.- Specified by:
getGroupsForAutoRegistrationin interfaceGroupsManagerImplApi- Parameters:
sess- sessionvo- vo- Returns:
- list of groups
-
getGroupsForAutoRegistration
public List<Group> getGroupsForAutoRegistration(PerunSession sess, Vo vo, ApplicationFormItem formItem) Description copied from interface:GroupsManagerImplApiReturns all groups which can be registered into during vo registration and are representing options of the specified application form item.- Specified by:
getGroupsForAutoRegistrationin interfaceGroupsManagerImplApi- Parameters:
sess- sessionvo- voformItem- application form item- Returns:
- list of groups
-
getGroupsForAutoRegistration
public List<Group> getGroupsForAutoRegistration(PerunSession sess, Group group, ApplicationFormItem formItem) Description copied from interface:GroupsManagerImplApiReturns all groups which can be registered into during group registration and are representing options of the specified application form item.- Specified by:
getGroupsForAutoRegistrationin interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- groupformItem- application form item- Returns:
- list of groups
-
getGroupsIds
Description copied from interface:GroupsManagerImplApiGet all groups ids for given vo.- Specified by:
getGroupsIdsin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessionvo- vo- Returns:
- list of groups ids
-
getGroupsPage
Description copied from interface:GroupsManagerImplApiGet page of groups from the given vo.- Specified by:
getGroupsPagein interfaceGroupsManagerImplApi- Parameters:
sess- sessionvo- voquery- query with page information- Returns:
- page of requested groups
-
getGroupsStructuresToSynchronize
Description copied from interface:GroupsManagerImplApiGets all groups which have enabled group structure synchronization.- Specified by:
getGroupsStructuresToSynchronizein interfaceGroupsManagerImplApi- Parameters:
sess-- Returns:
- list of groups structures to synchronize
-
getGroupsToSynchronize
Gets all groups which have enabled synchronization.- Specified by:
getGroupsToSynchronizein interfaceGroupsManagerImplApi- Parameters:
sess-- Returns:
- list of groups to synchronize
- Throws:
InternalErrorException
-
getGroupsWhereGroupIsAdmin
Description copied from interface:GroupsManagerImplApiReturns all groups where given group is GROUPADMIN.- Specified by:
getGroupsWhereGroupIsAdminin interfaceGroupsManagerImplApi- Parameters:
session- sessiongroup- group- Returns:
- list of all groups where given group is GROUPADMIN
-
getGroupsWhereUserIsActiveMember
Description copied from interface:GroupsManagerImplApiReturns groups in which the user is active member. Groups are looked up only for the specified VO.- Specified by:
getGroupsWhereUserIsActiveMemberin interfaceGroupsManagerImplApi- Parameters:
sess- sessionuser- user objectvo- VO object- Returns:
- List of groups
-
getGroupsWithAssignedExtSourceInVo
Description copied from interface:GroupsManagerImplApiGet all groups in specific vo with assigned extSource- Specified by:
getGroupsWithAssignedExtSourceInVoin interfaceGroupsManagerImplApi- Parameters:
sess-source-vo-- Returns:
- l
-
getName
-
getOperandGroups
Description copied from interface:GroupsManagerImplApiReturn all operand groups of requested result group.- Specified by:
getOperandGroupsin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessiongroupId- group id- Returns:
- list of Group objects
-
getParentApplicationFormForAutoRegistrationGroup
Description copied from interface:GroupsManagerImplApiGet parent form for auto registration group where this group is involved in auto registration process- Specified by:
getParentApplicationFormForAutoRegistrationGroupin interfaceGroupsManagerImplApi- Parameters:
group- auto registration group- Returns:
-
getParentGroup
Description copied from interface:GroupsManagerImplApiGet parent group.- Specified by:
getParentGroupin interfaceGroupsManagerImplApi- Parameters:
sess-group-- Returns:
- parent group
- Throws:
ParentGroupNotExistsException
-
getResultGroups
Description copied from interface:GroupsManagerImplApiReturn all result groups of requested operand group.- Specified by:
getResultGroupsin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessiongroupId- group id- Returns:
- list of Group objects
-
getResultGroupsIds
Description copied from interface:GroupsManagerImplApiReturn list of all result groups ids of requested operand group.- Specified by:
getResultGroupsIdsin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessiongroupId- group id- Returns:
- list of group ids
-
getServiceGroupMembers
Description copied from interface:GroupsManagerImplApiGets a list of Members, who are also service users, from a given group.- Specified by:
getServiceGroupMembersin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessiongroup- group from which are the service users chosen- Returns:
- list of Members from given group who are service users
-
getSubGroups
Description copied from interface:GroupsManagerImplApiGet all immediate subgroups of the parent group under the VO.- Specified by:
getSubGroupsin interfaceGroupsManagerImplApi- Parameters:
sess-parentGroup-- Returns:
- list of groups
-
getSubGroupsCount
Description copied from interface:GroupsManagerImplApiReturns number of immediate subgroups of the parent group.- Specified by:
getSubGroupsCountin interfaceGroupsManagerImplApi- Parameters:
sess-parentGroup-- Returns:
- count of parent group immediate subgroups
-
getSubgroupsPage
Description copied from interface:GroupsManagerImplApiGet page of subgroups from the given parent group.- Specified by:
getSubgroupsPagein interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- parent groupquery- query with page information- Returns:
- page of requested groups
-
getTotalGroupStatusForMembers
public Map<Integer,MemberGroupStatus> getTotalGroupStatusForMembers(PerunSession session, Group group, List<Member> members) Description copied from interface:GroupsManagerImplApiReturns total member's status of given members in given group.- Specified by:
getTotalGroupStatusForMembersin interfaceGroupsManagerImplApi- Parameters:
session- sessiongroup- groupmembers- members- Returns:
- total status of members in given group
-
getTotalMemberGroupStatus
public MemberGroupStatus getTotalMemberGroupStatus(PerunSession session, Member member, Group group) Description copied from interface:GroupsManagerImplApiReturns total member's status in given group. If there is no relation, null is returned.- Specified by:
getTotalMemberGroupStatusin interfaceGroupsManagerImplApi- Parameters:
session- sessionmember- membergroup- group- Returns:
- total status of member in given group, if there is no relation, null is returned
-
getUserGroups
Description copied from interface:GroupsManagerImplApiReturn groups where user is member.- Specified by:
getUserGroupsin interfaceGroupsManagerImplApi- Parameters:
sess-user-- Returns:
- list of groups
-
getUserGroups
public List<Group> getUserGroups(PerunSession sess, User user, List<Status> memberStatuses, List<MemberGroupStatus> memberGroupStatuses) Description copied from interface:GroupsManagerImplApiReturn groups where user is member with allowed statuses in vo and group. If statuses are empty or null, all statuses are used.- Specified by:
getUserGroupsin interfaceGroupsManagerImplApi- Parameters:
sess-user-memberStatuses- allowed statuses of member in VO- Returns:
- list of groups
-
getVoId
Description copied from interface:GroupsManagerImplApiGet the id of the VO which is owner of the group.- Specified by:
getVoIdin interfaceGroupsManagerImplApi- Parameters:
sess-group-- Returns:
- id of the VO
-
getVosWhereGroupIsAdmin
Description copied from interface:GroupsManagerImplApiReturns all vos where given group si VOADMIN.- Specified by:
getVosWhereGroupIsAdminin interfaceGroupsManagerImplApi- Parameters:
session- sessiongroup- group- Returns:
- list of all vos where given group is VOADMIN
-
groupExists
Description copied from interface:GroupsManagerImplApiCheck if group exists in underlaying data source.- Specified by:
groupExistsin interfaceGroupsManagerImplApi- Parameters:
sess-group-- Returns:
- true if group exists in underlaying data source, false otherwise
-
hasGroupAnyManagerRole
Description copied from interface:GroupsManagerImplApiChecks if the given group has any related manager roles- Specified by:
hasGroupAnyManagerRolein interfaceGroupsManagerImplApi- Parameters:
session- sessiongroup- group
-
isAllowedGroupToHierarchicalVo
Description copied from interface:GroupsManagerImplApiReturns flag representing if the group can be included in the (parent) vo's groups- Specified by:
isAllowedGroupToHierarchicalVoin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessiongroup- groupvo- parent vo- Returns:
- true if group can be included in vo's groups, false otherwise
-
isDirectGroupMember
Description copied from interface:GroupsManagerImplApiReturn true if Member is direct member of the Group- Specified by:
isDirectGroupMemberin interfaceGroupsManagerImplApi- Parameters:
sess-group-member-- Returns:
- true if Member is direct member of the Group
-
isGroupForAnyAutoRegistration
Description copied from interface:GroupsManagerImplApiCheck if group has automatic registration enabled in any form item.- Specified by:
isGroupForAnyAutoRegistrationin interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- group to check
-
isGroupForAutoRegistration
Description copied from interface:GroupsManagerImplApiCheck if group has automatic registration enabled in the given form item.- Specified by:
isGroupForAutoRegistrationin interfaceGroupsManagerImplApi- Parameters:
sess- sessiongroup- group to checkformItems- form items for which the group can be configured
-
isGroupMember
Description copied from interface:GroupsManagerImplApiReturn true if Member is member of the Group- Specified by:
isGroupMemberin interfaceGroupsManagerImplApi- Parameters:
sess-group-member-- Returns:
- true if Member is member of the Group
-
isOneWayRelationBetweenGroups
Description copied from interface:GroupsManagerImplApiChecks if relation exists between result group and operand group. It matters which one is result group and which one is operand group.- Specified by:
isOneWayRelationBetweenGroupsin interfaceGroupsManagerImplApi- Parameters:
resultGroup- result groupoperandGroup- operand group- Returns:
- true if there is a one-way relation, false otherwise
-
isRelationBetweenGroups
Description copied from interface:GroupsManagerImplApiChecks if relation between groups exists. It checks both ways. Does not matter which one is result group and which one is operand group.- Specified by:
isRelationBetweenGroupsin interfaceGroupsManagerImplApi- Parameters:
group1- groupgroup2- group- Returns:
- true if there is a relation, false otherwise
-
isRelationRemovable
Description copied from interface:GroupsManagerImplApiCheck 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!!!- Specified by:
isRelationRemovablein interfaceGroupsManagerImplApi- Returns:
- true if it can be deleted; false otherwise
-
isUserMemberOfGroup
Description copied from interface:GroupsManagerImplApiChecks whether the user is member of the group.- Specified by:
isUserMemberOfGroupin interfaceGroupsManagerImplApi- Parameters:
sess-user-group-- Returns:
- true if the user is member of the group
-
searchForGroups
Description copied from interface:GroupsManagerImplApiSimilarity substring search in all groups based on name, shortname, description and optionally ID- Specified by:
searchForGroupsin interfaceGroupsManagerImplApi- Parameters:
sess- sessionsearchString- string to search forincludeIDs- whether to search in IDs as well, used for PERUNADMINs- Returns:
- list of matched groups
-
searchForGroups
public List<Group> searchForGroups(PerunSession sess, String searchString, Set<Integer> groupIds, Set<Integer> voIds, boolean includeIDs) Description copied from interface:GroupsManagerImplApiSimilarity 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.- Specified by:
searchForGroupsin interfaceGroupsManagerImplApi- 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
Description copied from interface:GroupsManagerImplApiSuspend synchronizing groups and their structures.- Specified by:
suspendGroupSynchronizationin interfaceGroupsManagerImplApi- Parameters:
sess- sessionsuspend- whether to suspend or unsuspend
-
isSuspendedGroupSynchronization
public boolean isSuspendedGroupSynchronization()Description copied from interface:GroupsManagerImplApiCheck if synchronizing groups is suspended.- Specified by:
isSuspendedGroupSynchronizationin interfaceGroupsManagerImplApi- Returns:
- True if suspended, false if synchronizing
-
removeAllManagerRolesOfGroup
Description copied from interface:GroupsManagerImplApiRemoves all manager roles related to the given group- Specified by:
removeAllManagerRolesOfGroupin interfaceGroupsManagerImplApi- Parameters:
session- sessiongroup- group
-
removeGroupUnion
public void removeGroupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws GroupRelationDoesNotExist Description copied from interface:GroupsManagerImplApiRemoves a union between two groups.- Specified by:
removeGroupUnionin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessionresultGroup- result groupoperandGroup- operand group- Throws:
GroupRelationDoesNotExist- if the union between the two groups does not exist
-
removeMember
public void removeMember(PerunSession sess, Group group, Member member) throws NotGroupMemberException Description copied from interface:GroupsManagerImplApiRemoves member form the group. The member object MUST have sourceGroupId parameter.- Specified by:
removeMemberin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessiongroup- groupmember- member- Throws:
NotGroupMemberException
-
removeResultGroupRelations
Description copied from interface:GroupsManagerImplApiRemoves all relations of this result group.- Specified by:
removeResultGroupRelationsin interfaceGroupsManagerImplApi- Parameters:
sess- perun sessionresultGroup- result group
-
saveGroupRelation
public void saveGroupRelation(PerunSession sess, Group resultGroup, Group operandGroup, boolean parentFlag) Description copied from interface:GroupsManagerImplApiSaves union operation between result group and operand group.- Specified by:
saveGroupRelationin interfaceGroupsManagerImplApi- 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)
-
setDirectGroupStatus
public void setDirectGroupStatus(PerunSession sess, Member member, Group group, MemberGroupStatus status) Description copied from interface:GroupsManagerImplApiSet direct status of the member to specified status in given group.- Specified by:
setDirectGroupStatusin interfaceGroupsManagerImplApi- Parameters:
member- member whose status will be changedgroup- group where member's status will be changedstatus- status that will be set
-
setIndirectGroupStatus
public void setIndirectGroupStatus(PerunSession sess, Member member, Group group, MemberGroupStatus status) Description copied from interface:GroupsManagerImplApiSet status of the member to specified status for indirect relations where the given group is the source group.- Specified by:
setIndirectGroupStatusin interfaceGroupsManagerImplApi- Parameters:
member- member whose status will be changedgroup- group where member's status will be changedstatus- status that will be set
-
updateGroup
Description copied from interface:GroupsManagerImplApiUpdates group by ID.Update shortName and description. Return Group with correctly set parameters
- Specified by:
updateGroupin interfaceGroupsManagerImplApi- Parameters:
sess-group- to update (use only ID, shortName and description)- Returns:
- updated group with correctly set parameters
- Throws:
GroupExistsException- if group with same name already exists in the same VO
-
updateGroupName
Description copied from interface:GroupsManagerImplApiUpdates 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
- Specified by:
updateGroupNamein interfaceGroupsManagerImplApi- Parameters:
sess-group- to update (use only ID and name)- Returns:
- updated group with correctly set parameters
-
updateParentGroupId
Description copied from interface:GroupsManagerImplApiUpdates parentGroupId.!! IMPORTANT This method allows to change parentGroupId, but it doesn't update group and subGroup names !!
- Specified by:
updateParentGroupIdin interfaceGroupsManagerImplApi- Parameters:
sess-group- to update- Returns:
- group with updated parentGroupId
-