Class MembersManagerEntry
- All Implemented Interfaces:
MembersManager
- Author:
- Slavek Licehammer glory@ics.muni.cz
-
Field Summary
Fields inherited from interface cz.metacentrum.perun.core.api.MembersManager
MEMBERSHIP_EXPIRATION_ATTRIBUTE_NAME, MEMBERSHIP_EXPIRATION_RULES_ATTRIBUTE_NAME
-
Constructor Summary
-
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 sess, Member sponsoredMember, User sponsorUser) 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 sess, Vo vo, UserExtSource uea) 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 sess, 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.Gets the membersManagerBl for this instance.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> attrNames) 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.void
setMembersManagerBl
(MembersManagerBl membersManagerBl) Sets the membersManagerBl for this instance.void
setPerunBl
(PerunBl perunBl) Sets the perunBl for this instance.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.
-
Constructor Details
-
MembersManagerEntry
Constructor. -
MembersManagerEntry
public MembersManagerEntry()
-
-
Method Details
-
addMemberCandidates
public void addMemberCandidates(PerunSession sess, Vo vo, List<MemberCandidate> candidates) throws PrivilegeException, GroupNotExistsException, UserNotExistsException, WrongReferenceAttributeValueException, AlreadyMemberException, WrongAttributeValueException, ExtendMembershipException, VoNotExistsException Description copied from interface:MembersManager
Add member candidates.- Specified by:
addMemberCandidates
in interfaceMembersManager
- Parameters:
sess
- Perun sessionvo
- vocandidates
- Listlist of member candidates - Throws:
PrivilegeException
- insufficient permissionsGroupNotExistsException
- group does not existUserNotExistsException
- user does not existWrongReferenceAttributeValueException
- attribute value is illegalAlreadyMemberException
- candidate is already memberWrongAttributeValueException
- attribute value is illegalExtendMembershipException
- reason why user can't extend membershipVoNotExistsException
- vo does not exist
-
addMemberCandidates
public void addMemberCandidates(PerunSession sess, Vo vo, List<MemberCandidate> candidates, Group group) throws PrivilegeException, ExternallyManagedException, MemberNotExistsException, GroupNotExistsException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException, AttributeNotExistsException, AlreadyMemberException, WrongAttributeValueException, UserNotExistsException, ExtendMembershipException, VoNotExistsException Description copied from interface:MembersManager
Add member candidates to Group.- Specified by:
addMemberCandidates
in interfaceMembersManager
- 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
public boolean canBeMember(PerunSession sess, Vo vo, User user, String loa) throws VoNotExistsException, PrivilegeException Description copied from interface:MembersManager
Checks if the user can apply membership to the VO, it decides based on extendMembershipRules on the doNotAllowLoa key- Specified by:
canBeMember
in interfaceMembersManager
- Parameters:
sess
-vo
-user
-loa
-- Returns:
- true if user can be apply for membership to the VO
- Throws:
VoNotExistsException
PrivilegeException
-
canBeMemberWithReason
public boolean canBeMemberWithReason(PerunSession sess, Vo vo, User user, String loa) throws VoNotExistsException, ExtendMembershipException, PrivilegeException Description copied from interface:MembersManager
Checks if the user can apply membership to the VO, it decides based on extendMembershipRules on the doNotAllowLoa key- Specified by:
canBeMemberWithReason
in interfaceMembersManager
- Parameters:
sess
-vo
-user
-loa
-- Returns:
- true if user can be apply for membership to the VO
- Throws:
VoNotExistsException
ExtendMembershipException
PrivilegeException
-
canExtendMembership
public boolean canExtendMembership(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:MembersManager
Return true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise false.- Specified by:
canExtendMembership
in interfaceMembersManager
- Parameters:
sess
-member
-- Returns:
- true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise false.
- Throws:
PrivilegeException
MemberNotExistsException
-
canExtendMembershipWithReason
public boolean canExtendMembershipWithReason(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException, ExtendMembershipException Description copied from interface:MembersManager
Return true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise throws exception.- Specified by:
canExtendMembershipWithReason
in interfaceMembersManager
- Parameters:
sess
-member
-- Returns:
- true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise false
- Throws:
PrivilegeException
MemberNotExistsException
ExtendMembershipException
-
copySponsoredMembers
public void copySponsoredMembers(PerunSession session, List<Member> sponsored, User copyFrom, User copyTo, boolean copyValidity, LocalDate validityTo) throws SponsorshipDoesNotExistException, UserNotInRoleException, PrivilegeException, MemberNotSponsoredException Description copied from interface:MembersManager
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).- Specified by:
copySponsoredMembers
in interfaceMembersManager
- 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
public Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, String login, Candidate candidate) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Description copied from interface:MembersManager
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).- Specified by:
createMember
in interfaceMembersManager
- 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:
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
public Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, String login, Candidate candidate, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Description copied from interface:MembersManager
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).
- Specified by:
createMember
in interfaceMembersManager
- 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:
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
public Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, int extSourceLoa, String login, Candidate candidate) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Description copied from interface:MembersManager
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).- Specified by:
createMember
in interfaceMembersManager
- 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:
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
public 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 Description copied from interface:MembersManager
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).
- Specified by:
createMember
in interfaceMembersManager
- 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:
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
public Member createMember(PerunSession sess, Vo vo, Candidate candidate) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, VoNotExistsException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Description copied from interface:MembersManager
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).- Specified by:
createMember
in interfaceMembersManager
- Parameters:
sess
-vo
-candidate
-- Returns:
- newly created members
- Throws:
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
VoNotExistsException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
public Member createMember(PerunSession sess, Vo vo, Candidate candidate, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, VoNotExistsException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Description copied from interface:MembersManager
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).
- Specified by:
createMember
in interfaceMembersManager
- Parameters:
sess
-vo
-candidate
-groups
- list of groups where member will be added too- Returns:
- newly created members
- Throws:
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
VoNotExistsException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
public Member createMember(PerunSession sess, Vo vo, User user) throws AlreadyMemberException, WrongAttributeValueException, WrongReferenceAttributeValueException, VoNotExistsException, UserNotExistsException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Description copied from interface:MembersManager
Creates a new member from user. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Specified by:
createMember
in interfaceMembersManager
- Parameters:
sess
-vo
-user
-- Returns:
- newly created member
- Throws:
AlreadyMemberException
WrongAttributeValueException
WrongReferenceAttributeValueException
VoNotExistsException
UserNotExistsException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
public Member createMember(PerunSession sess, Vo vo, User user, List<Group> groups) throws AlreadyMemberException, WrongAttributeValueException, WrongReferenceAttributeValueException, VoNotExistsException, UserNotExistsException, PrivilegeException, ExtendMembershipException, GroupNotExistsException Description copied from interface:MembersManager
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).
- Specified by:
createMember
in interfaceMembersManager
- Parameters:
sess
-vo
-user
-groups
- list of groups where member will be added too- Returns:
- newly created member
- Throws:
AlreadyMemberException
WrongAttributeValueException
WrongReferenceAttributeValueException
VoNotExistsException
UserNotExistsException
PrivilegeException
ExtendMembershipException
GroupNotExistsException
-
createMember
public Member createMember(PerunSession sess, Vo vo, ExtSource extSource, String login) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException, VoNotExistsException, ExtSourceNotExistsException, PrivilegeException, GroupNotExistsException Description copied from interface:MembersManager
Create new member from user by login and ExtSource. This method validates member asynchronously- Specified by:
createMember
in interfaceMembersManager
- Parameters:
sess
-vo
-extSource
-login
-- Returns:
- newly created member
- Throws:
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
VoNotExistsException
ExtSourceNotExistsException
PrivilegeException
GroupNotExistsException
-
createMember
public Member createMember(PerunSession sess, Vo vo, ExtSource extSource, String login, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException, VoNotExistsException, ExtSourceNotExistsException, PrivilegeException, GroupNotExistsException Description copied from interface:MembersManager
Create new member from user by login and ExtSource.Also add this member to groups in list. This method validates member asynchronously
- Specified by:
createMember
in interfaceMembersManager
- Parameters:
sess
-vo
-extSource
-login
-groups
-- Returns:
- newly created member
- Throws:
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
VoNotExistsException
ExtSourceNotExistsException
PrivilegeException
GroupNotExistsException
-
createSpecificMember
public Member createSpecificMember(PerunSession sess, Vo vo, Candidate candidate, List<User> specificUserOwners, SpecificUserType specificUserType) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, VoNotExistsException, PrivilegeException, UserNotExistsException, ExtendMembershipException, GroupNotExistsException Description copied from interface:MembersManager
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).- Specified by:
createSpecificMember
in interfaceMembersManager
- 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:
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
VoNotExistsException
PrivilegeException
UserNotExistsException
ExtendMembershipException
GroupNotExistsException
-
createSpecificMember
public 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 Description copied from interface:MembersManager
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).
- Specified by:
createSpecificMember
in interfaceMembersManager
- 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:
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
VoNotExistsException
PrivilegeException
UserNotExistsException
ExtendMembershipException
GroupNotExistsException
-
createSponsoredMember
public 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 Description copied from interface:MembersManager
Creates a new sponsored Member and its User.- Specified by:
createSponsoredMember
in interfaceMembersManager
- 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:
PrivilegeException
- if not REGISTRAR or VOADMINAlreadyMemberException
LoginNotExistsException
PasswordCreationFailedException
ExtendMembershipException
WrongAttributeValueException
ExtSourceNotExistsException
WrongReferenceAttributeValueException
UserNotInRoleException
AlreadySponsorException
PasswordStrengthException
InvalidLoginException
InvalidSponsoredUserDataException
NamespaceRulesNotExistsException
-
createSponsoredMembers
public 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 Description copied from interface:MembersManager
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.
- Specified by:
createSponsoredMembers
in interfaceMembersManager
- 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
public 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 Description copied from interface:MembersManager
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.
- Specified by:
createSponsoredMembersFromCSV
in interfaceMembersManager
- 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
public void deleteAllMembers(PerunSession sess, Vo vo) throws VoNotExistsException, PrivilegeException, MemberAlreadyRemovedException, MemberLifecycleAlteringForbiddenException Description copied from interface:MembersManager
Deletes all VO members.- Specified by:
deleteAllMembers
in interfaceMembersManager
- Parameters:
sess
-vo
-- Throws:
VoNotExistsException
PrivilegeException
MemberAlreadyRemovedException
MemberLifecycleAlteringForbiddenException
- if some member comes from hierarchical member vo and cannot be altered in parent vo
-
deleteMember
public void deleteMember(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException, MemberAlreadyRemovedException, MemberLifecycleAlteringForbiddenException Description copied from interface:MembersManager
Deletes only member data appropriated by member id.- Specified by:
deleteMember
in interfaceMembersManager
- Parameters:
sess
-member
-- Throws:
MemberNotExistsException
PrivilegeException
MemberAlreadyRemovedException
MemberLifecycleAlteringForbiddenException
- if member comes from hierarchical member vo and cannot be altered in parent vo
-
deleteMembers
public void deleteMembers(PerunSession sess, List<Member> members) throws MemberNotExistsException, PrivilegeException, MemberAlreadyRemovedException, MemberLifecycleAlteringForbiddenException Description copied from interface:MembersManager
Delete given members. It is possible to delete members from multiple vos.- Specified by:
deleteMembers
in interfaceMembersManager
- Parameters:
sess
- sessionmembers
- members that will be deleted- Throws:
MemberNotExistsException
- 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
public String extendExpirationForSponsoredMember(PerunSession sess, Member sponsoredMember, User sponsorUser) throws PrivilegeException, MemberNotExistsException, UserNotExistsException Description copied from interface:MembersManager
Extends expiration date. Sponsored members cannot apply for membership extension, this method allows a sponsor to extend it.- Specified by:
extendExpirationForSponsoredMember
in interfaceMembersManager
- Parameters:
sess
- actorsponsoredMember
- existing member that is sponsoredsponsorUser
- sponsoring user or null for the caller- Returns:
- new expiration date
- Throws:
PrivilegeException
- if not REGISTRAR or VOADMINMemberNotExistsException
UserNotExistsException
-
extendMembership
public void extendMembership(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException, ExtendMembershipException Description copied from interface:MembersManager
Extend member membership using membershipExpirationRules attribute defined at VO.- Specified by:
extendMembership
in interfaceMembersManager
- Parameters:
sess
-member
-- Throws:
PrivilegeException
MemberNotExistsException
ExtendMembershipException
-
findCompleteRichMembers
public List<RichMember> findCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames, String searchString, boolean onlySponsored) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
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.- Specified by:
findCompleteRichMembers
in interfaceMembersManager
- Parameters:
sess
-vo
-attrsNames
-searchString
-onlySponsored
- return only sponsored members- Returns:
- list of founded richMembers with specific attributes from Vo for searchString
- Throws:
PrivilegeException
VoNotExistsException
-
findCompleteRichMembers
public List<RichMember> findCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames, List<String> allowedStatuses, String searchString) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
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.- Specified by:
findCompleteRichMembers
in interfaceMembersManager
- Parameters:
sess
-vo
-attrsNames
-allowedStatuses
-searchString
-- Returns:
- list of founded richMembers with specific attributes from Vo for searchString with allowed statuses
- Throws:
PrivilegeException
VoNotExistsException
-
findCompleteRichMembers
public List<RichMember> findCompleteRichMembers(PerunSession sess, List<String> attrsNames, List<String> allowedStatuses, String searchString) throws PrivilegeException Description copied from interface:MembersManager
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.- Specified by:
findCompleteRichMembers
in interfaceMembersManager
- Parameters:
sess
-attrsNames
-allowedStatuses
-searchString
-- Returns:
- list of founded richMembers with specific attributes by searchString with allowed statuses
- Throws:
PrivilegeException
-
findCompleteRichMembers
public List<RichMember> findCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, String searchString, boolean lookingInParentGroup) throws PrivilegeException, GroupNotExistsException, ParentGroupNotExistsException Description copied from interface:MembersManager
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.
- Specified by:
findCompleteRichMembers
in interfaceMembersManager
- Parameters:
sess
-group
-attrsNames
-searchString
-lookingInParentGroup
-- Returns:
- list of founded richMembers with specific attributes from Group for searchString
- Throws:
PrivilegeException
GroupNotExistsException
ParentGroupNotExistsException
-
findCompleteRichMembers
public List<RichMember> findCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, List<String> allowedStatuses, List<String> allowedGroupStatuses, String searchString, boolean lookingInParentGroup) throws PrivilegeException, GroupNotExistsException, ParentGroupNotExistsException Description copied from interface:MembersManager
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.
- Specified by:
findCompleteRichMembers
in interfaceMembersManager
- Parameters:
sess
-group
-attrsNames
-allowedStatuses
-allowedGroupStatuses
-searchString
-lookingInParentGroup
-- Returns:
- list of founded richMembers with specific attributes from Group for searchString
- Throws:
PrivilegeException
GroupNotExistsException
ParentGroupNotExistsException
-
findMembersByName
public List<Member> findMembersByName(PerunSession sess, String searchString) throws PrivilegeException Description copied from interface:MembersManager
Return list of members by the searchString- Specified by:
findMembersByName
in interfaceMembersManager
- Parameters:
sess
-searchString
-- Returns:
- list of members
- Throws:
PrivilegeException
-
findMembersByNameInVo
public List<Member> findMembersByNameInVo(PerunSession sess, Vo vo, String searchString) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Return list of members by the searchString under defined VO.- Specified by:
findMembersByNameInVo
in interfaceMembersManager
- Parameters:
sess
-vo
-searchString
-- Returns:
- list of members
- Throws:
PrivilegeException
VoNotExistsException
-
findMembersInGroup
public List<Member> findMembersInGroup(PerunSession sess, Group group, String searchString) throws PrivilegeException, GroupNotExistsException Description copied from interface:MembersManager
Return list of members by the searchString under defined Group. Search is done in name, email and login.- Specified by:
findMembersInGroup
in interfaceMembersManager
- Parameters:
sess
-group
-searchString
-- Returns:
- list of members
- Throws:
PrivilegeException
GroupNotExistsException
-
findMembersInParentGroup
public List<Member> findMembersInParentGroup(PerunSession sess, Group group, String searchString) throws PrivilegeException, GroupNotExistsException, ParentGroupNotExistsException Description copied from interface:MembersManager
Return list of members by the searchString udner parentGroup of defined Group. Search is done in name, email and login.- Specified by:
findMembersInParentGroup
in interfaceMembersManager
- Parameters:
sess
-group
- this group is used to get parent group, we are searching members of the parent groupsearchString
-- Returns:
- Throws:
PrivilegeException
GroupNotExistsException
ParentGroupNotExistsException
-
findMembersInVo
public List<Member> findMembersInVo(PerunSession sess, Vo vo, String searchString) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Return list of members by the searchString under defined VO. Search is done in name, email and login.- Specified by:
findMembersInVo
in interfaceMembersManager
- Parameters:
sess
-vo
-searchString
-- Returns:
- list of members
- Throws:
PrivilegeException
VoNotExistsException
-
findRichMembersInVo
public List<RichMember> findRichMembersInVo(PerunSession sess, Vo vo, String searchString) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Return list of rich members by the searchString under defined VO. Search is done in name, email and login.- Specified by:
findRichMembersInVo
in interfaceMembersManager
- Parameters:
sess
-vo
-searchString
-- Returns:
- list of rich members
- Throws:
PrivilegeException
VoNotExistsException
-
findRichMembersWithAttributesInGroup
public List<RichMember> findRichMembersWithAttributesInGroup(PerunSession sess, Group group, String searchString) throws PrivilegeException, GroupNotExistsException Description copied from interface:MembersManager
Return list of rich members with attributes by the searchString under defined Group. Search is done in name, email and login.- Specified by:
findRichMembersWithAttributesInGroup
in interfaceMembersManager
- Parameters:
sess
-group
- this group is used to get parent group, we are searching members of the parent groupsearchString
-- Returns:
- Throws:
PrivilegeException
GroupNotExistsException
- is thrown if group or parent group of this group not exists.
-
findRichMembersWithAttributesInParentGroup
public List<RichMember> findRichMembersWithAttributesInParentGroup(PerunSession sess, Group group, String searchString) throws PrivilegeException, GroupNotExistsException Description copied from interface:MembersManager
Return list of rich with attributes members by the searchString under parent group of defined Group. Search is done in name, email and login.- Specified by:
findRichMembersWithAttributesInParentGroup
in interfaceMembersManager
- Parameters:
sess
-group
-searchString
-- Returns:
- Throws:
PrivilegeException
GroupNotExistsException
- is thrown if group or parent group of this group not exists.
-
findRichMembersWithAttributesInVo
public List<RichMember> findRichMembersWithAttributesInVo(PerunSession sess, Vo vo, String searchString) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Return list of rich members with attributes by the searchString under defined VO. Search is done in name, email and login.- Specified by:
findRichMembersWithAttributesInVo
in interfaceMembersManager
- Parameters:
sess
-vo
-searchString
-- Returns:
- list of rich members with attributes
- Throws:
PrivilegeException
VoNotExistsException
-
getAllMembers
Description copied from interface:MembersManager
Get all members from all vos.- Specified by:
getAllMembers
in interfaceMembersManager
- Parameters:
sess
- session- Returns:
- list of all members from all Vos.
- Throws:
PrivilegeException
-
getAllNamespacesRules
Description copied from interface:MembersManager
Return all loaded namespaces rules.- Specified by:
getAllNamespacesRules
in interfaceMembersManager
- Returns:
- all namespaces rules
-
getAllSponsoredMembers
public List<RichMember> getAllSponsoredMembers(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Gets list of all sponsored members of a VO.- Specified by:
getAllSponsoredMembers
in interfaceMembersManager
- 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
public List<MemberWithSponsors> getAllSponsoredMembersAndTheirSponsors(PerunSession sess, Vo vo, List<String> attrNames) throws VoNotExistsException, PrivilegeException, AttributeNotExistsException Description copied from interface:MembersManager
Gets list of VO's all sponsored members with sponsors.- Specified by:
getAllSponsoredMembersAndTheirSponsors
in interfaceMembersManager
- 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
public List<RichMember> getCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames) throws PrivilegeException, VoNotExistsException, AttributeNotExistsException Description copied from interface:MembersManager
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.- Specified by:
getCompleteRichMembers
in interfaceMembersManager
- Parameters:
sess
-vo
-attrsNames
-- Returns:
- list of richMembers with specific attributes from Vo
- Throws:
PrivilegeException
VoNotExistsException
AttributeNotExistsException
-
getCompleteRichMembers
public List<RichMember> getCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames, List<String> allowedStatuses) throws PrivilegeException, VoNotExistsException, AttributeNotExistsException Description copied from interface:MembersManager
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.- Specified by:
getCompleteRichMembers
in interfaceMembersManager
- Parameters:
sess
-vo
-attrsNames
-allowedStatuses
-- Returns:
- list of richMembers with specific attributes from Vo
- Throws:
PrivilegeException
VoNotExistsException
AttributeNotExistsException
-
getCompleteRichMembers
public List<RichMember> getCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, boolean lookingInParentGroup) throws PrivilegeException, ParentGroupNotExistsException, GroupNotExistsException, AttributeNotExistsException Description copied from interface:MembersManager
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.
- Specified by:
getCompleteRichMembers
in interfaceMembersManager
- Parameters:
sess
-group
-attrsNames
-lookingInParentGroup
-- Returns:
- list of richMembers with specific attributes from Group
- Throws:
PrivilegeException
GroupNotExistsException
AttributeNotExistsException
ParentGroupNotExistsException
-
getCompleteRichMembers
public List<RichMember> getCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, List<String> allowedStatuses, List<String> allowedGroupStatuses, boolean lookingInParentGroup) throws PrivilegeException, ParentGroupNotExistsException, GroupNotExistsException, AttributeNotExistsException Description copied from interface:MembersManager
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.
- Specified by:
getCompleteRichMembers
in interfaceMembersManager
- Parameters:
sess
-group
-attrsNames
-allowedStatuses
-allowedGroupStatuses
-lookingInParentGroup
-- Returns:
- list of richMembers with specific attributes from group
- Throws:
PrivilegeException
GroupNotExistsException
AttributeNotExistsException
ParentGroupNotExistsException
-
getCompleteRichMembers
public List<RichMember> getCompleteRichMembers(PerunSession sess, Group group, Resource resource, List<String> attrsNames, List<String> allowedStatuses) throws AttributeNotExistsException, GroupNotExistsException, ResourceNotExistsException, PrivilegeException, GroupResourceMismatchException Description copied from interface:MembersManager
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.- Specified by:
getCompleteRichMembers
in interfaceMembersManager
- Parameters:
sess
-group
-resource
-attrsNames
-allowedStatuses
-- Returns:
- list of richMembers with specific attributes
- Throws:
AttributeNotExistsException
GroupNotExistsException
ResourceNotExistsException
PrivilegeException
GroupResourceMismatchException
-
getMemberByExtSourceNameAndExtLogin
public Member getMemberByExtSourceNameAndExtLogin(PerunSession sess, Vo vo, String extSourceName, String extLogin) throws ExtSourceNotExistsException, UserExtSourceNotExistsException, MemberNotExistsException, UserNotExistsException, VoNotExistsException, PrivilegeException Description copied from interface:MembersManager
Get member by extSourceName, extSourceLogin and Vo- Specified by:
getMemberByExtSourceNameAndExtLogin
in interfaceMembersManager
- 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
PrivilegeException
-
getMemberById
public Member getMemberById(PerunSession sess, int id) throws MemberNotExistsException, PrivilegeException Description copied from interface:MembersManager
Returns member by his id.- Specified by:
getMemberById
in interfaceMembersManager
- Parameters:
sess
-id
-- Returns:
- member
- Throws:
MemberNotExistsException
PrivilegeException
-
getMemberByUser
public Member getMemberByUser(PerunSession sess, Vo vo, User user) throws MemberNotExistsException, PrivilegeException, VoNotExistsException, UserNotExistsException Description copied from interface:MembersManager
Returns member by his user and vo.- Specified by:
getMemberByUser
in interfaceMembersManager
- Parameters:
sess
-vo
-user
-- Returns:
- member
- Throws:
MemberNotExistsException
PrivilegeException
VoNotExistsException
UserNotExistsException
-
getMemberByUserExtSource
public Member getMemberByUserExtSource(PerunSession sess, Vo vo, UserExtSource uea) throws VoNotExistsException, MemberNotExistsException, PrivilegeException Description copied from interface:MembersManager
Find member of this Vo by his login in external source- Specified by:
getMemberByUserExtSource
in interfaceMembersManager
- Parameters:
sess
-vo
-uea
-- Returns:
- selected user or throws MemberNotExistsException in case the requested member doesn't exists in this Vo
- Throws:
VoNotExistsException
MemberNotExistsException
PrivilegeException
-
getMemberVo
Description copied from interface:MembersManager
Get the member VO.- Specified by:
getMemberVo
in interfaceMembersManager
- Parameters:
sess
-member
-- Returns:
- member's VO
- Throws:
MemberNotExistsException
-
getMembers
public List<Member> getMembers(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get all VO members.- Specified by:
getMembers
in interfaceMembersManager
- Parameters:
sess
-vo
-- Returns:
- all members of the VO
- Throws:
PrivilegeException
VoNotExistsException
-
getMembers
public List<Member> getMembers(PerunSession sess, Vo vo, Status status) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get all VO members who have the status.- Specified by:
getMembers
in interfaceMembersManager
- Parameters:
sess
-vo
-status
- get only members who have this status- Returns:
- all members of the VO
- Throws:
PrivilegeException
VoNotExistsException
-
getMembersByIds
Description copied from interface:MembersManager
Returns members by their ids.- Specified by:
getMembersByIds
in interfaceMembersManager
- Parameters:
sess
-ids
-- Returns:
- list of members with specified ids
- Throws:
PrivilegeException
-
getMembersByUser
public List<Member> getMembersByUser(PerunSession sess, User user) throws PrivilegeException, UserNotExistsException Description copied from interface:MembersManager
Returns members by his user.- Specified by:
getMembersByUser
in interfaceMembersManager
- Parameters:
sess
-user
-- Returns:
- member
- Throws:
PrivilegeException
UserNotExistsException
-
getMembersCount
public int getMembersCount(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get the VO members count.- Specified by:
getMembersCount
in interfaceMembersManager
- Parameters:
sess
-vo
-- Returns:
- count of VO members
- Throws:
PrivilegeException
VoNotExistsException
-
getMembersCount
public int getMembersCount(PerunSession sess, Vo vo, Status status) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get the VO members count with defined status.- Specified by:
getMembersCount
in interfaceMembersManager
- Parameters:
sess
-vo
-status
-- Returns:
- count of VO members
- Throws:
PrivilegeException
VoNotExistsException
-
getMembersManagerBl
Gets the membersManagerBl for this instance.- Returns:
- The membersManagerBl.
-
getMembersPage
public Paginated<RichMember> getMembersPage(PerunSession sess, Vo vo, MembersPageQuery query, List<String> attrNames) throws VoNotExistsException, PrivilegeException, GroupNotExistsException, PolicyNotExistsException Description copied from interface:MembersManager
Get page of members from the given vo, with the given attributes.- Specified by:
getMembersPage
in interfaceMembersManager
- Parameters:
sess
- sessionvo
- voquery
- query with page informationattrNames
- attribute names- Returns:
- page of requested rich members
- Throws:
VoNotExistsException
- if there is no such voPrivilegeException
- insufficient permissionGroupNotExistsException
- if there is no such query groupPolicyNotExistsException
-
getMembersPage
public Paginated<RichMember> getMembersPage(PerunSession sess, Vo vo, MembersPageQuery query, List<String> attrNames, String policy) throws VoNotExistsException, PrivilegeException, GroupNotExistsException, PolicyNotExistsException Description copied from interface:MembersManager
Get page of members from the given vo, with the given attributes, based on policy.- Specified by:
getMembersPage
in interfaceMembersManager
- 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 voPrivilegeException
- insufficient permissionGroupNotExistsException
- if there is no such query groupPolicyNotExistsException
-
getNewExtendMembership
public Date getNewExtendMembership(PerunSession sess, Member member) throws MemberNotExistsException Description copied from interface:MembersManager
Returns the date to which will be extended member's expiration time.- Specified by:
getNewExtendMembership
in interfaceMembersManager
- Parameters:
sess
-member
-- Returns:
- date
- Throws:
MemberNotExistsException
-
getNewExtendMembership
public Date getNewExtendMembership(PerunSession sess, Vo vo, String loa) throws VoNotExistsException, ExtendMembershipException Description copied from interface:MembersManager
Returns the date to which will be extended member's expiration time.- Specified by:
getNewExtendMembership
in interfaceMembersManager
- Parameters:
sess
-vo
-loa
-- Returns:
- date
- Throws:
VoNotExistsException
ExtendMembershipException
-
getPerunBl
-
getRichMemberById
public RichMember getRichMemberById(PerunSession sess, int id) throws PrivilegeException, MemberNotExistsException Description copied from interface:MembersManager
Get richMember without attribute by id of member- Specified by:
getRichMemberById
in interfaceMembersManager
- Parameters:
sess
-id
- of member- Returns:
- richMember without attributes (only with user)
- Throws:
PrivilegeException
- if user has no rights to get this richMemberMemberNotExistsException
- if member not exists
-
getRichMemberWithAttributes
public RichMember getRichMemberWithAttributes(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:MembersManager
Get Member to RichMember with attributes.- Specified by:
getRichMemberWithAttributes
in interfaceMembersManager
- Parameters:
sess
-member
-- Returns:
- Throws:
PrivilegeException
MemberNotExistsException
-
getRichMembers
public List<RichMember> getRichMembers(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get all rich members of VO. Rich member object contains user, member, userExtSources.- Specified by:
getRichMembers
in interfaceMembersManager
- Parameters:
sess
-vo
-- Returns:
- list of rich members, empty list if there are no members in VO
- Throws:
PrivilegeException
VoNotExistsException
-
getRichMembers
public List<RichMember> getRichMembers(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:MembersManager
Get all rich members of Group. Rich member object contains user, member, userExtSources.- Specified by:
getRichMembers
in interfaceMembersManager
- Parameters:
sess
-group
-- Returns:
- list of rich members, empty list if there are no members in Group
- Throws:
PrivilegeException
GroupNotExistsException
-
getRichMembers
public List<RichMember> getRichMembers(PerunSession sess, Vo vo, Status status) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get all rich members of VO with specified status. Rich member object contains user, member, userExtSources.- Specified by:
getRichMembers
in interfaceMembersManager
- 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:
PrivilegeException
VoNotExistsException
-
getRichMembersByIds
public List<RichMember> getRichMembersByIds(PerunSession sess, List<Integer> ids, List<String> attrNames) throws PrivilegeException, AttributeNotExistsException Description copied from interface:MembersManager
Returns rich members by their IDs with specific attributes.- Specified by:
getRichMembersByIds
in interfaceMembersManager
- Parameters:
sess
- Perun sessionids
- Listlist of members IDs attrNames
- 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
public List<RichMember> getRichMembersNoUserAttributes(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get all rich members of VO. Rich member object contains user, member, userExtSources and member attributes. User attributes aren't included- Specified by:
getRichMembersNoUserAttributes
in interfaceMembersManager
- Parameters:
sess
-vo
-- Returns:
- list of rich members with all member attributes
- Throws:
PrivilegeException
VoNotExistsException
-
getRichMembersWithAttributes
public List<RichMember> getRichMembersWithAttributes(PerunSession sess, Vo vo, List<AttributeDefinition> attrsDef) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get RichMembers with Attributes but only with selected attributes from list attrsDef for vo.- Specified by:
getRichMembersWithAttributes
in interfaceMembersManager
- Parameters:
sess
-vo
-attrsDef
- list of attrDefs only for selected attributes- Returns:
- list of richmembers
- Throws:
PrivilegeException
VoNotExistsException
-
getRichMembersWithAttributes
public List<RichMember> getRichMembersWithAttributes(PerunSession sess, List<String> allowedStatuses, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:MembersManager
Get all rich members with allowed statuses from specific group. Rich member object contains user, member, userExtSources and member/user attributes.- Specified by:
getRichMembersWithAttributes
in interfaceMembersManager
- 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:
PrivilegeException
GroupNotExistsException
-
getRichMembersWithAttributes
public List<RichMember> getRichMembersWithAttributes(PerunSession sess, Group group, List<AttributeDefinition> attrsDef) throws PrivilegeException, GroupNotExistsException Description copied from interface:MembersManager
Get RichMembers with Attributes but only with selected attributes from list attrsDef for group.- Specified by:
getRichMembersWithAttributes
in interfaceMembersManager
- Parameters:
sess
-group
-attrsDef
-- Returns:
- Throws:
PrivilegeException
GroupNotExistsException
-
getRichMembersWithAttributes
public List<RichMember> getRichMembersWithAttributes(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get all rich members of VO. Rich member object contains user, member, userExtSources and member/user attributes.- Specified by:
getRichMembersWithAttributes
in interfaceMembersManager
- Parameters:
sess
-vo
-- Returns:
- list of rich members with all member/user attributes, empty list if there are no members in VO
- Throws:
PrivilegeException
VoNotExistsException
-
getRichMembersWithAttributes
public List<RichMember> getRichMembersWithAttributes(PerunSession sess, Vo vo, Status status) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get all rich members of VO with specified status. Rich member object contains user, member, userExtSources and member/user attributes.- Specified by:
getRichMembersWithAttributes
in interfaceMembersManager
- 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:
PrivilegeException
VoNotExistsException
-
getRichMembersWithAttributesByNames
public List<RichMember> getRichMembersWithAttributesByNames(PerunSession sess, Vo vo, List<String> attrsNames) throws PrivilegeException, VoNotExistsException, AttributeNotExistsException Description copied from interface:MembersManager
Get RichMembers with Attributes but only with selected attributes from list attrsDef for vo.- Specified by:
getRichMembersWithAttributesByNames
in interfaceMembersManager
- Parameters:
sess
-vo
-attrsNames
- list of attrNames for selected attributes- Returns:
- list of richmembers
- Throws:
PrivilegeException
VoNotExistsException
AttributeNotExistsException
-
getRichMembersWithAttributesByNames
public List<RichMember> getRichMembersWithAttributesByNames(PerunSession sess, Group group, List<String> attrsNames) throws PrivilegeException, GroupNotExistsException, AttributeNotExistsException Description copied from interface:MembersManager
Get RichMembers with Attributes but only with selected attributes from list attrsDef for group.- Specified by:
getRichMembersWithAttributesByNames
in interfaceMembersManager
- Parameters:
sess
-group
-attrsNames
- list of attrNames for selected attributes- Returns:
- list of richmembers
- Throws:
PrivilegeException
GroupNotExistsException
AttributeNotExistsException
-
getServiceUserRichMembers
public List<RichMember> getServiceUserRichMembers(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Get RichMembers from a VO who are service users.- Specified by:
getServiceUserRichMembers
in interfaceMembersManager
- Parameters:
sess
-vo
-- Returns:
- List of RichMembers from the VO, who are service users
- Throws:
PrivilegeException
VoNotExistsException
-
getSponsoredMembers
public List<RichMember> getSponsoredMembers(PerunSession sess, Vo vo, User user, List<String> attrNames) throws AttributeNotExistsException, PrivilegeException, VoNotExistsException, UserNotExistsException Description copied from interface:MembersManager
Get all sponsored RichMembers with attributes by list of attribute names for specific User and Vo.- Specified by:
getSponsoredMembers
in interfaceMembersManager
- 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:
AttributeNotExistsException
- if any attributeDefinition can't be found by one of attribute namesPrivilegeException
- if user in session is not allowed to call this methodVoNotExistsException
- if Vo not exists in PerunUserNotExistsException
- if User not exists in Perun
-
getSponsoredMembers
public List<RichMember> getSponsoredMembers(PerunSession sess, Vo vo, User user) throws PrivilegeException, VoNotExistsException, UserNotExistsException Description copied from interface:MembersManager
Gets list of members of a VO sponsored by the given user.- Specified by:
getSponsoredMembers
in interfaceMembersManager
- 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:
PrivilegeException
- if not REGISTRAR or VOADMINVoNotExistsException
UserNotExistsException
-
getSponsoredMembers
public List<RichMember> getSponsoredMembers(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Description copied from interface:MembersManager
Gets list of sponsored members of a VO.- Specified by:
getSponsoredMembers
in interfaceMembersManager
- Parameters:
sess
- actorvo
- virtual organization from which are the sponsored members chosen- Returns:
- list of members from given VO who are sponsored
- Throws:
PrivilegeException
- if not REGISTRAR or VOADMINVoNotExistsException
-
getSponsoredMembersAndTheirSponsors
public List<MemberWithSponsors> getSponsoredMembersAndTheirSponsors(PerunSession sess, Vo vo, List<String> attrNames) throws VoNotExistsException, PrivilegeException, AttributeNotExistsException Description copied from interface:MembersManager
Gets list of sponsored members with sponsors.- Specified by:
getSponsoredMembersAndTheirSponsors
in interfaceMembersManager
- 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
public void moveMembership(PerunSession sess, Vo vo, User sourceUser, User targetUser) throws UserNotExistsException, VoNotExistsException, PrivilegeException, ExtendMembershipException, MemberNotExistsException, AlreadyMemberException Description copied from interface:MembersManager
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.- Specified by:
moveMembership
in interfaceMembersManager
- 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 permissionsExtendMembershipException
- when targetUser doesn't have required LOA for the VOMemberNotExistsException
- when sourceUser is not member of the VOAlreadyMemberException
- when targetUser is already member of the VO
-
removeSponsor
public void removeSponsor(PerunSession sess, Member sponsoredMember, User sponsorToRemove) throws PrivilegeException Description copied from interface:MembersManager
Removes the sponsor.- Specified by:
removeSponsor
in interfaceMembersManager
- Parameters:
sess
- actorsponsoredMember
- existing member that is sponsoredsponsorToRemove
- sponsoring user for removal- Throws:
PrivilegeException
- if not REGISTRAR or VOADMIN
-
removeSponsors
public void removeSponsors(PerunSession sess, Member sponsoredMember, List<User> sponsorsToRemove) throws PrivilegeException Description copied from interface:MembersManager
Removes the sponsors from member.- Specified by:
removeSponsors
in interfaceMembersManager
- Parameters:
sess
- actorsponsoredMember
- existing member that is sponsoredsponsorsToRemove
- sponsoring users for removal- Throws:
PrivilegeException
- if not REGISTRAR or VOADMIN
-
sendAccountActivationLinkEmail
public void sendAccountActivationLinkEmail(PerunSession sess, Member member, String namespace, String url, String mailAttributeUrn, String language) throws PrivilegeException, MemberNotExistsException, AttributeNotExistsException, NotificationMemberMailNotExistsException Description copied from interface:MembersManager
Send mail to user's preferred email address with link for non-authz account activation. Correct authz information is stored in link's URL.- Specified by:
sendAccountActivationLinkEmail
in interfaceMembersManager
- 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:
PrivilegeException
- If not VO admin of memberMemberNotExistsException
- If member not existsNotificationMemberMailNotExistsException
- If the attribute with stored mail is not filled.AttributeNotExistsException
-
sendPasswordResetLinkEmail
public void sendPasswordResetLinkEmail(PerunSession sess, Member member, String namespace, String url, String mailAttributeUrn, String language) throws PrivilegeException, MemberNotExistsException, AttributeNotExistsException, NotificationMemberMailNotExistsException Description copied from interface:MembersManager
Send mail to user's preferred email address with link for non-authz password reset. Correct authz information is stored in link's URL.- Specified by:
sendPasswordResetLinkEmail
in interfaceMembersManager
- 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:
PrivilegeException
- If not VO admin of memberMemberNotExistsException
- If member not existsNotificationMemberMailNotExistsException
- If the attribute with stored mail is not filled.AttributeNotExistsException
-
sendUsernameReminderEmail
public void sendUsernameReminderEmail(PerunSession sess, Member member, String namespace, String mailAttributeUrn, String language) throws PrivilegeException, MemberNotExistsException, AttributeNotExistsException, NotificationMemberMailNotExistsException Description copied from interface:MembersManager
Send mail to user's preferred email address with reminder of the username in the given namespace.- Specified by:
sendUsernameReminderEmail
in interfaceMembersManager
- 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:
PrivilegeException
- If not VO admin of memberMemberNotExistsException
- If member not existsNotificationMemberMailNotExistsException
- If the attribute with stored mail is not filled.AttributeNotExistsException
-
setMembersManagerBl
Sets the membersManagerBl for this instance.- Parameters:
membersManagerBl
- The membersManagerBl.
-
setPerunBl
Sets the perunBl for this instance.- Parameters:
perunBl
- The perunBl.
-
setSponsoredMember
public 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 Description copied from interface:MembersManager
Creates a sponsored membership for the given user.- Specified by:
setSponsoredMember
in interfaceMembersManager
- 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
public RichMember setSponsorshipForMember(PerunSession session, Member sponsoredMember, User sponsor, LocalDate validityTo) throws MemberNotExistsException, AlreadySponsoredMemberException, UserNotInRoleException, PrivilegeException, AlreadySponsorException Description copied from interface:MembersManager
Transform non-sponsored member to sponsored one with defined sponsor- Specified by:
setSponsorshipForMember
in interfaceMembersManager
- 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:
MemberNotExistsException
- if member with defined id not exists in system PerunAlreadySponsoredMemberException
- if member is already sponsoredUserNotInRoleException
- if sponsor hasn't right role in the same voPrivilegeException
- if not PerunAdminAlreadySponsorException
- sponsoredMember is already sponsored by User and his sponsorship is still active
-
setStatus
public Member setStatus(PerunSession sess, Member member, Status status) throws PrivilegeException, MemberNotExistsException, WrongAttributeValueException, WrongReferenceAttributeValueException, MemberNotValidYetException, MemberLifecycleAlteringForbiddenException Description copied from interface:MembersManager
Set status of the member to specified status.- Specified by:
setStatus
in interfaceMembersManager
- Parameters:
sess
-member
-status
- new status- Returns:
- member with status set
- Throws:
PrivilegeException
MemberNotExistsException
WrongAttributeValueException
WrongReferenceAttributeValueException
MemberNotValidYetException
MemberLifecycleAlteringForbiddenException
- if member comes from hierarchical member vo and cannot be altered in parent vo
-
sponsorMember
public RichMember sponsorMember(PerunSession session, Member sponsored, User sponsor, LocalDate validityTo) throws PrivilegeException, MemberNotSponsoredException, AlreadySponsorException, UserNotInRoleException Description copied from interface:MembersManager
Assigns a new sponsor to an existing member.- Specified by:
sponsorMember
in interfaceMembersManager
- 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:
PrivilegeException
MemberNotSponsoredException
AlreadySponsorException
UserNotInRoleException
-
sponsorMembers
public void sponsorMembers(PerunSession session, List<Member> sponsored, User sponsor, LocalDate validityTo) throws PrivilegeException, MemberNotSponsoredException, AlreadySponsorException, UserNotInRoleException Description copied from interface:MembersManager
Assigns a new sponsor to existing members. If some members are non-sponsored, turn them into sponsored and assign the sponsor.- Specified by:
sponsorMembers
in interfaceMembersManager
- 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:
PrivilegeException
MemberNotSponsoredException
AlreadySponsorException
UserNotInRoleException
-
someAvailableSponsorExistsForMember
public boolean someAvailableSponsorExistsForMember(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException Description copied from interface:MembersManager
Checks if some vo sponsor who does not already sponsor given member exists.- Specified by:
someAvailableSponsorExistsForMember
in interfaceMembersManager
- Parameters:
sess
- perun sessionmember
- member- Returns:
- true if available sponsor exists, false otherwise
- Throws:
MemberNotExistsException
- when member does not existPrivilegeException
- insufficient permissions
-
getAvailableSponsorsForMember
public List<User> getAvailableSponsorsForMember(PerunSession sess, Member member) throws MemberNotExistsException, PrivilegeException Description copied from interface:MembersManager
Returns all available sponsors for given member.- Specified by:
getAvailableSponsorsForMember
in interfaceMembersManager
- Parameters:
sess
- perun sessionmember
- member- Returns:
- list of available sponsors
- Throws:
MemberNotExistsException
- when member does not existPrivilegeException
- insufficient permissions
-
suspendMemberTo
public void suspendMemberTo(PerunSession sess, Member member, Date suspendedTo) throws MemberNotExistsException, PrivilegeException, BanAlreadyExistsException Description copied from interface:MembersManager
Set date to which will be member suspended in his VO.For almost unlimited time please use time in the far future.
- Specified by:
suspendMemberTo
in interfaceMembersManager
- 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:
MemberNotExistsException
- if member not exists in PerunPrivilegeException
BanAlreadyExistsException
-
unsetSponsorshipForMember
public RichMember unsetSponsorshipForMember(PerunSession session, Member sponsoredMember) throws MemberNotExistsException, MemberNotSponsoredException, PrivilegeException Description copied from interface:MembersManager
Transform sponsored member to non-sponsored one. Delete all his sponsors.- Specified by:
unsetSponsorshipForMember
in interfaceMembersManager
- 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 yetPrivilegeException
- if not PerunAdmin
-
unsuspendMember
public void unsuspendMember(PerunSession sess, Member member) throws MemberNotExistsException, MemberNotSuspendedException, PrivilegeException Description copied from interface:MembersManager
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)
- Specified by:
unsuspendMember
in interfaceMembersManager
- Parameters:
sess
-member
- member for which the suspend state will be removed- Throws:
MemberNotExistsException
MemberNotSuspendedException
- if member has not set date to which should be considered as suspendedPrivilegeException
-
updateSponsorshipValidity
public void updateSponsorshipValidity(PerunSession sess, Member sponsoredMember, User sponsor, LocalDate newValidity) throws PrivilegeException, SponsorshipDoesNotExistException, MemberNotExistsException, UserNotExistsException Description copied from interface:MembersManager
Update the sponsorship of given member for given sponsor.- Specified by:
updateSponsorshipValidity
in interfaceMembersManager
- 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
public Member validateMemberAsync(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:MembersManager
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.- Specified by:
validateMemberAsync
in interfaceMembersManager
- Parameters:
sess
-member
-- Returns:
- member with new status set
- Throws:
PrivilegeException
MemberNotExistsException
-