Interface MembersManager
- All Known Implementing Classes:
MembersManagerEntry
- Author:
- Michal Prochazka, Slavek Licehammer, Zora Sebestianova
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMemberCandidates
(PerunSession sess, Vo vo, List<MemberCandidate> candidates) Add member candidates.void
addMemberCandidates
(PerunSession sess, Vo vo, List<MemberCandidate> candidates, Group group) Add member candidates to Group.boolean
canBeMember
(PerunSession sess, Vo vo, User user, String loa) Checks if the user can apply membership to the VO, it decides based on extendMembershipRules on the doNotAllowLoa keyboolean
canBeMemberWithReason
(PerunSession sess, Vo vo, User user, String loa) Checks if the user can apply membership to the VO, it decides based on extendMembershipRules on the doNotAllowLoa keyboolean
canExtendMembership
(PerunSession sess, Member member) Return true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise false.boolean
canExtendMembershipWithReason
(PerunSession sess, Member member) Return true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise throws exception.void
copySponsoredMembers
(PerunSession session, List<Member> sponsored, User copyFrom, User copyTo, boolean copyValidity, LocalDate validityTo) Set another user (copyTo) as sponsor of sponsored members of user (copyFrom).createMember
(PerunSession sess, Vo vo, Candidate candidate) Creates a new member from candidate returned by the method VosManager.findCandidates which fills Candidate .userExtSource.createMember
(PerunSession sess, Vo vo, Candidate candidate, List<Group> groups) Creates a new member from candidate returned by the method VosManager.findCandidates which fills Candidate .userExtSource.createMember
(PerunSession sess, Vo vo, ExtSource extSource, String login) Create new member from user by login and ExtSource.createMember
(PerunSession sess, Vo vo, ExtSource extSource, String login, List<Group> groups) Create new member from user by login and ExtSource.createMember
(PerunSession sess, Vo vo, User user) Creates a new member from user.createMember
(PerunSession sess, Vo vo, User user, List<Group> groups) Creates a new member from user.createMember
(PerunSession sess, Vo vo, String extSourceName, String extSourceType, int extSourceLoa, String login, Candidate candidate) Creates a new member and sets all member's attributes from the candidate.createMember
(PerunSession sess, Vo vo, String extSourceName, String extSourceType, int extSourceLoa, String login, Candidate candidate, List<Group> groups) Creates a new member and sets all member's attributes from the candidate.createMember
(PerunSession sess, Vo vo, String extSourceName, String extSourceType, String login, Candidate candidate) Creates a new member and sets all member's attributes from the candidate.createMember
(PerunSession sess, Vo vo, String extSourceName, String extSourceType, String login, Candidate candidate, List<Group> groups) Creates a new member and sets all member's attributes from the candidate.createSpecificMember
(PerunSession sess, Vo vo, Candidate candidate, List<User> specificUserOwners, SpecificUserType specificUserType) Creates a new member from candidate which is prepared for creating specific User In list specificUserOwners can't be specific user, only normal users and sponsored users are allowed.createSpecificMember
(PerunSession sess, Vo vo, Candidate candidate, List<User> specificUserOwners, SpecificUserType specificUserType, List<Group> groups) Creates a new member from candidate which is prepared for creating specificUser In list specificUserOwners can't be specific user, only normal users and sponsored users are allowed.createSponsoredMember
(PerunSession session, SponsoredUserData data, Vo vo, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url) Creates a new sponsored Member and its User.createSponsoredMembers
(PerunSession session, Vo vo, String namespace, List<String> names, String email, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url) Creates new sponsored Members (with random generated passwords).createSponsoredMembersFromCSV
(PerunSession sess, Vo vo, String namespace, List<String> data, String header, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url, List<Group> groups) Creates new sponsored members using input from CSV file.void
deleteAllMembers
(PerunSession sess, Vo vo) Deletes all VO members.void
deleteMember
(PerunSession sess, Member member) Deletes only member data appropriated by member id.void
deleteMembers
(PerunSession sess, List<Member> members) Delete given members.extendExpirationForSponsoredMember
(PerunSession session, Member sponsored, User sponsor) Extends expiration date.void
extendMembership
(PerunSession sess, Member member) Extend member membership using membershipExpirationRules attribute defined at VO.findCompleteRichMembers
(PerunSession sess, Group group, List<String> attrsNames, String searchString, boolean lookingInParentGroup) Return list of richMembers for specific group by the searchString with attrs specific for list of attrsNames.findCompleteRichMembers
(PerunSession sess, Group group, List<String> attrsNames, List<String> allowedStatuses, List<String> allowedGroupStatuses, String searchString, boolean lookingInParentGroup) Return list of richMembers for specific group by the searchString with attrs specific for list of attrsNames and who have only status which is contain in lists of statuses.findCompleteRichMembers
(PerunSession sess, Vo vo, List<String> attrsNames, String searchString, boolean onlySponsored) Return list of richMembers for specific vo by the searchString with attrs specific for list of attrsNames.findCompleteRichMembers
(PerunSession sess, Vo vo, List<String> attrsNames, List<String> allowedStatuses, String searchString) Return list of richMembers for specific vo by the searchString with attrs specific for list of attrsNames and who have only status which is contain in list of statuses.findCompleteRichMembers
(PerunSession sess, List<String> attrsNames, List<String> allowedStatuses, String searchString) Return list of richMembers from Perun by searchString with attrs specific for list of attrsNames and who have only status which is contain in list of statuses.findMembersByName
(PerunSession sess, String searchString) Return list of members by the searchStringfindMembersByNameInVo
(PerunSession sess, Vo vo, String searchString) Return list of members by the searchString under defined VO.findMembersInGroup
(PerunSession sess, Group group, String searchString) Return list of members by the searchString under defined Group.findMembersInParentGroup
(PerunSession sess, Group group, String searchString) Return list of members by the searchString udner parentGroup of defined Group.findMembersInVo
(PerunSession sess, Vo vo, String searchString) Return list of members by the searchString under defined VO.findRichMembersInVo
(PerunSession sess, Vo vo, String searchString) Return list of rich members by the searchString under defined VO.findRichMembersWithAttributesInGroup
(PerunSession sess, Group group, String searchString) Return list of rich members with attributes by the searchString under defined Group.findRichMembersWithAttributesInParentGroup
(PerunSession sess, Group group, String searchString) Return list of rich with attributes members by the searchString under parent group of defined Group.findRichMembersWithAttributesInVo
(PerunSession sess, Vo vo, String searchString) Return list of rich members with attributes by the searchString under defined VO.getAllMembers
(PerunSession sess) Get all members from all vos.Return all loaded namespaces rules.getAllSponsoredMembers
(PerunSession sess, Vo vo) Gets list of all sponsored members of a VO.getAllSponsoredMembersAndTheirSponsors
(PerunSession sess, Vo vo, List<String> attrNames) Gets list of VO's all sponsored members with sponsors.getAvailableSponsorsForMember
(PerunSession sess, Member member) Returns all available sponsors for given member.getCompleteRichMembers
(PerunSession sess, Group group, Resource resource, List<String> attrsNames, List<String> allowedStatuses) Get all RichMembers with attributes specific for list of attrNames.getCompleteRichMembers
(PerunSession sess, Group group, List<String> attrsNames, boolean lookingInParentGroup) Get all RichMembers with attrs specific for list of attrsNames from the group.getCompleteRichMembers
(PerunSession sess, Group group, List<String> attrsNames, List<String> allowedStatuses, List<String> allowedGroupStatuses, boolean lookingInParentGroup) Get all RichMembers with attrs specific for list of attrsNames from the group and have only status which is contain in lists of statuses.getCompleteRichMembers
(PerunSession sess, Vo vo, List<String> attrsNames) Get all RichMembers with attrs specific for list of attrsNames from the vo.getCompleteRichMembers
(PerunSession sess, Vo vo, List<String> attrsNames, List<String> allowedStatuses) Get all RichMembers with attrs specific for list of attrsNames from the vo and have only status which is contain in list of statuses.getMemberByExtSourceNameAndExtLogin
(PerunSession sess, Vo vo, String extSourceName, String extLogin) Get member by extSourceName, extSourceLogin and VogetMemberById
(PerunSession sess, int id) Returns member by his id.getMemberByUser
(PerunSession sess, Vo vo, User user) Returns member by his user and vo.getMemberByUserExtSource
(PerunSession perunSession, Vo vo, UserExtSource userExtSource) Find member of this Vo by his login in external sourcegetMembers
(PerunSession sess, Vo vo) Get all VO members.getMembers
(PerunSession sess, Vo vo, Status status) Get all VO members who have the status.getMembersByIds
(PerunSession perunSession, List<Integer> ids) Returns members by their ids.getMembersByUser
(PerunSession sess, User user) Returns members by his user.int
getMembersCount
(PerunSession sess, Vo vo) Get the VO members count.int
getMembersCount
(PerunSession sess, Vo vo, Status status) Get the VO members count with defined status.getMembersPage
(PerunSession sess, Vo vo, MembersPageQuery query, List<String> attrNames) Get page of members from the given vo, with the given attributes.getMembersPage
(PerunSession sess, Vo vo, MembersPageQuery query, List<String> attrNames, String policy) Get page of members from the given vo, with the given attributes, based on policy.getMemberVo
(PerunSession sess, Member member) Get the member VO.getNewExtendMembership
(PerunSession sess, Member member) Returns the date to which will be extended member's expiration time.getNewExtendMembership
(PerunSession sess, Vo vo, String loa) Returns the date to which will be extended member's expiration time.getRichMemberById
(PerunSession sess, int id) Get richMember without attribute by id of membergetRichMembers
(PerunSession sess, Group group) Get all rich members of Group.getRichMembers
(PerunSession sess, Vo vo) Get all rich members of VO.getRichMembers
(PerunSession sess, Vo vo, Status status) Get all rich members of VO with specified status.getRichMembersByIds
(PerunSession sess, List<Integer> ids, List<String> attrsNames) Returns rich members by their IDs with specific attributes.getRichMembersNoUserAttributes
(PerunSession sess, Vo vo) Get all rich members of VO.getRichMembersWithAttributes
(PerunSession sess, Group group, List<AttributeDefinition> attrsDef) Get RichMembers with Attributes but only with selected attributes from list attrsDef for group.getRichMembersWithAttributes
(PerunSession sess, Vo vo) Get all rich members of VO.getRichMembersWithAttributes
(PerunSession sess, Vo vo, Status status) Get all rich members of VO with specified status.getRichMembersWithAttributes
(PerunSession sess, Vo vo, List<AttributeDefinition> attrsDef) Get RichMembers with Attributes but only with selected attributes from list attrsDef for vo.getRichMembersWithAttributes
(PerunSession sess, List<String> allowedStatuses, Group group) Get all rich members with allowed statuses from specific group.getRichMembersWithAttributesByNames
(PerunSession sess, Group group, List<String> attrsNames) Get RichMembers with Attributes but only with selected attributes from list attrsDef for group.getRichMembersWithAttributesByNames
(PerunSession sess, Vo vo, List<String> attrsNames) Get RichMembers with Attributes but only with selected attributes from list attrsDef for vo.getRichMemberWithAttributes
(PerunSession sess, Member member) Get Member to RichMember with attributes.getServiceUserRichMembers
(PerunSession sess, Vo vo) Get RichMembers from a VO who are service users.getSponsoredMembers
(PerunSession sess, Vo vo) Gets list of sponsored members of a VO.getSponsoredMembers
(PerunSession sess, Vo vo, User user) Gets list of members of a VO sponsored by the given user.getSponsoredMembers
(PerunSession sess, Vo vo, User user, List<String> attrNames) Get all sponsored RichMembers with attributes by list of attribute names for specific User and Vo.getSponsoredMembersAndTheirSponsors
(PerunSession sess, Vo vo, List<String> attrNames) Gets list of sponsored members with sponsors.void
moveMembership
(PerunSession sess, Vo vo, User sourceUser, User targetUser) Moves membership in VO from source user to target user - moves the source user's memberships in non-synchronized groups, member related attributes, bans and sponsorships in the VO.void
removeSponsor
(PerunSession sess, Member sponsoredMember, User sponsorToRemove) Removes the sponsor.void
removeSponsors
(PerunSession sess, Member sponsoredMember, List<User> sponsorsToRemove) Removes the sponsors from member.void
sendAccountActivationLinkEmail
(PerunSession sess, Member member, String namespace, String url, String mailAttributeUrn, String language) Send mail to user's preferred email address with link for non-authz account activation.void
sendPasswordResetLinkEmail
(PerunSession sess, Member member, String namespace, String url, String mailAttributeUrn, String language) Send mail to user's preferred email address with link for non-authz password reset.void
sendUsernameReminderEmail
(PerunSession sess, Member member, String namespace, String mailAttributeUrn, String language) Send mail to user's preferred email address with reminder of the username in the given namespace.setSponsoredMember
(PerunSession session, Vo vo, User userToBeSponsored, String namespace, String password, String login, User sponsor, LocalDate validityTo) Creates a sponsored membership for the given user.setSponsorshipForMember
(PerunSession session, Member sponsoredMember, User sponsor, LocalDate validityTo) Transform non-sponsored member to sponsored one with defined sponsorsetStatus
(PerunSession sess, Member member, Status status) Set status of the member to specified status.boolean
someAvailableSponsorExistsForMember
(PerunSession sess, Member member) Checks if some vo sponsor who does not already sponsor given member exists.sponsorMember
(PerunSession session, Member sponsored, User sponsor, LocalDate validityTo) Assigns a new sponsor to an existing member.void
sponsorMembers
(PerunSession session, List<Member> sponsored, User sponsor, LocalDate validityTo) Assigns a new sponsor to existing members.void
suspendMemberTo
(PerunSession sess, Member member, Date suspendedTo) Set date to which will be member suspended in his VO.unsetSponsorshipForMember
(PerunSession session, Member sponsoredMember) Transform sponsored member to non-sponsored one.void
unsuspendMember
(PerunSession sess, Member member) Remove suspend state from Member - remove date to which member should be considered as suspended in the VO.void
updateSponsorshipValidity
(PerunSession sess, Member sponsoredMember, User sponsor, LocalDate newValidity) Update the sponsorship of given member for given sponsor.validateMemberAsync
(PerunSession sess, Member member) Validate all attributes for member and set member's status to VALID.
-
Field Details
-
MEMBERSHIP_EXPIRATION_RULES_ATTRIBUTE_NAME
Attribute which contains rules for membership expiration- See Also:
-
MEMBERSHIP_EXPIRATION_ATTRIBUTE_NAME
Attribute which contains member's expiration- See Also:
-
-
Method Details
-
addMemberCandidates
void addMemberCandidates(PerunSession sess, Vo vo, List<MemberCandidate> candidates) throws PrivilegeException, GroupNotExistsException, UserNotExistsException, WrongReferenceAttributeValueException, AlreadyMemberException, WrongAttributeValueException, ExtendMembershipException, VoNotExistsException Add member candidates.- Parameters:
sess
- Perun sessionvo
- vocandidates
- Listlist of member candidates - Throws:
PrivilegeException
- insufficient permissionsGroupNotExistsException
- group does not existUserNotExistsException
- user does not existWrongAttributeValueException
- attribute value is illegalAlreadyMemberException
- candidate is already memberWrongReferenceAttributeValueException
- attribute value is illegalExtendMembershipException
- reason why user can't extend membershipVoNotExistsException
- vo does not exist
-
addMemberCandidates
void addMemberCandidates(PerunSession sess, Vo vo, List<MemberCandidate> candidates, Group group) throws PrivilegeException, ExternallyManagedException, MemberNotExistsException, GroupNotExistsException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException, AttributeNotExistsException, AlreadyMemberException, WrongAttributeValueException, UserNotExistsException, ExtendMembershipException, VoNotExistsException Add member candidates to Group.- Parameters:
sess
- Perun sessionvo
- vocandidates
- Listlist of member candidates group
- group- Throws:
PrivilegeException
- insufficient permissionsExternallyManagedException
- group is externally managedMemberNotExistsException
- member does not existGroupNotExistsException
- group does not existWrongReferenceAttributeValueException
- attribute value is illegalWrongAttributeAssignmentException
- attribute does not belong to appropriate entityAttributeNotExistsException
- attribute does not existAlreadyMemberException
- candidate is already memberWrongAttributeValueException
- attribute value is illegalUserNotExistsException
- user does not existExtendMembershipException
- reason why user can't extend membershipVoNotExistsException
- vo does not exist
-
canBeMember
boolean canBeMember(PerunSession sess, Vo vo, User user, String loa) throws VoNotExistsException, PrivilegeException Checks if the user can apply membership to the VO, it decides based on extendMembershipRules on the doNotAllowLoa key- Parameters:
sess
-vo
-user
-loa
-- Returns:
- true if user can be apply for membership to the VO
- Throws:
InternalErrorException
VoNotExistsException
PrivilegeException
-
canBeMemberWithReason
boolean canBeMemberWithReason(PerunSession sess, Vo vo, User user, String loa) throws VoNotExistsException, ExtendMembershipException, PrivilegeException Checks if the user can apply membership to the VO, it decides based on extendMembershipRules on the doNotAllowLoa key- Parameters:
sess
-vo
-user
-loa
-- Returns:
- true if user can be apply for membership to the VO
- Throws:
InternalErrorException
VoNotExistsException
ExtendMembershipException
PrivilegeException
-
canExtendMembership
boolean canExtendMembership(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Return true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise false.- Parameters:
sess
-member
-- Returns:
- true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise false.
- Throws:
InternalErrorException
PrivilegeException
MemberNotExistsException
-
canExtendMembershipWithReason
boolean canExtendMembershipWithReason(PerunSession sess, Member member) throws ExtendMembershipException, PrivilegeException, MemberNotExistsException Return true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise throws exception.- Parameters:
sess
-member
-- Returns:
- true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise false
- Throws:
InternalErrorException
ExtendMembershipException
PrivilegeException
MemberNotExistsException
-
copySponsoredMembers
void copySponsoredMembers(PerunSession session, List<Member> sponsored, User copyFrom, User copyTo, boolean copyValidity, LocalDate validityTo) throws SponsorshipDoesNotExistException, UserNotInRoleException, PrivilegeException, MemberNotSponsoredException Set another user (copyTo) as sponsor of sponsored members of user (copyFrom). If the copyValidity flag is set to true, also set the validity to the same value as the existing sponsorship. Otherwise set validity to the value of validityTo (set to never if null).- Parameters:
session
-sponsored
- members to add new sponsor tocopyFrom
- already existing sponsor of the memberscopyTo
- new user to sponsor the memberscopyValidity
- whether to copy validityvalidityTo
- last day when the sponsorship is active (null means the sponsorship will last forever)- Throws:
SponsorshipDoesNotExistException
UserNotInRoleException
PrivilegeException
MemberNotSponsoredException
-
createMember
Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, String login, Candidate candidate) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Creates a new member and sets all member's attributes from the candidate. Also stores the associated user if doesn't exist. This method is used by the registrar. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Parameters:
sess
-vo
-extSourceName
- name of the extSourceextSourceType
- type of the extSource (e.g. cz.metacentrum.perun.core.impl.ExtSourceIdp)login
- user's login within extSourcecandidate
-- Returns:
- newly created member, who has set all his/her attributes
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, String login, Candidate candidate, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Creates a new member and sets all member's attributes from the candidate. Also stores the associated user if doesn't exist. This method is used by the registrar.Also add this member to groups in list. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).
- Parameters:
sess
-vo
-extSourceName
- name of the extSourceextSourceType
- type of the extSource (e.g. cz.metacentrum.perun.core.impl.ExtSourceIdp)login
- user's login within extSourcecandidate
-groups
- list of groups where member will be added too- Returns:
- newly created member, who has set all his/her attributes
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, int extSourceLoa, String login, Candidate candidate) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Creates a new member and sets all member's attributes from the candidate. Also stores the associated user if doesn't exist. This method is used by the registrar. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Parameters:
sess
-vo
-extSourceName
- name of the extSourceextSourceType
- type of the extSource (e.g. cz.metacentrum.perun.core.impl.ExtSourceIdp)extSourceLoa
- level of assurancelogin
- user's login within extSourcecandidate
-- Returns:
- newly created member, who has set all his/her attributes
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, int extSourceLoa, String login, Candidate candidate, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Creates a new member and sets all member's attributes from the candidate. Also stores the associated user if doesn't exist. This method is used by the registrar.Also add this member to groups in list. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).
- Parameters:
sess
-vo
-extSourceName
- name of the extSourceextSourceType
- type of the extSource (e.g. cz.metacentrum.perun.core.impl.ExtSourceIdp)extSourceLoa
- level of assurancelogin
- user's login within extSourcecandidate
-groups
- list of groups where member will be added too- Returns:
- newly created member, who has set all his/her attributes
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
Member createMember(PerunSession sess, Vo vo, Candidate candidate) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, VoNotExistsException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Creates a new member from candidate returned by the method VosManager.findCandidates which fills Candidate .userExtSource. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Parameters:
sess
-vo
-candidate
-- Returns:
- newly created members
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
VoNotExistsException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
Member createMember(PerunSession sess, Vo vo, Candidate candidate, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, VoNotExistsException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Creates a new member from candidate returned by the method VosManager.findCandidates which fills Candidate .userExtSource.Also add this member to groups in list. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).
- Parameters:
sess
-vo
-candidate
-groups
- list of groups where member will be added too- Returns:
- newly created members
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
VoNotExistsException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
Member createMember(PerunSession sess, Vo vo, User user) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, VoNotExistsException, UserNotExistsException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Creates a new member from user. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Parameters:
sess
-vo
-user
-- Returns:
- newly created member
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
VoNotExistsException
UserNotExistsException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
Member createMember(PerunSession sess, Vo vo, User user, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, VoNotExistsException, UserNotExistsException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Creates a new member from user.Also add this member to groups in list. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).
- Parameters:
sess
-vo
-user
-groups
- list of groups where member will be added too- Returns:
- newly created member
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
VoNotExistsException
UserNotExistsException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
Member createMember(PerunSession sess, Vo vo, ExtSource extSource, String login) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException, VoNotExistsException, ExtSourceNotExistsException, PrivilegeException, GroupNotExistsException Create new member from user by login and ExtSource. This method validates member asynchronously- Parameters:
sess
-vo
-extSource
-login
-- Returns:
- newly created member
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
VoNotExistsException
ExtSourceNotExistsException
PrivilegeException
GroupNotExistsException
-
createMember
Member createMember(PerunSession sess, Vo vo, ExtSource extSource, String login, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException, VoNotExistsException, ExtSourceNotExistsException, PrivilegeException, GroupNotExistsException Create new member from user by login and ExtSource.Also add this member to groups in list. This method validates member asynchronously
- Parameters:
sess
-vo
-extSource
-login
-groups
-- Returns:
- newly created member
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
VoNotExistsException
ExtSourceNotExistsException
PrivilegeException
GroupNotExistsException
-
createSpecificMember
Member createSpecificMember(PerunSession sess, Vo vo, Candidate candidate, List<User> specificUserOwners, SpecificUserType specificUserType) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, VoNotExistsException, PrivilegeException, UserNotExistsException, ExtendMembershipException, GroupNotExistsException Creates a new member from candidate which is prepared for creating specific User In list specificUserOwners can't be specific user, only normal users and sponsored users are allowed. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Parameters:
sess
-vo
-candidate
- prepared future specificUserspecificUserOwners
- list of users who own specificUser (can't be empty or contain specificUser)specificUserType
- type of specific user (service)- Returns:
- newly created member (of specificUser)
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
VoNotExistsException
PrivilegeException
UserNotExistsException
ExtendMembershipException
GroupNotExistsException
-
createSpecificMember
Member createSpecificMember(PerunSession sess, Vo vo, Candidate candidate, List<User> specificUserOwners, SpecificUserType specificUserType, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, VoNotExistsException, PrivilegeException, UserNotExistsException, ExtendMembershipException, GroupNotExistsException Creates a new member from candidate which is prepared for creating specificUser In list specificUserOwners can't be specific user, only normal users and sponsored users are allowed.Also add this member to groups in list. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).
- Parameters:
sess
-vo
-candidate
- prepared future specificUserspecificUserOwners
- list of users who own specificUser (can't be empty or contain specificUser)specificUserType
- type of specific user (service)groups
- list of groups where member will be added too- Returns:
- newly created member (of specific User)
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
VoNotExistsException
PrivilegeException
UserNotExistsException
ExtendMembershipException
GroupNotExistsException
-
createSponsoredMember
RichMember createSponsoredMember(PerunSession session, SponsoredUserData data, Vo vo, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url) throws PrivilegeException, AlreadyMemberException, LoginNotExistsException, PasswordCreationFailedException, ExtendMembershipException, WrongAttributeValueException, ExtSourceNotExistsException, WrongReferenceAttributeValueException, UserNotInRoleException, PasswordStrengthException, InvalidLoginException, AlreadySponsorException, InvalidSponsoredUserDataException, NamespaceRulesNotExistsException Creates a new sponsored Member and its User.- Parameters:
session
- actordata
- about the user that should be created, required fields depend on the provided namespace. However, it has to contain either `guestName`, or `firstName` and `lastName`. Also, if you want to create an external account, specify the `namespace` field.vo
- virtual organization for the membersponsor
- sponsoring user or null for the callervalidityTo
- last day when the sponsorship is active (null means the sponsorship will last forever)sendActivationLink
- if true link for manual activation of account will be send to the email be careful when using with empty (no-reply) emaillanguage
- language of the activation email (e.g. "en", "cs"). Use english if null.url
- base URL of Perun Instance- Returns:
- new Member in the Vo
- Throws:
InternalErrorException
- if given parameters are invalidPrivilegeException
- if not REGISTRAR or VOADMINAlreadyMemberException
LoginNotExistsException
PasswordCreationFailedException
ExtendMembershipException
WrongAttributeValueException
ExtSourceNotExistsException
WrongReferenceAttributeValueException
UserNotInRoleException
AlreadySponsorException
PasswordStrengthException
InvalidLoginException
InvalidSponsoredUserDataException
NamespaceRulesNotExistsException
-
createSponsoredMembers
List<Map<String,String>> createSponsoredMembers(PerunSession session, Vo vo, String namespace, List<String> names, String email, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url) throws PrivilegeException Creates new sponsored Members (with random generated passwords).Since there may be error while creating some of the members and we cannot simply rollback the transaction and start over, exceptions during member creation are not thrown and the returned list has this structure:
[{"name" -> name, "status" -> "OK" or "Error...", "login" -> login, "password" -> password}]
Each list element represents member as map containing keys "name", "status", "login" and "password". "status" has as its value either "OK" or message of exception which was thrown during creation of the member. "name" contains full entry as received (e.g. first name; last name; email), "login" contains login (e.g. učo) if status is OK, "password" contains password if status is OK.
- Parameters:
session
- perun sessionvo
- vo for membersnamespace
- namespace for selecting password modulenames
- names of members to create, single name should have the format {firstName};{lastName} to be parsed wellemail
- (optional) preferred email that will be set to the created user. If no email is provided, "no-reply@muni.cz" is used.sponsor
- sponsoring user or null for the callervalidityTo
- last day when the sponsorship is active (null means the sponsorship will last forever)sendActivationLink
- if true link for manual activation of every created sponsored member account will be send to the email, be careful when using with empty (no-reply) emaillanguage
- language of the activation email (e.g. "en", "cs"). Use english if null.url
- base URL of Perun Instance- Returns:
- list of maps of name, status, login and password
- Throws:
PrivilegeException
-
createSponsoredMembersFromCSV
List<Map<String,String>> createSponsoredMembersFromCSV(PerunSession sess, Vo vo, String namespace, List<String> data, String header, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url, List<Group> groups) throws PrivilegeException Creates new sponsored members using input from CSV file.Since there may be error while creating some of the members and we cannot simply rollback the transaction and start over, exceptions during member creation are not thrown and the returned list has this structure:
[{"name" -> name, "status" -> "OK" or "Error...", "login" -> login, "password" -> password}]
Each list element represents member as map containing keys "name", "status", "login" and "password". "status" has as its value either "OK" or message of exception which was thrown during creation of the member. "name" contains full entry as received (e.g. first name; last name; email), "login" contains login (e.g. učo) if status is OK, "password" contains password if status is OK.
- Parameters:
sess
- perun sessionvo
- virtual organization to created sponsored members innamespace
- used for selecting external system in which guest user account will be createddata
- csv file values separated by semicolon ';' charactersheader
- header to the given csv data, it should represent columns for the given data. Required values are - firstname, lastname, urn:perun:user:attribute-def:def:preferredMail Optional values are - urn:perun:user:attribute-def:def:note The order of the items doesn't matter.sponsor
- sponsoring usersendActivationLink
- if true link for manual activation of every created sponsored member account will be send to email which was set for him, be careful when using no-reply emailslanguage
- language of the activation email (e.g. "en", "cs"). Use english if null.url
- base URL of Perun Instancegroups
- groups, to which will be the created users assigned- Returns:
- list of maps of name, status, login and password
- Throws:
PrivilegeException
- insufficient permissions
-
deleteAllMembers
void deleteAllMembers(PerunSession sess, Vo vo) throws VoNotExistsException, PrivilegeException, MemberAlreadyRemovedException, MemberLifecycleAlteringForbiddenException Deletes all VO members.- Parameters:
sess
-vo
-- Throws:
InternalErrorException
VoNotExistsException
PrivilegeException
MemberAlreadyRemovedException
MemberLifecycleAlteringForbiddenException
- if some member comes from hierarchical member vo and cannot be altered in parent vo
-
deleteMember
void deleteMember(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException, MemberAlreadyRemovedException, MemberLifecycleAlteringForbiddenException Deletes only member data appropriated by member id.- Parameters:
sess
-member
-- Throws:
InternalErrorException
MemberNotExistsException
PrivilegeException
MemberAlreadyRemovedException
MemberLifecycleAlteringForbiddenException
- if member comes from hierarchical member vo and cannot be altered in parent vo
-
deleteMembers
void deleteMembers(PerunSession sess, List<Member> members) throws MemberNotExistsException, PrivilegeException, MemberAlreadyRemovedException, MemberLifecycleAlteringForbiddenException Delete given members. It is possible to delete members from multiple vos.- Parameters:
sess
- sessionmembers
- members that will be deleted- Throws:
InternalErrorException
- internal errorMemberNotExistsException
- if any member doesn't existPrivilegeException
- insufficient permissionsMemberAlreadyRemovedException
- if already removedMemberLifecycleAlteringForbiddenException
- if some member comes from hierarchical member vo and cannot be altered in parent vo
-
extendExpirationForSponsoredMember
String extendExpirationForSponsoredMember(PerunSession session, Member sponsored, User sponsor) throws PrivilegeException, MemberNotExistsException, UserNotExistsException Extends expiration date. Sponsored members cannot apply for membership extension, this method allows a sponsor to extend it.- Parameters:
session
- actorsponsored
- existing member that is sponsoredsponsor
- sponsoring user or null for the caller- Returns:
- new expiration date
- Throws:
InternalErrorException
- if given parameters are invalidPrivilegeException
- if not REGISTRAR or VOADMINMemberNotExistsException
UserNotExistsException
-
extendMembership
void extendMembership(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException, ExtendMembershipException Extend member membership using membershipExpirationRules attribute defined at VO.- Parameters:
sess
-member
-- Throws:
InternalErrorException
PrivilegeException
MemberNotExistsException
ExtendMembershipException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames, String searchString, boolean onlySponsored) throws PrivilegeException, VoNotExistsException Return list of richMembers for specific vo by the searchString with attrs specific for list of attrsNames. If attrsNames is empty or null return all attributes for specific richMembers.- Parameters:
sess
-vo
-attrsNames
-searchString
-onlySponsored
- return only sponsored members- Returns:
- list of founded richMembers with specific attributes from Vo for searchString
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
ParentGroupNotExistsException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames, List<String> allowedStatuses, String searchString) throws PrivilegeException, VoNotExistsException Return list of richMembers for specific vo by the searchString with attrs specific for list of attrsNames and who have only status which is contain in list of statuses. If attrsNames is empty or null return all attributes for specific richMembers. If listOfStatuses is empty or null, return all possible statuses.- Parameters:
sess
-vo
-attrsNames
-allowedStatuses
-searchString
-- Returns:
- list of founded richMembers with specific attributes from Vo for searchString with allowed statuses
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
ParentGroupNotExistsException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, List<String> attrsNames, List<String> allowedStatuses, String searchString) throws PrivilegeException Return list of richMembers from Perun by searchString with attrs specific for list of attrsNames and who have only status which is contain in list of statuses. If attrsNames is empty or null return all attributes for specific richMembers. If listOfStatuses is empty or null, return all possible statuses.- Parameters:
sess
-attrsNames
-allowedStatuses
-searchString
-- Returns:
- list of founded richMembers with specific attributes by searchString with allowed statuses
- Throws:
InternalErrorException
PrivilegeException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, String searchString, boolean lookingInParentGroup) throws PrivilegeException, GroupNotExistsException, ParentGroupNotExistsException Return list of richMembers for specific group by the searchString with attrs specific for list of attrsNames. If attrsNames is empty or null return all attributes for specific richMembers.If lookingInParentGroup is true, find all these richMembers only for parentGroup of this group. If this group is top level group, so find richMembers from members group.
- Parameters:
sess
-group
-attrsNames
-searchString
-lookingInParentGroup
-- Returns:
- list of founded richMembers with specific attributes from Group for searchString
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
ParentGroupNotExistsException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, List<String> allowedStatuses, List<String> allowedGroupStatuses, String searchString, boolean lookingInParentGroup) throws PrivilegeException, GroupNotExistsException, ParentGroupNotExistsException Return list of richMembers for specific group by the searchString with attrs specific for list of attrsNames and who have only status which is contain in lists of statuses. If attrsNames is empty or null return all attributes for specific richMembers. If listOfStatuses or listOfGroupStatuses is empty or null, return all possible statuses.If lookingInParentGroup is true, find all these richMembers only for parentGroup of this group. If this group is top level group, so find richMembers from members group.
- Parameters:
sess
-group
-attrsNames
-allowedStatuses
-allowedGroupStatuses
-searchString
-lookingInParentGroup
-- Returns:
- list of founded richMembers with specific attributes from Group for searchString
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
ParentGroupNotExistsException
-
findMembersByName
Return list of members by the searchString- Parameters:
sess
-searchString
-- Returns:
- list of members
- Throws:
InternalErrorException
PrivilegeException
-
findMembersByNameInVo
List<Member> findMembersByNameInVo(PerunSession sess, Vo vo, String searchString) throws PrivilegeException, VoNotExistsException Return list of members by the searchString under defined VO.- Parameters:
sess
-vo
-searchString
-- Returns:
- list of members
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
findMembersInGroup
List<Member> findMembersInGroup(PerunSession sess, Group group, String searchString) throws PrivilegeException, GroupNotExistsException Return list of members by the searchString under defined Group. Search is done in name, email and login.- Parameters:
sess
-group
-searchString
-- Returns:
- list of members
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
-
findMembersInParentGroup
List<Member> findMembersInParentGroup(PerunSession sess, Group group, String searchString) throws PrivilegeException, GroupNotExistsException, ParentGroupNotExistsException Return list of members by the searchString udner parentGroup of defined Group. Search is done in name, email and login.- Parameters:
sess
-group
- this group is used to get parent group, we are searching members of the parent groupsearchString
-- Returns:
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
ParentGroupNotExistsException
-
findMembersInVo
List<Member> findMembersInVo(PerunSession sess, Vo vo, String searchString) throws PrivilegeException, VoNotExistsException Return list of members by the searchString under defined VO. Search is done in name, email and login.- Parameters:
sess
-vo
-searchString
-- Returns:
- list of members
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
findRichMembersInVo
List<RichMember> findRichMembersInVo(PerunSession sess, Vo vo, String searchString) throws PrivilegeException, VoNotExistsException Return list of rich members by the searchString under defined VO. Search is done in name, email and login.- Parameters:
sess
-vo
-searchString
-- Returns:
- list of rich members
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
findRichMembersWithAttributesInGroup
List<RichMember> findRichMembersWithAttributesInGroup(PerunSession sess, Group group, String searchString) throws PrivilegeException, GroupNotExistsException Return list of rich members with attributes by the searchString under defined Group. Search is done in name, email and login.- Parameters:
sess
-group
- this group is used to get parent group, we are searching members of the parent groupsearchString
-- Returns:
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
- is thrown if group or parent group of this group not exists.
-
findRichMembersWithAttributesInParentGroup
List<RichMember> findRichMembersWithAttributesInParentGroup(PerunSession sess, Group group, String searchString) throws PrivilegeException, GroupNotExistsException Return list of rich with attributes members by the searchString under parent group of defined Group. Search is done in name, email and login.- Parameters:
sess
-group
-searchString
-- Returns:
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
- is thrown if group or parent group of this group not exists.
-
findRichMembersWithAttributesInVo
List<RichMember> findRichMembersWithAttributesInVo(PerunSession sess, Vo vo, String searchString) throws PrivilegeException, VoNotExistsException Return list of rich members with attributes by the searchString under defined VO. Search is done in name, email and login.- Parameters:
sess
-vo
-searchString
-- Returns:
- list of rich members with attributes
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getAllMembers
Get all members from all vos.- Parameters:
sess
- session- Returns:
- list of all members from all Vos.
- Throws:
PrivilegeException
-
getAllNamespacesRules
List<NamespaceRules> getAllNamespacesRules()Return all loaded namespaces rules.- Returns:
- all namespaces rules
-
getAllSponsoredMembers
List<RichMember> getAllSponsoredMembers(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Gets list of all sponsored members of a VO.- Parameters:
sess
- perun sessionvo
- virtual organization from which are the sponsored members chosen- Returns:
- list of members from given VO who are sponsored
- Throws:
PrivilegeException
- insufficient permissionsVoNotExistsException
-
getAllSponsoredMembersAndTheirSponsors
List<MemberWithSponsors> getAllSponsoredMembersAndTheirSponsors(PerunSession sess, Vo vo, List<String> attrNames) throws VoNotExistsException, PrivilegeException, AttributeNotExistsException Gets list of VO's all sponsored members with sponsors.- Parameters:
sess
- sessionvo
- virtual organization from which are the sponsored members chosenattrNames
- list of attrNames for selected attributes- Returns:
- list of members with sponsors
- Throws:
VoNotExistsException
- if given VO does not existPrivilegeException
- if not VOADMIN, VOOBSERVER, PERUNOBSERVER or SPONSORAttributeNotExistsException
-
getCompleteRichMembers
List<RichMember> getCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames) throws PrivilegeException, VoNotExistsException, AttributeNotExistsException Get all RichMembers with attrs specific for list of attrsNames from the vo. If attrsNames is empty or null return all attributes for specific richMembers.- Parameters:
sess
-vo
-attrsNames
-- Returns:
- list of richMembers with specific attributes from Vo
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
AttributeNotExistsException
-
getCompleteRichMembers
List<RichMember> getCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames, List<String> allowedStatuses) throws PrivilegeException, VoNotExistsException, AttributeNotExistsException Get all RichMembers with attrs specific for list of attrsNames from the vo and have only status which is contain in list of statuses. If attrsNames is empty or null return all attributes for specific richMembers. If listOfStatuses is empty or null, return all possible statuses.- Parameters:
sess
-vo
-attrsNames
-allowedStatuses
-- Returns:
- list of richMembers with specific attributes from Vo
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
AttributeNotExistsException
-
getCompleteRichMembers
List<RichMember> getCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, boolean lookingInParentGroup) throws PrivilegeException, GroupNotExistsException, AttributeNotExistsException, ParentGroupNotExistsException Get all RichMembers with attrs specific for list of attrsNames from the group. If attrsNames is empty or null return all attributes for specific richMembers.If lookingInParentGroup is true, get all these richMembers only for parentGroup of this group. If this group is top level group, so get richMembers from members group.
- Parameters:
sess
-group
-attrsNames
-lookingInParentGroup
-- Returns:
- list of richMembers with specific attributes from Group
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
AttributeNotExistsException
ParentGroupNotExistsException
-
getCompleteRichMembers
List<RichMember> getCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, List<String> allowedStatuses, List<String> allowedGroupStatuses, boolean lookingInParentGroup) throws PrivilegeException, GroupNotExistsException, AttributeNotExistsException, ParentGroupNotExistsException Get all RichMembers with attrs specific for list of attrsNames from the group and have only status which is contain in lists of statuses. If attrsNames is empty or null return all attributes for specific richMembers. If listOfStatuses or listOfGroupStatuses is empty or null, return all possible statuses.If lookingInParentGroup is true, get all these richMembers only for parentGroup of this group. If this group is top level group, so get richMembers from members group.
- Parameters:
sess
-group
-attrsNames
-allowedStatuses
-allowedGroupStatuses
-lookingInParentGroup
-- Returns:
- list of richMembers with specific attributes from group
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
AttributeNotExistsException
ParentGroupNotExistsException
-
getCompleteRichMembers
List<RichMember> getCompleteRichMembers(PerunSession sess, Group group, Resource resource, List<String> attrsNames, List<String> allowedStatuses) throws AttributeNotExistsException, GroupNotExistsException, ResourceNotExistsException, PrivilegeException, GroupResourceMismatchException Get all RichMembers with attributes specific for list of attrNames. Attributes are defined by member (user) and resource (facility) objects. It returns also user-facility (in userAttributes of RichMember) and member-resource (in memberAttributes of RichMember) attributes. Members are defined by group and are filtered by list of allowed statuses.- Parameters:
sess
-group
-resource
-attrsNames
-allowedStatuses
-- Returns:
- list of richMembers with specific attributes
- Throws:
InternalErrorException
AttributeNotExistsException
ResourceNotExistsException
GroupNotExistsException
PrivilegeException
GroupResourceMismatchException
-
getMemberByExtSourceNameAndExtLogin
Member getMemberByExtSourceNameAndExtLogin(PerunSession sess, Vo vo, String extSourceName, String extLogin) throws ExtSourceNotExistsException, UserExtSourceNotExistsException, MemberNotExistsException, UserNotExistsException, VoNotExistsException, PrivilegeException Get member by extSourceName, extSourceLogin and Vo- Parameters:
sess
-vo
- Vo where we are looking for memberextSourceName
- name of extSourceextLogin
- login of user in extSource- Returns:
- member
- Throws:
ExtSourceNotExistsException
UserExtSourceNotExistsException
MemberNotExistsException
UserNotExistsException
VoNotExistsException
InternalErrorException
PrivilegeException
-
getMemberById
Returns member by his id.- Parameters:
sess
-id
-- Returns:
- member
- Throws:
InternalErrorException
MemberNotExistsException
PrivilegeException
-
getMemberByUser
Member getMemberByUser(PerunSession sess, Vo vo, User user) throws MemberNotExistsException, PrivilegeException, VoNotExistsException, UserNotExistsException Returns member by his user and vo.- Parameters:
sess
-vo
-user
-- Returns:
- member
- Throws:
InternalErrorException
MemberNotExistsException
VoNotExistsException
UserNotExistsException
PrivilegeException
-
getMemberByUserExtSource
Member getMemberByUserExtSource(PerunSession perunSession, Vo vo, UserExtSource userExtSource) throws VoNotExistsException, MemberNotExistsException, PrivilegeException Find member of this Vo by his login in external source- Parameters:
perunSession
-vo
-userExtSource
-- Returns:
- selected user or throws MemberNotExistsException in case the requested member doesn't exists in this Vo
- Throws:
InternalErrorException
MemberNotExistsException
PrivilegeException
VoNotExistsException
-
getMemberVo
Get the member VO.- Parameters:
sess
-member
-- Returns:
- member's VO
- Throws:
InternalErrorException
MemberNotExistsException
-
getMembers
Get all VO members.- Parameters:
sess
-vo
-- Returns:
- all members of the VO
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getMembers
List<Member> getMembers(PerunSession sess, Vo vo, Status status) throws PrivilegeException, VoNotExistsException Get all VO members who have the status.- Parameters:
sess
-vo
-status
- get only members who have this status- Returns:
- all members of the VO
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getMembersByIds
List<Member> getMembersByIds(PerunSession perunSession, List<Integer> ids) throws PrivilegeException Returns members by their ids.- Parameters:
perunSession
-ids
-- Returns:
- list of members with specified ids
- Throws:
InternalErrorException
PrivilegeException
-
getMembersByUser
List<Member> getMembersByUser(PerunSession sess, User user) throws PrivilegeException, UserNotExistsException Returns members by his user.- Parameters:
sess
-user
-- Returns:
- member
- Throws:
InternalErrorException
UserNotExistsException
PrivilegeException
-
getMembersCount
Get the VO members count.- Parameters:
sess
-vo
-- Returns:
- count of VO members
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getMembersCount
int getMembersCount(PerunSession sess, Vo vo, Status status) throws PrivilegeException, VoNotExistsException Get the VO members count with defined status.- Parameters:
sess
-vo
-status
-- Returns:
- count of VO members
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getMembersPage
Paginated<RichMember> getMembersPage(PerunSession sess, Vo vo, MembersPageQuery query, List<String> attrNames) throws VoNotExistsException, PrivilegeException, GroupNotExistsException, PolicyNotExistsException Get page of members from the given vo, with the given attributes.- Parameters:
sess
- sessionvo
- voquery
- query with page informationattrNames
- attribute names- Returns:
- page of requested rich members
- Throws:
VoNotExistsException
- if there is no such voGroupNotExistsException
- if there is no such query groupPrivilegeException
- insufficient permissionPolicyNotExistsException
-
getMembersPage
Paginated<RichMember> getMembersPage(PerunSession sess, Vo vo, MembersPageQuery query, List<String> attrNames, String policy) throws VoNotExistsException, PrivilegeException, GroupNotExistsException, PolicyNotExistsException Get page of members from the given vo, with the given attributes, based on policy.- Parameters:
sess
- sessionvo
- voquery
- query with page informationattrNames
- attribute namespolicy
- policy to use- Returns:
- page of requested rich members
- Throws:
VoNotExistsException
- if there is no such voGroupNotExistsException
- if there is no such query groupPrivilegeException
- insufficient permissionPolicyNotExistsException
-
getNewExtendMembership
Returns the date to which will be extended member's expiration time.- Parameters:
sess
-member
-- Returns:
- date
- Throws:
InternalErrorException
MemberNotExistsException
-
getNewExtendMembership
Date getNewExtendMembership(PerunSession sess, Vo vo, String loa) throws VoNotExistsException, ExtendMembershipException Returns the date to which will be extended member's expiration time.- Parameters:
sess
-vo
-loa
-- Returns:
- date
- Throws:
InternalErrorException
VoNotExistsException
ExtendMembershipException
-
getRichMemberById
RichMember getRichMemberById(PerunSession sess, int id) throws PrivilegeException, MemberNotExistsException Get richMember without attribute by id of member- Parameters:
sess
-id
- of member- Returns:
- richMember without attributes (only with user)
- Throws:
InternalErrorException
PrivilegeException
- if user has no rights to get this richMemberMemberNotExistsException
- if member not exists
-
getRichMemberWithAttributes
RichMember getRichMemberWithAttributes(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Get Member to RichMember with attributes.- Parameters:
sess
-member
-- Returns:
- Throws:
InternalErrorException
PrivilegeException
MemberNotExistsException
-
getRichMembers
List<RichMember> getRichMembers(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Get all rich members of VO. Rich member object contains user, member, userExtSources.- Parameters:
sess
-vo
-- Returns:
- list of rich members, empty list if there are no members in VO
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getRichMembers
List<RichMember> getRichMembers(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Get all rich members of Group. Rich member object contains user, member, userExtSources.- Parameters:
sess
-group
-- Returns:
- list of rich members, empty list if there are no members in Group
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
-
getRichMembers
List<RichMember> getRichMembers(PerunSession sess, Vo vo, Status status) throws PrivilegeException, VoNotExistsException Get all rich members of VO with specified status. Rich member object contains user, member, userExtSources.- Parameters:
sess
-vo
-status
- get only members who have this status- Returns:
- list of rich members, empty list if there are no members in VO with specified status
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getRichMembersByIds
List<RichMember> getRichMembersByIds(PerunSession sess, List<Integer> ids, List<String> attrsNames) throws PrivilegeException, AttributeNotExistsException Returns rich members by their IDs with specific attributes.- Parameters:
sess
- Perun sessionids
- Listlist of members IDs attrsNames
- ListAttribute names. If the list is null or empty, no attributes will be provided. - Returns:
- List
RichMembers with specified IDs and attributes - Throws:
PrivilegeException
AttributeNotExistsException
-
getRichMembersNoUserAttributes
List<RichMember> getRichMembersNoUserAttributes(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Get all rich members of VO. Rich member object contains user, member, userExtSources and member attributes. User attributes aren't included- Parameters:
sess
-vo
-- Returns:
- list of rich members with all member attributes
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getRichMembersWithAttributes
List<RichMember> getRichMembersWithAttributes(PerunSession sess, Vo vo, List<AttributeDefinition> attrsDef) throws PrivilegeException, VoNotExistsException Get RichMembers with Attributes but only with selected attributes from list attrsDef for vo.- Parameters:
sess
-vo
-attrsDef
- list of attrDefs only for selected attributes- Returns:
- list of richmembers
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getRichMembersWithAttributes
List<RichMember> getRichMembersWithAttributes(PerunSession sess, List<String> allowedStatuses, Group group) throws PrivilegeException, GroupNotExistsException Get all rich members with allowed statuses from specific group. Rich member object contains user, member, userExtSources and member/user attributes.- Parameters:
sess
-allowedStatuses
- only allowed statusesgroup
- to get richMembers from- Returns:
- list of rich members with all member/user attributes, empty list if there are no members in group
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
-
getRichMembersWithAttributes
List<RichMember> getRichMembersWithAttributes(PerunSession sess, Group group, List<AttributeDefinition> attrsDef) throws PrivilegeException, GroupNotExistsException Get RichMembers with Attributes but only with selected attributes from list attrsDef for group.- Parameters:
sess
-group
-attrsDef
-- Returns:
- Throws:
InternalErrorException
PrivilegeException
GroupNotExistsException
-
getRichMembersWithAttributes
List<RichMember> getRichMembersWithAttributes(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Get all rich members of VO. Rich member object contains user, member, userExtSources and member/user attributes.- Parameters:
sess
-vo
-- Returns:
- list of rich members with all member/user attributes, empty list if there are no members in VO
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getRichMembersWithAttributes
List<RichMember> getRichMembersWithAttributes(PerunSession sess, Vo vo, Status status) throws PrivilegeException, VoNotExistsException Get all rich members of VO with specified status. Rich member object contains user, member, userExtSources and member/user attributes.- Parameters:
sess
-vo
-status
-- Returns:
- list of rich members with all member/user attributes, empty list if there are no members in VO with specified status
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getRichMembersWithAttributesByNames
List<RichMember> getRichMembersWithAttributesByNames(PerunSession sess, Vo vo, List<String> attrsNames) throws PrivilegeException, VoNotExistsException, AttributeNotExistsException Get RichMembers with Attributes but only with selected attributes from list attrsDef for vo.- Parameters:
sess
-vo
-attrsNames
- list of attrNames for selected attributes- Returns:
- list of richmembers
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
AttributeNotExistsException
-
getRichMembersWithAttributesByNames
List<RichMember> getRichMembersWithAttributesByNames(PerunSession sess, Group group, List<String> attrsNames) throws PrivilegeException, GroupNotExistsException, AttributeNotExistsException Get RichMembers with Attributes but only with selected attributes from list attrsDef for group.- Parameters:
sess
-group
-attrsNames
- list of attrNames for selected attributes- Returns:
- list of richmembers
- Throws:
InternalErrorException
PrivilegeException
AttributeNotExistsException
GroupNotExistsException
-
getServiceUserRichMembers
List<RichMember> getServiceUserRichMembers(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Get RichMembers from a VO who are service users.- Parameters:
sess
-vo
-- Returns:
- List of RichMembers from the VO, who are service users
- Throws:
PrivilegeException
VoNotExistsException
-
getSponsoredMembers
List<RichMember> getSponsoredMembers(PerunSession sess, Vo vo, User user, List<String> attrNames) throws AttributeNotExistsException, PrivilegeException, VoNotExistsException, UserNotExistsException Get all sponsored RichMembers with attributes by list of attribute names for specific User and Vo.- Parameters:
sess
-vo
- to specify Member for Useruser
- to specify Member for UserattrNames
- list of attrNames - if empty, return richMembers without attributes- Returns:
- list of sponsored rich members with attributes from the list
- Throws:
InternalErrorException
- if any internal error has occurredAttributeNotExistsException
- if any attributeDefinition can't be found by one of attribute namesVoNotExistsException
- if Vo not exists in PerunUserNotExistsException
- if User not exists in PerunPrivilegeException
- if user in session is not allowed to call this method
-
getSponsoredMembers
List<RichMember> getSponsoredMembers(PerunSession sess, Vo vo, User user) throws PrivilegeException, VoNotExistsException, UserNotExistsException Gets list of members of a VO sponsored by the given user.- Parameters:
sess
- actorvo
- virtual organization from which are the sponsored members chosenuser
- user of system- Returns:
- list of members from given VO who are sponsored by the given user.
- Throws:
InternalErrorException
- if given parameters are invalidPrivilegeException
- if not REGISTRAR or VOADMINVoNotExistsException
UserNotExistsException
-
getSponsoredMembers
List<RichMember> getSponsoredMembers(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Gets list of sponsored members of a VO.- Parameters:
sess
- actorvo
- virtual organization from which are the sponsored members chosen- Returns:
- list of members from given VO who are sponsored
- Throws:
InternalErrorException
- if given parameters are invalidPrivilegeException
- if not REGISTRAR or VOADMINVoNotExistsException
-
getSponsoredMembersAndTheirSponsors
List<MemberWithSponsors> getSponsoredMembersAndTheirSponsors(PerunSession sess, Vo vo, List<String> attrNames) throws VoNotExistsException, PrivilegeException, AttributeNotExistsException Gets list of sponsored members with sponsors.- Parameters:
sess
- sessionvo
- virtual organization from which are the sponsored members chosenattrNames
- list of attrNames for selected attributes- Returns:
- list of members with sponsors
- Throws:
VoNotExistsException
- if given VO does not existPrivilegeException
- if not VOADMIN, VOOBSERVER, PERUNOBSERVER or SPONSORAttributeNotExistsException
-
moveMembership
void moveMembership(PerunSession sess, Vo vo, User sourceUser, User targetUser) throws UserNotExistsException, VoNotExistsException, PrivilegeException, ExtendMembershipException, MemberNotExistsException, AlreadyMemberException Moves membership in VO from source user to target user - moves the source user's memberships in non-synchronized groups, member related attributes, bans and sponsorships in the VO. Removes the source user's member object. If VO is member of any hierarchical parent VO, user's membership is moved in parent VOs also. If VO is parent of any hierarchical member VO, user's membership is not moved in member VOs.- Parameters:
sess
- sessionvo
- the VO in which the membership should be movedsourceUser
- the user to move membership fromtargetUser
- the user to move membership to- Throws:
UserNotExistsException
- if there is no such userVoNotExistsException
- if there is no such VOPrivilegeException
- insufficient permissionsMemberNotExistsException
- when sourceUser is not member of the VOAlreadyMemberException
- when targetUser is already member of the VOExtendMembershipException
- when targetUser doesn't have required LOA for the VO
-
removeSponsor
void removeSponsor(PerunSession sess, Member sponsoredMember, User sponsorToRemove) throws PrivilegeException Removes the sponsor.- Parameters:
sess
- actorsponsoredMember
- existing member that is sponsoredsponsorToRemove
- sponsoring user for removal- Throws:
InternalErrorException
- if given parameters are invalidPrivilegeException
- if not REGISTRAR or VOADMIN
-
removeSponsors
void removeSponsors(PerunSession sess, Member sponsoredMember, List<User> sponsorsToRemove) throws PrivilegeException Removes the sponsors from member.- Parameters:
sess
- actorsponsoredMember
- existing member that is sponsoredsponsorsToRemove
- sponsoring users for removal- Throws:
InternalErrorException
- if given parameters are invalidPrivilegeException
- if not REGISTRAR or VOADMIN
-
sendAccountActivationLinkEmail
void sendAccountActivationLinkEmail(PerunSession sess, Member member, String namespace, String url, String mailAttributeUrn, String language) throws PrivilegeException, MemberNotExistsException, UserNotExistsException, AttributeNotExistsException, NotificationMemberMailNotExistsException Send mail to user's preferred email address with link for non-authz account activation. Correct authz information is stored in link's URL.- Parameters:
sess
- PerunSessionmember
- Member to get user to send link mail tonamespace
- namespace to activate account in (member must have login in it)url
- base URL of Perun instancemailAttributeUrn
- urn of the attribute with stored maillanguage
- language of the message- Throws:
InternalErrorException
PrivilegeException
- If not VO admin of memberMemberNotExistsException
- If member not existsNotificationMemberMailNotExistsException
- If the attribute with stored mail is not filled.UserNotExistsException
AttributeNotExistsException
-
sendPasswordResetLinkEmail
void sendPasswordResetLinkEmail(PerunSession sess, Member member, String namespace, String url, String mailAttributeUrn, String language) throws PrivilegeException, MemberNotExistsException, UserNotExistsException, AttributeNotExistsException, NotificationMemberMailNotExistsException Send mail to user's preferred email address with link for non-authz password reset. Correct authz information is stored in link's URL.- Parameters:
sess
- PerunSessionmember
- Member to get user to send link mail tonamespace
- namespace to change password in (member must have login in it)url
- base URL of Perun instancemailAttributeUrn
- urn of the attribute with stored maillanguage
- language of the message- Throws:
InternalErrorException
PrivilegeException
- If not VO admin of memberMemberNotExistsException
- If member not existsNotificationMemberMailNotExistsException
- If the attribute with stored mail is not filled.UserNotExistsException
AttributeNotExistsException
-
sendUsernameReminderEmail
void sendUsernameReminderEmail(PerunSession sess, Member member, String namespace, String mailAttributeUrn, String language) throws PrivilegeException, MemberNotExistsException, UserNotExistsException, AttributeNotExistsException, NotificationMemberMailNotExistsException Send mail to user's preferred email address with reminder of the username in the given namespace.- Parameters:
sess
- PerunSessionmember
- Member to get user to send link mail tonamespace
- namespace to change password in (member must have login in it)mailAttributeUrn
- urn of the attribute with stored maillanguage
- language of the message- Throws:
InternalErrorException
PrivilegeException
- If not VO admin of memberMemberNotExistsException
- If member not existsNotificationMemberMailNotExistsException
- If the attribute with stored mail is not filled.UserNotExistsException
AttributeNotExistsException
-
setSponsoredMember
RichMember setSponsoredMember(PerunSession session, Vo vo, User userToBeSponsored, String namespace, String password, String login, User sponsor, LocalDate validityTo) throws PrivilegeException, AlreadyMemberException, LoginNotExistsException, PasswordCreationFailedException, ExtendMembershipException, WrongAttributeValueException, ExtSourceNotExistsException, WrongReferenceAttributeValueException, UserNotInRoleException, PasswordStrengthException, InvalidLoginException, AlreadySponsorException, InvalidSponsoredUserDataException, NamespaceRulesNotExistsException Creates a sponsored membership for the given user.- Parameters:
session
- actorvo
- virtual organization for the memberuserToBeSponsored
- user, that will be sponsored by sponsornamespace
- namespace for selecting password modulepassword
- passwordlogin
- loginsponsor
- sponsoring user or null for the callervalidityTo
- last day when the sponsorship is active (null means the sponsorship will last forever)- Returns:
- sponsored member
- Throws:
PrivilegeException
AlreadyMemberException
LoginNotExistsException
PasswordCreationFailedException
ExtendMembershipException
WrongAttributeValueException
ExtSourceNotExistsException
WrongReferenceAttributeValueException
UserNotInRoleException
PasswordStrengthException
InvalidLoginException
AlreadySponsorException
InvalidSponsoredUserDataException
NamespaceRulesNotExistsException
-
setSponsorshipForMember
RichMember setSponsorshipForMember(PerunSession session, Member sponsoredMember, User sponsor, LocalDate validityTo) throws MemberNotExistsException, AlreadySponsoredMemberException, UserNotInRoleException, AlreadySponsorException, PrivilegeException Transform non-sponsored member to sponsored one with defined sponsor- Parameters:
session
- perun sessionsponsoredMember
- member who will be set as sponsored onesponsor
- new sponsor of this membervalidityTo
- last day when the sponsorship is active (null means the sponsorship will last forever)- Returns:
- sponsored member
- Throws:
InternalErrorException
- if given parameters are invalidMemberNotExistsException
- if member with defined id not exists in system PerunAlreadySponsoredMemberException
- if member is already sponsoredUserNotInRoleException
- if sponsor hasn't right role in the same voAlreadySponsorException
- sponsoredMember is already sponsored by User and his sponsorship is still activePrivilegeException
- if not PerunAdmin
-
setStatus
Member setStatus(PerunSession sess, Member member, Status status) throws PrivilegeException, MemberNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, MemberNotValidYetException, MemberLifecycleAlteringForbiddenException Set status of the member to specified status.- Parameters:
sess
-member
-status
- new status- Returns:
- member with status set
- Throws:
InternalErrorException
MemberNotExistsException
MemberNotValidYetException
WrongReferenceAttributeValueException
WrongAttributeValueException
PrivilegeException
MemberLifecycleAlteringForbiddenException
- if member comes from hierarchical member vo and cannot be altered in parent vo
-
sponsorMember
RichMember sponsorMember(PerunSession session, Member sponsored, User sponsor, LocalDate validityTo) throws PrivilegeException, MemberNotSponsoredException, AlreadySponsorException, UserNotInRoleException Assigns a new sponsor to an existing member.- Parameters:
session
- actorsponsored
- existing member that needs sponsoringsponsor
- sponsoring user or null for the callervalidityTo
- last day when the sponsorship is active (null means the sponsorship will last forever)- Returns:
- existing Member
- Throws:
InternalErrorException
PrivilegeException
MemberNotSponsoredException
AlreadySponsorException
UserNotInRoleException
-
sponsorMembers
void sponsorMembers(PerunSession session, List<Member> sponsored, User sponsor, LocalDate validityTo) throws PrivilegeException, MemberNotSponsoredException, AlreadySponsorException, UserNotInRoleException Assigns a new sponsor to existing members. If some members are non-sponsored, turn them into sponsored and assign the sponsor.- Parameters:
session
- actorsponsored
- existing members that needs sponsoringsponsor
- sponsoring user or null for the callervalidityTo
- last day when the sponsorship is active (null means the sponsorship will last forever)- Throws:
InternalErrorException
PrivilegeException
MemberNotSponsoredException
AlreadySponsorException
UserNotInRoleException
-
someAvailableSponsorExistsForMember
boolean someAvailableSponsorExistsForMember(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException Checks if some vo sponsor who does not already sponsor given member exists.- Parameters:
sess
- perun sessionmember
- member- Returns:
- true if available sponsor exists, false otherwise
- Throws:
MemberNotExistsException
- when member does not existPrivilegeException
- insufficient permissions
-
getAvailableSponsorsForMember
List<User> getAvailableSponsorsForMember(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException Returns all available sponsors for given member.- Parameters:
sess
- perun sessionmember
- member- Returns:
- list of available sponsors
- Throws:
MemberNotExistsException
- when member does not existPrivilegeException
- insufficient permissions
-
suspendMemberTo
void suspendMemberTo(PerunSession sess, Member member, Date suspendedTo) throws MemberNotExistsException, PrivilegeException, BanAlreadyExistsException Set date to which will be member suspended in his VO.For almost unlimited time please use time in the far future.
- Parameters:
sess
-member
- member who will be suspendedsuspendedTo
- date to which will be member suspended (after this date, he will not be affected by suspension any more)- Throws:
InternalErrorException
PrivilegeException
MemberNotExistsException
- if member not exists in PerunBanAlreadyExistsException
-
unsetSponsorshipForMember
RichMember unsetSponsorshipForMember(PerunSession session, Member sponsoredMember) throws MemberNotExistsException, MemberNotSponsoredException, PrivilegeException Transform sponsored member to non-sponsored one. Delete all his sponsors.- Parameters:
session
- perun sessionsponsoredMember
- member who will be unset from sponsoring- Returns:
- non-sponsored member
- Throws:
MemberNotExistsException
- if member with defined id not exists in system PerunMemberNotSponsoredException
- if member is not sponsored yetInternalErrorException
- if given parameters are invalidPrivilegeException
- if not PerunAdmin
-
unsuspendMember
void unsuspendMember(PerunSession sess, Member member) throws MemberNotExistsException, MemberNotSuspendedException, PrivilegeException Remove suspend state from Member - remove date to which member should be considered as suspended in the VO.WARNING: this will remove the date even if it is in the past (so member is no longer considered as suspended)
- Parameters:
sess
-member
- member for which the suspend state will be removed- Throws:
InternalErrorException
MemberNotExistsException
MemberNotSuspendedException
- if member has not set date to which should be considered as suspendedPrivilegeException
-
updateSponsorshipValidity
void updateSponsorshipValidity(PerunSession sess, Member sponsoredMember, User sponsor, LocalDate newValidity) throws PrivilegeException, SponsorshipDoesNotExistException, MemberNotExistsException, UserNotExistsException Update the sponsorship of given member for given sponsor.- Parameters:
sess
- sessionsponsoredMember
- sponsored membersponsor
- sponsornewValidity
- new validity, can be set to null never expire- Throws:
PrivilegeException
- insufficient permissionsSponsorshipDoesNotExistException
- if the given user is not sponsor of the given memberMemberNotExistsException
- if there is no such memberUserNotExistsException
- if there is no such user
-
validateMemberAsync
Member validateMemberAsync(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Validate all attributes for member and set member's status to VALID. This method runs asynchronously. It immediately return member with ORIGINAL status and after asynchronous validation successfully finishes it switch member's status to VALID. If validation ends with error, member keeps his status.- Parameters:
sess
-member
-- Returns:
- member with new status set
- Throws:
InternalErrorException
MemberNotExistsException
PrivilegeException
-