Package cz.metacentrum.perun.core.bl
Interface FacilitiesManagerBl
- All Known Implementing Classes:
FacilitiesManagerBlImpl
public interface FacilitiesManagerBl
Facility manager can create a new facility or find an existing facility.
- Author:
- Michal Prochazka, Slavek Licehammer
-
Method Summary
Modifier and TypeMethodDescriptionaddHost
(PerunSession perunSession, 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) Create hosts in Perun and add them to the Facility 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. void
addOwner
(PerunSession perunSession, Facility facility, Owner owner) Add owner of the facilityvoid
assignSecurityTeam
(PerunSession sess, Facility facility, SecurityTeam securityTeam) Assign given security team to given facility (means the facility trusts the security team)boolean
banExists
(PerunSession sess, int banId) Get true if any band defined by id exists for any user and facility.boolean
banExists
(PerunSession sess, int userId, int facilityId) Get true if any ban for user and facility exists.void
checkBanExists
(PerunSession sess, int banId) Check if ban already exists.void
checkBanExists
(PerunSession sess, int userId, int facilityId) Check if ban already exists.void
checkFacilityExists
(PerunSession sess, Facility facility) void
checkHostExists
(PerunSession sess, Host host) void
checkSecurityTeamAssigned
(PerunSession sess, Facility facility, SecurityTeam securityTeam) Check if security team is assigned to facility.void
checkSecurityTeamNotAssigned
(PerunSession sess, Facility facility, SecurityTeam securityTeam) Check if security team is not assigned to facility.void
copyAttributes
(PerunSession sess, Facility sourceFacility, Facility destinationFacility) Copy all attributes of the source facility to the destination facility.void
copyManagers
(PerunSession sess, Facility sourceFacility, Facility destinationFacility) Copy all managers(admins) of the source facility to the destination facility.void
copyOwners
(PerunSession sess, Facility sourceFacility, Facility destinationFacility) Copy all owners of the source facility to the destination facility.createFacility
(PerunSession perunSession, Facility facility) Store the facility.void
deleteFacility
(PerunSession perunSession, 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.Get all expired bans on any facility to now dategetAllowedFacilities
(PerunSession sess, Member member) Get facilities where member is allowed.getAllowedFacilities
(PerunSession sess, User user) Get facilities where the user is allowed.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)getAllowedMembers
(PerunSession sess, Facility facility) Return all members, which are "allowed" on facility.getAllowedMembers
(PerunSession sess, Facility facility, Service service) Return all members, which are "allowed" on facility through any resource assigned to the given service.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 You can specify VO or Service you are interested in to filter resulting users (they must be members of VO and from Resource with assigned Service).getAllowedUsersNotExpiredInGroups
(PerunSession sess, Facility facility, Vo specificVo, Service specificService) Return all users who can use this facility and who are not expired in any of groups associated with any resource You can specify VO or Service you are interested in to filter resulting users (they must be members of VO and from Resource with assigned Service).getAllowedVos
(PerunSession perunSession, 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, SecurityTeam securityTeam) Get facilities where the security team is assignedgetAssignedFacilities
(PerunSession sess, Service service) Get facilities where the services is defined.getAssignedFacilities
(PerunSession sess, User user) Get facilities where the user is assigned.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 specifiedgetAssignedRichResources
(PerunSession perunSession, Facility facility) Returns all rich resources assigned to the facility with VO property filledgetAssignedRichResources
(PerunSession perunSession, Facility facility, Service service) Returns all rich resources assigned to the facility and service with VO property filledgetAssignedSecurityTeams
(PerunSession sess, Facility facility) Return all security teams which specific facility trustsgetAssignedUsers
(PerunSession sess, Facility facility) Returns list of Users assigned to chosen 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) Deprecated.getDirectRichAdmins
(PerunSession sess, Facility facility) Deprecated.getDirectRichAdminsWithSpecificAttributes
(PerunSession perunSession, Facility facility, List<String> specificAttributes) Deprecated.getEnrichedBansForFacility
(PerunSession sess, Facility facility, List<String> attrNames) Get all enriched bans for members on the resource with user and member attributesgetEnrichedBansForUser
(PerunSession sess, User user, List<String> attrNames) Get enriched bans for user on all resources where user is assigned with user and member attributesgetEnrichedFacilities
(PerunSession perunSession) Gets all enriched facilities.getFacilities
(PerunSession perunSession) List all facilities.getFacilitiesByAttribute
(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!) for facilities with the attribute 'searchAttributeName' and its value 'searchAttributeValue'.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) Searches for the Facilities with specified ids.getFacilitiesByPerunBean
(PerunSession sess, Group group) Returns list of facilities connected with a groupgetFacilitiesByPerunBean
(PerunSession sess, Host host) Returns list of facilities connected with a hostgetFacilitiesByPerunBean
(PerunSession sess, Member member) Returns list of facilities connected with a membergetFacilitiesByPerunBean
(PerunSession sess, Resource resource) Returns list of facilities connected with a resourcegetFacilitiesByPerunBean
(PerunSession sess, User user) Returns list of facilities connected with a usergetFacilitiesByPerunBean
(PerunSession sess, Vo vo) Returns list of facilities connected with a voint
getFacilitiesCount
(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 sess, Facility facility) List hosts of Facility.getHostsByHostname
(PerunSession sess, String hostname) Get all hosts with this hostname (from all facilities).int
getHostsCount
(PerunSession sess, 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) Returns owners of the facility.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.getRichFacilities
(PerunSession perunSession) Get all rich Facilities with all their owners.getRichFacilities
(PerunSession perunSession, List<Facility> facilities) Get all RichFacilities with all their owners from list of Facilities.void
Remove all expired bans on facilities to now date.void
removeBan
(PerunSession sess, int banId) Remove ban by id from facilities bans.void
removeBan
(PerunSession sess, int userId, int facilityId) Remove ban by user_id and facility_id.void
removeHost
(PerunSession perunSession, Host host, Facility facility) Remove hosts from the Facility.void
removeHosts
(PerunSession sess, List<Host> hosts, Facility facility) Remove hosts from the Facility.void
removeOwner
(PerunSession perunSession, Facility facility, Owner owner) Remove owner of the facilityvoid
removeSecurityTeam
(PerunSession sess, Facility facility, SecurityTeam securityTeam) Remove (Unassign) given security team from given facilitysetBan
(PerunSession sess, BanOnFacility banOnFacility) Set ban for user on facilityvoid
setOwners
(PerunSession perunSession, Facility facility, List<Owner> owners) Deprecated.Use addOwner and removeOwner insteadupdateBan
(PerunSession sess, BanOnFacility banOnFacility) Update description and validity timestamp of specific ban.updateFacility
(PerunSession perunSession, Facility facility) Updates facility.
-
Method Details
-
addHost
Adds host to the Facility.- Parameters:
perunSession
-host
-facility
- return host
-
addHosts
List<Host> addHosts(PerunSession sess, List<Host> hosts, Facility facility) throws HostExistsException Create hosts in Perun and add them to the Facility 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. - Parameters:
sess
-hosts
- ID of any host doesn't need to be filled. Hosts will be created.facility
-- Returns:
- Hosts with ID's set.
- Throws:
HostExistsException
-
addHosts
List<Host> addHosts(PerunSession sess, Facility facility, List<String> hosts) throws HostExistsException, WrongPatternException Create hosts in Perun and add them to the Facility. 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].- Parameters:
sess
-facility
-hosts
- list of strings with names of hosts, the name can by generative- Returns:
- Hosts with ID's set.
- Throws:
HostExistsException
WrongPatternException
- when syntax of any of the hostnames is wrong
-
addOwner
void addOwner(PerunSession perunSession, Facility facility, Owner owner) throws OwnerAlreadyAssignedException Add owner of the facility- Parameters:
perunSession
-facility
-owner
-- Throws:
InternalErrorException
OwnerAlreadyAssignedException
-
assignSecurityTeam
Assign given security team to given facility (means the facility trusts the security team)- Parameters:
sess
-facility
-securityTeam
-- Throws:
InternalErrorException
-
banExists
Get true if any ban for user and facility exists.- Parameters:
sess
-userId
- id of userfacilityId
- id of facility- Returns:
- true if ban exists
- Throws:
InternalErrorException
-
banExists
Get 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
-
checkBanExists
Check if ban already exists.Throw exception if no.
- Parameters:
sess
-userId
- user idfacilityId
- facility id- Throws:
InternalErrorException
BanNotExistsException
-
checkBanExists
Check if ban already exists.Throw exception if no.
- Parameters:
sess
-banId
- ban id- Throws:
InternalErrorException
BanNotExistsException
-
checkFacilityExists
- Throws:
FacilityNotExistsException
-
checkHostExists
- Throws:
HostNotExistsException
-
checkSecurityTeamAssigned
void checkSecurityTeamAssigned(PerunSession sess, Facility facility, SecurityTeam securityTeam) throws SecurityTeamNotAssignedException Check if security team is assigned to facility. Throw exception info not.- Parameters:
sess
-facility
-securityTeam
-- Throws:
InternalErrorException
SecurityTeamNotAssignedException
-
checkSecurityTeamNotAssigned
void checkSecurityTeamNotAssigned(PerunSession sess, Facility facility, SecurityTeam securityTeam) throws SecurityTeamAlreadyAssignedException Check if security team is not assigned to facility. Throw exception info is.- Parameters:
sess
-facility
-securityTeam
-- Throws:
InternalErrorException
SecurityTeamAlreadyAssignedException
-
copyAttributes
void copyAttributes(PerunSession sess, Facility sourceFacility, Facility destinationFacility) throws WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException Copy 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.- Parameters:
sess
-sourceFacility
-destinationFacility
-- Throws:
InternalErrorException
WrongAttributeAssignmentException
- if there is no facility attributeWrongAttributeValueException
- if the attribute value is illegalWrongReferenceAttributeValueException
- if the attribute value is illegal
-
copyManagers
Copy 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.- Parameters:
sess
-sourceFacility
-destinationFacility
-- Throws:
InternalErrorException
-
copyOwners
Copy 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.- Parameters:
sourceFacility
-destinationFacility
-- Throws:
InternalErrorException
-
createFacility
Facility createFacility(PerunSession perunSession, Facility facility) throws FacilityExistsException, ConsentHubExistsException Store the facility.- Parameters:
perunSession
-facility
-- Returns:
- Throws:
InternalErrorException
FacilityExistsException
ConsentHubExistsException
-
deleteFacility
void deleteFacility(PerunSession perunSession, Facility facility, Boolean force) throws RelationExistsException, FacilityAlreadyRemovedException, HostAlreadyRemovedException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException Delete the facility by id.- Parameters:
perunSession
-facility
-force
-- Throws:
InternalErrorException
RelationExistsException
- there are still some resources assigned to this facilityFacilityAlreadyRemovedException
- there are 0 rows affected by delete from DBHostAlreadyRemovedException
- if there is at least 1 host who was not affected by deleting from DBResourceAlreadyRemovedException
- if there are at least 1 resource not affected by deleting from DBGroupAlreadyRemovedFromResourceException
- there are at least 1 group on resource not affected by deleting from DB
-
getAdminGroups
Gets list of all group administrators of the Facility.- Parameters:
sess
-facility
-- Returns:
- list of Groups that are admins in the facility
- Throws:
InternalErrorException
-
getAdmins
Gets 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
- Parameters:
perunSession
-facility
-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:
InternalErrorException
-
getAdmins
Deprecated.Gets list of all user administrators of the Facility. If some group is administrator of the given group, all members are included in the list.- Parameters:
sess
-facility
-- Returns:
- list of Users who are admins in the facility
- Throws:
InternalErrorException
-
getAllExpiredBansOnFacilities
Get all expired bans on any facility to now date- Parameters:
sess
-- Returns:
- list of expired bans for any facility
- Throws:
InternalErrorException
-
getAllowedFacilities
Get facilities where the user is allowed.- Parameters:
sess
-user
-- Returns:
- List of allowed facilities of the user.
-
getAllowedFacilities
Get facilities where member is allowed.- Parameters:
sess
-member
-- Returns:
- List of allowed facilities of the member.
-
getAllowedGroups
List<Group> 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)- Parameters:
perunSession
-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:
InternalErrorException
-
getAllowedMembers
Return all members, which are "allowed" on facility.- Parameters:
sess
-facility
-- Returns:
- list of allowed members
- Throws:
InternalErrorException
-
getAllowedMembers
Return 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
-
getAllowedRichGroupsWithAttributes
List<RichGroup> 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.- 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:
InternalErrorException
- when implementation fails
-
getAllowedUsers
Return all users who can use this facility- Parameters:
sess
-facility
-- Returns:
- list of users
-
getAllowedUsers
List<User> getAllowedUsers(PerunSession sess, Facility facility, Vo specificVo, Service specificService) Return all users who can use this facility You can specify VO or Service you are interested in to filter resulting users (they must be members of VO and from Resource with assigned Service). if specificVo, specificService or both are null, they do not specific (all possible results are returned)- Parameters:
sess
-facility
-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:
InternalErrorException
-
getAllowedUsersNotExpiredInGroups
List<User> getAllowedUsersNotExpiredInGroups(PerunSession sess, Facility facility, Vo specificVo, Service specificService) Return all users who can use this facility and who are not expired in any of groups associated with any resource You can specify VO or Service you are interested in to filter resulting users (they must be members of VO and from Resource with assigned Service). if specificVo, specificService or both are null, they do not specific (all possible results are returned)- Parameters:
sess
-facility
-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:
InternalErrorException
-
getAllowedVos
Return 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
-
getAssignedFacilities
Get facilities which are assigned to Group (via resource).- Parameters:
sess
-group
-- Returns:
- Throws:
InternalErrorException
-
getAssignedFacilities
Get facilities which have the member access on.- Parameters:
sess
-member
-- Returns:
- Throws:
InternalErrorException
-
getAssignedFacilities
Get facilities where the user is assigned.- Parameters:
sess
-user
-- Returns:
- Throws:
InternalErrorException
-
getAssignedFacilities
Get facilities where the services is defined.- Parameters:
sess
-service
-- Returns:
- Throws:
InternalErrorException
-
getAssignedFacilities
Get facilities where the security team is assigned- Parameters:
sess
-securityTeam
-- Returns:
- Throws:
InternalErrorException
-
getAssignedResources
Returns all resources assigned to the facility.- Parameters:
perunSession
-facility
-- Returns:
- list of resources assigned to the facility
- Throws:
InternalErrorException
-
getAssignedResources
List<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
- Throws:
InternalErrorException
-
getAssignedRichResources
Returns all rich resources assigned to the facility with VO property filled- Parameters:
perunSession
-facility
-- Returns:
- list of resources assigned to the facility
- Throws:
InternalErrorException
-
getAssignedRichResources
List<RichResource> getAssignedRichResources(PerunSession perunSession, Facility facility, Service service) Returns all rich resources assigned to the facility and service with VO property filled- Parameters:
perunSession
-facility
-service
-- Returns:
- list of resources assigned to the facility and service
- Throws:
InternalErrorException
-
getAssignedSecurityTeams
Return all security teams which specific facility trusts- Parameters:
sess
-facility
- specific facility- Returns:
- list of assigned security teams
- Throws:
InternalErrorException
-
getAssignedUsers
Returns list of Users assigned to chosen Facility.- Parameters:
sess
-facility
-- Returns:
- list of Users
- Throws:
InternalErrorException
-
getAssignedUsers
Returns list of Users assigned with chosen Facility containing resources where service is assigned.- Parameters:
sess
-facility
-service
-- Returns:
- list of Users
- Throws:
InternalErrorException
-
getAssociatedMembers
Return 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
-
getAssociatedUsers
Return all users, which are associated with facility through any member/resource. Does not require ACTIVE group-resource status.- Parameters:
sess
-facility
-- Returns:
- list of associated users
-
getBan
Get specific facility ban.- Parameters:
sess
-userId
- the user idfaclityId
- the facility id- Returns:
- specific facility ban
- Throws:
InternalErrorException
BanNotExistsException
-
getBanById
Get 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
-
getBansForFacility
Get all users bans for facility- Parameters:
sess
-facilityId
- the facility id- Returns:
- list of all users bans on facility
- Throws:
InternalErrorException
-
getBansForUser
Get all facilities bans for user.- Parameters:
sess
-userId
- the user id- Returns:
- list of bans for user on any facility
- Throws:
InternalErrorException
-
getDirectAdmins
Deprecated.Gets 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
-
getDirectRichAdmins
Deprecated.Get all Facility admins, which are assigned directly (not by group membership) without attributes.- Parameters:
sess
-facility
-- Returns:
- return list of RichUsers without attributes.
- Throws:
InternalErrorException
-
getDirectRichAdminsWithSpecificAttributes
@Deprecated List<RichUser> getDirectRichAdminsWithSpecificAttributes(PerunSession perunSession, Facility facility, List<String> specificAttributes) Deprecated.Get 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)- Parameters:
perunSession
-facility
-specificAttributes
-- Returns:
- list of RichUsers with specific attributes.
- Throws:
InternalErrorException
-
getEnrichedBansForFacility
List<EnrichedBanOnFacility> getEnrichedBansForFacility(PerunSession sess, Facility facility, List<String> attrNames) throws AttributeNotExistsException Get all enriched bans for members on the resource with user and member attributes- Parameters:
sess
-facility
- facilityattrNames
- names of attributes- Returns:
- list of all enriched bans on facility
- Throws:
AttributeNotExistsException
-
getEnrichedBansForUser
List<EnrichedBanOnFacility> getEnrichedBansForUser(PerunSession sess, User user, List<String> attrNames) throws AttributeNotExistsException Get enriched bans for user on all resources where user is assigned with user and member attributes- Parameters:
sess
-user
- userattrNames
- names of attributes- Returns:
- list of all user's bans on facility
- Throws:
AttributeNotExistsException
-
getEnrichedFacilities
Gets all enriched facilities.- Parameters:
perunSession
-- Returns:
- List of all EnrichedFacilities
- Throws:
InternalErrorException
-
getFacilities
List all facilities.- Parameters:
perunSession
-- Returns:
- List of all Facilities within the Perun
- Throws:
InternalErrorException
-
getFacilitiesByAttribute
List<Facility> getFacilitiesByAttribute(PerunSession sess, String attributeName, String attributeValue) throws WrongAttributeAssignmentException Returns all facilities that have set the attribute 'attributeName' with the value 'attributeValue'. Searching only def and opt attributes. Large attributes are not supported.- Parameters:
sess
- perun sessionattributeName
- attribute name to be searched byattributeValue
- attribute value to be searched by- Returns:
- Throws:
InternalErrorException
WrongAttributeAssignmentException
-
getFacilitiesByAttributeWithAttributes
List<FacilityWithAttributes> getFacilitiesByAttributeWithAttributes(PerunSession sess, String searchAttributeName, String searchAttributeValue, List<String> attrNames) throws AttributeNotExistsException Searches (partially!) for facilities with the attribute 'searchAttributeName' and its value 'searchAttributeValue'. Found Facilities are returned along with attributes listed in 'attrNames'.- 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:
AttributeNotExistsException
- when the attribute to search by does not exist
-
getFacilitiesByDestination
List<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
-
getFacilitiesByHostName
Return all facilities where exists host with the specific hostname- Parameters:
sess
-hostname
- specific hostname- Returns:
- Throws:
InternalErrorException
-
getFacilitiesByIds
Searches for the Facilities with specified ids.- Parameters:
perunSession
-ids
-- Returns:
- list of Facilities with specified ids
- Throws:
InternalErrorException
-
getFacilitiesByPerunBean
Returns list of facilities connected with a group- Parameters:
sess
-group
-- Returns:
- list of facilities connected with group
- Throws:
InternalErrorException
-
getFacilitiesByPerunBean
Returns list of facilities connected with a member- Parameters:
sess
-member
-- Returns:
- list of facilities connected with member
- Throws:
InternalErrorException
-
getFacilitiesByPerunBean
Returns list of facilities connected with a resource- Parameters:
sess
-resource
-- Returns:
- list of facilities connected with resource
- Throws:
InternalErrorException
-
getFacilitiesByPerunBean
Returns list of facilities connected with a user- Parameters:
sess
-user
-- Returns:
- list of facilities connected with user
- Throws:
InternalErrorException
-
getFacilitiesByPerunBean
Returns list of facilities connected with a host- Parameters:
sess
-host
-- Returns:
- list of facilities connected with host
- Throws:
InternalErrorException
-
getFacilitiesByPerunBean
Returns list of facilities connected with a vo- Parameters:
sess
-vo
-- Returns:
- list of facilities connected with vo
- Throws:
InternalErrorException
-
getFacilitiesCount
Get count of all facilities.- Parameters:
perunSession
-- Returns:
- count of all facilities
- Throws:
InternalErrorException
-
getFacilitiesWhereUserIsAdmin
Get 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, where the user is an admin.
- Throws:
InternalErrorException
-
getFacilityById
Searches for the Facility with specified id.- Parameters:
perunSession
-id
-- Returns:
- Facility with specified id
- Throws:
InternalErrorException
FacilityNotExistsException
-
getFacilityByName
Facility getFacilityByName(PerunSession perunSession, String name) throws FacilityNotExistsException Searches for the Facility by its name.- Parameters:
perunSession
-name
-- Returns:
- Facility with specified name
- Throws:
InternalErrorException
FacilityNotExistsException
-
getFacilityForHost
Return facility which has the host.- Parameters:
sess
-host
-- Returns:
- facility
- Throws:
InternalErrorException
-
getHostById
Get the host by its ID.- Parameters:
sess
-id
-- Returns:
- host
- Throws:
HostNotExistsException
InternalErrorException
-
getHosts
List hosts of Facility.- Parameters:
sess
-facility
-- Returns:
- hosts
- Throws:
InternalErrorException
-
getHostsByHostname
Get all hosts with this hostname (from all facilities).- Parameters:
sess
-hostname
-- Returns:
- list of hosts by hostname
- Throws:
InternalErrorException
-
getHostsCount
Count hosts in the facility.- Parameters:
sess
-facility
-- Returns:
- the number of hosts present in the Cluster.
- Throws:
InternalErrorException
-
getOwnerFacilities
Returns list of all facilities owned by the owner.- Parameters:
perunSession
-owner
-- Returns:
- list of facilities owned by the owner
- Throws:
InternalErrorException
-
getOwners
Returns owners of the facility.- Parameters:
perunSession
-facility
-- Returns:
- owners of specified facility
- Throws:
InternalErrorException
-
getRichAdmins
List<RichUser> getRichAdmins(PerunSession perunSession, Facility facility, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws UserNotExistsException Gets 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.
- Parameters:
perunSession
-facility
-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:
InternalErrorException
UserNotExistsException
-
getRichAdmins
Deprecated.Get all Facility admins without attributes.- Parameters:
sess
-facility
-- Returns:
- return list of RichUsers without attributes.
- Throws:
InternalErrorException
-
getRichAdminsWithAttributes
@Deprecated List<RichUser> getRichAdminsWithAttributes(PerunSession sess, Facility facility) throws UserNotExistsException Deprecated.Get all Facility admins with attributes.- Parameters:
sess
-facility
-- Returns:
- list of Rich Users who are admins in the facility WITH ATTRIBUTES
- Throws:
InternalErrorException
UserNotExistsException
-
getRichAdminsWithSpecificAttributes
@Deprecated List<RichUser> getRichAdminsWithSpecificAttributes(PerunSession perunSession, Facility facility, List<String> specificAttributes) Deprecated.Get 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)- Parameters:
perunSession
-facility
-specificAttributes
-- Returns:
- list of RichUsers with specific attributes.
- Throws:
InternalErrorException
-
getRichFacilities
Get all rich Facilities with all their owners.- Parameters:
perunSession
-- Returns:
- list of RichFacilities with owners
- Throws:
InternalErrorException
-
getRichFacilities
Get all RichFacilities with all their owners from list of Facilities.- Parameters:
perunSession
-facilities
- list of facilities- Returns:
- list of RichFacilities with owners
- Throws:
InternalErrorException
-
removeAllExpiredBansOnFacilities
Remove all expired bans on facilities to now date.Get all expired bans and remove them one by one with auditing process. This method is for purpose of removing expired bans using some cron tool.
- Parameters:
sess
-- Throws:
InternalErrorException
-
removeBan
Remove ban by id from facilities bans.- Parameters:
sess
-banId
- id of specific ban- Throws:
InternalErrorException
BanNotExistsException
-
removeBan
Remove ban by user_id and facility_id.- Parameters:
sess
-userId
- the id of userfacilityId
- the id of facility- Throws:
InternalErrorException
BanNotExistsException
-
removeHost
void removeHost(PerunSession perunSession, Host host, Facility facility) throws HostAlreadyRemovedException Remove hosts from the Facility.- Parameters:
perunSession
-host
-facility
-- Throws:
InternalErrorException
HostAlreadyRemovedException
- if 0 rows was affected by deleting from DB
-
removeHosts
void removeHosts(PerunSession sess, List<Host> hosts, Facility facility) throws HostAlreadyRemovedException Remove hosts from the Facility.- Parameters:
sess
-hosts
-facility
-- Throws:
InternalErrorException
HostAlreadyRemovedException
- if there is at least 1 not removed host (not affected by removing from DB)
-
removeOwner
void removeOwner(PerunSession perunSession, Facility facility, Owner owner) throws OwnerAlreadyRemovedException Remove owner of the facility- Parameters:
perunSession
-facility
-owner
-- Throws:
InternalErrorException
OwnerAlreadyRemovedException
-
removeSecurityTeam
Remove (Unassign) given security team from given facility- Parameters:
sess
-facility
-securityTeam
-- Throws:
InternalErrorException
-
setBan
BanOnFacility setBan(PerunSession sess, BanOnFacility banOnFacility) throws BanAlreadyExistsException Set ban for user on facility- Parameters:
sess
-banOnFacility
- the ban- Returns:
- ban on facility
- Throws:
InternalErrorException
BanAlreadyExistsException
-
setOwners
Deprecated.Use addOwner and removeOwner insteadUpdates owners of facility- Parameters:
perunSession
-facility
-owners
-- Throws:
InternalErrorException
-
updateBan
Update description and validity timestamp of specific ban.- Parameters:
sess
-banOnFacility
- ban to be updated- Returns:
- updated ban
- Throws:
InternalErrorException
-
updateFacility
Facility updateFacility(PerunSession perunSession, Facility facility) throws FacilityExistsException, ConsentHubExistsException Updates facility.- Parameters:
perunSession
-facility
- to update- Returns:
- updated facility
- Throws:
InternalErrorException
FacilityExistsException
ConsentHubExistsException
-