Interface FacilitiesManagerImplApi
- All Known Implementing Classes:
- FacilitiesManagerImpl
public interface FacilitiesManagerImplApi
Facility manager can create a new facility or find an existing facility.
 
You must get an instance of FacilityManager from PerunSession:
    PerunSession perunSession = ...;
    FacilityManager gm = perunSession.getPerun().getFacilityManager();
 - Author:
- Michal Prochazka, Slavek Licehammer
- 
Method SummaryModifier and TypeMethodDescriptionaddHost(PerunSession perunSession, Host host, Facility facility) Adds host to the Facility.voidaddOwner(PerunSession perunSession, Facility facility, Owner owner) Deprecated.booleanbanExists(PerunSession sess, int banId) Get true if any band defined by id exists for any user and facility.booleanbanExists(PerunSession sess, int userId, int facilityId) Get true if any ban for user and facility exists.voidcheckFacilityExists(PerunSession perunSession, Facility facility) Check if facility exists in underlaying data source.voidcheckHostExists(PerunSession sess, Host host) createFacility(PerunSession perunSession, Facility facility) Inserts facility into DB.voiddeleteFacility(PerunSession perunSession, Facility facility) Deletes facility by id.voiddeleteFacilityOwners(PerunSession perunSession, Facility facility) Deletes all facility owners.booleanfacilityExists(PerunSession perunSession, Facility facility) Check if facility exists in underlaying data source.getAdminGroups(PerunSession sess, Facility facility) Gets list of all group administrators of the Facility.getAdmins(PerunSession sess, Facility facility) Gets list of all user administrators of the Facility.Get all expired bans on any facility to now dategetAllowedFacilities(PerunSession sess, Member member) Return all allowed facilities of the member.getAllowedFacilities(PerunSession sess, User user) Return all allowed facilities of the user.getAllowedMembers(PerunSession sess, Facility facility) Return all members, which are "allowed" on facility through any resource disregarding their possible expired status in a group.getAllowedMembers(PerunSession sess, Facility facility, Service service) Return all members, which are "allowed" on facility through any resource assigned to the given service.getAllowedUsers(PerunSession sess, Facility facility) Return all users, which are "allowed" on facility through any member/resource.getAllowedVos(PerunSession perunSession, Facility facility) Return all VO which can use this facility.getAssignedResources(PerunSession perunSession, Facility facility) Returns all resources assigned to the facility.getAssignedResources(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService) Returns all resources assigned to the facility with optionally VO and Service specified.getAssignedRichResources(PerunSession perunSession, Facility facility) Returns all rich resources assigned to the facility.getAssignedRichResources(PerunSession perunSession, Facility facility, Service service) Returns all rich resources assigned to the facility and service.getAssignedUsers(PerunSession sess, Facility facility) Return all users assigned to Facility.getAssignedUsers(PerunSession sess, Facility facility, Service service) Returns list of Users assigned with chosen Facility containing resources where service is assigned.getAssociatedMembers(PerunSession sess, Facility facility, User user) Return all members, which are associated with the facility and belong to given user.getAssociatedUsers(PerunSession sess, Facility facility) Return all users, which are associated with facility through any member/resource.getBan(PerunSession sess, int userId, int faclityId) Get specific facility ban.getBanById(PerunSession sess, int banId) Get Ban for user on facility by it's idgetBansForFacility(PerunSession sess, int facilityId) Get all users bans for facilitygetBansForUser(PerunSession sess, int userId) Get all facilities bans for user.getDirectAdmins(PerunSession perunSession, Facility facility) Gets list of direct user administrators of the Facility.getFacilities(PerunSession perunSession) List all facilities.getFacilitiesByAttribute(PerunSession sess, Attribute attribute) Returns all facilities which have set the attribute with the value.getFacilitiesByAttributePartialMatch(PerunSession sess, AttributeDefinition attrDef, String value) Partial search for facilities with the attribute 'attrDef' set to a similar value to 'value'getFacilitiesByDestination(PerunSession perunSession, 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 perunSession, List<Integer> ids) Gets facilities by their ids.intgetFacilitiesCount(PerunSession perunSession) Get count of all facilities.getFacilitiesWhereUserIsAdmin(PerunSession sess, User user) Get all facilities where the user is admin.getFacilityById(PerunSession perunSession, int id) Searches for the Facility with specified id.getFacilityByName(PerunSession perunSession, String name) Searches for the Facility by its name.getFacilityForHost(PerunSession sess, Host host) Return facility which has the host.getHostById(PerunSession sess, int id) Get the host by its ID.getHosts(PerunSession perunSession, Facility facility) List hosts from facility.getHostsByHostname(PerunSession sess, String hostname) Get all hosts with this hostname (from all facilities).intgetHostsCount(PerunSession perunSession, Facility facility) Count hosts in the facility.getOwnerFacilities(PerunSession perunSession, Owner owner) Returns list of all facilities owned by the owner.getOwners(PerunSession perunSession, Facility facility) Deprecated.booleanhostExists(PerunSession sess, Host host) voidremoveAllServiceDenials(int facilityId) Remove all service denials on given facility.voidremoveBan(PerunSession sess, int banId) Remove ban by id from facilities bans.voidremoveBan(PerunSession sess, int userId, int facilityId) Remove ban by user_id and facility_id.voidremoveHost(PerunSession perunSession, Host host) Remove hosts from the Facility.voidremoveOwner(PerunSession perunSession, Facility facility, Owner owner) Deprecated.searchForFacilities(PerunSession sess, String searchString, boolean includeIDs) Similarity substring search in all facilities based on name, description and optionally in IDssearchForFacilities(PerunSession sess, String searchString, Set<Integer> facilityIds, boolean includeIDs) Similarity substring search in provided facilities based on name, description and optionally IDsetBan(PerunSession sess, BanOnFacility banOnFacility) Set ban for user on facilityvoidsetOwners(PerunSession perunSession, Facility facility, List<Owner> owners) Deprecated.updateBan(PerunSession sess, BanOnFacility banOnFacility) Update description and validity timestamp of specific ban.updateFacility(PerunSession perunSession, Facility facility) Updates facility in DB.
- 
Method Details- 
addHostAdds host to the Facility.- Parameters:
- perunSession-
- host-
- facility- return host
 
