Interface MembersManagerBl
- All Known Implementing Classes:
MembersManagerBlImpl
- Author:
- Michal Prochazka, Slavek Licehammer, Zora Sebestianova
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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
checkMemberExists
(PerunSession sess, Member member) void
checkMemberLifecycleIsAlterable
(PerunSession sess, Member member) Throws exception if member is member of hierarchical vo but comes from its member vos.void
checkSponsoredUserData
(PerunSession sess, SponsoredUserData data) Checks, whether the provided data are valid according to the namespace rules, if the namespace is not null.convertMembersToRichMembers
(PerunSession sess, List<Member> members) Fill the RichMember object with data from Member and corresponding User.convertMembersToRichMembersNoUserAttributes
(PerunSession sess, List<RichMember> richMembers) Fill the RichMember object with data from Member, corresponding User object and member attributes.convertMembersToRichMembersWithAttributes
(PerunSession sess, List<RichMember> richMembers) Fill the RichMember object with data from Member and corresponding User and user/member attributes.convertMembersToRichMembersWithAttributes
(PerunSession sess, List<RichMember> richMembers, Resource resource, List<AttributeDefinition> attrsDef) Fill the RichMember object with data from Member and corresponding User, user/member, user-facility and member-resource attributes defined by list of attribute definition.convertMembersToRichMembersWithAttributes
(PerunSession sess, List<RichMember> richMembers, List<AttributeDefinition> attrsDef) Fill the RichMember object with data from Member and corresponding User and user/member attributes defined by list of attribute definition.convertMembersToRichMembersWithAttributesBatch
(PerunSession sess, List<RichMember> richMembers, List<AttributeDefinition> attDefs) Optimized variant ofconvertMembersToRichMembersWithAttribute
.convertUserToSponsor
(PerunSession sess, User user, Member sponsoredMember) Convert given User to the Sponsor object.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, List<Group> groups) Create new member from user by login and ExtSource.createMember
(PerunSession sess, Vo vo, SpecificUserType specificUserType, Candidate candidate) Creates a new member from candidate returned by the method VosManager.findCandidates which fills Candidate .userExtSource.createMember
(PerunSession sess, Vo vo, SpecificUserType specificUserType, Candidate candidate, List<Group> groups, List<String> overwriteUserAttributes) Creates a new member from candidate returned by the method VosManager.findCandidates which fills Candidate .userExtSource.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.createMemberSync
(PerunSession sess, Vo vo, Candidate candidate) Creates member.createMemberSync
(PerunSession sess, Vo vo, Candidate candidate, List<Group> groups) Creates member.createMemberSync
(PerunSession sess, Vo vo, Candidate candidate, List<Group> groups, List<String> overwriteUserAttributes) Creates member.createServiceMember
(PerunSession sess, Vo vo, Candidate candidate, List<User> owners) Creates a new member from candidate which is prepared for creating service user.createServiceMember
(PerunSession sess, Vo vo, Candidate candidate, List<User> owners, List<Group> groups) Creates a new member from candidate which is prepared for creating service user.createSponsoredMember
(PerunSession session, SponsoredUserData data, Vo vo, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url, Validation validation) Creates a new sponsored member.createSponsoredMembers
(PerunSession session, Vo vo, String namespace, List<String> names, String email, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url, Validation validation) Creates new sponsored members.createSponsoredMembersFromCSV
(PerunSession sess, Vo vo, String namespace, List<String> data, String header, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url, Validation validation, List<Group> groups) Creates new sponsored members.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.disableMember
(PerunSession sess, Member member) Disable member.expireMember
(PerunSession sess, Member member) Set member's status to expired.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.filterOnlyAllowedAttributes
(PerunSession sess, RichMember richMember) For richMember filter all his user and member attributes and remove all which principal has no access to.filterOnlyAllowedAttributes
(PerunSession sess, List<RichMember> richMembers) For list of richMembers filter all their user and member attributes and remove all which principal has no access to.filterOnlyAllowedAttributes
(PerunSession sess, List<RichMember> richMembers, Group group, boolean useContext) For list of richMembers filter all their user and member attributes and remove all which principal has no access to.findCompleteRichMembers
(PerunSession sess, Group group, List<String> attrsNames, String searchString, boolean lookingInParentGroup) Return list of richMembers for specific group by the searchString with attributes 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 attributes 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 attributes 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 attributes specific for list of attrsNames and who have only status which is contain in list of statuses.findCompleteRichMembers
(PerunSession sess, List<String> attrsNames, String searchString) Return list of richMembers by the searchString with attributes specific for list of attrsNames.findCompleteRichMembers
(PerunSession sess, List<String> attrsNames, List<String> allowedStatuses, String searchString) Return list of richMembers by the searchString with attributes specific for list of attrsNames and who have only status which is contain in list of statuses.findMembers
(PerunSession sess, Vo vo, String searchString, boolean onlySponsored) Return list of members VO by specific string.findMembersByName
(PerunSession sess, String searchString) Return list of members by theirs name.findMembersByNameInVo
(PerunSession sess, Vo vo, String searchString) Return list of members by theirs name 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 theirs name or login or email under defined VO.findRichMembers
(PerunSession sess, String searchString, boolean onlySponsored) Return list of rich members by theirs name, id, uuid, login or emailfindRichMembersInVo
(PerunSession sess, Vo vo, String searchString, boolean onlySponsored) Return list of rich members by theirs name, id, uuid, login or email under defined VO.findRichMembersWithAttributes
(PerunSession sess, String searchString) Return list of rich members with attributes by theirs name or login or emailfindRichMembersWithAttributes
(PerunSession sess, String searchString, List<String> attrsNames) Return list of rich members with certain attributes by theirs name or login or email.findRichMembersWithAttributesInGroup
(PerunSession sess, Group group, String searchString) Return list of rich members with attributes by the searchString under defined Group.findRichMembersWithAttributesInGroup
(PerunSession sess, Group group, String searchString, List<String> attrsNames) Return list of rich members with certain attributes by the searchString under defined Group.findRichMembersWithAttributesInParentGroup
(PerunSession sess, Group group, String searchString) Return list of rich members with attributes by the searchString under parent group of defined Group.findRichMembersWithAttributesInVo
(PerunSession sess, Vo vo, String searchString) Return list of rich members with attributes by theirs name or login or email under defined VO.findRichMembersWithAttributesInVo
(PerunSession sess, Vo vo, String searchString, List<String> attrsNames, boolean onlySponsored) Return list of rich members with certain attributes by theirs name or login or email defined VO.getAllMembers
(PerunSession sess) Get all members from all vos.Return all loaded namespaces rules.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 attributes 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 attributes 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 attributes specific for list of attrsNames from the vo.getCompleteRichMembers
(PerunSession sess, Vo vo, List<String> attrsNames, List<String> allowedStatuses) Get all RichMembers with attributes specific for list of attrsNames from the vo and have only status which is contain in list of statuses.getMemberByExtSourceNameAndExtLogin
(PerunSession sess, Vo vo, String extSourceName, String extLogin) Get member by extSourceName, extSourceLogin and VogetMemberById
(PerunSession sess, int id) Returns member by his id.getMemberByUser
(PerunSession sess, Vo vo, User user) Returns member by his user and vo.getMemberByUserExtSource
(PerunSession perunSession, Vo vo, UserExtSource userExtSource) Find member of this Vo by his login in external sourcegetMemberByUserExtSources
(PerunSession perunSession, Vo vo, List<UserExtSource> userExtSources) Get member by its external sources.getMemberByUserId
(PerunSession sess, Vo vo, int userId) Returns member by his userId.getMembers
(PerunSession sess, Vo vo) Get all VO members.getMembers
(PerunSession sess, Vo vo, Status status) Get all VO members who have the status.getMembersByIds
(PerunSession perunSession, List<Integer> ids) Returns members by their ids.getMembersByUser
(PerunSession sess, User user) Return all VO Members of the User.getMembersByUsers
(PerunSession sess, List<User> users, Vo vo) Convert list of users into the list of members.getMembersByUsersIds
(PerunSession sess, List<Integer> usersIds, Vo vo) Convert list of users' ids into the list of members.getMembersByUserWithStatus
(PerunSession sess, User user, Status status) Return all VO Members of the User, which have specified Status in their VO.int
getMembersCount
(PerunSession sess, Vo vo) Get the VO members count.int
getMembersCount
(PerunSession sess, Vo vo, Status status) Returns number of Vo members with defined status.getMembersPage
(PerunSession sess, Vo vo, MembersPageQuery query, List<String> attrNames) Get page of members from the given vo, with the given attributes.getMembersPage
(PerunSession sess, Vo vo, MembersPageQuery query, List<String> attrNames, String policy) Get page of members from the given vo, with the given attributes, based on policy.getMemberVo
(PerunSession sess, Member member) Get the member VO.getNamespaceRules
(String namespace) Get NamespaceRules for the namespace from the LoginNamespacesRulesConfigContainergetNewExtendMembership
(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 potential member of the VO.getRichMember
(PerunSession sess, Member member) Get Member to RichMember with attributes.getRichMembers
(PerunSession sess, Group group) Get rich members for displaying on pages.getRichMembers
(PerunSession sess, Vo vo) Get rich members for displaying on pages.getRichMembers
(PerunSession sess, Vo vo, Status status) Get rich members who have the status, for displaying on pages.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.getRichMembersWithAttributes
(PerunSession sess, Group group, List<Member> members, List<AttributeDefinition> attrsDef) Get RichMembers with Attributes but only with selected attributes from list attrsDef and for specified members.getRichMembersWithAttributes
(PerunSession sess, Vo vo) Get rich members for displaying on pages.getRichMembersWithAttributes
(PerunSession sess, Vo vo, Status status) Get rich members who have the status, for displaying on pages.getRichMembersWithAttributes
(PerunSession sess, Vo vo, List<AttributeDefinition> attrsDef) Get RichMembers with Attributes but only with selected attributes from list attrsDef.getRichMembersWithAttributes
(PerunSession sess, List<String> allowedStatuses, Group group) Get rich members for displaying on pages.getRichMembersWithAttributesByNames
(PerunSession sess, Group group, Resource resource, List<String> attrsNames) Get RichMembers with Attributes but only with selected attributes from list attrsDef for 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 attrsNames 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, User user) Gets list of members that are sponsored by the user in all vos.getSponsoredMembers
(PerunSession sess, Vo vo) Gets list of sponsored members of a VO.getSponsoredMembers
(PerunSession sess, Vo vo, User user) Gets list of members that are sponsored by the user in the vo.getSponsoredRichMembers
(PerunSession sess, Vo vo) Get list of rich members that are sponsored in the VO.getSponsorship
(PerunSession sess, Member sponsoredMember, User sponsor) For the given member and user returns their sponsorship relation object.getSponsorshipsExpiringInRange
(PerunSession sess, LocalDate from, LocalDate to) Returns sponsorship, which have validityTo in range [from, to).getUnifiedMemberGroupStatus
(PerunSession sess, Member member, Resource resource) Returns unified result of MemberGroupStatus for specified member and resource.getUnifiedMemberGroupStatus
(PerunSession sess, User user, Facility facility) Returns unified result of MemberGroupStatus for specified user and facility.boolean
haveStatus
(PerunSession sess, Member member, Status status) Return true if member have specified status.invalidateMember
(PerunSession sess, Member member) Set member status to invalid.boolean
isMemberAllowed
(PerunSession sess, Member member) Return false if member has status INVALID or DISABLED.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 sponsor) Removes a sponsor.retainMembersWithStatus
(PerunSession sess, List<Member> members, Status status) Retain only members with specified status.void
sendAccountActivationLinkEmail
(PerunSession sess, Member member, String namespace, String url, String mailAddress, 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 mailAddress, 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 mailAddress, String language) Send mail to user's preferred email address with username for the given namespace.void
setOrganizationsAttributes
(PerunSession sess, Vo vo, Member member) Set memberOrganizations and memberOrganizationsHistory attributes for specific member.setSponsoredMember
(PerunSession session, SponsoredUserData data, Vo vo, User userToBeSponsored, User sponsor, LocalDate validityTo, Validation validation) Creates a sponsored membership for the given user.setSponsoredMember
(PerunSession session, Vo vo, User userToBeSponsored, String namespace, String password, User sponsor, Validation validation) Creates a sponsored membership for the given user.setSponsorshipForMember
(PerunSession session, Member sponsoredMember, User sponsor) Transform non-sponsored member to sponsored one with defined sponsorsetSponsorshipForMember
(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 sponsoredMember, User sponsor) Links sponsored member and sponsoring user.sponsorMember
(PerunSession session, Member sponsoredMember, User sponsor, LocalDate validityTo) Links sponsored member and sponsoring user.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.updateMember
(PerunSession sess, Member member) Update member in underlaying data source.void
updateOrganizationsAttributes
(PerunSession sess, Vo vo, Member member) Update value of memberOrganizations or memberOrganizationsHistory attribute for specific member.void
updateSponsorshipValidity
(PerunSession sess, Member sponsoredMember, User sponsor, LocalDate newValidity) Update the sponsorship of given member for given sponsor.validateMember
(PerunSession sess, Member member) Validate all atributes for member and set member's status to VALID.void
validateMemberAsync
(PerunSession sess, Member member) Validate all attributes for member and then set member's status to VALID.
-
Method Details
-
canBeMember
Checks if the user can apply membership to the VO, it decides based on extendMembershipRules on the doNotAllowLoa key- Parameters:
sess
-vo
-user
-loa
-- Returns:
- true if user can be apply for membership to the VO
- Throws:
InternalErrorException
-
canBeMemberWithReason
boolean canBeMemberWithReason(PerunSession sess, Vo vo, User user, String loa) throws ExtendMembershipException Checks if the user can apply membership to the VO, it decides based on extendMembershipRules on the doNotAllowLoa key- Parameters:
sess
-vo
-user
-loa
-- Returns:
- true if user can be apply for membership to the VO, exception with reason otherwise
- Throws:
InternalErrorException
ExtendMembershipException
-
canExtendMembership
Return true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise false.- Parameters:
sess
-member
-- Returns:
- true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise false
- Throws:
InternalErrorException
-
canExtendMembershipWithReason
boolean canExtendMembershipWithReason(PerunSession sess, Member member) throws ExtendMembershipException Return true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise throws exception.- Parameters:
sess
-member
-- Returns:
- true if the membership can be extended or if no rules were set for the membershipExpiration, otherwise throws exception with reason
- Throws:
InternalErrorException
ExtendMembershipException
-
checkMemberExists
- Throws:
MemberNotExistsException
-
checkMemberLifecycleIsAlterable
void checkMemberLifecycleIsAlterable(PerunSession sess, Member member) throws MemberLifecycleAlteringForbiddenException Throws exception if member is member of hierarchical vo but comes from its member vos.- Parameters:
sess
- sessionmember
- member- Throws:
MemberLifecycleAlteringForbiddenException
- member comes from hierarchical vo
-
checkSponsoredUserData
void checkSponsoredUserData(PerunSession sess, SponsoredUserData data) throws InvalidSponsoredUserDataException, NamespaceRulesNotExistsException Checks, whether the provided data are valid according to the namespace rules, if the namespace is not null.- Parameters:
sess
- sessiondata
- data to be checked- Throws:
InvalidSponsoredUserDataException
- if the data are not validNamespaceRulesNotExistsException
- if there are no namespace rules for the given namespace
-
convertMembersToRichMembers
Fill the RichMember object with data from Member and corresponding User.- Parameters:
sess
-members
-- Returns:
- list of richMembers
- Throws:
InternalErrorException
-
convertMembersToRichMembersNoUserAttributes
List<RichMember> convertMembersToRichMembersNoUserAttributes(PerunSession sess, List<RichMember> richMembers) Fill the RichMember object with data from Member, corresponding User object and member attributes.- Parameters:
sess
-richMembers
-- Returns:
- list of rich members with all member attributes
- Throws:
InternalErrorException
-
convertMembersToRichMembersWithAttributes
List<RichMember> convertMembersToRichMembersWithAttributes(PerunSession sess, List<RichMember> richMembers) Fill the RichMember object with data from Member and corresponding User and user/member attributes.- Parameters:
sess
-richMembers
-- Returns:
- Throws:
InternalErrorException
-
convertMembersToRichMembersWithAttributes
List<RichMember> convertMembersToRichMembersWithAttributes(PerunSession sess, List<RichMember> richMembers, List<AttributeDefinition> attrsDef) Fill the RichMember object with data from Member and corresponding User and user/member attributes defined by list of attribute definition.- Parameters:
sess
-richMembers
-attrsDef
-- Returns:
- Throws:
InternalErrorException
-
convertMembersToRichMembersWithAttributes
List<RichMember> convertMembersToRichMembersWithAttributes(PerunSession sess, List<RichMember> richMembers, Resource resource, List<AttributeDefinition> attrsDef) throws MemberResourceMismatchException Fill the RichMember object with data from Member and corresponding User, user/member, user-facility and member-resource attributes defined by list of attribute definition.- Parameters:
sess
-richMembers
-resource
-attrsDef
-- Returns:
- Throws:
InternalErrorException
MemberResourceMismatchException
-
convertMembersToRichMembersWithAttributesBatch
List<RichMember> convertMembersToRichMembersWithAttributesBatch(PerunSession sess, List<RichMember> richMembers, List<AttributeDefinition> attDefs) Optimized variant ofconvertMembersToRichMembersWithAttribute
. Fetches the def/opt user and member attributes in batch methods. Any missing attributes for each member are added with null values (meaning their value was not present in the db). For other (virt, core, core-managed) attributes the usual convertMembersToRichMembersWithAttribute method is called. The method is supposed to be used when a large amount of def attributes needs to be retrieved efficiently.- Parameters:
sess
-richMembers
-attDefs
-- Returns:
- list of rich members with userAttributes and memberAttributes filled
- Throws:
InternalErrorException
-
convertUserToSponsor
Convert given User to the Sponsor object. For the sponsor object, there is loaded information about the sponsorship. Also, if the given user is a RichUser, all of its attributes and userExtSources are also set to the sponsor object.- Parameters:
sess
- sessionuser
- a User or a RichUser objectsponsoredMember
- member, to which the sponsorship information is loaded- Returns:
- Sponsor object created from given user object with addition info about sponsorship for the given member.
-
createMember
Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, String login, Candidate candidate) throws WrongReferenceAttributeValueException, WrongAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member and sets all member's attributes from the candidate. It can be called in synchronous or asynchronous mode Also stores the associated user if doesn't exist. This method is used by the registrar. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Parameters:
sess
-vo
-extSourceName
- name of the extSourceextSourceType
- type of the extSource (e.g. cz.metacentrum.perun.core.impl.ExtSourceIdp)login
- user's login within extSourcecandidate
-- Returns:
- newly created member, who has set all his/her attributes
- Throws:
InternalErrorException
WrongReferenceAttributeValueException
WrongAttributeValueException
AlreadyMemberException
ExtendMembershipException
-
createMember
Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, String login, Candidate candidate, List<Group> groups) throws WrongReferenceAttributeValueException, WrongAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member and sets all member's attributes from the candidate. It can be called in synchronous or asynchronous mode Also stores the associated user if doesn't exist. This method is used by the registrar.Also add this member to groups in list. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).
- Parameters:
sess
-vo
-extSourceName
- name of the extSourceextSourceType
- type of the extSource (e.g. cz.metacentrum.perun.core.impl.ExtSourceIdp)login
- user's login within extSourcecandidate
-groups
- list of groups where member will be added too- Returns:
- newly created member, who has set all his/her attributes
- Throws:
InternalErrorException
WrongReferenceAttributeValueException
WrongAttributeValueException
AlreadyMemberException
ExtendMembershipException
-
createMember
Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, int extSourceLoa, String login, Candidate candidate) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member and sets all member's attributes from the candidate. Also stores the associated user if doesn't exist. This method is used by the registrar. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Parameters:
sess
-vo
-extSourceName
- name of the extSourceextSourceType
- type of the extSource (e.g. cz.metacentrum.perun.core.impl.ExtSourceIdp)extSourceLoa
- level of assurancelogin
- user's login within extSourcecandidate
-- Returns:
- newly created member, who has set all his/her attributes
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
-
createMember
Member createMember(PerunSession sess, Vo vo, String extSourceName, String extSourceType, int extSourceLoa, String login, Candidate candidate, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member and sets all member's attributes from the candidate. Also stores the associated user if doesn't exist. This method is used by the registrar.Also add this member to groups in list. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).
- Parameters:
sess
-vo
-extSourceName
- name of the extSourceextSourceType
- type of the extSource (e.g. cz.metacentrum.perun.core.impl.ExtSourceIdp)extSourceLoa
- level of assurancelogin
- user's login within extSourcecandidate
-groups
- list of groups where member will be added too- Returns:
- newly created member, who has set all his/her attributes
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
-
createMember
Member createMember(PerunSession sess, Vo vo, Candidate candidate) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member from candidate returned by the method VosManager.findCandidates which fills Candidate .userExtSource. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Parameters:
sess
-vo
-candidate
-- Returns:
- newly created members
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
- See Also:
-
createMember
Member createMember(PerunSession sess, Vo vo, Candidate candidate, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member from candidate returned by the method VosManager.findCandidates which fills Candidate .userExtSource.Also add this member to groups in list. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).
- Parameters:
sess
-vo
-candidate
-groups
- list of groups where member will be added too- Returns:
- newly created members
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
- See Also:
-
createMember
Member createMember(PerunSession sess, Vo vo, SpecificUserType specificUserType, Candidate candidate) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member from candidate returned by the method VosManager.findCandidates which fills Candidate .userExtSource. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Parameters:
sess
-vo
-specificUserType
- (Normal or service or sponsored)candidate
-- Returns:
- newly created members
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
- See Also:
-
createMember
Member createMember(PerunSession sess, Vo vo, SpecificUserType specificUserType, Candidate candidate, List<Group> groups, List<String> overwriteUserAttributes) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member from candidate returned by the method VosManager.findCandidates which fills Candidate .userExtSource.Also add this member to groups in list. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).
- Parameters:
sess
-vo
-specificUserType
- (Normal or service or sponsored)candidate
-groups
- list of groups where member will be added toooverwriteUserAttributes
- list of user attributes names which will be overwrite instead of merged- Returns:
- newly created members
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
- See Also:
-
createMember
Member createMember(PerunSession sess, Vo vo, User user) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member from user. This method runs asynchronously- Parameters:
sess
-vo
-user
-- Returns:
- newly created member
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
-
createMember
Member createMember(PerunSession sess, Vo vo, User user, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member from user.Also add this member to groups in list. This method runs asynchronously
- Parameters:
sess
-vo
-user
-groups
- list of groups where member will be added too- Returns:
- newly created member
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
-
createMember
Member createMember(PerunSession sess, Vo vo, ExtSource extSource, String login, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Create new member from user by login and ExtSource.Also add this member to groups in list. This method runs asynchronously
- Parameters:
sess
-vo
-extSource
-login
-groups
- list of groups where member will be added too- Returns:
- newly created member
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
-
createMemberSync
Member createMemberSync(PerunSession sess, Vo vo, Candidate candidate) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates member. Runs synchronously. -
createMemberSync
Member createMemberSync(PerunSession sess, Vo vo, Candidate candidate, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates member. Runs synchronously. Add member also to all groups in list. -
createMemberSync
Member createMemberSync(PerunSession sess, Vo vo, Candidate candidate, List<Group> groups, List<String> overwriteUserAttributes) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates member. Runs synchronously. Add member also to all groups in list. -
createServiceMember
Member createServiceMember(PerunSession sess, Vo vo, Candidate candidate, List<User> owners) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member from candidate which is prepared for creating service user. In list specificUserOwners can't be service user, only normal users are allowed. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).- Parameters:
sess
-vo
-candidate
- prepared future specificUserowners
- list of users who own the service (can't be empty or contain specific user)- Returns:
- newly created member (of service User)
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
-
createServiceMember
Member createServiceMember(PerunSession sess, Vo vo, Candidate candidate, List<User> owners, List<Group> groups) throws WrongAttributeValueException, WrongReferenceAttributeValueException, AlreadyMemberException, ExtendMembershipException Creates a new member from candidate which is prepared for creating service user. In list specificUserOwners can't be service user, only normal users are allowed.Also add this member to groups in list. This method runs WITHOUT synchronization. If validation is needed, need to call concrete validateMember method (validateMemberAsync recommended).
- Parameters:
sess
-vo
-candidate
- prepared future specificUserowners
- list of users who own the service user (can't be empty or contain service user)groups
- list of groups where member will be added too- Returns:
- newly created member (of specific User)
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
AlreadyMemberException
ExtendMembershipException
-
createSponsoredMember
Member createSponsoredMember(PerunSession session, SponsoredUserData data, Vo vo, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url, Validation validation) throws AlreadyMemberException, LoginNotExistsException, PasswordCreationFailedException, ExtendMembershipException, WrongAttributeValueException, ExtSourceNotExistsException, WrongReferenceAttributeValueException, UserNotInRoleException, PasswordStrengthException, InvalidLoginException, AlreadySponsorException, InvalidSponsoredUserDataException, NamespaceRulesNotExistsException Creates a new sponsored member.- Parameters:
session
- perun sessiondata
- 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 organizationsponsor
- 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 Instancevalidation
- Type of members validation, when using Validation.ASYNC do not call this method in a cycle!- Returns:
- created member
- Throws:
InternalErrorException
AlreadyMemberException
LoginNotExistsException
PasswordCreationFailedException
ExtendMembershipException
WrongAttributeValueException
ExtSourceNotExistsException
WrongReferenceAttributeValueException
UserNotInRoleException
- if the member is not in required roleAlreadySponsorException
PasswordStrengthException
InvalidLoginException
InvalidSponsoredUserDataException
NamespaceRulesNotExistsException
-
createSponsoredMembers
List<Map<String,String>> createSponsoredMembers(PerunSession session, Vo vo, String namespace, List<String> names, String email, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url, Validation validation) Creates new sponsored members.Since there may be error while creating some of the members and we cannot simply rollback the transaction and start over, exceptions during member creation are not thrown and the returned list has this structure:
[{"name" -> name, "status" -> "OK" or "Error...", "login" -> login, "password" -> password}]
Each list element represents member as map containing keys "name", "status", "login" and "password". "status" has as its value either "OK" or message of exception which was thrown during creation of the member. "name" contains full entry as received (e.g. first name; last name; email), "login" contains login (e.g. učo) if status is OK, "password" contains password if status is OK.
- Parameters:
session
- perun sessionvo
- virtual organization to created sponsored members innamespace
- used for selecting external system in which guest user account will be creatednames
- 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 usersendActivationLink
- 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 Instancevalidation
- Type of members validation, when ASYNC do not call this method in a cycle!- Returns:
- list of maps of name, status, login and password
-
createSponsoredMembersFromCSV
List<Map<String,String>> createSponsoredMembersFromCSV(PerunSession sess, Vo vo, String namespace, List<String> data, String header, User sponsor, LocalDate validityTo, boolean sendActivationLink, String language, String url, Validation validation, List<Group> groups) Creates new sponsored members.Since there may be error while creating some of the members and we cannot simply rollback the transaction and start over, exceptions during member creation are not thrown and the returned list has this structure:
[{"name" -> name, "status" -> "OK" or "Error...", "login" -> login, "password" -> password}]
Each list element represents member as map containing keys "name", "status", "login" and "password". "status" has as its value either "OK" or message of exception which was thrown during creation of the member. "name" contains full entry as received (e.g. first name; last name; email), "login" contains login (e.g. učo) if status is OK, "password" contains password if status is OK.
- Parameters:
sess
- perun sessionvo
- virtual organization to created sponsored members innamespace
- used for selecting external system in which guest user account will be createddata
- csv file values separated by semicolon ';' charactersheader
- header to the given csv data, it should represent columns for the given data. Required values are - firstname, lastname, urn:perun:user:attribute-def:def:preferredMail Optional values are - urn:perun:user:attribute-def:def:note The order of the items doesn't matter.sponsor
- sponsoring usersendActivationLink
- if true link for manual activation of every created sponsored member account will be send to email which was set for him, be careful when using no-reply emailslanguage
- language of the activation email (e.g. "en", "cs"). Use english if null.url
- base URL of Perun Instancevalidation
- Type of members validation, when ASYNC do not call this method in a cycle!groups
- groups, to which will be the created users assigned- Returns:
- list of maps of name, status, login and password
-
deleteAllMembers
Deletes all VO members.- Parameters:
sess
-vo
-- Throws:
InternalErrorException
MemberAlreadyRemovedException
-
deleteMember
Deletes only member data appropriated by member id.- Parameters:
sess
-member
-- Throws:
InternalErrorException
MemberAlreadyRemovedException
-
deleteMembers
Delete given members. It is possible to delete members from multiple vos.- Parameters:
sess
- sessionmembers
- members that will be deleted- Throws:
InternalErrorException
- internal errorMemberAlreadyRemovedException
- if already removed
-
disableMember
Disable member.As side effect, on success will change status of the object member.
- Parameters:
sess
-member
-- Returns:
- member with new status set
- Throws:
InternalErrorException
MemberNotValidYetException
-
expireMember
Member expireMember(PerunSession sess, Member member) throws WrongReferenceAttributeValueException, WrongAttributeValueException Set member's status to expired. All attributes are validated if was in INVALID or DISABLED state before. If validation ends with error, member keeps his old status.Method runs in nested transaction. As side effect, on success will change status of the object member.
- Parameters:
sess
-member
-- Returns:
- member with new status set
- Throws:
InternalErrorException
WrongReferenceAttributeValueException
WrongAttributeValueException
-
extendExpirationForSponsoredMember
String extendExpirationForSponsoredMember(PerunSession sess, Member sponsoredMember, User sponsorUser) Extends expiration date. Sponsored members cannot apply for membership extension, this method allows a sponsor to extend it.- Parameters:
sess
- perun sessionsponsoredMember
- member which is sponsoredsponsorUser
- sponsoring user or null for the caller- Returns:
- new expiration date
- Throws:
InternalErrorException
-
extendMembership
Extend member membership using membershipExpirationRules attribute defined at VO.- Parameters:
sess
-member
-- Throws:
InternalErrorException
ExtendMembershipException
-
filterOnlyAllowedAttributes
For richMember filter all his user and member attributes and remove all which principal has no access to.- Parameters:
sess
-richMember
-- Returns:
- richMember with only allowed attributes
- Throws:
InternalErrorException
-
filterOnlyAllowedAttributes
For list of richMembers filter all their user and member attributes and remove all which principal has no access to.- Parameters:
sess
-richMembers
-- Returns:
- list of richMembers with only allowed attributes
- Throws:
InternalErrorException
-
filterOnlyAllowedAttributes
List<RichMember> filterOnlyAllowedAttributes(PerunSession sess, List<RichMember> richMembers, Group group, boolean useContext) For list of richMembers filter all their user and member attributes and remove all which principal has no access to.Context means that voId for all members is same (rules can be same for all members in list)
if useContext is true: every attribute is unique in context of friendlyName, which means more attributes for more members have same rules if friendly name is same for all of them (better performance, worse authorization check) if useContext is false: every attribute is unique in context of member, which means every attribute for more members need to be check separately, because for example members can be from different vos (better authorization check, worse performance)
- Parameters:
sess
-richMembers
- list of richMembers for which attributes need to be filteredgroup
-useContext
- true or false means using context or not using context (more above in javadoc)- Returns:
- list of richMembers with only allowed attributes
- Throws:
InternalErrorException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames, String searchString, boolean onlySponsored) Return list of richMembers for specific vo by the searchString with attributes specific for list of attrsNames. If attrsNames is empty or null return all attributes for specific richMembers.- Parameters:
sess
-vo
-attrsNames
-searchString
-onlySponsored
- return only sponsored members- Returns:
- list of founded richMembers with specific attributes from Vo for searchString
- Throws:
InternalErrorException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, List<String> attrsNames, String searchString) Return list of richMembers by the searchString with attributes specific for list of attrsNames. If attrsNames is empty or null return all attributes for specific richMembers.- Parameters:
sess
-attrsNames
-searchString
-- Returns:
- list of founded richMembers with specific attributes from Vo for searchString
- Throws:
InternalErrorException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames, List<String> allowedStatuses, String searchString) Return list of richMembers for specific vo by the searchString with attributes specific for list of attrsNames and who have only status which is contain in list of statuses. If attrsNames is empty or null return all attributes for specific richMembers. If listOfStatuses is empty or null, return all possible statuses.- Parameters:
sess
-vo
-attrsNames
-allowedStatuses
-searchString
-- Returns:
- list of founded richMembers with specific attributes from Vo for searchString with allowed statuses
- Throws:
InternalErrorException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, List<String> attrsNames, List<String> allowedStatuses, String searchString) Return list of richMembers by the searchString with attributes specific for list of attrsNames and who have only status which is contain in list of statuses. If attrsNames is empty or null return all attributes for specific richMembers. If listOfStatuses is empty or null, return all possible statuses.- Parameters:
sess
-attrsNames
-allowedStatuses
-searchString
-- Returns:
- list of founded richMembers with specific attributes by searchString with allowed statuses
- Throws:
InternalErrorException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, String searchString, boolean lookingInParentGroup) throws ParentGroupNotExistsException Return list of richMembers for specific group by the searchString with attributes specific for list of attrsNames. If attrsNames is empty or null return all attributes for specific richMembers.If lookingInParentGroup is true, find all these richMembers only for parentGroup of this group. If this group is top level group, so find richMembers from members group.
- Parameters:
sess
-group
-attrsNames
-searchString
-lookingInParentGroup
-- Returns:
- list of founded richMembers with specific attributes from Group for searchString
- Throws:
InternalErrorException
ParentGroupNotExistsException
-
findCompleteRichMembers
List<RichMember> findCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, List<String> allowedStatuses, List<String> allowedGroupStatuses, String searchString, boolean lookingInParentGroup) throws ParentGroupNotExistsException Return list of richMembers for specific group by the searchString with attributes specific for list of attrsNames and who have only status which is contain in lists of statuses. If attrsNames is empty or null return all attributes for specific richMembers. If listOfStatuses or listOfGroupStatuses is empty or null, return all possible statuses.If lookingInParentGroup is true, find all these richMembers only for parentGroup of this group. If this group is top level group, so find richMembers from members group.
- Parameters:
sess
-group
-attrsNames
-allowedStatuses
-allowedGroupStatuses
-searchString
-lookingInParentGroup
-- Returns:
- list of founded richMembers with specific attributes from Group for searchString
- Throws:
InternalErrorException
ParentGroupNotExistsException
-
findMembers
Return list of members VO by specific string. All searches are case insensitive. Looking for searchString in member mail, user preferredMail, logins, name, IDs (user and member) and user UUID. If parameter onlySponsored is true, it will return only sponsored members by searchString. If vo is null, looking for any members in whole Perun. If vo is not null, looking only in specific VO.invalid input: '<'- Parameters:
sess
-vo
- for which searching will be filtered, if null there is no filter for vosearchString
- it will be looking for this search string in the specific parameters in DBonlySponsored
- it will return only sponsored members in vo- Returns:
- all members from specific VO by specific string
- Throws:
InternalErrorException
-
findMembersByName
Return list of members by theirs name.- Parameters:
sess
-searchString
-- Returns:
- list of members
- Throws:
InternalErrorException
-
findMembersByNameInVo
Return list of members by theirs name under defined VO.- Parameters:
sess
-vo
-searchString
-- Returns:
- list of members
- Throws:
InternalErrorException
-
findMembersInGroup
Return list of members by the searchString under defined Group. Search is done in name, email and login.- Parameters:
sess
-group
-searchString
-- Returns:
- list of members
- Throws:
InternalErrorException
-
findMembersInParentGroup
Return list of members by the searchString udner parentGroup of defined Group. Search is done in name, email and login. If the group is top-level group, searching in "members" group of vo in which the group exists.- Parameters:
sess
-group
- this group is used to get parent group, we are searching members of the parent groupsearchString
-- Returns:
- Throws:
InternalErrorException
-
findMembersInVo
Return list of members by theirs name or login or email under defined VO.- Parameters:
sess
-vo
-searchString
-- Returns:
- list of members
- Throws:
InternalErrorException
-
findRichMembers
Return list of rich members by theirs name, id, uuid, login or email- Parameters:
sess
-searchString
-onlySponsored
- return only sponsored members- Returns:
- list of rich members
- Throws:
InternalErrorException
-
findRichMembersInVo
List<RichMember> findRichMembersInVo(PerunSession sess, Vo vo, String searchString, boolean onlySponsored) Return list of rich members by theirs name, id, uuid, login or email under defined VO.- Parameters:
sess
-vo
-searchString
-onlySponsored
- return only sponsored members- Returns:
- list of rich members
- Throws:
InternalErrorException
-
findRichMembersWithAttributes
List<RichMember> findRichMembersWithAttributes(PerunSession sess, String searchString, List<String> attrsNames) Return list of rich members with certain attributes by theirs name or login or email.- Parameters:
sess
- sessionsearchString
- search stringattrsNames
- list of attribute names that should be found- Returns:
- list of rich members with certain attributes
- Throws:
InternalErrorException
-
findRichMembersWithAttributes
Return list of rich members with attributes by theirs name or login or email- Parameters:
sess
-searchString
-- Returns:
- list of rich members with attributes
- Throws:
InternalErrorException
-
findRichMembersWithAttributesInGroup
List<RichMember> findRichMembersWithAttributesInGroup(PerunSession sess, Group group, String searchString, List<String> attrsNames) Return list of rich members with certain attributes by the searchString under defined Group. Search is done in name, email and login.- Parameters:
sess
- sessiongroup
- groupsearchString
- search stringattrsNames
- list of attributes that should be found- Returns:
- list of rich members with certain attributes
- Throws:
InternalErrorException
-
findRichMembersWithAttributesInGroup
List<RichMember> findRichMembersWithAttributesInGroup(PerunSession sess, Group group, String searchString) Return list of rich members with attributes by the searchString under defined Group. Search is done in name, email and login.- Parameters:
sess
-group
-searchString
-- Returns:
- Throws:
InternalErrorException
-
findRichMembersWithAttributesInParentGroup
List<RichMember> findRichMembersWithAttributesInParentGroup(PerunSession sess, Group group, String searchString) Return list of rich members with attributes by the searchString under parent group of defined Group. Search is done in name, email and login.- Parameters:
sess
-group
- this group is used to get parent group, we are searching members of the parent groupsearchString
-- Returns:
- Throws:
InternalErrorException
-
findRichMembersWithAttributesInVo
List<RichMember> findRichMembersWithAttributesInVo(PerunSession sess, Vo vo, String searchString, List<String> attrsNames, boolean onlySponsored) Return list of rich members with certain attributes by theirs name or login or email defined VO.- Parameters:
sess
- sessionvo
- vosearchString
- search stringattrsNames
- list of attribute names that should be foundonlySponsored
- return only sponsored members- Returns:
- list of rich members with certain attributes
- Throws:
InternalErrorException
-
findRichMembersWithAttributesInVo
Return list of rich members with attributes by theirs name or login or email under defined VO.- Parameters:
sess
-vo
-searchString
-- Returns:
- list of rich members with attributes
- Throws:
InternalErrorException
-
getAllMembers
Get all members from all vos.- Parameters:
sess
- session- Returns:
- list of all members from all Vos.
-
getAllNamespacesRules
List<NamespaceRules> getAllNamespacesRules()Return all loaded namespaces rules.- Returns:
- all namespaces rules
-
getCompleteRichMembers
List<RichMember> getCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames) throws AttributeNotExistsException Get all RichMembers with attributes specific for list of attrsNames from the vo. If attrsNames is empty or null return all attributes for specific richMembers.- Parameters:
sess
-vo
-attrsNames
-- Returns:
- list of richMembers with specific attributes from Vo
- Throws:
InternalErrorException
AttributeNotExistsException
-
getCompleteRichMembers
List<RichMember> getCompleteRichMembers(PerunSession sess, Vo vo, List<String> attrsNames, List<String> allowedStatuses) throws AttributeNotExistsException Get all RichMembers with attributes specific for list of attrsNames from the vo and have only status which is contain in list of statuses. If attrsNames is empty or null return all attributes for specific richMembers. If listOfStatuses is empty or null, return all possible statuses.- Parameters:
sess
-vo
-attrsNames
-allowedStatuses
-- Returns:
- list of richMembers with specific attributes from Vo
- Throws:
InternalErrorException
AttributeNotExistsException
-
getCompleteRichMembers
List<RichMember> getCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, boolean lookingInParentGroup) throws AttributeNotExistsException, ParentGroupNotExistsException Get all RichMembers with attributes specific for list of attrsNames from the group. If attrsNames is empty or null return all attributes for specific richMembers.If lookingInParentGroup is true, get all these richMembers only for parentGroup of this group. If this group is top level group, so get richMembers from members group.
- Parameters:
sess
-group
-attrsNames
-lookingInParentGroup
-- Returns:
- list of richMembers with specific attributes from group
- Throws:
InternalErrorException
AttributeNotExistsException
ParentGroupNotExistsException
-
getCompleteRichMembers
List<RichMember> getCompleteRichMembers(PerunSession sess, Group group, List<String> attrsNames, List<String> allowedStatuses, List<String> allowedGroupStatuses, boolean lookingInParentGroup) throws AttributeNotExistsException, ParentGroupNotExistsException Get all RichMembers with attributes specific for list of attrsNames from the group and have only status which is contain in lists of statuses. If attrsNames is empty or null return all attributes for specific richMembers. If listOfStatuses or listOfGroupStatuses is empty or null, return all possible statuses.If lookingInParentGroup is true, get all these richMembers only for parentGroup of this group. If this group is top level group, so get richMembers from members group.
- Parameters:
sess
-group
-attrsNames
-allowedStatuses
-allowedGroupStatuses
-lookingInParentGroup
-- Returns:
- list of richMembers with specific attributes from group
- Throws:
InternalErrorException
AttributeNotExistsException
ParentGroupNotExistsException
-
getCompleteRichMembers
List<RichMember> getCompleteRichMembers(PerunSession sess, Group group, Resource resource, List<String> attrsNames, List<String> allowedStatuses) throws AttributeNotExistsException, GroupResourceMismatchException Get all RichMembers with attributes specific for list of attrNames. Attributes are defined by member (user) and resource (facility) objects. It returns also user-facility (in userAttributes of RichMember) and member-resource (in memberAttributes of RichMember) attributes. Members are defined by group and are filtered by list of allowed statuses.- Parameters:
sess
-group
-resource
-attrsNames
-allowedStatuses
-- Returns:
- list of richMembers with specific attributes
- Throws:
InternalErrorException
AttributeNotExistsException
GroupResourceMismatchException
-
getMemberByExtSourceNameAndExtLogin
Member getMemberByExtSourceNameAndExtLogin(PerunSession sess, Vo vo, String extSourceName, String extLogin) throws ExtSourceNotExistsException, UserExtSourceNotExistsException, MemberNotExistsException, UserNotExistsException Get member by extSourceName, extSourceLogin and Vo- Parameters:
sess
-vo
- Vo where we are looking for memberextSourceName
- name of extSourceextLogin
- login of user in extSource- Returns:
- member
- Throws:
ExtSourceNotExistsException
UserExtSourceNotExistsException
MemberNotExistsException
UserNotExistsException
InternalErrorException
-
getMemberById
Returns member by his id.- Parameters:
sess
-id
-- Returns:
- member
- Throws:
InternalErrorException
MemberNotExistsException
-
getMemberByUser
Returns member by his user and vo.- Parameters:
sess
-vo
-user
-- Returns:
- member
- Throws:
InternalErrorException
MemberNotExistsException
-
getMemberByUserExtSource
Member getMemberByUserExtSource(PerunSession perunSession, Vo vo, UserExtSource userExtSource) throws MemberNotExistsException Find member of this Vo by his login in external source- Parameters:
perunSession
-vo
-userExtSource
-- Returns:
- selected user or throws in case the requested member doesn't exists in this Vo
- Throws:
InternalErrorException
MemberNotExistsException
-
getMemberByUserExtSources
Member getMemberByUserExtSources(PerunSession perunSession, Vo vo, List<UserExtSource> userExtSources) throws MemberNotExistsException Get member by its external sources. If the given sources do not belong to a single member and exception is thrown.- Parameters:
perunSession
- sessionvo
- vouserExtSources
- ues- Returns:
- member
- Throws:
InternalErrorException
- internal errorMemberNotExistsException
- member does not exist
-
getMemberByUserId
Returns member by his userId.- Parameters:
sess
-vo
-userId
-- Returns:
- member
- Throws:
InternalErrorException
MemberNotExistsException
-
getMemberVo
Get the member VO.- Parameters:
sess
-member
-- Returns:
- member's VO
- Throws:
InternalErrorException
-
getMembers
Get all VO members.- Parameters:
sess
-vo
-- Returns:
- all members of the VO
- Throws:
InternalErrorException
-
getMembers
Get all VO members who have the status.- Parameters:
sess
-vo
-status
- get only members who have this status. If status is null return all members.- Returns:
- all members of the VO
- Throws:
InternalErrorException
-
getMembersByIds
Returns members by their ids.- Parameters:
perunSession
-ids
-- Returns:
- list of members with specified ids
- Throws:
InternalErrorException
-
getMembersByUser
Return all VO Members of the User.- Parameters:
sess
-user
-- Returns:
- List of Members
- Throws:
InternalErrorException
-
getMembersByUserWithStatus
Return all VO Members of the User, which have specified Status in their VO.- Parameters:
sess
-user
-status
-- Returns:
- List of Members
- Throws:
InternalErrorException
-
getMembersByUsers
Convert list of users into the list of members.- Parameters:
sess
-users
-vo
-- Returns:
- list of members
- Throws:
InternalErrorException
-
getMembersByUsersIds
Convert list of users' ids into the list of members.- Parameters:
sess
-usersIds
-vo
-- Returns:
- list of members
- Throws:
InternalErrorException
-
getMembersCount
Get the VO members count.- Parameters:
sess
-vo
-- Returns:
- count of VO members
- Throws:
InternalErrorException
-
getMembersCount
Returns number of Vo members with defined status.- Parameters:
sess
-vo
-status
-- Returns:
- number of members
- Throws:
InternalErrorException
-
getMembersPage
Paginated<RichMember> getMembersPage(PerunSession sess, Vo vo, MembersPageQuery query, List<String> attrNames) throws PolicyNotExistsException Get page of members from the given vo, with the given attributes.- Parameters:
sess
- sessionvo
- voquery
- query with page informationattrNames
- attribute names- Returns:
- page of requested rich members
- Throws:
PolicyNotExistsException
-
getMembersPage
Paginated<RichMember> getMembersPage(PerunSession sess, Vo vo, MembersPageQuery query, List<String> attrNames, String policy) throws PolicyNotExistsException Get page of members from the given vo, with the given attributes, based on policy.- Parameters:
sess
- sessionvo
- voquery
- query with page informationattrNames
- attribute namespolicy
- policy to use- Returns:
- page of requested rich members
- Throws:
PolicyNotExistsException
-
getNamespaceRules
Get NamespaceRules for the namespace from the LoginNamespacesRulesConfigContainer- Parameters:
namespace
- for which will be the rules fetched- Returns:
- NamespaceRules for the namespace
- Throws:
NamespaceRulesNotExistsException
- if there are no rules for the namespace
-
getNewExtendMembership
Returns the date to which will be extended member's expiration time.- Parameters:
sess
-member
-- Returns:
- date
- Throws:
InternalErrorException
-
getNewExtendMembership
Returns the date to which will be extended potential member of the VO.- Parameters:
sess
-vo
-loa
-- Returns:
- date
- Throws:
InternalErrorException
ExtendMembershipException
-
getRichMember
Get Member to RichMember with attributes.- Parameters:
sess
-member
-- Returns:
- Throws:
InternalErrorException
-
getRichMemberWithAttributes
Get Member to RichMember with attributes.- Parameters:
sess
-member
-- Returns:
- Throws:
InternalErrorException
-
getRichMembers
Get rich members for displaying on pages. Rich member object contains user, member, userExtSources.- Parameters:
sess
-vo
-- Returns:
- list of rich members on specified page, empty list if there are no user in this VO or in this page
- Throws:
InternalErrorException
-
getRichMembers
Get rich members for displaying on pages. Rich member object contains user, member, userExtSources.- Parameters:
sess
-group
-- Returns:
- list of rich members on specified page, empty list if there are no user in this Group or in this page
- Throws:
InternalErrorException
-
getRichMembers
Get rich members who have the status, for displaying on pages. Rich member object contains user, member, userExtSources.- Parameters:
sess
-vo
-status
- get only members who have this status. If status is null return all members.- Returns:
- list of rich members on specified page, empty list if there are no user in this VO or in this page
- Throws:
InternalErrorException
-
getRichMembersNoUserAttributes
List<RichMember> getRichMembersNoUserAttributes(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Get all rich members of VO. Rich member object contains user, member, userExtSources and member attributes. User attributes aren't included- Parameters:
sess
-vo
-- Returns:
- list of rich members with all member attributes
- Throws:
InternalErrorException
PrivilegeException
VoNotExistsException
-
getRichMembersWithAttributes
List<RichMember> getRichMembersWithAttributes(PerunSession sess, Vo vo, List<AttributeDefinition> attrsDef) Get RichMembers with Attributes but only with selected attributes from list attrsDef.- Parameters:
sess
-vo
-attrsDef
-- Returns:
- Throws:
InternalErrorException
-
getRichMembersWithAttributes
List<RichMember> getRichMembersWithAttributes(PerunSession sess, List<String> allowedStatuses, Group group) Get rich members for displaying on pages. Rich member object contains user, member, userExtSources, userAttributes, memberAttributes.- Parameters:
sess
-allowedStatuses
-group
-- Returns:
- list of rich members on specified page, empty list if there are no user in this group or in this page
- Throws:
InternalErrorException
-
getRichMembersWithAttributes
List<RichMember> getRichMembersWithAttributes(PerunSession sess, Group group, List<AttributeDefinition> attrsDef) Get RichMembers with Attributes but only with selected attributes from list attrsDef.- Parameters:
sess
-group
-attrsDef
-- Returns:
- Throws:
InternalErrorException
-
getRichMembersWithAttributes
List<RichMember> getRichMembersWithAttributes(PerunSession sess, Group group, List<Member> members, List<AttributeDefinition> attrsDef) Get RichMembers with Attributes but only with selected attributes from list attrsDef and for specified members.- Parameters:
sess
-group
-attrsDef
-- Returns:
- Throws:
InternalErrorException
-
getRichMembersWithAttributes
Get rich members for displaying on pages. Rich member object contains user, member, userExtSources, userAttributes, memberAttributes.- Parameters:
sess
-vo
-- Returns:
- list of rich members on specified page, empty list if there are no user in this VO or in this page
- Throws:
InternalErrorException
-
getRichMembersWithAttributes
Get rich members who have the status, for displaying on pages. Rich member object contains user, member, userExtSources, userAttributes, memberAttributes.- Parameters:
sess
-vo
-status
- get only members who have this status. If status is null return all members.- Returns:
- list of rich members on specified page, empty list if there are no user in this VO or in this page
- Throws:
InternalErrorException
-
getRichMembersWithAttributesByNames
List<RichMember> getRichMembersWithAttributesByNames(PerunSession sess, Vo vo, List<String> attrsNames) throws AttributeNotExistsException Get RichMembers with Attributes but only with selected attributes from list attrsNames for vo.- Parameters:
sess
-vo
-attrsNames
- list of attrNames for selected attributes- Returns:
- list of RichMembers
- Throws:
AttributeNotExistsException
InternalErrorException
-
getRichMembersWithAttributesByNames
List<RichMember> getRichMembersWithAttributesByNames(PerunSession sess, Group group, List<String> attrsNames) throws AttributeNotExistsException Get RichMembers with Attributes but only with selected attributes from list attrsDef for group.- Parameters:
sess
-group
-attrsNames
- list of attrNames for selected attributes- Returns:
- list of RichMembers
- Throws:
AttributeNotExistsException
InternalErrorException
-
getRichMembersWithAttributesByNames
List<RichMember> getRichMembersWithAttributesByNames(PerunSession sess, Group group, Resource resource, List<String> attrsNames) throws AttributeNotExistsException, GroupResourceMismatchException Get RichMembers with Attributes but only with selected attributes from list attrsDef for group. Get also user-facility (as user attribute in rich member) and member-resource (as member attributes in rich member) attributes by resource.- Parameters:
sess
-group
-resource
-attrsNames
- list of attrNames for selected attributes- Returns:
- list of RichMembers
- Throws:
AttributeNotExistsException
InternalErrorException
GroupResourceMismatchException
-
getServiceUserRichMembers
Get RichMembers from a VO who are service users.- Parameters:
sess
-vo
-- Returns:
- List of RichMembers from the VO, who are service users
-
getSponsoredMembers
Gets list of members that are sponsored by the user in the vo.- Parameters:
sess
- perun sessionvo
- virtual organizationuser
- user sponsoring members- Returns:
- list of members sponsored by the user in VO
- Throws:
InternalErrorException
- if given parameters are invalid
-
getSponsoredMembers
Gets list of members that are sponsored by the user in all vos.- Parameters:
sess
- perun sessionuser
- user sponsoring members- Returns:
- list of members sponsored by the user in VO
- Throws:
InternalErrorException
- if given parameters are invalid
-
getSponsoredMembers
Gets list of sponsored members of a VO.- Parameters:
sess
- sessionvo
- virtual organization from which are the sponsored members chosen- Returns:
- list of members from given vo who are sponsored
- Throws:
InternalErrorException
- if given parameters are invalid
-
getSponsoredRichMembers
Get list of rich members that are sponsored in the VO.- Parameters:
sess
-vo
-- Returns:
- list of rich members which are sponsored in the given VO
-
getSponsorship
Sponsorship getSponsorship(PerunSession sess, Member sponsoredMember, User sponsor) throws SponsorshipDoesNotExistException For the given member and user returns their sponsorship relation object. If there is no such relation, the SponsorshipDoesNotExistException is thrown.- Parameters:
sess
- sessionsponsoredMember
- sponsored membersponsor
- sponsor- Returns:
- Sponsorship object
- Throws:
SponsorshipDoesNotExistException
- if there is no sponsorship relation between the given member and user
-
getSponsorshipsExpiringInRange
Returns sponsorship, which have validityTo in range [from, to). (from is inclusive, to is exclusive).- Parameters:
sess
- sessionfrom
- lower validityTo bound (inclusive), use LocalDate.MIN if you don't want to specify the lower boundto
- upper validityTo bound (exclusive), use LocalDate.MAX, if you don't want to specify the upper bound- Returns:
- list of sponsorships which have validityTo set in the given range
-
getUnifiedMemberGroupStatus
Returns unified result of MemberGroupStatus for specified member and resource.If member is VALID in at least one group assigned to the resource, result is VALID. If member is not VALID in any of groups assigned to the resource, result is EXPIRED. If member is not assigned to the resource at all, result is NULL.
MemberGroupStatus is never related to the members status in a VO as a whole!
- Parameters:
sess
- PerunSessionmember
- Member to get unified MemberGroupStatusresource
- Resource to get unified MemberGroupStatus- Returns:
- MemberGroupStatus for member unified through all his groups assigned to the resource.
-
getUnifiedMemberGroupStatus
Returns unified result of MemberGroupStatus for specified user and facility.If user is VALID in at least one group assigned to at least one resource on facility, result is VALID. If user is not VALID in any of groups assigned to any of resources, result is EXPIRED. If user is not assigned to the resource at all, result is NULL.
MemberGroupStatus is never related to the members status in any VO!
- Parameters:
sess
- PerunSessionuser
- User to get unified MemberGroupStatusfacility
- Facility to get unified MemberGroupStatus- Returns:
- MemberGroupStatus for user unified throught all his groups assigned to any of resources of facility.
-
haveStatus
Return true if member have specified status.- Parameters:
sess
-member
-status
-- Returns:
- true if member have the specified status false otherwise
-
invalidateMember
Set member status to invalid.As side effect it will change status of the object member.
- Parameters:
sess
-member
-- Returns:
- member with new status set
- Throws:
InternalErrorException
-
isMemberAllowed
Return false if member has status INVALID or DISABLED. True in other cases.- Parameters:
sess
-member
- the member- Returns:
- false if member has INVALID or DISABLED status, true in other cases
- Throws:
InternalErrorException
-
moveMembership
void moveMembership(PerunSession sess, Vo vo, User sourceUser, User targetUser) throws MemberNotExistsException, AlreadyMemberException, ExtendMembershipException Moves membership in VO from source user to target user - moves the source user's memberships in non-synchronized groups, member related attributes, bans and sponsorships in the VO. Removes the source user's member object. If VO is member of any hierarchical parent VO, user's membership is moved in parent VOs also. If VO is parent of any hierarchical member VO, user's membership is not moved in member VOs.- Parameters:
sess
- sessionvo
- the VO in which the membership should be movedsourceUser
- the user to move membership fromtargetUser
- the user to move membership to- Throws:
MemberNotExistsException
- when sourceUser is not member of the VOAlreadyMemberException
- when targetUser is already member of the VOExtendMembershipException
- when the targetUser doesn't have required LOA for the VO
-
removeSponsor
Removes a sponsor.- Parameters:
sess
- perun sessionsponsoredMember
- member which is sponsoredsponsor
- sponsoring user- Throws:
InternalErrorException
- if given parameters are invalid
-
retainMembersWithStatus
Retain only members with specified status.- Parameters:
sess
-members
-status
-- Returns:
- Throws:
MemberNotValidYetException
-
sendAccountActivationLinkEmail
void sendAccountActivationLinkEmail(PerunSession sess, Member member, String namespace, String url, String mailAddress, String language) Send mail to user's preferred email address with link for non-authz account activation. Correct authz information is stored in link's URL.- Parameters:
sess
- PerunSessionmember
- Member to get user to send link mail tonamespace
- Namespace to activate account in (member must have login in)url
- base URL of Perun instancemailAddress
- mail address where email will be sentlanguage
- language of the message- Throws:
InternalErrorException
-
sendPasswordResetLinkEmail
void sendPasswordResetLinkEmail(PerunSession sess, Member member, String namespace, String url, String mailAddress, String language) Send mail to user's preferred email address with link for non-authz password reset. Correct authz information is stored in link's URL.- Parameters:
sess
- PerunSessionmember
- Member to get user to send link mail tonamespace
- Namespace to reset password in (member must have login in)url
- base URL of Perun instancemailAddress
- mail address where email will be sentlanguage
- language of the message- Throws:
InternalErrorException
-
sendUsernameReminderEmail
void sendUsernameReminderEmail(PerunSession sess, Member member, String namespace, String mailAddress, String language) Send mail to user's preferred email address with username for the given namespace.- Parameters:
sess
- PerunSessionmember
- Member to get user to send mail tonamespace
- Namespace for username/login (member must have login in this namespace)mailAddress
- mail address where email will be sentlanguage
- language of the message- Throws:
InternalErrorException
-
setOrganizationsAttributes
void setOrganizationsAttributes(PerunSession sess, Vo vo, Member member) throws AttributeNotExistsException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException, WrongAttributeValueException Set memberOrganizations and memberOrganizationsHistory attributes for specific member.- Parameters:
sess
- sessionvo
- VOmember
- member- Throws:
WrongAttributeValueException
- if the attribute value is illegalWrongReferenceAttributeValueException
- if attribute which is reference for used attribute has illegal valueAttributeNotExistsException
- if the attribute doesn't exists in the underlying data sourceWrongAttributeAssignmentException
- if attribute is not vo attribute
-
setSponsoredMember
Member setSponsoredMember(PerunSession session, SponsoredUserData data, Vo vo, User userToBeSponsored, User sponsor, LocalDate validityTo, Validation validation) throws AlreadyMemberException, ExtendMembershipException, UserNotInRoleException, PasswordStrengthException, WrongAttributeValueException, WrongReferenceAttributeValueException, LoginNotExistsException, PasswordCreationFailedException, InvalidLoginException, ExtSourceNotExistsException, AlreadySponsorException, InvalidSponsoredUserDataException, NamespaceRulesNotExistsException Creates a sponsored membership for the given user.- Parameters:
session
- perun sessiondata
- data about the user, which are used to create an account in an external system, if neededvo
- virtual organizationuserToBeSponsored
- user, that will be sponsored by sponsorsponsor
- sponsoring uservalidation
- Type of members validation, when using Validation.ASYNC do not call this method in a cycle!- Returns:
- sponsored member
- Throws:
AlreadyMemberException
ExtendMembershipException
UserNotInRoleException
PasswordStrengthException
WrongAttributeValueException
WrongReferenceAttributeValueException
LoginNotExistsException
PasswordCreationFailedException
InvalidLoginException
ExtSourceNotExistsException
AlreadySponsorException
InvalidSponsoredUserDataException
NamespaceRulesNotExistsException
-
setSponsoredMember
Member setSponsoredMember(PerunSession session, Vo vo, User userToBeSponsored, String namespace, String password, User sponsor, Validation validation) throws AlreadyMemberException, ExtendMembershipException, UserNotInRoleException, PasswordStrengthException, WrongAttributeValueException, WrongReferenceAttributeValueException, LoginNotExistsException, PasswordCreationFailedException, InvalidLoginException, ExtSourceNotExistsException, AlreadySponsorException, InvalidSponsoredUserDataException, NamespaceRulesNotExistsException Creates a sponsored membership for the given user.- Parameters:
session
- perun sessionvo
- virtual organizationuserToBeSponsored
- user, that will be sponsored by sponsornamespace
- used for selecting external system in which guest user account will be createdpassword
- passwordsponsor
- sponsoring uservalidation
- Type of members validation, when using Validation.ASYNC do not call this method in a cycle!- Returns:
- sponsored member
- Throws:
AlreadyMemberException
ExtendMembershipException
UserNotInRoleException
PasswordStrengthException
WrongAttributeValueException
WrongReferenceAttributeValueException
LoginNotExistsException
PasswordCreationFailedException
InvalidLoginException
ExtSourceNotExistsException
AlreadySponsorException
InvalidSponsoredUserDataException
NamespaceRulesNotExistsException
-
setSponsorshipForMember
Member setSponsorshipForMember(PerunSession session, Member sponsoredMember, User sponsor, LocalDate validityTo) throws AlreadySponsoredMemberException, UserNotInRoleException, AlreadySponsorException Transform non-sponsored member to sponsored one with defined sponsor- Parameters:
session
- perun sessionsponsoredMember
- member who will be set as sponsored onesponsor
- new sponsor of this membervalidityTo
- the last day when the sponsorship is active- Returns:
- sponsored member
- Throws:
AlreadySponsoredMemberException
- if member was already flagged as sponsoredUserNotInRoleException
- if sponsor has not right role in the member's VOInternalErrorException
- if something unexpected happenedAlreadySponsorException
- sponsoredMember is already sponsored by User and his sponsorship is still active
-
setSponsorshipForMember
Member setSponsorshipForMember(PerunSession session, Member sponsoredMember, User sponsor) throws AlreadySponsoredMemberException, UserNotInRoleException, AlreadySponsorException Transform non-sponsored member to sponsored one with defined sponsor- Parameters:
session
- perun sessionsponsoredMember
- member who will be set as sponsored onesponsor
- new sponsor of this member- Returns:
- sponsored member
- Throws:
AlreadySponsoredMemberException
- if member was already flagged as sponsoredUserNotInRoleException
- if sponsor has not right role in the member's VOInternalErrorException
- if something unexpected happenedAlreadySponsorException
- sponsoredMember is already sponsored by User and his sponsorship is still active
-
setStatus
Member setStatus(PerunSession sess, Member member, Status status) throws WrongAttributeValueException, WrongReferenceAttributeValueException, MemberNotValidYetException Set status of the member to specified status.- Parameters:
sess
-member
-status
- new status- Returns:
- member with status set
- Throws:
InternalErrorException
WrongReferenceAttributeValueException
MemberNotValidYetException
WrongAttributeValueException
-
sponsorMember
Member sponsorMember(PerunSession session, Member sponsoredMember, User sponsor) throws MemberNotSponsoredException, AlreadySponsorException, UserNotInRoleException Links sponsored member and sponsoring user.- Parameters:
session
- perun sessionsponsoredMember
- member which is sponsoredsponsor
- sponsoring user- Returns:
- member
- Throws:
InternalErrorException
MemberNotSponsoredException
AlreadySponsorException
UserNotInRoleException
-
sponsorMember
Member sponsorMember(PerunSession session, Member sponsoredMember, User sponsor, LocalDate validityTo) throws MemberNotSponsoredException, AlreadySponsorException, UserNotInRoleException Links sponsored member and sponsoring user.- Parameters:
session
- perun sessionsponsoredMember
- member which is sponsoredsponsor
- sponsoring uservalidityTo
- last day when the sponsorship is active (null means the sponsorship will last forever)- Returns:
- member
- Throws:
InternalErrorException
MemberNotSponsoredException
AlreadySponsorException
UserNotInRoleException
-
suspendMemberTo
void suspendMemberTo(PerunSession sess, Member member, Date suspendedTo) throws BanAlreadyExistsException Set date to which will be member suspended in his VO.For almost unlimited time please use time in the far future.
- Parameters:
sess
-member
- member who will be suspendedsuspendedTo
- date to which will be member suspended (after this date, he will not be affected by suspension any more)- Throws:
InternalErrorException
BanAlreadyExistsException
-
unsetSponsorshipForMember
Member unsetSponsorshipForMember(PerunSession session, Member sponsoredMember) throws MemberNotSponsoredException Transform sponsored member to non-sponsored one. Delete all his sponsors.- Parameters:
session
- perun sessionsponsoredMember
- member which who be unset from sponsoring- Returns:
- non-sponsored member
- Throws:
MemberNotSponsoredException
- If member was not set as sponsored before calling this method.InternalErrorException
- if something unexpected happend
-
unsuspendMember
Remove suspend state from Member - remove date to which member should be considered as suspended in the VO.WARNING: this method will always succeed if member exists, because it will set date for suspension to null
- Parameters:
sess
-member
- member for which the suspend state will be removed- Throws:
InternalErrorException
-
updateMember
Member updateMember(PerunSession sess, Member member) throws WrongReferenceAttributeValueException, WrongAttributeValueException Update member in underlaying data source. Member is find by id. Other java attributes are updated.- Parameters:
sess
-member
- member who have set new java attributes.- Returns:
- updated member
- Throws:
InternalErrorException
WrongReferenceAttributeValueException
WrongAttributeValueException
-
updateOrganizationsAttributes
void updateOrganizationsAttributes(PerunSession sess, Vo vo, Member member) throws AttributeNotExistsException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException Update value of memberOrganizations or memberOrganizationsHistory attribute for specific member.- Parameters:
sess
- sessionvo
- VOmember
- member- Throws:
WrongAttributeValueException
- if the attribute value is illegalWrongReferenceAttributeValueException
- if attribute which is reference for used attribute has illegal valueAttributeNotExistsException
- if the attribute doesn't exists in the underlying data sourceWrongAttributeAssignmentException
- if attribute is not vo attribute
-
updateSponsorshipValidity
void updateSponsorshipValidity(PerunSession sess, Member sponsoredMember, User sponsor, LocalDate newValidity) throws SponsorshipDoesNotExistException Update the sponsorship of given member for given sponsor.- Parameters:
sess
- sessionsponsoredMember
- sponsored membersponsor
- sponsornewValidity
- new validity, can be set to null never expire- Throws:
SponsorshipDoesNotExistException
- if the given user is not sponsor of the given member
-
validateMember
Member validateMember(PerunSession sess, Member member) throws WrongAttributeValueException, WrongReferenceAttributeValueException Validate all atributes for member and set member's status to VALID. This method runs synchronously.Method runs in nested transaction. As side effect, on success will change status of the object member.
- Parameters:
sess
-member
-- Returns:
- membet with new status set
- Throws:
InternalErrorException
WrongAttributeValueException
WrongReferenceAttributeValueException
-
validateMemberAsync
Validate all attributes for member and then set member's status to VALID. This method runs asynchronously. If validation ends with error, member keeps his status.- Parameters:
sess
-member
-
-
someAvailableSponsorExistsForMember
Checks if some vo sponsor who does not already sponsor given member exists.- Parameters:
sess
- perun sessionmember
- member- Returns:
- true if available sponsor exists, false otherwise
-
getAvailableSponsorsForMember
Returns all available sponsors for given member.- Parameters:
sess
- perun sessionmember
- member- Returns:
- list of available sponsors
-