Package cz.metacentrum.perun.core.entry
Class VosManagerEntry
java.lang.Object
cz.metacentrum.perun.core.entry.VosManagerEntry
- All Implemented Interfaces:
VosManager
VosManager entry logic
- Author:
- Michal Prochazka michalp@ics.muni.cz, Slavek Licehammer glory@ics.muni.cz
-
Field Summary
Fields inherited from interface cz.metacentrum.perun.core.api.VosManager
MEMBERS_GROUP, MEMBERS_GROUP_DESCRIPTION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdmin
(PerunSession sess, Vo vo, Group group) Add a group administrator to the VO.void
addAdmin
(PerunSession sess, Vo vo, User user) Add a user administrator to the VO.void
addMemberVo
(PerunSession sess, Vo vo, Vo memberVo) Adds new relationship between vo and a member vo.void
addSponsorRole
(PerunSession sess, Vo vo, Group group) Adds role SPONSOR for group in a VO.void
addSponsorRole
(PerunSession sess, Vo vo, User user) Adds role SPONSOR for user in a VO.void
convertSponsoredUsers
(PerunSession sess, Vo vo) For the given vo, creates sponsored members for each sponsored user who is a member of the given vo.void
convertSponsoredUsersWithNewSponsor
(PerunSession sess, Vo vo, User newSponsor) For the given vo, creates sponsored members for each sponsored user who is a member of the given vo.createVo
(PerunSession sess, Vo vo) Create new VO.void
deleteVo
(PerunSession sess, Vo vo) Delete VO.void
deleteVo
(PerunSession sess, Vo vo, boolean forceDelete) Delete VO.findCandidates
(PerunSession sess, Group group, String searchString) Finds users, who can join the group in Vo.findCandidates
(PerunSession sess, Vo vo, String searchString) Finds users, who can join the Vo.findCandidates
(PerunSession sess, Vo vo, String searchString, int maxNumOfResults) Finds users, who can join the Vo.getAdminGroups
(PerunSession sess, Vo vo) Deprecated.getAdminGroups
(PerunSession perunSession, Vo vo, String role) Get list of group administrators of the given VO.getAdmins
(PerunSession sess, Vo vo) Deprecated.getAdmins
(PerunSession perunSession, Vo vo, String role, boolean onlyDirectAdmins) Get list of user administrators of specific vo for specific role.getAllVos
(PerunSession perunSession) Get list of Vos without any privilege.getBanById
(PerunSession sess, int banId) Get vo ban with given id.getBanForMember
(PerunSession sess, Member member) Get ban for given member, or null if he is not banned.getBansForVo
(PerunSession sess, int voId) Get list of all bans for vo with given id.getCompleteCandidates
(PerunSession sess, Group group, List<String> attrNames, String searchString) Finds MemberCandidates who can join the Group.getCompleteCandidates
(PerunSession sess, Vo vo, List<String> attrNames, String searchString) Finds MemberCandidates who can join the Vo.getDirectAdmins
(PerunSession sess, Vo vo) Deprecated.getDirectRichAdminsWithSpecificAttributes
(PerunSession sess, Vo vo, List<String> specificAttributes) Deprecated.getEnrichedBansForUser
(PerunSession sess, int userId, List<String> attrNames) Gets all Enriched Bans for given user.getEnrichedBansForVo
(PerunSession sess, int voId, List<String> attrNames) Gets all Enriched Bans for given vo.getEnrichedVoById
(PerunSession sess, int id) Finds existing vo by and id and returns corresponding EnrichedVogetEnrichedVos
(PerunSession sess) Get list of EnrichedVos of all the VOs the user has access togetMemberVos
(PerunSession sess, int voId) Gets all member organizations of the given vo.getParentVos
(PerunSession sess, int memberVoId) Gets all organizations where given vo is direct member.Gets the perunBl for this instance.getRichAdmins
(PerunSession sess, Vo vo) Deprecated.getRichAdmins
(PerunSession perunSession, Vo vo, String role, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) Get list of richUser administrators of specific vo for specific role.getRichAdminsWithAttributes
(PerunSession sess, Vo vo) Deprecated.getRichAdminsWithSpecificAttributes
(PerunSession sess, Vo vo, List<String> specificAttributes) Deprecated.getVoById
(PerunSession sess, int id) Finds existing VO by id.getVoByShortName
(PerunSession sess, String shortName) Find existing VO by short name (short name is unique).getVoMembersCountsByStatus
(PerunSession sess, Vo vo) Returns number of vo members by their status.getVos
(PerunSession sess) Get list of Vos by Access Righs: If User is: - PERUNADMIN : get all Vos - VoAdmin : Vo where user is Admin - GroupAdmin: Vo where user is GroupAdmingetVosByIds
(PerunSession sess, List<Integer> ids) Finds existing VOs by ids.int
getVosCount
(PerunSession sess) Get count of all vos.void
removeAdmin
(PerunSession sess, Vo vo, Group group) Removes a group administrator from the VO.void
removeAdmin
(PerunSession sess, Vo vo, User user) Removes a user administrator from the VO.void
removeBan
(PerunSession sess, int banId) Remove vo ban with given id.void
removeBanForMember
(PerunSession sess, Member member) Remove vo ban for given member.void
removeMemberVo
(PerunSession sess, Vo vo, Vo memberVo) Removes member vo from given vo.void
removeSponsorRole
(PerunSession sess, Vo vo, Group group) Removes role SPONSOR from group in a VO.void
removeSponsorRole
(PerunSession sess, Vo vo, User user) Removes role SPONSOR from user in a VO.setBan
(PerunSession sess, BanOnVo ban) Set ban for member on his vo.void
setPerunBl
(PerunBl perunBl) Sets the perunBl for this instance.void
setVosManagerBl
(VosManagerBl vosManagerBl) Sets the vosManagerBl for this instance.updateBan
(PerunSession sess, BanOnVo banOnVo) Update existing ban (description, validation timestamp)updateVo
(PerunSession sess, Vo vo) Updates VO.
-
Constructor Details
-
VosManagerEntry
Constructor. -
VosManagerEntry
public VosManagerEntry()
-
-
Method Details
-
addAdmin
public void addAdmin(PerunSession sess, Vo vo, User user) throws PrivilegeException, AlreadyAdminException, VoNotExistsException, UserNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:VosManager
Add a user administrator to the VO.- Specified by:
addAdmin
in interfaceVosManager
user
- user who will became an VO administrator- Throws:
PrivilegeException
AlreadyAdminException
VoNotExistsException
UserNotExistsException
RoleCannotBeManagedException
RoleCannotBeSetException
-
addAdmin
public void addAdmin(PerunSession sess, Vo vo, Group group) throws PrivilegeException, AlreadyAdminException, VoNotExistsException, GroupNotExistsException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:VosManager
Add a group administrator to the VO.- Specified by:
addAdmin
in interfaceVosManager
group
- that will become a VO administrator- Throws:
PrivilegeException
AlreadyAdminException
VoNotExistsException
GroupNotExistsException
RoleCannotBeManagedException
RoleCannotBeSetException
-
addMemberVo
public void addMemberVo(PerunSession sess, Vo vo, Vo memberVo) throws RelationExistsException, PrivilegeException, VoNotExistsException Description copied from interface:VosManager
Adds new relationship between vo and a member vo. If user is member in both vos, updates memberOrganizations list attribute. If user is member only in member vo, creates member in parent vo and sets memberOrganizations list attribute.- Specified by:
addMemberVo
in interfaceVosManager
- Parameters:
sess
- sessionvo
- vomemberVo
- new member of the vo- Throws:
RelationExistsException
- if member vo is already member of the voPrivilegeException
- if not authorizedVoNotExistsException
- if any of the vos don't exist
-
addSponsorRole
public void addSponsorRole(PerunSession sess, Vo vo, User user) throws AlreadyAdminException, VoNotExistsException, UserNotExistsException, PrivilegeException, RoleCannotBeManagedException, RoleCannotBeSetException Adds role SPONSOR for user in a VO.- Specified by:
addSponsorRole
in interfaceVosManager
- Parameters:
sess
- perun sessionvo
- virtual organizationuser
- specific user in VO- Throws:
AlreadyAdminException
VoNotExistsException
UserNotExistsException
PrivilegeException
RoleCannotBeManagedException
RoleCannotBeSetException
-
addSponsorRole
public void addSponsorRole(PerunSession sess, Vo vo, Group group) throws AlreadyAdminException, VoNotExistsException, GroupNotExistsException, PrivilegeException, RoleCannotBeManagedException, RoleCannotBeSetException Adds role SPONSOR for group in a VO.- Specified by:
addSponsorRole
in interfaceVosManager
- Parameters:
sess
- perun sessionvo
- virtual organizationgroup
- specific group in VO- Throws:
AlreadyAdminException
VoNotExistsException
GroupNotExistsException
PrivilegeException
RoleCannotBeManagedException
RoleCannotBeSetException
-
convertSponsoredUsers
Description copied from interface:VosManager
For the given vo, creates sponsored members for each sponsored user who is a member of the given vo. Original sponsors of the users will be set to the sponsored members.- Specified by:
convertSponsoredUsers
in interfaceVosManager
- Parameters:
sess
- sessionvo
- vo where members will be converted- Throws:
PrivilegeException
-
convertSponsoredUsersWithNewSponsor
public void convertSponsoredUsersWithNewSponsor(PerunSession sess, Vo vo, User newSponsor) throws PrivilegeException Description copied from interface:VosManager
For the given vo, creates sponsored members for each sponsored user who is a member of the given vo. The sponsored members will be sponsored by the given user, not by its original sponsors.- Specified by:
convertSponsoredUsersWithNewSponsor
in interfaceVosManager
- Parameters:
sess
- sessionvo
- vo where members will be convertednewSponsor
- user, who will be set as a sponsor to the sponsored members- Throws:
PrivilegeException
-
createVo
Description copied from interface:VosManager
Create new VO.- Specified by:
createVo
in interfaceVosManager
vo
- vo object with prefilled voShortName and voName- Returns:
- newly created VO
- Throws:
VoExistsException
PrivilegeException
-
deleteVo
Description copied from interface:VosManager
Delete VO.- Specified by:
deleteVo
in interfaceVosManager
- Throws:
VoNotExistsException
PrivilegeException
-
deleteVo
public void deleteVo(PerunSession sess, Vo vo, boolean forceDelete) throws VoNotExistsException, PrivilegeException Description copied from interface:VosManager
Delete VO.- Specified by:
deleteVo
in interfaceVosManager
forceDelete
- force the deletion of the VO, regardless there are any existing entities associated with the VO (they will be deleted)- Throws:
VoNotExistsException
PrivilegeException
-
findCandidates
public List<Candidate> findCandidates(PerunSession sess, Vo vo, String searchString, int maxNumOfResults) throws VoNotExistsException, PrivilegeException Description copied from interface:VosManager
Finds users, who can join the Vo.- Specified by:
findCandidates
in interfaceVosManager
searchString
- depends on the extSource of the VO, could by part of the name, email or something like that.maxNumOfResults
- limit the maximum number of returned entries- Returns:
- list of candidates who match the searchString
- Throws:
VoNotExistsException
PrivilegeException
-
findCandidates
public List<Candidate> findCandidates(PerunSession sess, Vo vo, String searchString) throws VoNotExistsException, PrivilegeException Description copied from interface:VosManager
Finds users, who can join the Vo.- Specified by:
findCandidates
in interfaceVosManager
vo
- vo to be usedsearchString
- depends on the extSource of the VO, could by part of the name, email or something like that.- Returns:
- list of candidates who match the searchString
- Throws:
VoNotExistsException
PrivilegeException
-
findCandidates
public List<Candidate> findCandidates(PerunSession sess, Group group, String searchString) throws GroupNotExistsException, PrivilegeException Description copied from interface:VosManager
Finds users, who can join the group in Vo.- Specified by:
findCandidates
in interfaceVosManager
group
- group to be usedsearchString
- depends on the extSource of the Group, could by part of the name, email or something like that.- Returns:
- list of candidates who match the searchString
- Throws:
GroupNotExistsException
PrivilegeException
-
getAdminGroups
public List<Group> getAdminGroups(PerunSession perunSession, Vo vo, String role) throws PrivilegeException, VoNotExistsException, RoleNotSupportedException Description copied from interface:VosManager
Get list of group administrators of the given VO.Supported roles: VOOBSERVER, TOPGROUPCREATOR, VOADMIN, SPONSOR
- Specified by:
getAdminGroups
in interfaceVosManager
- Returns:
- List of groups, who are administrators of the Vo with supported role. Returns empty list if there is no VO group admin.
- Throws:
PrivilegeException
VoNotExistsException
RoleNotSupportedException
-
getAdminGroups
@Deprecated public List<Group> getAdminGroups(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Deprecated.Description copied from interface:VosManager
Get list of group administrators of the given VO.- Specified by:
getAdminGroups
in interfaceVosManager
- Returns:
- List of groups, who are administrators of the Vo. Returns empty list if there is no VO group admin.
- Throws:
PrivilegeException
VoNotExistsException
-
getAdmins
public List<User> getAdmins(PerunSession perunSession, Vo vo, String role, boolean onlyDirectAdmins) throws PrivilegeException, VoNotExistsException, RoleNotSupportedException Description copied from interface:VosManager
Get list of user administrators of specific vo for specific role. If some group is administrator of the VO, all VALID members are included in the list.If onlyDirectAdmins is true, return only direct users of the group for supported role.
Supported roles: VOOBSERVER, TOPGROUPCREATOR, VOADMIN
- Specified by:
getAdmins
in interfaceVosManager
role
- supported roleonlyDirectAdmins
- if true, get only direct user administrators (if false, get both direct and indirect)- Returns:
- list of all user administrators of the given vo for supported role
- Throws:
PrivilegeException
VoNotExistsException
RoleNotSupportedException
-
getAdmins
@Deprecated public List<User> getAdmins(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Deprecated.Description copied from interface:VosManager
Get list of Vo administrators. If some group is administrator of the VO, all members are included in the list.- Specified by:
getAdmins
in interfaceVosManager
- Returns:
- List of users, who are administrators of the Vo. Returns empty list if there is no VO admin.
- Throws:
PrivilegeException
VoNotExistsException
-
getAllVos
Description copied from interface:VosManager
Get list of Vos without any privilege.- Specified by:
getAllVos
in interfaceVosManager
- Returns:
- List of VOs or empty ArrayList
- Throws:
PrivilegeException
-
getBanById
public BanOnVo getBanById(PerunSession sess, int banId) throws BanNotExistsException, PrivilegeException Description copied from interface:VosManager
Get vo ban with given id.- Specified by:
getBanById
in interfaceVosManager
- Parameters:
sess
- sessionbanId
- ban id- Returns:
- found ban
- Throws:
BanNotExistsException
- if there is no such banPrivilegeException
- insufficient permissions
-
getBanForMember
public BanOnVo getBanForMember(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:VosManager
Get ban for given member, or null if he is not banned.- Specified by:
getBanForMember
in interfaceVosManager
- Parameters:
sess
- sessionmember
- member- Returns:
- found ban or null if the member is not banned
- Throws:
PrivilegeException
- insufficient permissionsMemberNotExistsException
- if there is no such member
-
getBansForVo
public List<BanOnVo> getBansForVo(PerunSession sess, int voId) throws PrivilegeException, VoNotExistsException Description copied from interface:VosManager
Get list of all bans for vo with given id.- Specified by:
getBansForVo
in interfaceVosManager
- Parameters:
sess
- sessionvoId
- vo id- Returns:
- vo bans for given vo
- Throws:
PrivilegeException
- insufficient permissionsVoNotExistsException
- if there is no vo with given id
-
getCompleteCandidates
public List<MemberCandidate> getCompleteCandidates(PerunSession sess, Vo vo, List<String> attrNames, String searchString) throws VoNotExistsException, PrivilegeException Description copied from interface:VosManager
Finds MemberCandidates who can join the Vo.- Specified by:
getCompleteCandidates
in interfaceVosManager
- Parameters:
sess
- sessionvo
- vo to be usedattrNames
- names of attributes that will be foundsearchString
- depends on the extSource of the Group, could by part of the name, email or something like that.- Returns:
- list of MemberCandidates for given vo.
- Throws:
VoNotExistsException
- when vo does not existPrivilegeException
- privilege exception
-
getCompleteCandidates
public List<MemberCandidate> getCompleteCandidates(PerunSession sess, Group group, List<String> attrNames, String searchString) throws GroupNotExistsException, PrivilegeException Description copied from interface:VosManager
Finds MemberCandidates who can join the Group.- Specified by:
getCompleteCandidates
in interfaceVosManager
- Parameters:
sess
- sessiongroup
- group to be usedattrNames
- names of attributes that will be foundsearchString
- depends on the extSource of the Group, could by part of the name, email or something like that.- Returns:
- list of MemberCandidates for given vo.
- Throws:
GroupNotExistsException
- when group does not existPrivilegeException
- privilege exception
-
getDirectAdmins
@Deprecated public List<User> getDirectAdmins(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Deprecated.Description copied from interface:VosManager
Gets list of direct user administrators of the VO. 'Direct' means, there aren't included users, who are members of group administrators, in the returned list.- Specified by:
getDirectAdmins
in interfaceVosManager
- Throws:
PrivilegeException
VoNotExistsException
-
getDirectRichAdminsWithSpecificAttributes
@Deprecated public List<RichUser> getDirectRichAdminsWithSpecificAttributes(PerunSession sess, Vo vo, List<String> specificAttributes) throws PrivilegeException, VoNotExistsException Deprecated.Description copied from interface:VosManager
Get list of Vo administrators, which are directly assigned (not by group membership) with specific attributes. From list of specificAttributes get all Users Attributes and find those for every RichAdmin (only, other attributes are not searched)- Specified by:
getDirectRichAdminsWithSpecificAttributes
in interfaceVosManager
- Returns:
- list of RichUsers with specific attributes.
- Throws:
PrivilegeException
VoNotExistsException
-
getEnrichedBansForUser
public List<EnrichedBanOnVo> getEnrichedBansForUser(PerunSession sess, int userId, List<String> attrNames) throws PrivilegeException, UserNotExistsException, AttributeNotExistsException Description copied from interface:VosManager
Gets all Enriched Bans for given user.- Specified by:
getEnrichedBansForUser
in interfaceVosManager
- Parameters:
sess
- sessionuserId
- id of userattrNames
- List of attribute names, returns all attributes if empty or null- Returns:
- List of Enriched Bans
- Throws:
UserNotExistsException
- if user does not existPrivilegeException
AttributeNotExistsException
-
getEnrichedBansForVo
public List<EnrichedBanOnVo> getEnrichedBansForVo(PerunSession sess, int voId, List<String> attrNames) throws PrivilegeException, AttributeNotExistsException, VoNotExistsException Description copied from interface:VosManager
Gets all Enriched Bans for given vo. Attr names specify which attributes should be included in RichMember.- Specified by:
getEnrichedBansForVo
in interfaceVosManager
- Parameters:
sess
- sessionvoId
- id of voattrNames
- List of attribute names, returns all attributes if empty or null- Returns:
- List of Enriched Bans
- Throws:
PrivilegeException
AttributeNotExistsException
VoNotExistsException
-
getEnrichedVoById
public EnrichedVo getEnrichedVoById(PerunSession sess, int id) throws VoNotExistsException, PrivilegeException Description copied from interface:VosManager
Finds existing vo by and id and returns corresponding EnrichedVo- Specified by:
getEnrichedVoById
in interfaceVosManager
- Returns:
- EnrichedVO object of requested VO, which contains its member and parent VOs
- Throws:
VoNotExistsException
PrivilegeException
-
getEnrichedVos
Description copied from interface:VosManager
Get list of EnrichedVos of all the VOs the user has access to- Specified by:
getEnrichedVos
in interfaceVosManager
- Returns:
- List of EnrichedVos or empty list
- Throws:
PrivilegeException
-
getMemberVos
public List<Vo> getMemberVos(PerunSession sess, int voId) throws PrivilegeException, VoNotExistsException Description copied from interface:VosManager
Gets all member organizations of the given vo.- Specified by:
getMemberVos
in interfaceVosManager
- Parameters:
sess
- sessionvoId
- vo id- Returns:
- list of member vos
- Throws:
PrivilegeException
- if not authorizedVoNotExistsException
- if given vo does not exist
-
getParentVos
public List<Vo> getParentVos(PerunSession sess, int memberVoId) throws PrivilegeException, VoNotExistsException Description copied from interface:VosManager
Gets all organizations where given vo is direct member.- Specified by:
getParentVos
in interfaceVosManager
- Parameters:
sess
- sessionmemberVoId
- member vo id- Returns:
- list of direct parent vos
- Throws:
PrivilegeException
- if not authorizedVoNotExistsException
- if given member vo does not exist
-
getPerunBl
Gets the perunBl for this instance.- Returns:
- The perunBl.
-
getRichAdmins
public List<RichUser> getRichAdmins(PerunSession perunSession, Vo vo, String role, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws PrivilegeException, VoNotExistsException, UserNotExistsException, RoleNotSupportedException Description copied from interface:VosManager
Get list of richUser administrators of specific vo for specific role. If some group is administrator of the VO, all VALID members are included in the list.Supported roles: VOOBSERVER, TOPGROUPCREATOR, VOADMIN, SPONSOR
If "onlyDirectAdmins" is "true", return only direct users of the vo for supported role with specific attributes. If "allUserAttributes" is "true", do not specify attributes through list and return them all in objects richUser . Ignoring list of specific attributes.
- Specified by:
getRichAdmins
in interfaceVosManager
specificAttributes
- list of specified attributes which are needed in object richUserallUserAttributes
- if true, get all possible user attributes and ignore list of specificAttributes (if false, get only specific attributes)onlyDirectAdmins
- if true, get only direct user administrators (if false, get both direct and indirect)- Returns:
- list of RichUser administrators for the vo and supported role with attributes
- Throws:
PrivilegeException
VoNotExistsException
UserNotExistsException
RoleNotSupportedException
-
getRichAdmins
@Deprecated public List<RichUser> getRichAdmins(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException Deprecated.Description copied from interface:VosManager
Get list of Vo administrators like RichUsers without attributes.- Specified by:
getRichAdmins
in interfaceVosManager
- Returns:
- List of users, who are administrators of the Vo. Returns empty list if there is no VO admin.
- Throws:
PrivilegeException
VoNotExistsException
-
getRichAdminsWithAttributes
@Deprecated public List<RichUser> getRichAdminsWithAttributes(PerunSession sess, Vo vo) throws PrivilegeException, VoNotExistsException, UserNotExistsException Deprecated.Description copied from interface:VosManager
Get list of Vo administrators like RichUsers with attributes.- Specified by:
getRichAdminsWithAttributes
in interfaceVosManager
- Returns:
- List of users, who are administrators of the Vo. Returns empty list if there is no VO admin.
- Throws:
PrivilegeException
VoNotExistsException
UserNotExistsException
-
getRichAdminsWithSpecificAttributes
@Deprecated public List<RichUser> getRichAdminsWithSpecificAttributes(PerunSession sess, Vo vo, List<String> specificAttributes) throws PrivilegeException, VoNotExistsException Deprecated.Description copied from interface:VosManager
Get list of Vo administrators with specific attributes. From list of specificAttributes get all Users Attributes and find those for every RichAdmin (only, other attributes are not searched)- Specified by:
getRichAdminsWithSpecificAttributes
in interfaceVosManager
- Returns:
- list of RichUsers with specific attributes.
- Throws:
PrivilegeException
VoNotExistsException
-
getVoById
Description copied from interface:VosManager
Finds existing VO by id.- Specified by:
getVoById
in interfaceVosManager
- Returns:
- VO with requested id or throws VoNotExistsException if the VO with specified id doesn't exist
- Throws:
VoNotExistsException
PrivilegeException
-
getVoByShortName
public Vo getVoByShortName(PerunSession sess, String shortName) throws VoNotExistsException, PrivilegeException Description copied from interface:VosManager
Find existing VO by short name (short name is unique).- Specified by:
getVoByShortName
in interfaceVosManager
shortName
- short name of VO which you find (for example "KZCU")- Returns:
- VO with requested shortName or throws VoNotExistsException if the VO with specified shortName doesn't exist
- Throws:
VoNotExistsException
PrivilegeException
-
getVoMembersCountsByStatus
public Map<Status,Integer> getVoMembersCountsByStatus(PerunSession sess, Vo vo) throws VoNotExistsException, PrivilegeException Description copied from interface:VosManager
Returns number of vo members by their status.- Specified by:
getVoMembersCountsByStatus
in interfaceVosManager
- Parameters:
sess
- perun sessionvo
- vo of members- Returns:
- map of status in vo to number of vo members with the status
- Throws:
VoNotExistsException
- if vo does not existPrivilegeException
- insufficient permissions
-
getVos
Description copied from interface:VosManager
Get list of Vos by Access Righs: If User is: - PERUNADMIN : get all Vos - VoAdmin : Vo where user is Admin - GroupAdmin: Vo where user is GroupAdmin- Specified by:
getVos
in interfaceVosManager
- Returns:
- List of VOs or empty ArrayList
- Throws:
PrivilegeException
-
getVosByIds
Description copied from interface:VosManager
Finds existing VOs by ids.- Specified by:
getVosByIds
in interfaceVosManager
- Returns:
- VOs with requested ids
- Throws:
PrivilegeException
-
getVosCount
Description copied from interface:VosManager
Get count of all vos.- Specified by:
getVosCount
in interfaceVosManager
- Parameters:
sess
- PerunSession- Returns:
- count of all vos
-
removeAdmin
public void removeAdmin(PerunSession sess, Vo vo, User user) throws PrivilegeException, VoNotExistsException, UserNotAdminException, UserNotExistsException, RoleCannotBeManagedException Description copied from interface:VosManager
Removes a user administrator from the VO.- Specified by:
removeAdmin
in interfaceVosManager
user
- user who will lose an VO administrator role- Throws:
PrivilegeException
VoNotExistsException
UserNotAdminException
UserNotExistsException
RoleCannotBeManagedException
-
removeAdmin
public void removeAdmin(PerunSession sess, Vo vo, Group group) throws PrivilegeException, VoNotExistsException, GroupNotAdminException, GroupNotExistsException, RoleCannotBeManagedException Description copied from interface:VosManager
Removes a group administrator from the VO.- Specified by:
removeAdmin
in interfaceVosManager
group
- group that will lose a VO administrator role- Throws:
PrivilegeException
VoNotExistsException
GroupNotAdminException
GroupNotExistsException
RoleCannotBeManagedException
-
removeBan
public void removeBan(PerunSession sess, int banId) throws PrivilegeException, BanNotExistsException Description copied from interface:VosManager
Remove vo ban with given id.- Specified by:
removeBan
in interfaceVosManager
- Parameters:
sess
- sessionbanId
- if of vo ban- Throws:
PrivilegeException
- insufficient permissionsBanNotExistsException
- if there is no ban with specified id
-
removeBanForMember
public void removeBanForMember(PerunSession sess, Member member) throws PrivilegeException, BanNotExistsException, MemberNotExistsException Description copied from interface:VosManager
Remove vo ban for given member.- Specified by:
removeBanForMember
in interfaceVosManager
- Parameters:
sess
- sessionmember
- member- Throws:
PrivilegeException
- insufficient permissionsBanNotExistsException
- if there is no ban for member with given idMemberNotExistsException
- if there is no such member
-
removeMemberVo
public void removeMemberVo(PerunSession sess, Vo vo, Vo memberVo) throws RelationNotExistsException, PrivilegeException, VoNotExistsException Description copied from interface:VosManager
Removes member vo from given vo. Updates memberOrganizations list attribute for those members of parent vo who came from the member vo.- Specified by:
removeMemberVo
in interfaceVosManager
- Parameters:
sess
- sessionvo
- vomemberVo
- member vo to be removed- Throws:
RelationNotExistsException
- if member vo is not a member of the voPrivilegeException
- if not authorizedVoNotExistsException
- if any of the vos don't exist
-
removeSponsorRole
public void removeSponsorRole(PerunSession sess, Vo vo, User user) throws UserNotAdminException, VoNotExistsException, UserNotExistsException, PrivilegeException, RoleCannotBeManagedException Removes role SPONSOR from user in a VO.- Specified by:
removeSponsorRole
in interfaceVosManager
- Parameters:
sess
- perun sessionvo
- virtual organizationuser
- user in VO for removal of sponsor role- Throws:
UserNotAdminException
VoNotExistsException
UserNotExistsException
PrivilegeException
RoleCannotBeManagedException
-
removeSponsorRole
public void removeSponsorRole(PerunSession sess, Vo vo, Group group) throws GroupNotAdminException, VoNotExistsException, GroupNotExistsException, PrivilegeException, RoleCannotBeManagedException Removes role SPONSOR from group in a VO.- Specified by:
removeSponsorRole
in interfaceVosManager
- Parameters:
sess
- perun sessionvo
- virtual organizationgroup
- group in VO for removal of sponsor role- Throws:
GroupNotAdminException
VoNotExistsException
GroupNotExistsException
PrivilegeException
RoleCannotBeManagedException
-
setBan
public BanOnVo setBan(PerunSession sess, BanOnVo ban) throws PrivilegeException, MemberNotExistsException, BanAlreadyExistsException Description copied from interface:VosManager
Set ban for member on his vo.- Specified by:
setBan
in interfaceVosManager
- Parameters:
sess
- sessionban
- ban information- Returns:
- created ban object
- Throws:
PrivilegeException
- insufficient permissionsMemberNotExistsException
- if there is no member with specified idBanAlreadyExistsException
-
setPerunBl
Sets the perunBl for this instance.- Parameters:
perunBl
- The perunBl.
-
setVosManagerBl
Sets the vosManagerBl for this instance.- Parameters:
vosManagerBl
- The vosManagerBl.
-
updateBan
public BanOnVo updateBan(PerunSession sess, BanOnVo banOnVo) throws PrivilegeException, BanNotExistsException, VoNotExistsException Description copied from interface:VosManager
Update existing ban (description, validation timestamp)- Specified by:
updateBan
in interfaceVosManager
banOnVo
- the specific ban- Returns:
- updated ban
- Throws:
PrivilegeException
BanNotExistsException
VoNotExistsException
-
updateVo
Description copied from interface:VosManager
Updates VO.- Specified by:
updateVo
in interfaceVosManager
- Returns:
- returns updated VO
- Throws:
VoNotExistsException
PrivilegeException
-