- 
addOwner@Deprecated void addOwner(PerunSession perunSession, Facility facility, Owner owner) throws OwnerAlreadyAssignedException Deprecated.Add owner of the facility- Parameters:
- perunSession-
- facility-
- owner-
- Throws:
- InternalErrorException
- OwnerAlreadyAssignedException
 
- 
banExistsGet true if any ban for user and facility exists.- Parameters:
- sess-
- userId- id of user
- facilityId- id of facility
- Returns:
- true if ban exists
- Throws:
- InternalErrorException
 
- 
banExistsGet true if any band defined by id exists for any user and facility.- Parameters:
- sess-
- banId- id of ban
- Returns:
- true if ban exists
- Throws:
- InternalErrorException
 
- 
checkFacilityExistsvoid checkFacilityExists(PerunSession perunSession, Facility facility) throws FacilityNotExistsException Check if facility exists in underlaying data source.- Parameters:
- perunSession-
- facility-
- Throws:
- InternalErrorException
- FacilityNotExistsException
 
- 
checkHostExists- Throws:
- HostNotExistsException
 
- 
createFacilityInserts facility into DB.- Parameters:
- perunSession-
- facility-
- Throws:
- InternalErrorException
 
- 
deleteFacilityvoid deleteFacility(PerunSession perunSession, Facility facility) throws FacilityAlreadyRemovedException Deletes facility by id.- Parameters:
- perunSession-
- facility-
- Throws:
- InternalErrorException
- FacilityAlreadyRemovedException- if there are 0 rows affected by delete from DB
 
