Class GroupsManagerEntry
- All Implemented Interfaces:
GroupsManager
- Author:
- Michal Prochazka michalp@ics.muni.cz, Slavek Licehammer glory@ics.muni.cz
-
Field Summary
Fields inherited from interface cz.metacentrum.perun.core.api.GroupsManager
GROUP_FLAT_SYNCHRONIZATION_ATTRNAME, GROUP_FULL_NAME_REGEXP, GROUP_MEMBERSHIP_EXPIRATION_RULES_ATTRNAME, GROUP_SHORT_NAME_REGEXP, GROUP_START_OF_LAST_SUCCESSFUL_SYNC_ATTRNAME, GROUP_START_OF_LAST_SYNC_ATTRNAME, GROUP_STRUCTURE_SYNCHRO_INTERVAL_ATTRNAME, GROUP_STRUCTURE_SYNCHRO_TIMES_ATTRNAME, GROUP_SYNCHRO_TIMES_ATTRNAME, GROUP_SYNCHRONIZATION_FILE_ATTRNAME, GROUPAUTHORITATIVEGROUP_ATTRNAME, GROUPEXTSOURCE_ATTRNAME, GROUPLIGHTWEIGHTSYNCHRONIZATION_ATTRNAME, GROUPMEMBERSEXTSOURCE_ATTRNAME, GROUPMEMBERSFILTER_ATTRNAME, GROUPMEMBERSQUERY_ATTRNAME, GROUPS_STRUCTURE_LOGIN_ATTRNAME, GROUPS_STRUCTURE_LOGIN_PREFIX_ATTRNAME, GROUPS_STRUCTURE_SYNCHRO_ENABLED_ATTRNAME, GROUPSQUERY_ATTRNAME, GROUPSYNCHROENABLED_ATTRNAME, GROUPSYNCHROINTERVAL_ATTRNAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdmin
(PerunSession sess, Group group, Group authorizedGroup) Adds a group administrator to the group.void
addAdmin
(PerunSession sess, Group group, User user) Adds a user administrator of the group.void
addMember
(PerunSession sess, Group group, Member member) Adds member of the VO to the group in the same VO.void
addMember
(PerunSession sess, List<Group> groups, Member member) Adds member of the VO to the groups in the same VO.void
addMembers
(PerunSession sess, Group group, List<Member> members) Adds members of the VO to the group in the same VO.void
allowGroupsToHierarchicalVo
(PerunSession sess, List<Group> groups, Vo vo) Sets flag required for including groups to parent vo in a vo hierarchy.void
allowGroupToHierarchicalVo
(PerunSession sess, Group group, Vo vo) Sets flag required for including group to parent vo in a vo hierarchy.boolean
canExtendMembershipInGroup
(PerunSession sess, Member member, Group group) Returns true if member in given group can extend membership or if no rules were set for the membershipExpirationboolean
canExtendMembershipInGroupWithReason
(PerunSession sess, Member member, Group group) Returns true if member in given group can extend membership or throws exception with reason why use can't extends membershipvoid
copyMembers
(PerunSession sess, Group sourceGroup, List<Group> destinationGroups, List<Member> members) Copies direct members from one group to other groups in the same VO.createGroup
(PerunSession sess, Group parentGroup, Group group) Creates a new subgroup of the existing group.createGroup
(PerunSession sess, Vo vo, Group group) Creates a new top-level group and associates it with the VO from parameter.createGroupUnion
(PerunSession sess, Group resultGroup, Group operandGroup) Performs union operation on two groups.void
deleteAllGroups
(PerunSession sess, Vo vo) Deletes all groups under the VO except built-in groups (members, admins groups).void
deleteGroup
(PerunSession sess, Group group) Deletes group only if has no subgroups and no members.void
deleteGroup
(PerunSession sess, Group group, boolean forceDelete) If forceDelete is false, delete only group and if this group has members or subgroups, throw an exception.void
deleteGroups
(PerunSession perunSession, List<Group> groups, boolean forceDelete) Delete all groups in list from perun.void
disallowGroupsToHierarchicalVo
(PerunSession sess, List<Group> groups, Vo vo) Unsets flag required for including groups to parent vo in a vo hierarchyvoid
disallowGroupToHierarchicalVo
(PerunSession sess, Group group, Vo vo) Unsets flag required for including group to parent vo in a vo hierarchyvoid
extendMembershipInGroup
(PerunSession sess, Member member, Group group) Extend member membership in given group using membershipExpirationRules attribute defined in Group.void
forceAllSubGroupsSynchronization
(PerunSession sess, Group group) Force synchronization for all subgroups (recursively - whole tree) of the group (useful for group structure)void
forceGroupStructureSynchronization
(PerunSession sess, Group group) Puts the group on the first place to the queue of groups waiting for group structure synchronization.void
forceGroupSynchronization
(PerunSession sess, Group group) Synchronizes the group with the external group.getActiveGroupMembers
(PerunSession sess, Group group) Return all members of the group who are active (valid) in the group.getAdminGroups
(PerunSession sess, Group group) Gets list of all group administrators of given group.getAdmins
(PerunSession sess, Group group) Deprecated.getAdmins
(PerunSession perunSession, Group group, boolean onlyDirectAdmins) 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 groups of Vo by ACCESS RIGHTS: If user is: - PERUNADMIN or VOADMIN : all groups in vo - GROUPADMIN : only groups where user is admingetAllGroupsWhereMemberIsActive
(PerunSession sess, Member member) Returns all member's groups where member is in active state (is valid there) Included members group.getAllGroupsWithHierarchy
(PerunSession sess, Vo vo) Get groups of the VO stored in the map reflecting the hierarchy by ACCESS RIGHTS: If user is: - PERUNADMIN or VOADMIN : all Groups - GROUPADMIN : only groups where user is groupAdmingetAllMemberGroups
(PerunSession sess, Member member) Return all member's groups.getAllRichGroups
(PerunSession sess) Get all groups with all attributes.getAllRichGroups
(PerunSession sess, List<String> attrNames) Get all groups with their specified attributes.getAllRichGroupsWithAttributesByNames
(PerunSession sess, Vo vo, List<String> attrNames) Deprecated.getAllRichGroupsWithAttributesByNames
(PerunSession sess, Vo vo, List<String> attrNames, List<String> roles, List<RoleAssignmentType> types) Return all RichGroups containing selected attributes filtered by role and its typegetAllRichSubGroupsWithAttributesByNames
(PerunSession sess, Group parentGroup, List<String> attrNames) Deprecated.getAllRichSubGroupsWithAttributesByNames
(PerunSession sess, Group parentGroup, List<String> attrNames, List<String> roles, List<RoleAssignmentType> types) Return all RichSubGroups in parentGroup (all levels sub groups) containing selected attributes filtered by role and its type,getAllSubGroups
(PerunSession sess, Group parentGroup) Get all subgroups of the parentGroup recursively.getDirectAdmins
(PerunSession sess, Group group) Deprecated.getDirectRichAdminsWithSpecificAttributes
(PerunSession perunSession, Group group, List<String> specificAttributes) Deprecated.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 VO.getGroupDirectMembers
(PerunSession sess, Group group) Return all direct group members.int
getGroupDirectMembersCount
(PerunSession sess, Group group) Returns count of direct members in the groupgetGroupDirectRichMembers
(PerunSession sess, Group group) Returns direct group members in the RichMember object, which contains Member+User data.getGroupMemberById
(PerunSession sess, Group group, int memberId) Get group member by member ID.getGroupMembers
(PerunSession sess, Group group) Return all group members.getGroupMembers
(PerunSession sess, Group group, Status status) Return group members with specified vo membership status.int
getGroupMembersCount
(PerunSession sess, Group group) getGroupMembersCountsByGroupStatus
(PerunSession sess, Group group) Returns counts of group members by their group status.getGroupMembersCountsByVoStatus
(PerunSession sess, Group group) Returns counts of group members by their status in VO.getGroupRichMembers
(PerunSession sess, Group group) Returns group members in the RichMember object, which contains Member+User data.getGroupRichMembers
(PerunSession sess, Group group, Status status) Returns group members with specified membership status in the RichMember object, which contains Member+User data.getGroupRichMembersByIds
(PerunSession sess, int groupId, List<Integer> memberIds, List<String> attrNames) Returns list of RichMembers with requested attributes by their member IDs from given group.getGroupRichMembersWithAttributes
(PerunSession sess, Group group) Returns group members in the RichMember object, which contains Member+User data.getGroupRichMembersWithAttributes
(PerunSession sess, Group group, Status status) Returns group members with specified membership status in the RichMember object, which contains Member+User data.getGroups
(PerunSession sess, Vo vo) Get groups of users under the VO by ACCESS RIGHTS: If user is: - PERUNADMIN or VOADMIN : all groups - GROUPADMIN : only groups where user is GroupAdmingetGroupsByIds
(PerunSession sess, List<Integer> ids) Search for the groups with specified ids in all VOs.int
getGroupsCount
(PerunSession sess) Get count of all groupsint
getGroupsCount
(PerunSession sess, Vo vo) Gets the groupsManagerBl for this instance.getGroupsPage
(PerunSession sess, Vo vo, GroupsPageQuery query, List<String> attrNames) Get page of groups from the given vo.getGroupsWhereMemberIsActive
(PerunSession sess, Member member) Returns all member's groups where member is in active state (is valid there) Excluded members group.getGroupsWhereMemberIsInactive
(PerunSession sess, Member member) Returns all member's groups where member is in inactive state (it is not valid and it is expired there) Excluded members group.getGroupsWhereUserIsActiveMember
(PerunSession sess, User user, Vo vo) Returns groups in which the user is active member.getGroupUnions
(PerunSession sess, Group group, boolean reverseDirection) Get list of group unions for specified group.getInactiveGroupMembers
(PerunSession sess, Group group) Return all members of the group who are inactive (expired) in the group.getIndirectMembershipPaths
(PerunSession sess, Member member, Group group) Get unique paths of groups via which member is indirectly included to the group.getMemberGroups
(PerunSession sess, Member member) Returns all member's groups.getMemberGroupsByAttribute
(PerunSession sess, Member member, Attribute attribute) Method return list of groups for selected member which (groups) has set specific attribute.getMemberRichGroupsWithAttributesByNames
(PerunSession sess, Member member, List<String> attrNames) Deprecated.getMemberRichGroupsWithAttributesByNames
(PerunSession sess, Member member, List<String> attrNames, List<String> roles, List<RoleAssignmentType> types) Return all RichGroups for specified member, containing selected attributes filtered by role and its type.getParentGroup
(PerunSession sess, Group group) Get parent group.getParentGroupMembers
(PerunSession sess, Group group) Get members from parent group.getParentGroupRichMembers
(PerunSession sess, Group group) Get members form the parent group in RichMember format.getParentGroupRichMembersWithAttributes
(PerunSession sess, Group group) Get members form the parent group in RichMember format including user/member attributes.getRichAdmins
(PerunSession perunSession, Group group) Deprecated.getRichAdmins
(PerunSession perunSession, Group group, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) Gets list of all richUser administrators of this group.getRichAdminsWithAttributes
(PerunSession perunSession, Group group) Deprecated.getRichAdminsWithSpecificAttributes
(PerunSession perunSession, Group group, List<String> specificAttributes) Deprecated.getRichGroupByIdWithAttributesByNames
(PerunSession sess, int groupId, List<String> attrNames) Return RichGroup selected by id containing selected attributesgetRichGroupsAssignedToResourceWithAttributesByNames
(PerunSession sess, Member member, Resource resource, List<String> attrNames) Get list of all richGroups with selected attributes assigned to the resource filtered by specific member.getRichGroupsAssignedToResourceWithAttributesByNames
(PerunSession sess, Resource resource, List<String> attrNames) Get list of all richGroups with selected attributes assigned to resource.getRichSubGroupsWithAttributesByNames
(PerunSession sess, Group parentGroup, List<String> attrNames) Return RichSubGroups in parentGroup (only 1 level subgroups) containing selected attributesgetSubGroups
(PerunSession sess, Group parentGroup) Get all subgroups of the parent group under the VO.int
getSubGroupsCount
(PerunSession sess, Group parentGroup) Returns number of immediate subgroups of the parent group.getSubgroupsPage
(PerunSession sess, Group group, GroupsPageQuery query, List<String> attrNames) Get page of subgroups from the given parent group.getVo
(PerunSession sess, Group group) Gets the Vo which is owner of the group.boolean
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 GroupisGroupLastAdminInSomeFacility
(PerunSession sess, List<Group> groups) Check whether some of the groups supply the last FACILITYADMIN in some facility, return the groups that do.isGroupLastAdminInSomeVo
(PerunSession sess, List<Group> groups) Check whether some of the groups supply the last VOADMIN in some vo, return the groups that do.boolean
isGroupMember
(PerunSession sess, Group group, Member member) Return true if Member is member of the Groupboolean
Check if synchronizing groups is suspended.void
moveGroup
(PerunSession sess, Group destinationGroup, Group movingGroup) Move one group structure under another group in same vo or as top level groupvoid
removeAdmin
(PerunSession sess, Group group, Group authorizedGroup) Removes a group administrator of the group.void
removeAdmin
(PerunSession sess, Group group, User user) Removes a user administrator form the group.void
removeGroupUnion
(PerunSession sess, Group resultGroup, Group operandGroup) Removes a union relation between two groups.void
removeGroupUnions
(PerunSession sess, Group resultGroup, List<Group> operandGroups) Removes a union relations between groups.void
removeMember
(PerunSession sess, Group group, Member member) Removes member form the group.void
removeMember
(PerunSession sess, Member member, List<Group> groups) Removes a member from a list of groups.void
removeMembers
(PerunSession sess, Group group, List<Member> members) Removes members from a group.void
setGroupsManagerBl
(GroupsManagerBl groupsManagerBl) Sets the groupsManagerBl for this instance.setMemberGroupStatus
(PerunSession sess, Member member, Group group, MemberGroupStatus status) Set Members Group status for specified DIRECT member and group.void
setPerunBl
(PerunBl perunBl) Sets the perunBl for this instance.void
suspendGroupSynchronization
(PerunSession sess, boolean suspend) Suspend synchronizing groups and their structures.void
Synchronize all groups which have enabled synchronization.void
Synchronize all groups structures (with members) which have enabled group structure synchronization.updateGroup
(PerunSession sess, Group group) Updates group by ID.
-
Constructor Details
-
GroupsManagerEntry
-
GroupsManagerEntry
public GroupsManagerEntry()
-
-
Method Details
-
addAdmin
public void addAdmin(PerunSession sess, Group group, User user) throws AlreadyAdminException, PrivilegeException, GroupNotExistsException, UserNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:GroupsManager
Adds a user administrator of the group.- Specified by:
addAdmin
in interfaceGroupsManager
- Parameters:
sess
-group
-user
-- Throws:
AlreadyAdminException
PrivilegeException
GroupNotExistsException
UserNotExistsException
RoleCannotBeManagedException
RoleCannotBeSetException
-
addAdmin
public void addAdmin(PerunSession sess, Group group, Group authorizedGroup) throws AlreadyAdminException, PrivilegeException, GroupNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:GroupsManager
Adds a group administrator to the group.- Specified by:
addAdmin
in interfaceGroupsManager
- Parameters:
sess
-group
- - group that will be assigned admins (users) from authorizedGroupauthorizedGroup
- - group that will be given the privilege- Throws:
AlreadyAdminException
PrivilegeException
GroupNotExistsException
RoleCannotBeManagedException
RoleCannotBeSetException
-
addMember
public void addMember(PerunSession sess, List<Group> groups, Member member) throws MemberNotExistsException, PrivilegeException, AlreadyMemberException, GroupNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException, AttributeNotExistsException, ExternallyManagedException Description copied from interface:GroupsManager
Adds member of the VO to the groups in the same VO.- Specified by:
addMember
in interfaceGroupsManager
- Parameters:
sess
-groups
- list of groups, the member will be added tomember
- member to be added- Throws:
MemberNotExistsException
PrivilegeException
AlreadyMemberException
GroupNotExistsException
WrongAttributeValueException
- if any member attribute value, required by resource (on which the group is assigned), is wrongWrongReferenceAttributeValueException
WrongAttributeAssignmentException
AttributeNotExistsException
ExternallyManagedException
-
addMember
public void addMember(PerunSession sess, Group group, Member member) throws MemberNotExistsException, PrivilegeException, AlreadyMemberException, GroupNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException, AttributeNotExistsException, ExternallyManagedException Description copied from interface:GroupsManager
Adds member of the VO to the group in the same VO.- Specified by:
addMember
in interfaceGroupsManager
- Parameters:
sess
-group
-member
-- Throws:
MemberNotExistsException
PrivilegeException
AlreadyMemberException
GroupNotExistsException
WrongAttributeValueException
- if any member attribute value, required by resource (on which the group is assigned), is wrongWrongReferenceAttributeValueException
WrongAttributeAssignmentException
AttributeNotExistsException
ExternallyManagedException
-
addMembers
public void addMembers(PerunSession sess, Group group, List<Member> members) throws MemberNotExistsException, PrivilegeException, AlreadyMemberException, GroupNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException, AttributeNotExistsException, ExternallyManagedException Description copied from interface:GroupsManager
Adds members of the VO to the group in the same VO.- Specified by:
addMembers
in interfaceGroupsManager
- Parameters:
sess
-group
- list of groups, the member will be added tomembers
- member to be added- Throws:
MemberNotExistsException
PrivilegeException
AlreadyMemberException
GroupNotExistsException
WrongAttributeValueException
- if any member attribute value, required by resource (on which the group is assigned), is wrongWrongReferenceAttributeValueException
WrongAttributeAssignmentException
AttributeNotExistsException
ExternallyManagedException
-
allowGroupToHierarchicalVo
public void allowGroupToHierarchicalVo(PerunSession sess, Group group, Vo vo) throws VoNotExistsException, GroupNotExistsException, PrivilegeException, RelationNotExistsException, RelationExistsException Description copied from interface:GroupsManager
Sets flag required for including group to parent vo in a vo hierarchy.- Specified by:
allowGroupToHierarchicalVo
in interfaceGroupsManager
- Parameters:
sess
- perun sessiongroup
- groupvo
- parent vo- Throws:
VoNotExistsException
- if vo does not existGroupNotExistsException
- if group does not existPrivilegeException
- insufficient rightsRelationNotExistsException
- if group is not from parent vo's member vosRelationExistsException
- if group is already allowed to be included to parent vo
-
allowGroupsToHierarchicalVo
public void allowGroupsToHierarchicalVo(PerunSession sess, List<Group> groups, Vo vo) throws VoNotExistsException, GroupNotExistsException, PrivilegeException, RelationNotExistsException, RelationExistsException Description copied from interface:GroupsManager
Sets flag required for including groups to parent vo in a vo hierarchy.- Specified by:
allowGroupsToHierarchicalVo
in interfaceGroupsManager
- Parameters:
sess
- perun sessiongroups
- list of groupsvo
- parent vo- Throws:
VoNotExistsException
- if vo does not existGroupNotExistsException
- if group does not existPrivilegeException
- insufficient rightsRelationNotExistsException
- if group is not from parent vo's member vosRelationExistsException
- if group is already allowed to be included to parent vo
-
canExtendMembershipInGroup
public boolean canExtendMembershipInGroup(PerunSession sess, Member member, Group group) throws MemberNotExistsException, GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Returns true if member in given group can extend membership or if no rules were set for the membershipExpiration- Specified by:
canExtendMembershipInGroup
in interfaceGroupsManager
- Parameters:
sess
- sessionmember
- membergroup
- group- Returns:
- true if given member can extend membership in given group or if no rules were set for the membership expiration, false otherwise
- Throws:
MemberNotExistsException
GroupNotExistsException
PrivilegeException
-
canExtendMembershipInGroupWithReason
public boolean canExtendMembershipInGroupWithReason(PerunSession sess, Member member, Group group) throws MemberNotExistsException, GroupNotExistsException, PrivilegeException, ExtendMembershipException Description copied from interface:GroupsManager
Returns true if member in given group can extend membership or throws exception with reason why use can't extends membership- Specified by:
canExtendMembershipInGroupWithReason
in interfaceGroupsManager
- Parameters:
sess
- sessionmember
- membergroup
- group- Returns:
- true if given member can extend membership in given group or throws exception with reason why not
- Throws:
ExtendMembershipException
- reason why user can't extend membershipMemberNotExistsException
GroupNotExistsException
PrivilegeException
-
copyMembers
public void copyMembers(PerunSession sess, Group sourceGroup, List<Group> destinationGroups, List<Member> members) throws WrongReferenceAttributeValueException, WrongAttributeValueException, GroupNotExistsException, MemberNotExistsException, GroupGroupMismatchException, PrivilegeException, ExternallyManagedException, MemberGroupMismatchException Description copied from interface:GroupsManager
Copies direct members from one group to other groups in the same VO. The members are copied without their member-group attributes. Copies all direct members if members list is empty or null.- Specified by:
copyMembers
in interfaceGroupsManager
- Parameters:
sess
- perun sessionsourceGroup
- group to copy members fromdestinationGroups
- groups to copy members tomembers
- members to be copied- Throws:
WrongReferenceAttributeValueException
WrongAttributeValueException
GroupNotExistsException
- when one of the groups does not existMemberNotExistsException
- when one of the members does not existGroupGroupMismatchException
- when the groups are not in the same VoPrivilegeException
ExternallyManagedException
- when destination group is managed from an external sourceMemberGroupMismatchException
-
createGroup
public Group createGroup(PerunSession sess, Vo vo, Group group) throws GroupExistsException, PrivilegeException, VoNotExistsException Description copied from interface:GroupsManager
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
- Specified by:
createGroup
in interfaceGroupsManager
- Parameters:
sess
-vo
- to associates group withgroup
- new group with name without ":"- Returns:
- newly created top-level group
- Throws:
GroupExistsException
PrivilegeException
VoNotExistsException
-
createGroup
public Group createGroup(PerunSession sess, Group parentGroup, Group group) throws GroupNotExistsException, GroupExistsException, PrivilegeException, GroupRelationNotAllowed, GroupRelationAlreadyExists, ExternallyManagedException Description copied from interface:GroupsManager
Creates a new subgroup of the existing group.- Specified by:
createGroup
in interfaceGroupsManager
- 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:
GroupNotExistsException
GroupExistsException
PrivilegeException
GroupRelationNotAllowed
GroupRelationAlreadyExists
ExternallyManagedException
-
createGroupUnion
public Group createGroupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws GroupNotExistsException, PrivilegeException, GroupRelationNotAllowed, GroupRelationAlreadyExists, WrongAttributeValueException, WrongReferenceAttributeValueException, ExternallyManagedException, VoNotExistsException Description copied from interface:GroupsManager
Performs union operation on two groups. Members from operand group are added to result group as indirect.- Specified by:
createGroupUnion
in interfaceGroupsManager
- Parameters:
sess
- perun sessionresultGroup
- group to which members are addedoperandGroup
- group from which members are taken- Returns:
- result group
- Throws:
GroupNotExistsException
PrivilegeException
GroupRelationNotAllowed
GroupRelationAlreadyExists
WrongAttributeValueException
WrongReferenceAttributeValueException
VoNotExistsException
ExternallyManagedException
-
deleteAllGroups
public void deleteAllGroups(PerunSession sess, Vo vo) throws VoNotExistsException, PrivilegeException, GroupAlreadyRemovedException, GroupAlreadyRemovedFromResourceException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved Description copied from interface:GroupsManager
Deletes all groups under the VO except built-in groups (members, admins groups).- Specified by:
deleteAllGroups
in interfaceGroupsManager
- Parameters:
sess
-vo
- VO- Throws:
VoNotExistsException
PrivilegeException
GroupAlreadyRemovedException
- if there is at least 1 group not affected by deleting from DBGroupAlreadyRemovedFromResourceException
- if there is at least 1 group on resource affected by deleting from DBGroupRelationDoesNotExist
GroupRelationCannotBeRemoved
-
deleteGroup
public void deleteGroup(PerunSession sess, Group group, boolean forceDelete) throws GroupNotExistsException, PrivilegeException, RelationExistsException, GroupAlreadyRemovedException, GroupAlreadyRemovedFromResourceException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved, ExternallyManagedException Description copied from interface:GroupsManager
If forceDelete is false, delete only group and if this group has members or subgroups, throw an exception. If forceDelete is true, delete group with all subgroups, members and administrators, then delete this group.- Specified by:
deleteGroup
in interfaceGroupsManager
- Parameters:
sess
-group
- group to deleteforceDelete
- if forceDelete is false, delete group only if is empty and has no subgroups, if is true, delete anyway with all connections- Throws:
GroupNotExistsException
PrivilegeException
RelationExistsException
GroupAlreadyRemovedException
GroupAlreadyRemovedFromResourceException
GroupRelationDoesNotExist
GroupRelationCannotBeRemoved
ExternallyManagedException
-
deleteGroup
public void deleteGroup(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException, RelationExistsException, GroupAlreadyRemovedException, GroupAlreadyRemovedFromResourceException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved, ExternallyManagedException Description copied from interface:GroupsManager
Deletes group only if has no subgroups and no members. Other way throw exception. This method is same like deleteGroup(sess, group, false) with false for forceDelete- Specified by:
deleteGroup
in interfaceGroupsManager
- Parameters:
sess
-group
- group to delete- Throws:
GroupNotExistsException
PrivilegeException
RelationExistsException
GroupAlreadyRemovedException
GroupAlreadyRemovedFromResourceException
GroupRelationDoesNotExist
GroupRelationCannotBeRemoved
ExternallyManagedException
-
deleteGroups
public void deleteGroups(PerunSession perunSession, List<Group> groups, boolean forceDelete) throws GroupNotExistsException, PrivilegeException, GroupAlreadyRemovedException, RelationExistsException, GroupAlreadyRemovedFromResourceException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved, ExternallyManagedException Description copied from interface:GroupsManager
Delete all groups in list from perun. (Except members group)If forceDelete is false, delete groups only if none of them (IN MOMENT OF DELETING) has subgroups and members, in other case throw exception. if forceDelete is true, delete groups with all subgroups and members.
Groups are deleted in order: from longest name to the shortest - ex: Group A:b:c will be deleted sooner than Group A:b etc. - reason for this: with group are deleted its subgroups too
Important: Groups can be from different VOs.
- Specified by:
deleteGroups
in interfaceGroupsManager
- Parameters:
perunSession
-groups
- list of groups to deletedforceDelete
- if forceDelete is false, delete groups only if all of them have no subgroups and no members, if is true, delete anyway with all connections- Throws:
GroupNotExistsException
- If any group not exists in perunPrivilegeException
- if user has no right to call delete operation on any of these groupsGroupAlreadyRemovedException
- if any groups is already deletedRelationExistsException
- raise if group has subgroups or member (forceDelete is false)GroupAlreadyRemovedFromResourceException
- if any group is already removed from resourceGroupRelationDoesNotExist
GroupRelationCannotBeRemoved
ExternallyManagedException
-
disallowGroupToHierarchicalVo
public void disallowGroupToHierarchicalVo(PerunSession sess, Group group, Vo vo) throws VoNotExistsException, GroupNotExistsException, PrivilegeException, RelationNotExistsException Description copied from interface:GroupsManager
Unsets flag required for including group to parent vo in a vo hierarchy- Specified by:
disallowGroupToHierarchicalVo
in interfaceGroupsManager
- Parameters:
sess
- perun sessiongroup
- groupvo
- parent vo- Throws:
VoNotExistsException
- if vo does not existGroupNotExistsException
- if group does not existPrivilegeException
- insufficient rightsRelationNotExistsException
- if group is not allowed to be included in parent vo
-
disallowGroupsToHierarchicalVo
public void disallowGroupsToHierarchicalVo(PerunSession sess, List<Group> groups, Vo vo) throws VoNotExistsException, GroupNotExistsException, PrivilegeException, RelationNotExistsException Description copied from interface:GroupsManager
Unsets flag required for including groups to parent vo in a vo hierarchy- Specified by:
disallowGroupsToHierarchicalVo
in interfaceGroupsManager
- Parameters:
sess
- perun sessiongroups
- list of groupsvo
- parent vo- Throws:
VoNotExistsException
- if vo does not existGroupNotExistsException
- if group does not existPrivilegeException
- insufficient rightsRelationNotExistsException
- if group is not allowed to be included in parent vo
-
extendMembershipInGroup
public void extendMembershipInGroup(PerunSession sess, Member member, Group group) throws ExtendMembershipException, PrivilegeException, MemberNotExistsException, GroupNotExistsException Description copied from interface:GroupsManager
Extend member membership in given group using membershipExpirationRules attribute defined in Group.- Specified by:
extendMembershipInGroup
in interfaceGroupsManager
- Parameters:
sess
- sessionmember
- membergroup
- group- Throws:
ExtendMembershipException
- extend membership exceptionPrivilegeException
MemberNotExistsException
GroupNotExistsException
-
forceAllSubGroupsSynchronization
public void forceAllSubGroupsSynchronization(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Force synchronization for all subgroups (recursively - whole tree) of the group (useful for group structure)- Specified by:
forceAllSubGroupsSynchronization
in interfaceGroupsManager
- Parameters:
sess
-group
- the group where all its subgroups will be forced to synchronize- Throws:
GroupNotExistsException
- when group not exists in PerunPrivilegeException
- user is not privileged to call this method
-
forceGroupStructureSynchronization
public void forceGroupStructureSynchronization(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException, GroupStructureSynchronizationAlreadyRunningException Description copied from interface:GroupsManager
Puts the group on the first place to the queue of groups waiting for group structure synchronization.- Specified by:
forceGroupStructureSynchronization
in interfaceGroupsManager
- Parameters:
sess
-group
-- Throws:
GroupNotExistsException
PrivilegeException
GroupStructureSynchronizationAlreadyRunningException
-
forceGroupSynchronization
public void forceGroupSynchronization(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException, GroupSynchronizationAlreadyRunningException, GroupSynchronizationNotEnabledException Description copied from interface:GroupsManager
Synchronizes the group with the external group.- Specified by:
forceGroupSynchronization
in interfaceGroupsManager
- Parameters:
sess
-group
-- Throws:
GroupNotExistsException
PrivilegeException
GroupSynchronizationAlreadyRunningException
- when synchronization for the group is already runningGroupSynchronizationNotEnabledException
- when group doesn't have synchronization enabled
-
getActiveGroupMembers
public List<Member> getActiveGroupMembers(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Return all members of the group who are active (valid) in the group.Do not return expired members of the group.
- Specified by:
getActiveGroupMembers
in interfaceGroupsManager
- Parameters:
sess
- perun sessiongroup
- to get members from- Returns:
- list of active (valid) members
- Throws:
PrivilegeException
- insufficient permissionGroupNotExistsException
- when group does not exist
-
getAdminGroups
public List<Group> getAdminGroups(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Gets list of all group administrators of given group.- Specified by:
getAdminGroups
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- list of all group administrators of the given group
- Throws:
PrivilegeException
GroupNotExistsException
-
getAdmins
public List<User> getAdmins(PerunSession perunSession, Group group, boolean onlyDirectAdmins) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
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.If onlyDirectAdmins is true, return only direct users of the group for supported role.
Supported roles: GroupAdmin
- Specified by:
getAdmins
in interfaceGroupsManager
- Parameters:
perunSession
-group
-onlyDirectAdmins
- if true, get only direct user administrators (if false, get both direct and indirect)- Returns:
- list of all user administrators of the given group for supported role
- Throws:
PrivilegeException
GroupNotExistsException
-
getAdmins
@Deprecated public List<User> getAdmins(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Deprecated.Description copied from interface:GroupsManager
Gets list of all user administrators of this group. If some group is administrator of the given group, all members are included in the list.- Specified by:
getAdmins
in interfaceGroupsManager
- Parameters:
sess
-group
-- Throws:
PrivilegeException
GroupNotExistsException
-
getAllAllowedGroupsToHierarchicalVo
public List<Group> getAllAllowedGroupsToHierarchicalVo(PerunSession sess, Vo vo) throws VoNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Returns all groups which can be included to VO.- Specified by:
getAllAllowedGroupsToHierarchicalVo
in interfaceGroupsManager
- Parameters:
sess
- sessionvo
- parent VO- Returns:
- list of allowed groups to hierarchical VO
- Throws:
VoNotExistsException
- if given VO does not existPrivilegeException
- if unauthorized
-
getAllAllowedGroupsToHierarchicalVo
public List<Group> getAllAllowedGroupsToHierarchicalVo(PerunSession sess, Vo vo, Vo memberVo) throws VoNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Returns groups which can be included to VO from specific member VO.- Specified by:
getAllAllowedGroupsToHierarchicalVo
in interfaceGroupsManager
- Parameters:
sess
- sessionvo
- parent VOmemberVo
- member VO- Returns:
- list of allowed groups to hierarchical VO
- Throws:
VoNotExistsException
- if given parent VO or member VO does not existPrivilegeException
- if unauthorized
-
getAllGroups
Description copied from interface:GroupsManager
Get all groups from all vos. Returned groups are filtered based on the principal rights.- Specified by:
getAllGroups
in interfaceGroupsManager
- Parameters:
sess
- session- Returns:
- list of all groups
- Throws:
PrivilegeException
- if the principal has insufficient permission
-
getAllGroups
public List<Group> getAllGroups(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:GroupsManager
Get groups of Vo by ACCESS RIGHTS: If user is: - PERUNADMIN or VOADMIN : all groups in vo - GROUPADMIN : only groups where user is admin- Specified by:
getAllGroups
in interfaceGroupsManager
- Parameters:
sess
-vo
-- Returns:
- list of groups
- Throws:
PrivilegeException
VoNotExistsException
-
getAllGroupsWhereMemberIsActive
public List<Group> getAllGroupsWhereMemberIsActive(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:GroupsManager
Returns all member's groups where member is in active state (is valid there) Included members group.- Specified by:
getAllGroupsWhereMemberIsActive
in interfaceGroupsManager
- Parameters:
sess
- perun sessionmember
- member to get groups for- Returns:
- list of groups where member is in active state (valid)
- Throws:
PrivilegeException
- user is not privileged to call this methodMemberNotExistsException
- member in parameter not exists in perun
-
getAllGroupsWithHierarchy
public Map<Group,Object> getAllGroupsWithHierarchy(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:GroupsManager
Get groups of the VO stored in the map reflecting the hierarchy by ACCESS RIGHTS: If user is: - PERUNADMIN or VOADMIN : all Groups - GROUPADMIN : only groups where user is groupAdmin- Specified by:
getAllGroupsWithHierarchy
in interfaceGroupsManager
- Parameters:
sess
-vo
-- Returns:
- map of the groups hierarchically organized
- Throws:
PrivilegeException
VoNotExistsException
-
getAllMemberGroups
public List<Group> getAllMemberGroups(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:GroupsManager
Return all member's groups. Included members groups.- Specified by:
getAllMemberGroups
in interfaceGroupsManager
- Parameters:
sess
-member
-- Returns:
- Throws:
PrivilegeException
MemberNotExistsException
-
getAllRichGroups
Description copied from interface:GroupsManager
Get all groups with all attributes.- Specified by:
getAllRichGroups
in interfaceGroupsManager
- Parameters:
sess
- session- Returns:
- list of all groups with specified attributes
- Throws:
PrivilegeException
- if the principal has insufficient permission
-
getAllRichGroups
public List<RichGroup> getAllRichGroups(PerunSession sess, List<String> attrNames) throws PrivilegeException Description copied from interface:GroupsManager
Get all groups with their specified attributes. If theattrNames
are null or empty, all group attributes are returned.- Specified by:
getAllRichGroups
in interfaceGroupsManager
- Parameters:
sess
- sessionattrNames
- list of attribute names to get- Returns:
- list of all groups with specified attributes
- Throws:
PrivilegeException
- if the principal has insufficient permission
-
getAllRichGroupsWithAttributesByNames
@Deprecated public List<RichGroup> getAllRichGroupsWithAttributesByNames(PerunSession sess, Vo vo, List<String> attrNames) throws VoNotExistsException, PrivilegeException Deprecated.Description copied from interface:GroupsManager
Return all RichGroups containing selected attributes- Specified by:
getAllRichGroupsWithAttributesByNames
in interfaceGroupsManager
- Parameters:
sess
-vo
-attrNames
- if attrNames is null method will return RichGroups containing all attributes- Returns:
- List of RichGroups
- Throws:
VoNotExistsException
PrivilegeException
-
getAllRichGroupsWithAttributesByNames
public List<RichGroup> getAllRichGroupsWithAttributesByNames(PerunSession sess, Vo vo, List<String> attrNames, List<String> roles, List<RoleAssignmentType> types) throws VoNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Return all RichGroups containing selected attributes filtered by role and its type- Specified by:
getAllRichGroupsWithAttributesByNames
in interfaceGroupsManager
- Parameters:
sess
- perun sessionvo
- voattrNames
- if attrNames is null method will return RichGroups containing all attributesroles
- list of selected roles (if empty, then return groups by all roles)types
- list of selected types of roles (if empty, then return by roles of all types)- Returns:
- List of RichGroups
- Throws:
VoNotExistsException
PrivilegeException
-
getAllRichSubGroupsWithAttributesByNames
@Deprecated public List<RichGroup> getAllRichSubGroupsWithAttributesByNames(PerunSession sess, Group parentGroup, List<String> attrNames) throws GroupNotExistsException, PrivilegeException Deprecated.Description copied from interface:GroupsManager
Return all RichSubGroups in parentGroup (all levels sub groups) containing selected attributes- Specified by:
getAllRichSubGroupsWithAttributesByNames
in interfaceGroupsManager
- Parameters:
sess
-parentGroup
-attrNames
- if attrNames is null method will return RichGroups containing all attributes- Returns:
- List of RichGroups
- Throws:
GroupNotExistsException
PrivilegeException
-
getAllRichSubGroupsWithAttributesByNames
public List<RichGroup> getAllRichSubGroupsWithAttributesByNames(PerunSession sess, Group parentGroup, List<String> attrNames, List<String> roles, List<RoleAssignmentType> types) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Return all RichSubGroups in parentGroup (all levels sub groups) containing selected attributes filtered by role and its type,- Specified by:
getAllRichSubGroupsWithAttributesByNames
in interfaceGroupsManager
- Parameters:
sess
- perun sessionparentGroup
- parent groupattrNames
- if attrNames is null method will return RichGroups containing all attributesroles
- list of selected roles (if empty, then return groups by all roles)types
- list of selected types of roles (if empty, then return by roles of all types)- Returns:
- List of RichGroups
- Throws:
GroupNotExistsException
PrivilegeException
-
getAllSubGroups
public List<Group> getAllSubGroups(PerunSession sess, Group parentGroup) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Get all subgroups of the parentGroup recursively. (parentGroup subgroups, their subgroups etc...)- Specified by:
getAllSubGroups
in interfaceGroupsManager
- Parameters:
sess
-parentGroup
- parent group- Returns:
- list of groups
- Throws:
PrivilegeException
GroupNotExistsException
-
getDirectAdmins
@Deprecated public List<User> getDirectAdmins(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Deprecated.Description copied from interface:GroupsManager
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.- Specified by:
getDirectAdmins
in interfaceGroupsManager
- Parameters:
sess
-group
-- Throws:
PrivilegeException
GroupNotExistsException
-
getDirectRichAdminsWithSpecificAttributes
@Deprecated public List<RichUser> getDirectRichAdminsWithSpecificAttributes(PerunSession perunSession, Group group, List<String> specificAttributes) throws PrivilegeException, GroupNotExistsException Deprecated.Description copied from interface:GroupsManager
Get list of Group administrators, which are directly assigned (not by group membership) with specific attributes. From list of specificAttributes get all Users Attributes and find those for every RichAdmin (only, other attributes are not searched)- Specified by:
getDirectRichAdminsWithSpecificAttributes
in interfaceGroupsManager
- Parameters:
perunSession
-group
-specificAttributes
-- Returns:
- list of RichUsers with specific attributes.
- Throws:
PrivilegeException
GroupNotExistsException
-
getGroupById
public Group getGroupById(PerunSession sess, int id) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Search for the group with specified id in all VOs.- Specified by:
getGroupById
in interfaceGroupsManager
- Parameters:
sess
-id
-- Returns:
- group with specified id or throws GroupNotExistsException
- Throws:
GroupNotExistsException
PrivilegeException
-
getGroupByName
public Group getGroupByName(PerunSession sess, Vo vo, String name) throws GroupNotExistsException, PrivilegeException, VoNotExistsException Description copied from interface:GroupsManager
Search for the group with specified name in specified VO.IMPORTANT: need to use full name of group (ex. 'toplevel:a:b', not the shortname which is in this example 'b')
- Specified by:
getGroupByName
in interfaceGroupsManager
- Parameters:
sess
-vo
-name
-- Returns:
- group with specified name or throws GroupNotExistsException in specified VO
- Throws:
GroupNotExistsException
PrivilegeException
VoNotExistsException
-
getGroupDirectMembers
public List<Member> getGroupDirectMembers(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Return all direct group members.- Specified by:
getGroupDirectMembers
in interfaceGroupsManager
- Parameters:
sess
- perun sessiongroup
- group- Returns:
- list of direct members
- Throws:
PrivilegeException
- insufficient permissionGroupNotExistsException
- when group does not exist
-
getGroupDirectMembersCount
public int getGroupDirectMembersCount(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Returns count of direct members in the group- Specified by:
getGroupDirectMembersCount
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- count
- Throws:
GroupNotExistsException
PrivilegeException
-
getGroupDirectRichMembers
public List<RichMember> getGroupDirectRichMembers(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Returns direct group members in the RichMember object, which contains Member+User data.- Specified by:
getGroupDirectRichMembers
in interfaceGroupsManager
- Parameters:
sess
- sessiongroup
- group- Returns:
- list of direct RichMembers
- Throws:
PrivilegeException
- insufficient permissionGroupNotExistsException
- when group does not exist
-
getGroupMemberById
public Member getGroupMemberById(PerunSession sess, Group group, int memberId) throws NotGroupMemberException, GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Get group member by member ID.- Specified by:
getGroupMemberById
in interfaceGroupsManager
- Parameters:
sess
-group
-memberId
-- Returns:
- Member
- Throws:
NotGroupMemberException
GroupNotExistsException
PrivilegeException
-
getGroupMembers
public List<Member> getGroupMembers(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Return all group members.- Specified by:
getGroupMembers
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- list of members or empty list if the group is empty
- Throws:
PrivilegeException
GroupNotExistsException
-
getGroupMembers
public List<Member> getGroupMembers(PerunSession sess, Group group, Status status) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Return group members with specified vo membership status.- Specified by:
getGroupMembers
in interfaceGroupsManager
- Parameters:
sess
-group
-status
-- Returns:
- list of members with specified membership status or empty list if no such member is found in group
- Throws:
PrivilegeException
GroupNotExistsException
-
getGroupMembersCount
public int getGroupMembersCount(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException - Specified by:
getGroupMembersCount
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- count of members of specified group
- Throws:
GroupNotExistsException
PrivilegeException
-
getGroupMembersCountsByGroupStatus
public Map<MemberGroupStatus,Integer> getGroupMembersCountsByGroupStatus(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Returns counts of group members by their group status.- Specified by:
getGroupMembersCountsByGroupStatus
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- map of member status in group to count of group members with the status
- Throws:
GroupNotExistsException
- when the group doesn't existPrivilegeException
-
getGroupMembersCountsByVoStatus
public Map<Status,Integer> getGroupMembersCountsByVoStatus(PerunSession sess, Group group) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Returns counts of group members by their status in VO.- Specified by:
getGroupMembersCountsByVoStatus
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- map of member status in VO to count of group members with the status
- Throws:
GroupNotExistsException
- when the group doesn't existPrivilegeException
-
getGroupRichMembers
public List<RichMember> getGroupRichMembers(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Returns group members in the RichMember object, which contains Member+User data.- Specified by:
getGroupRichMembers
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- list of RichMembers
- Throws:
PrivilegeException
GroupNotExistsException
-
getGroupRichMembers
public List<RichMember> getGroupRichMembers(PerunSession sess, Group group, Status status) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Returns group members with specified membership status in the RichMember object, which contains Member+User data.- Specified by:
getGroupRichMembers
in interfaceGroupsManager
- Parameters:
sess
-group
-status
-- Returns:
- list of RichMembers
- Throws:
PrivilegeException
GroupNotExistsException
-
getGroupRichMembersByIds
public List<RichMember> getGroupRichMembersByIds(PerunSession sess, int groupId, List<Integer> memberIds, List<String> attrNames) throws GroupNotExistsException, PrivilegeException, AttributeNotExistsException Description copied from interface:GroupsManager
Returns list of RichMembers with requested attributes by their member IDs from given group. Skips invalid member IDs (unknown or not members of group). Supports member, member-group (stored in memberAttributes) and user attributes (stored in userAttributes).- Specified by:
getGroupRichMembersByIds
in interfaceGroupsManager
- Parameters:
sess
- perun sessiongroupId
- group idmemberIds
- ids of members to include in resultattrNames
- names of attributes to include in RichMembers- Returns:
- list of RichMembers
- Throws:
GroupNotExistsException
PrivilegeException
AttributeNotExistsException
-
getGroupRichMembersWithAttributes
public List<RichMember> getGroupRichMembersWithAttributes(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Returns group members in the RichMember object, which contains Member+User data. Also contains user and member attributes.- Specified by:
getGroupRichMembersWithAttributes
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- list of RichMembers
- Throws:
PrivilegeException
GroupNotExistsException
-
getGroupRichMembersWithAttributes
public List<RichMember> getGroupRichMembersWithAttributes(PerunSession sess, Group group, Status status) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Returns group members with specified membership status in the RichMember object, which contains Member+User data. Also contains user and member attributes.- Specified by:
getGroupRichMembersWithAttributes
in interfaceGroupsManager
- Parameters:
sess
-group
-status
-- Returns:
- list of RichMembers
- Throws:
PrivilegeException
GroupNotExistsException
-
getGroupUnions
public List<Group> getGroupUnions(PerunSession sess, Group group, boolean reverseDirection) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Get list of group unions for specified group.- Specified by:
getGroupUnions
in interfaceGroupsManager
- Parameters:
sess
- perun sessiongroup
- groupreverseDirection
- if false get all operand groups of requested result group if true get all result groups of requested operand group- Returns:
- list of groups.
- Throws:
GroupNotExistsException
PrivilegeException
-
getGroups
public List<Group> getGroups(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:GroupsManager
Get groups of users under the VO by ACCESS RIGHTS: If user is: - PERUNADMIN or VOADMIN : all groups - GROUPADMIN : only groups where user is GroupAdmin- Specified by:
getGroups
in interfaceGroupsManager
- Parameters:
sess
-vo
- vo- Returns:
- list of groups
- Throws:
PrivilegeException
VoNotExistsException
-
getGroupsByIds
Description copied from interface:GroupsManager
Search for the groups with specified ids in all VOs.- Specified by:
getGroupsByIds
in interfaceGroupsManager
- Parameters:
sess
-ids
-- Returns:
- groups with specified ids
- Throws:
PrivilegeException
-
getGroupsCount
- Specified by:
getGroupsCount
in interfaceGroupsManager
- Parameters:
sess
-vo
-- Returns:
- count of VO's groups
- Throws:
PrivilegeException
VoNotExistsException
-
getGroupsCount
Description copied from interface:GroupsManager
Get count of all groups- Specified by:
getGroupsCount
in interfaceGroupsManager
- Parameters:
sess
-- Returns:
- count of all groups
-
getGroupsManagerBl
Gets the groupsManagerBl for this instance.- Returns:
- The groupsManagerBl.
-
getGroupsManagerImpl
-
getGroupsPage
public Paginated<RichGroup> getGroupsPage(PerunSession sess, Vo vo, GroupsPageQuery query, List<String> attrNames) throws VoNotExistsException, PrivilegeException, MemberNotExistsException, GroupNotExistsException, MemberGroupMismatchException Description copied from interface:GroupsManager
Get page of groups from the given vo.- Specified by:
getGroupsPage
in interfaceGroupsManager
- Parameters:
sess
- sessionvo
- voquery
- query with page informationattrNames
- attribute names- Returns:
- page of requested rich groups
- Throws:
VoNotExistsException
PrivilegeException
MemberNotExistsException
GroupNotExistsException
MemberGroupMismatchException
-
getGroupsWhereMemberIsActive
public List<Group> getGroupsWhereMemberIsActive(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:GroupsManager
Returns all member's groups where member is in active state (is valid there) Excluded members group.- Specified by:
getGroupsWhereMemberIsActive
in interfaceGroupsManager
- Parameters:
sess
- perun sessionmember
- member to get groups for- Returns:
- list of groups where member is in active state (valid)
- Throws:
PrivilegeException
- user is not privileged to call this methodMemberNotExistsException
- member in parameter not exists in perun
-
getGroupsWhereMemberIsInactive
public List<Group> getGroupsWhereMemberIsInactive(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:GroupsManager
Returns all member's groups where member is in inactive state (it is not valid and it is expired there) Excluded members group.- Specified by:
getGroupsWhereMemberIsInactive
in interfaceGroupsManager
- Parameters:
sess
- perun sessionmember
- member to get groups for- Returns:
- list of groups where member is in inactive state (expired)
- Throws:
PrivilegeException
- user is not privileged to call this methodMemberNotExistsException
- member in parameter not exists in perun
-
getGroupsWhereUserIsActiveMember
public List<Group> getGroupsWhereUserIsActiveMember(PerunSession sess, User user, Vo vo) throws VoNotExistsException, UserNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Returns groups in which the user is active member. Groups are looked up only for the specified VO- Specified by:
getGroupsWhereUserIsActiveMember
in interfaceGroupsManager
- Parameters:
sess
- sessionuser
- user objectvo
- VO object- Returns:
- List of groups
- Throws:
VoNotExistsException
UserNotExistsException
PrivilegeException
-
getInactiveGroupMembers
public List<Member> getInactiveGroupMembers(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Return all members of the group who are inactive (expired) in the group.Do not return active members of the group.
- Specified by:
getInactiveGroupMembers
in interfaceGroupsManager
- Parameters:
sess
- perun sessiongroup
- to get members from- Returns:
- list of inactive (expired) members
- Throws:
PrivilegeException
- insufficient permissionGroupNotExistsException
- when group does not exist
-
getIndirectMembershipPaths
public List<List<Group>> getIndirectMembershipPaths(PerunSession sess, Member member, Group group) throws MemberNotExistsException, GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Get unique paths of groups via which member is indirectly included to the group. Cuts off after first included group.- Specified by:
getIndirectMembershipPaths
in interfaceGroupsManager
- Parameters:
sess
- perun sessionmember
- membergroup
- group in which the member is indirectly included- Returns:
- lists of groups [CURRENT GROUP -> SUBGROUP -> ... -> MEMBER'S SOURCE GROUP]
- Throws:
MemberNotExistsException
GroupNotExistsException
PrivilegeException
-
getMemberGroups
public List<Group> getMemberGroups(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:GroupsManager
Returns all member's groups. Except members groups.- Specified by:
getMemberGroups
in interfaceGroupsManager
- Parameters:
sess
-member
-- Returns:
- Throws:
PrivilegeException
MemberNotExistsException
-
getMemberGroupsByAttribute
public List<Group> getMemberGroupsByAttribute(PerunSession sess, Member member, Attribute attribute) throws WrongAttributeAssignmentException, PrivilegeException, MemberNotExistsException, AttributeNotExistsException Description copied from interface:GroupsManager
Method return list of groups for selected member which (groups) has set specific attribute. Attribute can be only from namespace "GROUP"- Specified by:
getMemberGroupsByAttribute
in interfaceGroupsManager
- Parameters:
sess
- sessmember
- memerattribute
- attribute from "GROUP" namespace- Returns:
- list of groups which contain member and have attribute with same value
- Throws:
WrongAttributeAssignmentException
PrivilegeException
MemberNotExistsException
AttributeNotExistsException
-
getMemberRichGroupsWithAttributesByNames
@Deprecated public List<RichGroup> getMemberRichGroupsWithAttributesByNames(PerunSession sess, Member member, List<String> attrNames) throws MemberNotExistsException, PrivilegeException Deprecated.Description copied from interface:GroupsManager
Return all RichGroups for specified member, containing selected attributes. "members" group is not included.Supported are attributes from these namespaces: - group - member-group
- Specified by:
getMemberRichGroupsWithAttributesByNames
in interfaceGroupsManager
- Parameters:
sess
- internal sessionmember
- the member to get the rich groups forattrNames
- list of selected attributes from supported namespaces- Returns:
- list of rich groups with selected attributes
- Throws:
MemberNotExistsException
PrivilegeException
-
getMemberRichGroupsWithAttributesByNames
public List<RichGroup> getMemberRichGroupsWithAttributesByNames(PerunSession sess, Member member, List<String> attrNames, List<String> roles, List<RoleAssignmentType> types) throws MemberNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Return all RichGroups for specified member, containing selected attributes filtered by role and its type. "members" group is not included.Supported are attributes from these namespaces: - group - member-group
- Specified by:
getMemberRichGroupsWithAttributesByNames
in interfaceGroupsManager
- Parameters:
sess
- internal sessionmember
- the member to get the rich groups forattrNames
- list of selected attributes from supported namespacesroles
- list of selected roles (if empty, then return groups by all roles)types
- list of selected types of roles (if empty, then return by roles of all types)- Returns:
- list of rich groups with selected attributes
- Throws:
MemberNotExistsException
PrivilegeException
-
getParentGroup
public Group getParentGroup(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException, ParentGroupNotExistsException Description copied from interface:GroupsManager
Get parent group. If group is topLevel group or Members group, return Members group.- Specified by:
getParentGroup
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- parent group
- Throws:
GroupNotExistsException
ParentGroupNotExistsException
PrivilegeException
-
getParentGroupMembers
public List<Member> getParentGroupMembers(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Get members from parent group. If the parent group doesn't exist (this is top level group) return all VO (from which the group is) members instead.- Specified by:
getParentGroupMembers
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- Throws:
PrivilegeException
GroupNotExistsException
-
getParentGroupRichMembers
public List<RichMember> getParentGroupRichMembers(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Get members form the parent group in RichMember format.- Specified by:
getParentGroupRichMembers
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- list of parent group rich members
- Throws:
PrivilegeException
GroupNotExistsException
-
getParentGroupRichMembersWithAttributes
public List<RichMember> getParentGroupRichMembersWithAttributes(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Get members form the parent group in RichMember format including user/member attributes.- Specified by:
getParentGroupRichMembersWithAttributes
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- list of parent group rich members
- Throws:
PrivilegeException
GroupNotExistsException
-
getPerunBl
-
getRichAdmins
public List<RichUser> getRichAdmins(PerunSession perunSession, Group group, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws PrivilegeException, GroupNotExistsException, UserNotExistsException Description copied from interface:GroupsManager
Gets list of all richUser administrators of this group. If some group is administrator of the given group, all VALID members are included in the list.Supported roles: GroupAdmin
If "onlyDirectAdmins" is "true", return only direct users of the group for supported role with specific attributes. If "allUserAttributes" is "true", do not specify attributes through list and return them all in objects richUser. Ignoring list of specific attributes.
- Specified by:
getRichAdmins
in interfaceGroupsManager
- Parameters:
perunSession
-group
-specificAttributes
- list of specified attributes which are needed in object richUserallUserAttributes
- if true, get all possible user attributes and ignore list of specificAttributes (if false, get only specific attributes)onlyDirectAdmins
- if true, get only direct user administrators (if false, get both direct and indirect)- Returns:
- list of RichUser administrators for the group and supported role with attributes
- Throws:
PrivilegeException
GroupNotExistsException
UserNotExistsException
-
getRichAdmins
@Deprecated public List<RichUser> getRichAdmins(PerunSession perunSession, Group group) throws PrivilegeException, GroupNotExistsException Deprecated.Description copied from interface:GroupsManager
Gets list of all administrators of this group like RichUsers without attributes.- Specified by:
getRichAdmins
in interfaceGroupsManager
- Parameters:
perunSession
-group
-- Throws:
PrivilegeException
GroupNotExistsException
-
getRichAdminsWithAttributes
@Deprecated public List<RichUser> getRichAdminsWithAttributes(PerunSession perunSession, Group group) throws PrivilegeException, GroupNotExistsException, UserNotExistsException Deprecated.Description copied from interface:GroupsManager
Gets list of all administrators of this group like RichUsers with attributes.- Specified by:
getRichAdminsWithAttributes
in interfaceGroupsManager
- Parameters:
perunSession
-group
-- Throws:
PrivilegeException
GroupNotExistsException
UserNotExistsException
-
getRichAdminsWithSpecificAttributes
@Deprecated public List<RichUser> getRichAdminsWithSpecificAttributes(PerunSession perunSession, Group group, List<String> specificAttributes) throws PrivilegeException, GroupNotExistsException Deprecated.Description copied from interface:GroupsManager
Get list of Group administrators with specific attributes. From list of specificAttributes get all Users Attributes and find those for every RichAdmin (only, other attributes are not searched)- Specified by:
getRichAdminsWithSpecificAttributes
in interfaceGroupsManager
- Parameters:
perunSession
-group
-specificAttributes
-- Returns:
- list of RichUsers with specific attributes.
- Throws:
PrivilegeException
GroupNotExistsException
-
getRichGroupByIdWithAttributesByNames
public RichGroup getRichGroupByIdWithAttributesByNames(PerunSession sess, int groupId, List<String> attrNames) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Return RichGroup selected by id containing selected attributes- Specified by:
getRichGroupByIdWithAttributesByNames
in interfaceGroupsManager
- Parameters:
sess
-groupId
-attrNames
- if attrNames is null method will return RichGroup containing all attributes- Returns:
- RichGroup
- Throws:
GroupNotExistsException
PrivilegeException
-
getRichGroupsAssignedToResourceWithAttributesByNames
public List<RichGroup> getRichGroupsAssignedToResourceWithAttributesByNames(PerunSession sess, Resource resource, List<String> attrNames) throws ResourceNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Get list of all richGroups with selected attributes assigned to resource. Allowed namespaces of attributes are group and group-resource.Last step is filtration of attributes: Attributes are filtered by rights of user in session. User get only those selected attributes he has rights to read.
- Specified by:
getRichGroupsAssignedToResourceWithAttributesByNames
in interfaceGroupsManager
- Parameters:
sess
-resource
- resource to get assigned groups forattrNames
- list of selected attribute names, if it is null, return all possible non-empty attributes, empty list in attrNames means - no attributes needed- Returns:
- list of RichGroup objects with specific attributes specified by object Resource and object Member.
- Throws:
ResourceNotExistsException
PrivilegeException
-
getRichGroupsAssignedToResourceWithAttributesByNames
public List<RichGroup> getRichGroupsAssignedToResourceWithAttributesByNames(PerunSession sess, Member member, Resource resource, List<String> attrNames) throws ResourceNotExistsException, PrivilegeException, MemberNotExistsException Description copied from interface:GroupsManager
Get list of all richGroups with selected attributes assigned to the resource filtered by specific member. Allowed namespaces of attributes are group, group-resource, member-groupLast step is filtration of attributes: Attributes are filtered by rights of user in session. User get only those selected attributes he has rights to read.
- Specified by:
getRichGroupsAssignedToResourceWithAttributesByNames
in interfaceGroupsManager
- Parameters:
sess
-member
- member used for filtering returned groups (groups have to contain this member to be returned)resource
- resource to get assigned groups forattrNames
- list of selected attribute names, if it is null, return all possible non-empty attributes, empty list in attrNames means - no attributes needed- Returns:
- list of RichGroup objects with specific attributes specified by object Resource and object Member
- Throws:
ResourceNotExistsException
PrivilegeException
MemberNotExistsException
-
getRichSubGroupsWithAttributesByNames
public List<RichGroup> getRichSubGroupsWithAttributesByNames(PerunSession sess, Group parentGroup, List<String> attrNames) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Return RichSubGroups in parentGroup (only 1 level subgroups) containing selected attributes- Specified by:
getRichSubGroupsWithAttributesByNames
in interfaceGroupsManager
- Parameters:
sess
-parentGroup
-attrNames
- if attrNames is null method will return RichGroups containing all attributes- Returns:
- List of RichGroups
- Throws:
GroupNotExistsException
PrivilegeException
-
getSubGroups
public List<Group> getSubGroups(PerunSession sess, Group parentGroup) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Get all subgroups of the parent group under the VO.- Specified by:
getSubGroups
in interfaceGroupsManager
- Parameters:
sess
-parentGroup
- parent group- Returns:
- list of groups
- Throws:
PrivilegeException
GroupNotExistsException
-
getSubGroupsCount
public int getSubGroupsCount(PerunSession sess, Group parentGroup) throws PrivilegeException, GroupNotExistsException Description copied from interface:GroupsManager
Returns number of immediate subgroups of the parent group.- Specified by:
getSubGroupsCount
in interfaceGroupsManager
- Parameters:
sess
-parentGroup
-- Returns:
- count of parent group immediate subgroups
- Throws:
PrivilegeException
GroupNotExistsException
-
getSubgroupsPage
public Paginated<RichGroup> getSubgroupsPage(PerunSession sess, Group group, GroupsPageQuery query, List<String> attrNames) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Get page of subgroups from the given parent group.- Specified by:
getSubgroupsPage
in interfaceGroupsManager
- Parameters:
sess
- sessiongroup
- parent groupquery
- query with page informationattrNames
- attribute names- Returns:
- page of requested rich groups
- Throws:
GroupNotExistsException
PrivilegeException
-
getVo
Description copied from interface:GroupsManager
Gets the Vo which is owner of the group.- Specified by:
getVo
in interfaceGroupsManager
- Parameters:
sess
-group
-- Returns:
- Vo which is owner of the group.
- Throws:
GroupNotExistsException
PrivilegeException
-
isAllowedGroupToHierarchicalVo
public boolean isAllowedGroupToHierarchicalVo(PerunSession sess, Group group, Vo vo) throws VoNotExistsException, GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Returns flag representing if the group can be included in the (parent) vo's groups- Specified by:
isAllowedGroupToHierarchicalVo
in interfaceGroupsManager
- Parameters:
sess
- perun sessiongroup
- groupvo
- parent vo- Returns:
- true if group can be included in vo's groups, false otherwise
- Throws:
VoNotExistsException
- if vo does not existGroupNotExistsException
- if group does not existPrivilegeException
- insufficient rights
-
isDirectGroupMember
public boolean isDirectGroupMember(PerunSession sess, Group group, Member member) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Return true if Member is direct member of the Group- Specified by:
isDirectGroupMember
in interfaceGroupsManager
- Parameters:
sess
- sessiongroup
- group where the membership is to be checkedmember
- member whose membership is to be checked- Returns:
- true if Member is direct member of the Group
- Throws:
GroupNotExistsException
PrivilegeException
-
isGroupLastAdminInSomeFacility
public List<Group> isGroupLastAdminInSomeFacility(PerunSession sess, List<Group> groups) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Check whether some of the groups supply the last FACILITYADMIN in some facility, return the groups that do. Such facilities could upon removal of the group be left without a person to manage them.- Specified by:
isGroupLastAdminInSomeFacility
in interfaceGroupsManager
- Parameters:
sess
- sessiongroups
- groups to check- Returns:
- list of groups which supply last FACILITYADMIN in some facility
- Throws:
GroupNotExistsException
- group does not existPrivilegeException
- insufficient rights
-
isGroupLastAdminInSomeVo
public List<Group> isGroupLastAdminInSomeVo(PerunSession sess, List<Group> groups) throws GroupNotExistsException, PrivilegeException Description copied from interface:GroupsManager
Check whether some of the groups supply the last VOADMIN in some vo, return the groups that do. Such vos could upon removal of the group be left without a person to manage them.- Specified by:
isGroupLastAdminInSomeVo
in interfaceGroupsManager
- Parameters:
sess
- sessiongroups
- groups to check- Returns:
- list of groups which supply last VOADMIN in some facility
- Throws:
GroupNotExistsException
- group does not existPrivilegeException
- insufficient rights
-
isGroupMember
public boolean isGroupMember(PerunSession sess, Group group, Member member) throws PrivilegeException, GroupNotExistsException, MemberNotExistsException Description copied from interface:GroupsManager
Return true if Member is member of the Group- Specified by:
isGroupMember
in interfaceGroupsManager
- Parameters:
sess
-group
-member
-- Returns:
- true if Member is member of the Group
- Throws:
PrivilegeException
GroupNotExistsException
MemberNotExistsException
-
moveGroup
public void moveGroup(PerunSession sess, Group destinationGroup, Group movingGroup) throws GroupNotExistsException, PrivilegeException, GroupMoveNotAllowedException, WrongAttributeValueException, WrongReferenceAttributeValueException, ExternallyManagedException Description copied from interface:GroupsManager
Move one group structure under another group in same vo or as top level group- Specified by:
moveGroup
in interfaceGroupsManager
- Parameters:
sess
- perun sessiondestinationGroup
- group to which is moving group moved, if it's null group will be moved as top level groupmovingGroup
- group which is moved to destination group- Throws:
GroupNotExistsException
PrivilegeException
WrongAttributeValueException
WrongReferenceAttributeValueException
GroupMoveNotAllowedException
ExternallyManagedException
-
removeAdmin
public void removeAdmin(PerunSession sess, Group group, User user) throws PrivilegeException, GroupNotExistsException, UserNotAdminException, UserNotExistsException, RoleCannotBeManagedException Description copied from interface:GroupsManager
Removes a user administrator form the group.- Specified by:
removeAdmin
in interfaceGroupsManager
- Parameters:
sess
-group
-user
-- Throws:
PrivilegeException
GroupNotExistsException
UserNotAdminException
UserNotExistsException
RoleCannotBeManagedException
-
removeAdmin
public void removeAdmin(PerunSession sess, Group group, Group authorizedGroup) throws PrivilegeException, GroupNotExistsException, GroupNotAdminException, RoleCannotBeManagedException Description copied from interface:GroupsManager
Removes a group administrator of the group.- Specified by:
removeAdmin
in interfaceGroupsManager
- Parameters:
sess
-group
-authorizedGroup
- group that will be removed the privilege- Throws:
PrivilegeException
GroupNotExistsException
GroupNotAdminException
RoleCannotBeManagedException
-
removeGroupUnion
public void removeGroupUnion(PerunSession sess, Group resultGroup, Group operandGroup) throws GroupNotExistsException, PrivilegeException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved, ExternallyManagedException Description copied from interface:GroupsManager
Removes a union relation between two groups. All indirect members that originate from operand group are removed from result group.- Specified by:
removeGroupUnion
in interfaceGroupsManager
- Parameters:
sess
- perun sessionresultGroup
- group from which members are removedoperandGroup
- group which members are removed from result group- Throws:
GroupNotExistsException
PrivilegeException
GroupRelationDoesNotExist
GroupRelationCannotBeRemoved
ExternallyManagedException
-
removeGroupUnions
public void removeGroupUnions(PerunSession sess, Group resultGroup, List<Group> operandGroups) throws GroupNotExistsException, PrivilegeException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved, ExternallyManagedException Description copied from interface:GroupsManager
Removes a union relations between groups. All indirect members that originate from operand groups are removed from result group.- Specified by:
removeGroupUnions
in interfaceGroupsManager
- Parameters:
sess
- perun sessionresultGroup
- group from which members are removedoperandGroups
- groups which members are removed from result group- Throws:
GroupNotExistsException
PrivilegeException
GroupRelationDoesNotExist
GroupRelationCannotBeRemoved
ExternallyManagedException
-
removeMember
public void removeMember(PerunSession sess, Group group, Member member) throws MemberNotExistsException, NotGroupMemberException, PrivilegeException, GroupNotExistsException, WrongAttributeAssignmentException, AttributeNotExistsException, ExternallyManagedException Description copied from interface:GroupsManager
Removes member form the group.- Specified by:
removeMember
in interfaceGroupsManager
- Parameters:
sess
-group
- group, from which the member is to be removedmember
- Member to be removed- Throws:
MemberNotExistsException
- when member doesn't existNotGroupMemberException
- when member is not in the groupPrivilegeException
GroupNotExistsException
- when the group doesn't existWrongAttributeAssignmentException
- when assigning atribute to wrong entityAttributeNotExistsException
- when attribute doesn't existExternallyManagedException
- when the group is externally managed
-
removeMember
public void removeMember(PerunSession sess, Member member, List<Group> groups) throws MemberNotExistsException, NotGroupMemberException, PrivilegeException, GroupNotExistsException, WrongAttributeAssignmentException, AttributeNotExistsException, ExternallyManagedException Description copied from interface:GroupsManager
Removes a member from a list of groups.- Specified by:
removeMember
in interfaceGroupsManager
- Parameters:
sess
-member
- Member to be removedgroups
- list of groups, from which the member is to be removed, can be empty- Throws:
MemberNotExistsException
- when member doesn't existNotGroupMemberException
- when member is not in the groupPrivilegeException
GroupNotExistsException
- when the group doesn't existWrongAttributeAssignmentException
- when assigning atribute to wrong entityAttributeNotExistsException
- when attribute doesn't existExternallyManagedException
- when the group is externally managed
-
removeMembers
public void removeMembers(PerunSession sess, Group group, List<Member> members) throws MemberNotExistsException, NotGroupMemberException, PrivilegeException, GroupNotExistsException, WrongAttributeAssignmentException, AttributeNotExistsException, ExternallyManagedException Description copied from interface:GroupsManager
Removes members from a group.- Specified by:
removeMembers
in interfaceGroupsManager
- Parameters:
sess
-group
- group, from which the members are to be removedmembers
- list of members to be removed, can be empty- Throws:
MemberNotExistsException
- when member doesn't existNotGroupMemberException
- when member is not in the groupPrivilegeException
GroupNotExistsException
- when the group doesn't existWrongAttributeAssignmentException
- when assigning atribute to wrong entityAttributeNotExistsException
- when attribute doesn't existExternallyManagedException
- when the group is externally managed
-
setGroupsManagerBl
Sets the groupsManagerBl for this instance.- Parameters:
groupsManagerBl
- The groupsManagerBl.
-
setMemberGroupStatus
public Member setMemberGroupStatus(PerunSession sess, Member member, Group group, MemberGroupStatus status) throws GroupNotExistsException, MemberNotExistsException, PrivilegeException, NotGroupMemberException Description copied from interface:GroupsManager
Set Members Group status for specified DIRECT member and group. Member with newly calculated group membership status is returned.Please note, that if member is also sourced from sub-groups or groups in relation and has VALID status in any of them, then resulting status is still VALID. In order to really expire such member is to set EXPIRED status also to all sourcing sub-groups or groups in relation.
- Specified by:
setMemberGroupStatus
in interfaceGroupsManager
- Parameters:
sess
- perun sessionmember
- member to set status forgroup
- group to set status instatus
- status to set (VALID/EXPIRED)- Returns:
- Member with newly calculated status.
- Throws:
GroupNotExistsException
MemberNotExistsException
PrivilegeException
NotGroupMemberException
-
setPerunBl
Sets the perunBl for this instance.- Parameters:
perunBl
- The perunBl.
-
suspendGroupSynchronization
public void suspendGroupSynchronization(PerunSession sess, boolean suspend) throws PrivilegeException Description copied from interface:GroupsManager
Suspend synchronizing groups and their structures. Groups being currently synchronized will finish.- Specified by:
suspendGroupSynchronization
in interfaceGroupsManager
- Parameters:
sess
- sessionsuspend
- whether to suspend or unsuspend- Throws:
PrivilegeException
-
isSuspendedGroupSynchronization
Description copied from interface:GroupsManager
Check if synchronizing groups is suspended.- Specified by:
isSuspendedGroupSynchronization
in interfaceGroupsManager
- Returns:
- True if suspended, false if synchronizing
- Throws:
PrivilegeException
-
synchronizeGroups
Description copied from interface:GroupsManager
Synchronize all groups which have enabled synchronization. This method is run by the scheduler every 5 minutes.- Specified by:
synchronizeGroups
in interfaceGroupsManager
- Throws:
PrivilegeException
-
synchronizeGroupsStructures
Description copied from interface:GroupsManager
Synchronize all groups structures (with members) which have enabled group structure synchronization. This method is run by the scheduler every 5 minutes.- Specified by:
synchronizeGroupsStructures
in interfaceGroupsManager
- Throws:
PrivilegeException
-
updateGroup
public Group updateGroup(PerunSession sess, Group group) throws GroupNotExistsException, GroupExistsException, PrivilegeException Description copied from interface:GroupsManager
Updates group by ID.Update shortName (use shortName) and description. Group.name is ignored. Return Group with correctly set parameters (including group.name)
- Specified by:
updateGroup
in interfaceGroupsManager
- Parameters:
sess
-group
- to update (use only ID, shortName and description)- Returns:
- updated group with correctly set parameters (including group.name)
- Throws:
GroupNotExistsException
GroupExistsException
- if group with same name already exists in the same VOPrivilegeException
-