Package cz.metacentrum.perun.core.entry
Class FacilitiesManagerEntry
java.lang.Object
cz.metacentrum.perun.core.entry.FacilitiesManagerEntry
- All Implemented Interfaces:
FacilitiesManager
- Author:
- Slavek Licehammer glory@ics.muni.cz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAdmin(PerunSession sess, Facility facility, Group group) Adds group administrator to the Facility.voidaddAdmin(PerunSession sess, Facility facility, User user) Adds user administrator to the Facility.addHost(PerunSession sess, Host host, Facility facility) Adds host to the Facility.addHosts(PerunSession sess, Facility facility, List<String> hosts) Create hosts in Perun and add them to the Facility.addHosts(PerunSession sess, List<Host> hosts, Facility facility) Adds hosts to the Facility.voidaddOwner(PerunSession sess, Facility facility, Owner owner) Deprecated.voidaddOwners(PerunSession sess, Facility facility, List<Owner> owners) Deprecated.voidcopyAttributes(PerunSession sess, Facility sourceFacility, Facility destinationFacility) Copy all attributes of the source facility to the destination facility.voidcopyManagers(PerunSession sess, Facility sourceFacility, Facility destinationFacility) Copy all managers(admins) of the source facility to the destination facility.voidcopyOwners(PerunSession sess, Facility sourceFacility, Facility destinationFacility) Deprecated.createFacility(PerunSession sess, Facility facility) Store the facility.voiddeleteFacility(PerunSession sess, Facility facility, Boolean force) Delete the facility by id.getAdminGroups(PerunSession sess, Facility facility) Gets list of all group administrators of the Facility.getAdmins(PerunSession sess, Facility facility) Deprecated.getAdmins(PerunSession perunSession, Facility facility, boolean onlyDirectAdmins) Gets list of all user administrators of the Facility.getAllowedGroups(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService) Get all Groups which can use this facility (Groups must be assigned to resource which belongs to this facility) specificVo and specificService can choose concrete groups if specificVo, specificService or both are null, they do not specific (all possible results are returned)getAllowedRichGroupsWithAttributes(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService, List<String> attrNames) Get all RichGroups which can use this facility (Groups must be assigned to Resource which belongs to this facility) specificVo and specificService can choose concrete groups if specificVo, specificService or both are null, they do not specific (all possible results are returned) We also retrieve attributes specified by attrNames for each returned RichGroup.getAllowedUsers(PerunSession sess, Facility facility) Return all users who can use this facilitygetAllowedUsers(PerunSession sess, Facility facility, Vo specificVo, Service specificService) Return all users who can use this facility specificVo and specificService can choose concrete users if specificVo, specificService or both are null, they do not specific (all possible results are returned)getAllowedVos(PerunSession sess, Facility facility) Return all VO which can use this facility.getAssignedFacilities(PerunSession sess, Group group) Get facilities which are assigned to Group (via resource).getAssignedFacilities(PerunSession sess, Member member) Get facilities which have the member access on.getAssignedFacilities(PerunSession sess, Service service) Get facilities where the service is defined.getAssignedFacilities(PerunSession sess, User user) Get facilities which have the user access on.getAssignedResources(PerunSession sess, Facility facility) Returns all resources assigned to the facility.getAssignedResourcesByAssignedService(PerunSession sess, Facility facility, Service service) Returns resources with specific service assigned to the facility.getAssignedRichResources(PerunSession sess, Facility facility) Returns all rich resources assigned to the facility with VO property filledgetAssignedRichResources(PerunSession sess, Facility facility, Service service) Returns all rich resources assigned to the facility and service with VO property filledgetAssignedUsers(PerunSession sess, Facility facility) Returns list of Users, assigned with chosen Facility.getAssignedUsers(PerunSession sess, Facility facility, Service service) Returns list of Users assigned with chosen Facility containing resources where service is assigned.getBan(PerunSession sess, int userId, int faclityId) Get ban by userId and facilityId.getBanById(PerunSession sess, int banId) Get Ban for user on facility by it's idgetBansForFacility(PerunSession sess, int facilityId) Get all bans for users on the facilitygetBansForUser(PerunSession sess, int userId) Get all bans for user on any facility.getDirectAdmins(PerunSession sess, Facility facility) Deprecated.getDirectRichAdminsWithSpecificAttributes(PerunSession perunSession, Facility facility, List<String> specificAttributes) Deprecated.getEnrichedBansForFacility(PerunSession sess, int facilityId, List<String> attrNames) Get all enriched bans for users on the facility.getEnrichedBansForUser(PerunSession sess, int userId, List<String> attrNames) Get all enriched bans on facility for user.Gets all enriched facilities user has access rights to.getEnrichedHosts(PerunSession sess, Facility facility, List<String> attrNames) Return all EnrichedHosts of given facility.getFacilities(PerunSession sess) List facilities by ACCESS RIGHTS: If User is: - PERUNADMIN : all facilities - FACILITYADMIN : only facilities where user is facility admingetFacilitiesByAttribute(PerunSession sess, String attributeName, String attributeValue) Returns all facilities that have set the attribute 'attributeName' with the value 'attributeValue'.getFacilitiesByAttributeWithAttributes(PerunSession sess, String searchAttributeName, String searchAttributeValue, List<String> attrNames) Searches (partially!)getFacilitiesByDestination(PerunSession sess, String destination) Searches for the Facilities by theirs destination.getFacilitiesByHostName(PerunSession sess, String hostname) Return all facilities where exists host with the specific hostnamegetFacilitiesByIds(PerunSession sess, List<Integer> ids) Searches for the Facilities with specified ids.intGet count of all facilities.Gets the facilitiesManagerBl for this instance.getFacilitiesWhereUserIsAdmin(PerunSession sess, User user) Get all facilities where the user is admin.getFacilityById(PerunSession sess, int id) Searches for the Facility with specified id.getFacilityByName(PerunSession sess, String name) Searches the Facility by its name.getFacilityForHost(PerunSession sess, Host host) Return facility which has the host.getHostById(PerunSession sess, int hostId) Get the host by its ID.getHosts(PerunSession sess, Facility facility) List hosts of Facility.getHostsByHostname(PerunSession sess, String hostname) Get all hosts with this hostname (from all facilities).intgetHostsCount(PerunSession sess, Facility facility) Count hosts of Facility.getOwnerFacilities(PerunSession sess, Owner owner) Returns list of all facilities owned by the owner.getOwners(PerunSession sess, Facility facility) Deprecated.getRichAdmins(PerunSession sess, Facility facility) Deprecated.getRichAdmins(PerunSession perunSession, Facility facility, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) Gets list of all richUser administrators of the Facility.getRichAdminsWithAttributes(PerunSession sess, Facility facility) Deprecated.getRichAdminsWithSpecificAttributes(PerunSession perunSession, Facility facility, List<String> specificAttributes) Deprecated.Get all possible rich Facilities with all their owners.voidremoveAdmin(PerunSession sess, Facility facility, Group group) Removes a group administrator from the Facility.voidremoveAdmin(PerunSession sess, Facility facility, User user) Removes a user administrator from the Facility.voidremoveBan(PerunSession sess, int banId) Remove existing ban by it's id.voidremoveBan(PerunSession sess, int userId, int facilityId) Remove existing ban by id of user and facility.voidremoveHost(PerunSession sess, Host host) Remove hosts from the Facility.voidremoveHostByHostname(PerunSession sess, String hostname) Remove host from the Facility based on hostname.voidremoveHosts(PerunSession sess, List<Host> hosts, Facility facility) Remove hosts from the Facility.voidremoveOwner(PerunSession sess, Facility facility, Owner owner) Deprecated.voidremoveOwners(PerunSession sess, Facility facility, List<Owner> owners) Deprecated.setBan(PerunSession sess, BanOnFacility banOnFacility) Set ban for user on facility.voidsetFacilitiesManagerBl(FacilitiesManagerBl facilitiesManagerBl) Sets the facilitiesManagerBl for this instance.voidsetOwners(PerunSession sess, Facility facility, List<Owner> owners) Deprecated.voidsetPerunBl(PerunBl perunBl) Sets the perunBl.updateBan(PerunSession sess, BanOnFacility banOnFacility) Update existing ban (description and validation timestamp)updateFacility(PerunSession sess, Facility facility) Updates facility.
-
Constructor Details
-
FacilitiesManagerEntry
-
FacilitiesManagerEntry
public FacilitiesManagerEntry()
-
-
Method Details
-
addAdmin
public void addAdmin(PerunSession sess, Facility facility, User user) throws FacilityNotExistsException, UserNotExistsException, PrivilegeException, AlreadyAdminException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:FacilitiesManagerAdds user administrator to the Facility.- Specified by:
addAdminin interfaceFacilitiesManager- Throws:
FacilityNotExistsExceptionUserNotExistsExceptionPrivilegeExceptionAlreadyAdminExceptionRoleCannotBeManagedExceptionRoleCannotBeSetException
-
addAdmin
public void addAdmin(PerunSession sess, Facility facility, Group group) throws FacilityNotExistsException, GroupNotExistsException, PrivilegeException, AlreadyAdminException, RoleCannotBeManagedException, RoleCannotBeSetException Description copied from interface:FacilitiesManagerAdds group administrator to the Facility.- Specified by:
addAdminin interfaceFacilitiesManager- Parameters:
group- that will become a Facility administrator- Throws:
FacilityNotExistsExceptionGroupNotExistsExceptionPrivilegeExceptionAlreadyAdminExceptionRoleCannotBeManagedExceptionRoleCannotBeSetException
-
addHost
public Host addHost(PerunSession sess, Host host, Facility facility) throws FacilityNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerAdds host to the Facility. Adds host only if host and destination with the same name doesn't exist or if privilege requirements are met.- Specified by:
addHostin interfaceFacilitiesManager- Returns:
- host
- Throws:
FacilityNotExistsExceptionPrivilegeException
-
addHosts
public List<Host> addHosts(PerunSession sess, List<Host> hosts, Facility facility) throws FacilityNotExistsException, PrivilegeException, HostExistsException Description copied from interface:FacilitiesManagerAdds hosts to the Facility. Adds hosts only if host and destination with the same name doesn't exist or if privilege requirements are met. Note: If you wish to add more hosts, it is recommended to prepare a Listof them so as there can be only one database call. - Specified by:
addHostsin interfaceFacilitiesManager- Parameters:
hosts- ID of any host doesn't need to be filled. Hosts will be created.- Returns:
- Hosts with ID's set.
- Throws:
FacilityNotExistsExceptionPrivilegeExceptionHostExistsException
-
addHosts
public List<Host> addHosts(PerunSession sess, Facility facility, List<String> hosts) throws FacilityNotExistsException, PrivilegeException, HostExistsException, WrongPatternException Description copied from interface:FacilitiesManagerCreate hosts in Perun and add them to the Facility. Adds hosts only if host and destination with the same name doesn't exist or if privilege requirements are met. Names of the hosts can be generative. The pattern is string with square brackets, e.g. "local[1-3]domain". Then the content of the brackets is distributed, so the list is [local1domain, local2domain, local3domain]. Multibrackets are aslo allowed. For example "a[00-01]b[90-91]c" generates [a00b90c, a00b91c, a01b90c, a01b91c].- Specified by:
addHostsin interfaceFacilitiesManager- Parameters:
hosts- list of strings with names of hosts, the name can by generative- Returns:
- Hosts with ID's set.
- Throws:
WrongPatternException- when syntax of any of the hostnames is wrongFacilityNotExistsExceptionPrivilegeExceptionHostExistsException
-
addOwner
@Deprecated public void addOwner(PerunSession sess, Facility facility, Owner owner) throws PrivilegeException, OwnerNotExistsException, FacilityNotExistsException, OwnerAlreadyAssignedException Deprecated.Description copied from interface:FacilitiesManagerAdd owner of the facility- Specified by:
addOwnerin interfaceFacilitiesManager- Throws:
PrivilegeExceptionOwnerNotExistsExceptionFacilityNotExistsExceptionOwnerAlreadyAssignedException
-
addOwners
@Deprecated public void addOwners(PerunSession sess, Facility facility, List<Owner> owners) throws PrivilegeException, OwnerNotExistsException, FacilityNotExistsException, OwnerAlreadyAssignedException Deprecated.Description copied from interface:FacilitiesManagerAdd owners of the facility- Specified by:
addOwnersin interfaceFacilitiesManager- Parameters:
sess- perun sessionfacility- facilityowners- list of owners to be added- Throws:
PrivilegeException- when the principal does not have sufficient rightsOwnerNotExistsException- when owner does not existFacilityNotExistsException- when facility does not existOwnerAlreadyAssignedException- when owner was already assigned to the facility
-
copyAttributes
public void copyAttributes(PerunSession sess, Facility sourceFacility, Facility destinationFacility) throws PrivilegeException, FacilityNotExistsException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:FacilitiesManagerCopy all attributes of the source facility to the destination facility. The attributes, that are in the destination facility and aren't in the source facility, are retained. The common attributes are replaced with attributes from source facility.- Specified by:
copyAttributesin interfaceFacilitiesManager- Throws:
WrongAttributeAssignmentException- if there is no facility attributeWrongAttributeValueException- if the attribute value is illegalWrongReferenceAttributeValueException- if the attribute value is illegalPrivilegeExceptionFacilityNotExistsException
-
copyManagers
public void copyManagers(PerunSession sess, Facility sourceFacility, Facility destinationFacility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:FacilitiesManagerCopy all managers(admins) of the source facility to the destination facility. The admins, that are in the destination facility and aren't in the source facility, are retained. The common admins are also retained in destination facility.- Specified by:
copyManagersin interfaceFacilitiesManager- Throws:
PrivilegeExceptionFacilityNotExistsException
-
copyOwners
@Deprecated public void copyOwners(PerunSession sess, Facility sourceFacility, Facility destinationFacility) throws FacilityNotExistsException, PrivilegeException Deprecated.Description copied from interface:FacilitiesManagerCopy all owners of the source facility to the destination facility. The owners, that are in the destination facility and aren't in the source facility, are retained. The common owners are replaced with owners from source facility.- Specified by:
copyOwnersin interfaceFacilitiesManager- Throws:
FacilityNotExistsExceptionPrivilegeException
-
createFacility
public Facility createFacility(PerunSession sess, Facility facility) throws PrivilegeException, FacilityExistsException, ConsentHubExistsException Description copied from interface:FacilitiesManagerStore the facility.- Specified by:
createFacilityin interfaceFacilitiesManager- Throws:
PrivilegeExceptionFacilityExistsExceptionConsentHubExistsException
-
deleteFacility
public void deleteFacility(PerunSession sess, Facility facility, Boolean force) throws RelationExistsException, FacilityNotExistsException, PrivilegeException, FacilityAlreadyRemovedException, HostAlreadyRemovedException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException Description copied from interface:FacilitiesManagerDelete the facility by id.- Specified by:
deleteFacilityin interfaceFacilitiesManager- Throws:
FacilityAlreadyRemovedException- if 0 rows affected by delete from DBHostAlreadyRemovedException- if there is at least 1 hosts not affected by deleting from DBResourceAlreadyRemovedException- if there is at least 1 resource not affected by deleting from DBGroupAlreadyRemovedFromResourceException- if there is at least 1 group on any resource affected by removing from DBRelationExistsExceptionFacilityNotExistsExceptionPrivilegeException
-
getAdminGroups
public List<Group> getAdminGroups(PerunSession sess, Facility facility) throws FacilityNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerGets list of all group administrators of the Facility.- Specified by:
getAdminGroupsin interfaceFacilitiesManager- Returns:
- list of Group that are admins in the facility.
- Throws:
FacilityNotExistsExceptionPrivilegeException
-
getAdmins
public List<User> getAdmins(PerunSession perunSession, Facility facility, boolean onlyDirectAdmins) throws PrivilegeException, FacilityNotExistsException Description copied from interface:FacilitiesManagerGets list of all user administrators of the Facility. If some group is administrator of the given group, all VALID members are included in the list.If onlyDirectAdmins is true, return only direct users of the group for supported role.
Supported roles: FacilityAdmin
- Specified by:
getAdminsin interfaceFacilitiesManager- Parameters:
onlyDirectAdmins- if true, get only direct user administrators (if false, get both direct and indirect)- Returns:
- list of all user administrators of the given facility for supported role
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getAdmins
@Deprecated public List<User> getAdmins(PerunSession sess, Facility facility) throws FacilityNotExistsException, PrivilegeException Deprecated.Description copied from interface:FacilitiesManagerGets list of all user administrators of the Facility. If some group is administrator of the given group, all members are included in the list.- Specified by:
getAdminsin interfaceFacilitiesManager- Returns:
- list of Users who are admins in the facility.
- Throws:
FacilityNotExistsExceptionPrivilegeException
-
getAllowedGroups
public List<Group> getAllowedGroups(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService) throws PrivilegeException, FacilityNotExistsException, ServiceNotExistsException, VoNotExistsException Description copied from interface:FacilitiesManagerGet all Groups which can use this facility (Groups must be assigned to resource which belongs to this facility) specificVo and specificService can choose concrete groups if specificVo, specificService or both are null, they do not specific (all possible results are returned)- Specified by:
getAllowedGroupsin interfaceFacilitiesManager- Parameters:
facility- searching for this facilityspecificVo- specific only those results which are in specific VO (with null, all results)specificService- specific only those results, which have resource with assigned specific service (if null, all results)- Returns:
- list of allowed groups
- Throws:
FacilityNotExistsException- if facility not exist, return this exceptionServiceNotExistsException- if service is not null and not existVoNotExistsException- if vo is not null and not existPrivilegeException
-
getAllowedRichGroupsWithAttributes
public List<RichGroup> getAllowedRichGroupsWithAttributes(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService, List<String> attrNames) throws PrivilegeException, FacilityNotExistsException, ServiceNotExistsException, VoNotExistsException Description copied from interface:FacilitiesManagerGet all RichGroups which can use this facility (Groups must be assigned to Resource which belongs to this facility) specificVo and specificService can choose concrete groups if specificVo, specificService or both are null, they do not specific (all possible results are returned) We also retrieve attributes specified by attrNames for each returned RichGroup.- Specified by:
getAllowedRichGroupsWithAttributesin interfaceFacilitiesManager- Parameters:
facility- searching for this facilityspecificVo- specific only those results which are in specific VO (with null, all results)specificService- specific only those results, which have resource with assigned specific service (if null, all results)attrNames- with each returned RichGroup we get also attributes specified by this list- Returns:
- list of allowed groups
- Throws:
FacilityNotExistsException- if facility not exist, return this exceptionServiceNotExistsException- if service is not null and not existVoNotExistsException- if vo is not null and not existPrivilegeException
-
getAllowedUsers
public List<User> getAllowedUsers(PerunSession sess, Facility facility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:FacilitiesManagerReturn all users who can use this facility- Specified by:
getAllowedUsersin interfaceFacilitiesManager- Returns:
- list of users
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getAllowedUsers
public List<User> getAllowedUsers(PerunSession sess, Facility facility, Vo specificVo, Service specificService) throws PrivilegeException, FacilityNotExistsException, ServiceNotExistsException, VoNotExistsException Description copied from interface:FacilitiesManagerReturn all users who can use this facility specificVo and specificService can choose concrete users if specificVo, specificService or both are null, they do not specific (all possible results are returned)- Specified by:
getAllowedUsersin interfaceFacilitiesManager- Parameters:
specificVo- specific only those results which are in specific VO (with null, all results)specificService- specific only those results, which have resource with assigned specific service (if null, all results)- Returns:
- list of users
- Throws:
ServiceNotExistsException- if service is not null and not existVoNotExistsException- if vo is not null and not existPrivilegeExceptionFacilityNotExistsException
-
getAllowedVos
public List<Vo> getAllowedVos(PerunSession sess, Facility facility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:FacilitiesManagerReturn all VO which can use this facility. (VO muset have the resource which belongs to this facility)- Specified by:
getAllowedVosin interfaceFacilitiesManager- Returns:
- list of Vos
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getAssignedFacilities
public List<Facility> getAssignedFacilities(PerunSession sess, Group group) throws PrivilegeException, GroupNotExistsException Description copied from interface:FacilitiesManagerGet facilities which are assigned to Group (via resource).- Specified by:
getAssignedFacilitiesin interfaceFacilitiesManager- Throws:
PrivilegeExceptionGroupNotExistsException
-
getAssignedFacilities
public List<Facility> getAssignedFacilities(PerunSession sess, Member member) throws PrivilegeException, MemberNotExistsException Description copied from interface:FacilitiesManagerGet facilities which have the member access on.- Specified by:
getAssignedFacilitiesin interfaceFacilitiesManager- Throws:
PrivilegeExceptionMemberNotExistsException
-
getAssignedFacilities
public List<Facility> getAssignedFacilities(PerunSession sess, User user) throws PrivilegeException, UserNotExistsException Description copied from interface:FacilitiesManagerGet facilities which have the user access on.- Specified by:
getAssignedFacilitiesin interfaceFacilitiesManager- Throws:
PrivilegeExceptionUserNotExistsException
-
getAssignedFacilities
public List<Facility> getAssignedFacilities(PerunSession sess, Service service) throws PrivilegeException, ServiceNotExistsException Description copied from interface:FacilitiesManagerGet facilities where the service is defined.- Specified by:
getAssignedFacilitiesin interfaceFacilitiesManager- Throws:
PrivilegeExceptionServiceNotExistsException
-
getAssignedResources
public List<Resource> getAssignedResources(PerunSession sess, Facility facility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:FacilitiesManagerReturns all resources assigned to the facility.- Specified by:
getAssignedResourcesin interfaceFacilitiesManager- Returns:
- list of resources assigned to the facility
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getAssignedResourcesByAssignedService
public List<Resource> getAssignedResourcesByAssignedService(PerunSession sess, Facility facility, Service service) throws PrivilegeException, FacilityNotExistsException, ServiceNotExistsException Description copied from interface:FacilitiesManagerReturns resources with specific service assigned to the facility.- Specified by:
getAssignedResourcesByAssignedServicein interfaceFacilitiesManager- Parameters:
sess- perun sessionfacility- facilityservice- specific only those results, which have resource with assigned specific service- Returns:
- list of resources assigned to the facility by specific service
- Throws:
FacilityNotExistsException- if facility does not existServiceNotExistsException- if service does not existPrivilegeException
-
getAssignedRichResources
public List<RichResource> getAssignedRichResources(PerunSession sess, Facility facility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:FacilitiesManagerReturns all rich resources assigned to the facility with VO property filled- Specified by:
getAssignedRichResourcesin interfaceFacilitiesManager- Returns:
- list of rich resources assigned to the facility
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getAssignedRichResources
public List<RichResource> getAssignedRichResources(PerunSession sess, Facility facility, Service service) throws PrivilegeException, FacilityNotExistsException, ServiceNotExistsException Description copied from interface:FacilitiesManagerReturns all rich resources assigned to the facility and service with VO property filled- Specified by:
getAssignedRichResourcesin interfaceFacilitiesManager- Returns:
- list of rich resources assigned to the facility and service
- Throws:
PrivilegeExceptionFacilityNotExistsExceptionServiceNotExistsException
-
getAssignedUsers
public List<User> getAssignedUsers(PerunSession sess, Facility facility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:FacilitiesManagerReturns list of Users, assigned with chosen Facility.- Specified by:
getAssignedUsersin interfaceFacilitiesManager- Returns:
- list of users
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getAssignedUsers
public List<User> getAssignedUsers(PerunSession sess, Facility facility, Service service) throws PrivilegeException, FacilityNotExistsException, ServiceNotExistsException Description copied from interface:FacilitiesManagerReturns list of Users assigned with chosen Facility containing resources where service is assigned.- Specified by:
getAssignedUsersin interfaceFacilitiesManager- Returns:
- list of users
- Throws:
PrivilegeExceptionFacilityNotExistsExceptionServiceNotExistsException
-
getBan
public BanOnFacility getBan(PerunSession sess, int userId, int faclityId) throws BanNotExistsException, PrivilegeException, UserNotExistsException, FacilityNotExistsException Description copied from interface:FacilitiesManagerGet ban by userId and facilityId.- Specified by:
getBanin interfaceFacilitiesManager- Parameters:
userId- the id of userfaclityId- the id of facility- Returns:
- specific ban for user on facility
- Throws:
BanNotExistsExceptionPrivilegeExceptionUserNotExistsExceptionFacilityNotExistsException
-
getBanById
public BanOnFacility getBanById(PerunSession sess, int banId) throws BanNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerGet Ban for user on facility by it's id- Specified by:
getBanByIdin interfaceFacilitiesManager- Parameters:
banId- the id of ban- Returns:
- facility ban by it's id
- Throws:
BanNotExistsExceptionPrivilegeException
-
getBansForFacility
public List<BanOnFacility> getBansForFacility(PerunSession sess, int facilityId) throws PrivilegeException, FacilityNotExistsException Description copied from interface:FacilitiesManagerGet all bans for users on the facility- Specified by:
getBansForFacilityin interfaceFacilitiesManager- Parameters:
facilityId- the id of facility- Returns:
- list of bans for all users on the facility
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getBansForUser
public List<BanOnFacility> getBansForUser(PerunSession sess, int userId) throws UserNotExistsException Description copied from interface:FacilitiesManagerGet all bans for user on any facility.- Specified by:
getBansForUserin interfaceFacilitiesManager- Parameters:
userId- the id of user- Returns:
- list of bans for user on any facility
- Throws:
UserNotExistsException
-
getDirectAdmins
@Deprecated public List<User> getDirectAdmins(PerunSession sess, Facility facility) throws FacilityNotExistsException, PrivilegeException Deprecated.Description copied from interface:FacilitiesManagerGets list of direct user administrators of the Facility. 'Direct' means, there aren't included users, who are members of group administrators, in the returned list.- Specified by:
getDirectAdminsin interfaceFacilitiesManager- Throws:
FacilityNotExistsExceptionPrivilegeException
-
getDirectRichAdminsWithSpecificAttributes
@Deprecated public List<RichUser> getDirectRichAdminsWithSpecificAttributes(PerunSession perunSession, Facility facility, List<String> specificAttributes) throws PrivilegeException, FacilityNotExistsException Deprecated.Description copied from interface:FacilitiesManagerGet list of Facility administrators, which are assigned directly (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:
getDirectRichAdminsWithSpecificAttributesin interfaceFacilitiesManager- Returns:
- list of RichUsers with specific attributes.
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getEnrichedBansForFacility
public List<EnrichedBanOnFacility> getEnrichedBansForFacility(PerunSession sess, int facilityId, List<String> attrNames) throws PrivilegeException, FacilityNotExistsException, AttributeNotExistsException Description copied from interface:FacilitiesManagerGet all enriched bans for users on the facility.- Specified by:
getEnrichedBansForFacilityin interfaceFacilitiesManager- Parameters:
sess-facilityId- id of the facilityattrNames- list of attribute names, returns all user attributes if null or empty- Returns:
- list of enriched bans on facility
- Throws:
PrivilegeExceptionFacilityNotExistsExceptionAttributeNotExistsException
-
getEnrichedBansForUser
public List<EnrichedBanOnFacility> getEnrichedBansForUser(PerunSession sess, int userId, List<String> attrNames) throws PrivilegeException, UserNotExistsException, AttributeNotExistsException Description copied from interface:FacilitiesManagerGet all enriched bans on facility for user.- Specified by:
getEnrichedBansForUserin interfaceFacilitiesManager- Parameters:
sess-userId- id of userattrNames- list of attributes names, returns all user/member attributes if null or empty- Returns:
- list of user's enriched bans on assigned facilities
- Throws:
PrivilegeExceptionUserNotExistsExceptionAttributeNotExistsException
-
getEnrichedFacilities
Description copied from interface:FacilitiesManagerGets all enriched facilities user has access rights to. If User is: - PERUNADMIN : all facilities - FACILITYADMIN : only facilities where user is facility admin - FACILITYOBSERVER: only facilities where user is facility observer- Specified by:
getEnrichedFacilitiesin interfaceFacilitiesManager- Parameters:
sess-- Returns:
- List of all EnrichedFacilities
- Throws:
PrivilegeException- insufficient permissions
-
getEnrichedHosts
public List<EnrichedHost> getEnrichedHosts(PerunSession sess, Facility facility, List<String> attrNames) throws AttributeNotExistsException, FacilityNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerReturn all EnrichedHosts of given facility. That is host with attributes given by attrNames.- Specified by:
getEnrichedHostsin interfaceFacilitiesManager- Parameters:
sess- perun sessionfacility- facilityattrNames- attribute names- Returns:
- list of enriched hosts
- Throws:
AttributeNotExistsException- if some attribute does not existFacilityNotExistsException- if facility does not existPrivilegeException- if user has insufficient permissions
-
getFacilities
Description copied from interface:FacilitiesManagerList facilities by ACCESS RIGHTS: If User is: - PERUNADMIN : all facilities - FACILITYADMIN : only facilities where user is facility admin- Specified by:
getFacilitiesin interfaceFacilitiesManager- Returns:
- List of all Facilities within the Perun
- Throws:
PrivilegeException
-
getFacilitiesByAttribute
public List<Facility> getFacilitiesByAttribute(PerunSession sess, String attributeName, String attributeValue) throws PrivilegeException, AttributeNotExistsException, WrongAttributeAssignmentException Description copied from interface:FacilitiesManagerReturns all facilities that have set the attribute 'attributeName' with the value 'attributeValue'. Searching only def and opt attributes. Large attributes are not supported.- Specified by:
getFacilitiesByAttributein interfaceFacilitiesManager- Parameters:
attributeName- name of the attributeattributeValue- value of the attribute- Returns:
- list of facilities
- Throws:
PrivilegeExceptionAttributeNotExistsExceptionWrongAttributeAssignmentException
-
getFacilitiesByAttributeWithAttributes
public List<FacilityWithAttributes> getFacilitiesByAttributeWithAttributes(PerunSession sess, String searchAttributeName, String searchAttributeValue, List<String> attrNames) throws PrivilegeException, AttributeNotExistsException Description copied from interface:FacilitiesManagerSearches (partially!) for facilities with the attribute 'searchAttributeName' and its value 'searchAttributeValue'. Found Facilities are returned along with attributes listed in 'attrNames'.- Specified by:
getFacilitiesByAttributeWithAttributesin interfaceFacilitiesManager- Parameters:
sess-searchAttributeName- name of the attribute to search bysearchAttributeValue- value to search forattrNames- names of attributes to return with facilities- Returns:
- list of facilities with attributes
- Throws:
PrivilegeExceptionAttributeNotExistsException- when the attribute to search by does not exist
-
getFacilitiesByDestination
public List<Facility> getFacilitiesByDestination(PerunSession sess, String destination) throws FacilityNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerSearches for the Facilities by theirs destination.- Specified by:
getFacilitiesByDestinationin interfaceFacilitiesManager- Returns:
- Facilities with specified name
- Throws:
FacilityNotExistsException- //FIXME proc tato vyjimka?PrivilegeException
-
getFacilitiesByHostName
Description copied from interface:FacilitiesManagerReturn all facilities where exists host with the specific hostname- Specified by:
getFacilitiesByHostNamein interfaceFacilitiesManager- Parameters:
hostname- specific hostname
-
getFacilitiesByIds
public List<Facility> getFacilitiesByIds(PerunSession sess, List<Integer> ids) throws PrivilegeException Description copied from interface:FacilitiesManagerSearches for the Facilities with specified ids.- Specified by:
getFacilitiesByIdsin interfaceFacilitiesManager- Parameters:
sess-ids-- Returns:
- list of Facilities with specified ids
- Throws:
PrivilegeException
-
getFacilitiesCount
Description copied from interface:FacilitiesManagerGet count of all facilities.- Specified by:
getFacilitiesCountin interfaceFacilitiesManager- Returns:
- count of all facilities
-
getFacilitiesManagerBl
Gets the facilitiesManagerBl for this instance.- Returns:
- The facilitiesManagerBl.
-
getFacilitiesManagerImpl
-
getFacilitiesWhereUserIsAdmin
public List<Facility> getFacilitiesWhereUserIsAdmin(PerunSession sess, User user) throws UserNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerGet all facilities where the user is admin. Including facilities, where the user is a VALID member of authorized group.- Specified by:
getFacilitiesWhereUserIsAdminin interfaceFacilitiesManager- Returns:
- list of Facilities, where the user is an admin.
- Throws:
UserNotExistsExceptionPrivilegeException
-
getFacilityById
public Facility getFacilityById(PerunSession sess, int id) throws FacilityNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerSearches for the Facility with specified id.- Specified by:
getFacilityByIdin interfaceFacilitiesManager- Returns:
- Facility with specified id
- Throws:
FacilityNotExistsExceptionPrivilegeException
-
getFacilityByName
public Facility getFacilityByName(PerunSession sess, String name) throws FacilityNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerSearches the Facility by its name.- Specified by:
getFacilityByNamein interfaceFacilitiesManager- Returns:
- Facility with specified name
- Throws:
FacilityNotExistsExceptionPrivilegeException
-
getFacilityForHost
public Facility getFacilityForHost(PerunSession sess, Host host) throws PrivilegeException, HostNotExistsException Description copied from interface:FacilitiesManagerReturn facility which has the host.- Specified by:
getFacilityForHostin interfaceFacilitiesManager- Returns:
- facility
- Throws:
PrivilegeExceptionHostNotExistsException
-
getHostById
public Host getHostById(PerunSession sess, int hostId) throws HostNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerGet the host by its ID.- Specified by:
getHostByIdin interfaceFacilitiesManager- Returns:
- host
- Throws:
HostNotExistsExceptionPrivilegeException
-
getHosts
public List<Host> getHosts(PerunSession sess, Facility facility) throws FacilityNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerList hosts of Facility.- Specified by:
getHostsin interfaceFacilitiesManager- Returns:
- hosts
- Throws:
FacilityNotExistsExceptionPrivilegeException
-
getHostsByHostname
Description copied from interface:FacilitiesManagerGet all hosts with this hostname (from all facilities).Facility Admin get only those which are from his facilities.
- Specified by:
getHostsByHostnamein interfaceFacilitiesManager- Returns:
- list of hosts by hostname
- Throws:
PrivilegeException
-
getHostsCount
public int getHostsCount(PerunSession sess, Facility facility) throws FacilityNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerCount hosts of Facility.- Specified by:
getHostsCountin interfaceFacilitiesManager- Returns:
- the number of hosts present in the facility
- Throws:
FacilityNotExistsExceptionPrivilegeException
-
getOwnerFacilities
public List<Facility> getOwnerFacilities(PerunSession sess, Owner owner) throws OwnerNotExistsException, PrivilegeException Description copied from interface:FacilitiesManagerReturns list of all facilities owned by the owner.- Specified by:
getOwnerFacilitiesin interfaceFacilitiesManager- Returns:
- list of facilities owned by the owner
- Throws:
OwnerNotExistsExceptionPrivilegeException
-
getOwners
@Deprecated public List<Owner> getOwners(PerunSession sess, Facility facility) throws PrivilegeException, FacilityNotExistsException Deprecated.Description copied from interface:FacilitiesManagerReturns owners of the facility.- Specified by:
getOwnersin interfaceFacilitiesManager- Returns:
- owners of specified facility
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getPerunBl
-
getRichAdmins
public List<RichUser> getRichAdmins(PerunSession perunSession, Facility facility, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws UserNotExistsException, PrivilegeException, FacilityNotExistsException Description copied from interface:FacilitiesManagerGets list of all richUser administrators of the Facility. If some group is administrator of the given group, all VALID members are included in the list.Supported roles: FacilityAdmin
If "onlyDirectAdmins" is "true", return only direct users of the group for supported role with specific attributes. If "allUserAttributes" is "true", do not specify attributes through list and return them all in objects richUser . Ignoring list of specific attributes.
- Specified by:
getRichAdminsin interfaceFacilitiesManager- Parameters:
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 facility and supported role with attributes
- Throws:
UserNotExistsExceptionPrivilegeExceptionFacilityNotExistsException
-
getRichAdmins
@Deprecated public List<RichUser> getRichAdmins(PerunSession sess, Facility facility) throws FacilityNotExistsException, PrivilegeException Deprecated.Description copied from interface:FacilitiesManagerGet all Facility admins without attributes.- Specified by:
getRichAdminsin interfaceFacilitiesManager- Returns:
- return list of RichUsers without attributes.
- Throws:
FacilityNotExistsExceptionPrivilegeException
-
getRichAdminsWithAttributes
@Deprecated public List<RichUser> getRichAdminsWithAttributes(PerunSession sess, Facility facility) throws UserNotExistsException, FacilityNotExistsException, PrivilegeException Deprecated.Description copied from interface:FacilitiesManagerGet all Facility admins with attributes.- Specified by:
getRichAdminsWithAttributesin interfaceFacilitiesManager- Returns:
- list of RichUsers who are admins in the facility WITH ATTRIBUTES.
- Throws:
UserNotExistsExceptionFacilityNotExistsExceptionPrivilegeException
-
getRichAdminsWithSpecificAttributes
@Deprecated public List<RichUser> getRichAdminsWithSpecificAttributes(PerunSession perunSession, Facility facility, List<String> specificAttributes) throws PrivilegeException, FacilityNotExistsException Deprecated.Description copied from interface:FacilitiesManagerGet list of Facility 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:
getRichAdminsWithSpecificAttributesin interfaceFacilitiesManager- Returns:
- list of RichUsers with specific attributes.
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getRichFacilities
Description copied from interface:FacilitiesManagerGet all possible rich Facilities with all their owners. For PerunAdmin get All richFacilities. For FacilityAdmin get only richFacilities under his administration.- Specified by:
getRichFacilitiesin interfaceFacilitiesManager- Returns:
- list of RichFacilities with owners
- Throws:
PrivilegeException
-
removeAdmin
public void removeAdmin(PerunSession sess, Facility facility, User user) throws FacilityNotExistsException, UserNotExistsException, PrivilegeException, UserNotAdminException, RoleCannotBeManagedException Description copied from interface:FacilitiesManagerRemoves a user administrator from the Facility.- Specified by:
removeAdminin interfaceFacilitiesManager- Throws:
FacilityNotExistsExceptionUserNotExistsExceptionPrivilegeExceptionUserNotAdminExceptionRoleCannotBeManagedException
-
removeAdmin
public void removeAdmin(PerunSession sess, Facility facility, Group group) throws FacilityNotExistsException, GroupNotExistsException, PrivilegeException, GroupNotAdminException, RoleCannotBeManagedException Description copied from interface:FacilitiesManagerRemoves a group administrator from the Facility.- Specified by:
removeAdminin interfaceFacilitiesManager- Parameters:
group- group that will lose a Facility administrator role- Throws:
FacilityNotExistsExceptionGroupNotExistsExceptionPrivilegeExceptionGroupNotAdminExceptionRoleCannotBeManagedException
-
removeBan
public void removeBan(PerunSession sess, int banId) throws PrivilegeException, BanNotExistsException, FacilityNotExistsException Description copied from interface:FacilitiesManagerRemove existing ban by it's id.- Specified by:
removeBanin interfaceFacilitiesManager- Parameters:
banId- the id of ban- Throws:
PrivilegeExceptionBanNotExistsExceptionFacilityNotExistsException
-
removeBan
public void removeBan(PerunSession sess, int userId, int facilityId) throws BanNotExistsException, PrivilegeException, FacilityNotExistsException Description copied from interface:FacilitiesManagerRemove existing ban by id of user and facility.- Specified by:
removeBanin interfaceFacilitiesManager- Parameters:
userId- the id of userfacilityId- the id of facility- Throws:
BanNotExistsExceptionPrivilegeExceptionFacilityNotExistsException
-
removeHost
public void removeHost(PerunSession sess, Host host) throws HostNotExistsException, PrivilegeException, HostAlreadyRemovedException Description copied from interface:FacilitiesManagerRemove hosts from the Facility.- Specified by:
removeHostin interfaceFacilitiesManager- Throws:
HostAlreadyRemovedException- if there are 0 rows affected by deleting from DBHostNotExistsExceptionPrivilegeException
-
removeHostByHostname
public void removeHostByHostname(PerunSession sess, String hostname) throws HostNotExistsException, HostAlreadyRemovedException, PrivilegeException Description copied from interface:FacilitiesManagerRemove host from the Facility based on hostname. If there is ambiguity, method throws exception and no host is removed.- Specified by:
removeHostByHostnamein interfaceFacilitiesManager- Throws:
HostNotExistsException- if there is ambiguity in host to removeHostAlreadyRemovedException- if there are 0 rows affected by deleting from DBPrivilegeException
-
removeHosts
public void removeHosts(PerunSession sess, List<Host> hosts, Facility facility) throws FacilityNotExistsException, PrivilegeException, HostAlreadyRemovedException Description copied from interface:FacilitiesManagerRemove hosts from the Facility.- Specified by:
removeHostsin interfaceFacilitiesManager- Throws:
HostAlreadyRemovedException- if there is at least 1 host not affected by deleting from DBFacilityNotExistsExceptionPrivilegeException
-
removeOwner
@Deprecated public void removeOwner(PerunSession sess, Facility facility, Owner owner) throws PrivilegeException, OwnerNotExistsException, FacilityNotExistsException, OwnerAlreadyRemovedException Deprecated.Description copied from interface:FacilitiesManagerRemove owner of the facility- Specified by:
removeOwnerin interfaceFacilitiesManager- Throws:
PrivilegeExceptionOwnerNotExistsExceptionFacilityNotExistsExceptionOwnerAlreadyRemovedException
-
removeOwners
@Deprecated public void removeOwners(PerunSession sess, Facility facility, List<Owner> owners) throws PrivilegeException, OwnerNotExistsException, FacilityNotExistsException, OwnerAlreadyRemovedException Deprecated.Description copied from interface:FacilitiesManagerRemove owners of the facility- Specified by:
removeOwnersin interfaceFacilitiesManager- Parameters:
sess- perun sessionfacility- facilityowners- list of owners to be removed- Throws:
PrivilegeException- when the principal does not have sufficient rightsOwnerNotExistsException- when owner does not existFacilityNotExistsException- when facility does not existOwnerAlreadyRemovedException- when owner was already removed from the facility
-
setBan
public BanOnFacility setBan(PerunSession sess, BanOnFacility banOnFacility) throws PrivilegeException, BanAlreadyExistsException, FacilityNotExistsException, UserNotExistsException Description copied from interface:FacilitiesManagerSet ban for user on facility.- Specified by:
setBanin interfaceFacilitiesManager- Parameters:
banOnFacility- the ban- Returns:
- ban on facility
- Throws:
PrivilegeExceptionBanAlreadyExistsExceptionFacilityNotExistsExceptionUserNotExistsException
-
setFacilitiesManagerBl
Sets the facilitiesManagerBl for this instance.- Parameters:
facilitiesManagerBl- The facilitiesManagerBl.
-
setOwners
@Deprecated public void setOwners(PerunSession sess, Facility facility, List<Owner> owners) throws PrivilegeException, FacilityNotExistsException, OwnerNotExistsException Deprecated.Description copied from interface:FacilitiesManagerUpdates owners of facility- Specified by:
setOwnersin interfaceFacilitiesManager- Throws:
PrivilegeExceptionFacilityNotExistsExceptionOwnerNotExistsException
-
setPerunBl
Sets the perunBl.- Parameters:
perunBl- The perunBl.
-
updateBan
public BanOnFacility updateBan(PerunSession sess, BanOnFacility banOnFacility) throws PrivilegeException, FacilityNotExistsException, UserNotExistsException, BanNotExistsException Description copied from interface:FacilitiesManagerUpdate existing ban (description and validation timestamp)- Specified by:
updateBanin interfaceFacilitiesManager- Parameters:
banOnFacility- the existing ban- Returns:
- updated ban
- Throws:
PrivilegeExceptionFacilityNotExistsExceptionUserNotExistsExceptionBanNotExistsException
-
updateFacility
public Facility updateFacility(PerunSession sess, Facility facility) throws FacilityNotExistsException, FacilityExistsException, PrivilegeException, ConsentHubExistsException Description copied from interface:FacilitiesManagerUpdates facility.- Specified by:
updateFacilityin interfaceFacilitiesManager- Parameters:
facility- to update- Returns:
- updated facility
- Throws:
FacilityNotExistsExceptionFacilityExistsExceptionPrivilegeExceptionConsentHubExistsException
-