- 
deleteFacilityOwnersDeletes all facility owners.- Parameters:
- perunSession-
- facility-
- Throws:
- InternalErrorException
 
- 
facilityExistsCheck if facility exists in underlaying data source.- Parameters:
- perunSession-
- facility-
- Returns:
- true if facility exists in underlaying data source, false otherwise
- Throws:
- InternalErrorException
 
- 
getAdminGroupsGets list of all group administrators of the Facility.- Parameters:
- sess-
- facility-
- Returns:
- list of groups who are admins in the facility
- Throws:
- InternalErrorException
 
- 
getAdminsGets 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.- Parameters:
- sess-
- facility-
- Returns:
- list of users who are admins in the facility
- Throws:
- InternalErrorException
 
- 
getAllExpiredBansOnFacilitiesGet all expired bans on any facility to now date- Parameters:
- sess-
- Returns:
- list of expired bans for any facility
- Throws:
- InternalErrorException
 
- 
getAllowedFacilitiesReturn all allowed facilities of the user. It means all facilities, where is assigned through some resource and member is allowed on such resource.- Parameters:
- sess-
- user-
- Returns:
- List of allowed facilities of the user.
 
- 
getAllowedFacilitiesReturn all allowed facilities of the member. It means all facilities, where is assigned through some resource and member is allowed.- Parameters:
- sess-
- member-
- Returns:
- List of allowed facilities of the member.
 
- 
getAllowedMembersReturn all members, which are "allowed" on facility through any resource disregarding their possible expired status in a group. All members include all group statuses, through which they can be filtered if necessary.- Parameters:
- sess-
- facility-
- Returns:
- list of allowed members
- Throws:
- InternalErrorException
 
- 
getAllowedMembersReturn all members, which are "allowed" on facility through any resource assigned to the given service. Service settings decide whether expired group and expired VO members are returned as well. Disabled and invalid VO members are always ignored.- Parameters:
- sess-
- facility-
- service-
- Returns:
- list of allowed members
 
- 
getAllowedUsersReturn all users, which are "allowed" on facility through any member/resource.- Parameters:
- sess-
- facility-
- Returns:
- list of allowed users
 
- 
getAllowedVosReturn all VO which can use this facility. (VO must have the resource which belongs to this facility).- Parameters:
- perunSession-
- facility-
- Returns:
- list of Vos
- Throws:
- InternalErrorException
 
- 
getAssignedResourcesReturns all resources assigned to the facility.- Parameters:
- perunSession-
- facility-
- Returns:
- list of resources assigned to the facility
- Throws:
- InternalErrorException
 
- 
getAssignedResourcesList<Resource> getAssignedResources(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService) Returns all resources assigned to the facility with optionally VO and Service specified.- Parameters:
- perunSession-
- facility-
- specificVo-
- specificService-
- Returns:
- list of resources assigned to the facility with optionally filter for VO and Service.
- Throws:
- InternalErrorException
 
- 
getAssignedRichResourcesReturns all rich resources assigned to the facility.- Parameters:
- perunSession-
- facility-
- Returns:
- list of rich resources assigned to the facility
- Throws:
- InternalErrorException
 
- 
getAssignedRichResourcesList<RichResource> getAssignedRichResources(PerunSession perunSession, Facility facility, Service service) Returns all rich resources assigned to the facility and service.- Parameters:
- perunSession-
- facility-
- service-
- Returns:
- list of rich resources assigned to the facility and service
- Throws:
- InternalErrorException
 
- 
getAssignedUsersReturn all users assigned to Facility.- Parameters:
- sess-
- facility-
- Returns:
- list of user
- Throws:
- InternalErrorException
 
- 
getAssignedUsersReturns list of Users assigned with chosen Facility containing resources where service is assigned.- Parameters:
- sess-
- facility-
- service-
- Returns:
- list of Users
- Throws:
- InternalErrorException
 
- 
getAssociatedMembersReturn all members, which are associated with the facility and belong to given user. Does not require ACTIVE group-resource status or any specific member status.- Parameters:
- sess-
- facility-
- user-
- Returns:
- list of associated members
- Throws:
- InternalErrorException
 
- 
getAssociatedUsersReturn all users, which are associated with facility through any member/resource. Does not require ACTIVE group-resource status.- Parameters:
- sess-
- facility-
- Returns:
- list of allowed users
 
- 
getBanGet specific facility ban.- Parameters:
- sess-
- userId- the user id
- faclityId- the facility id
- Returns:
- specific facility ban
- Throws:
- InternalErrorException
- BanNotExistsException
 
- 
getBanByIdGet Ban for user on facility by it's id- Parameters:
- sess-
- banId- the ban id
- Returns:
- facility ban by it's id
- Throws:
- InternalErrorException
- BanNotExistsException
 
- 
getBansForFacilityGet all users bans for facility- Parameters:
- sess-
- facilityId- the facility id
- Returns:
- list of all users bans on facility
- Throws:
- InternalErrorException
 
- 
getBansForUserGet all facilities bans for user.- Parameters:
- sess-
- userId- the user id
- Returns:
- list of bans for user on any facility
- Throws:
- InternalErrorException
 
- 
getDirectAdminsGets 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.- Parameters:
- perunSession-
- facility-
- Throws:
- InternalErrorException
 
- 
getFacilitiesList all facilities.- Parameters:
- perunSession-
- Returns:
- List of all Facilities within the Perun
- Throws:
- InternalErrorException
 
- 
getFacilitiesByAttributeReturns all facilities which have set the attribute with the value. Searching only def and opt attributes.- Parameters:
- sess-
- attribute-
- Returns:
- Throws:
- InternalErrorException
 
- 
getFacilitiesByAttributePartialMatchList<Facility> getFacilitiesByAttributePartialMatch(PerunSession sess, AttributeDefinition attrDef, String value) Partial search for facilities with the attribute 'attrDef' set to a similar value to 'value'- Parameters:
- sess-
- attrDef-
- Returns:
- Throws:
- InternalErrorException
 
- 
getFacilitiesByDestinationList<Facility> getFacilitiesByDestination(PerunSession perunSession, String destination) throws FacilityNotExistsException Searches for the Facilities by theirs destination.- Parameters:
- perunSession-
- destination-
- Returns:
- Facility with specified name
- Throws:
- FacilityNotExistsException
- InternalErrorException
 
- 
getFacilitiesByHostNameReturn all facilities where exists host with the specific hostname- Parameters:
- sess-
- hostname- specific hostname
- Returns:
- Throws:
- InternalErrorException
 
- 
getFacilitiesByIdsGets facilities by their ids. Silently skips non-existing facilities.- Parameters:
- perunSession-
- ids-
- Returns:
- list of facilities with specified ids
- Throws:
- InternalErrorException
 
- 
getFacilitiesCountGet count of all facilities.- Parameters:
- perunSession-
- Returns:
- count of all facilities
- Throws:
- InternalErrorException
 
- 
getFacilitiesWhereUserIsAdminGet all facilities where the user is admin. Including facilities, where the user is a VALID member of authorized group.- Parameters:
- sess-
- user-
- Returns:
- list of facilities
- Throws:
- InternalErrorException
 
- 
getFacilityByIdSearches for the Facility with specified id.- Parameters:
- perunSession-
- id-
- Returns:
- Facility with specified id
- Throws:
- FacilityNotExistsException
- InternalErrorException
 
- 
getFacilityByNameFacility getFacilityByName(PerunSession perunSession, String name) throws FacilityNotExistsException Searches for the Facility by its name.- Parameters:
- perunSession-
- name-
- Returns:
- Facility with specified name
- Throws:
- FacilityNotExistsException
- InternalErrorException
 
- 
getFacilityForHostReturn facility which has the host.- Parameters:
- sess-
- host-
- Returns:
- facility
- Throws:
- InternalErrorException
 
- 
getHostByIdGet the host by its ID.- Parameters:
- sess-
- id-
- Returns:
- host
- Throws:
- HostNotExistsException
- InternalErrorException
 
- 
getHostsList hosts from facility.- Parameters:
- perunSession-
- facility-
- Returns:
- hosts Hosts' id from the Cluster
- Throws:
- InternalErrorException
 
- 
getHostsByHostnameGet all hosts with this hostname (from all facilities).- Parameters:
- sess-
- hostname-
- Returns:
- list of hosts by hostname
- Throws:
- InternalErrorException
 
- 
getHostsCountCount hosts in the facility.- Parameters:
- perunSession-
- facility-
- Returns:
- int The number of hosts present in the Cluster.
- Throws:
- InternalErrorException
 
- 
getOwnerFacilitiesReturns list of all facilities owned by the owner.- Parameters:
- perunSession-
- owner-
- Returns:
- list of facilities owned by the owner
- Throws:
- InternalErrorException
 
- 
getOwnersDeprecated.Returns owners of the facility.- Parameters:
- perunSession-
- facility-
- Returns:
- owners of specified facility
- Throws:
- InternalErrorException
 
- 
hostExists
- 
removeAllServiceDenialsvoid removeAllServiceDenials(int facilityId) Remove all service denials on given facility.WARNING: this method should be removed in the future if the tasks module is merged into core module. - Parameters:
- facilityId- facility id
- Throws:
- InternalErrorException- when db operation fails
 
- 
removeBanRemove ban by id from facilities bans.- Parameters:
- sess-
- banId- id of specific ban
- Throws:
- InternalErrorException
- BanNotExistsException
 
- 
removeBanRemove ban by user_id and facility_id.- Parameters:
- sess-
- userId- the id of user
- facilityId- the id of facility
- Throws:
- InternalErrorException
- BanNotExistsException
 
- 
removeHostRemove hosts from the Facility.- Parameters:
- perunSession-
- host-
- Throws:
- InternalErrorException
- HostAlreadyRemovedException- if 0 rows affected by deleting from DB
 
- 
removeOwner@Deprecated void removeOwner(PerunSession perunSession, Facility facility, Owner owner) throws OwnerAlreadyRemovedException Deprecated.Remove owner of the facility- Parameters:
- perunSession-
- facility-
- owner-
- Throws:
- InternalErrorException
- OwnerAlreadyRemovedException
 
- 
searchForFacilitiesSimilarity substring search in all facilities based on name, description and optionally in IDs- Parameters:
- sess- session
- searchString- string to search for
- includeIDs- whether to search in IDs as well, used for PERUNADMINs
- Returns:
- list of matched facilities
 
- 
searchForFacilitiesList<Facility> searchForFacilities(PerunSession sess, String searchString, Set<Integer> facilityIds, boolean includeIDs) Similarity substring search in provided facilities based on name, description and optionally ID- Parameters:
- sess- session
- searchString- string to search for
- facilityIds- IDs of facilities to perform the search in
- includeIDs- whether to search in IDs as well, used for PERUNADMINs
- Returns:
- list of matched facilities
 
- 
setBanSet ban for user on facility- Parameters:
- sess-
- banOnFacility- the ban
- Returns:
- ban on facility
- Throws:
- InternalErrorException
 
- 
setOwnersDeprecated.Updates owners of facility- Parameters:
- perunSession-
- facility-
- owners-
- Throws:
- InternalErrorException
 
- 
updateBanUpdate description and validity timestamp of specific ban.- Parameters:
- sess-
- banOnFacility- ban to be updated
- Returns:
- updated ban
- Throws:
- InternalErrorException
 
- 
updateFacilityFacility updateFacility(PerunSession perunSession, Facility facility) throws FacilityExistsException Updates facility in DB.- Parameters:
- perunSession-
- facility-
- Throws:
- InternalErrorException
- FacilityExistsException- if the name of facility has been already used for different Facility
 
 
-