Package cz.metacentrum.perun.core.blImpl
Class FacilitiesManagerBlImpl
java.lang.Object
cz.metacentrum.perun.core.blImpl.FacilitiesManagerBlImpl
- All Implemented Interfaces:
FacilitiesManagerBl
- Author:
- Slavek Licehammer glory@ics.muni.cz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddHost
(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) 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 sess, 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 sess, Facility facility) Store the facility.void
deleteFacility
(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.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 disregarding their possible expired status in a group.getAllowedMembersNotExpiredInGroups
(PerunSession sess, Facility facility, Service service) Return all members, which are "allowed" on facility through any resource assigned to the given service and have ACTIVE status in a group.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 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, 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 sess, Facility facility) Returns all resources assigned to the facility.getAssignedResources
(PerunSession sess, Facility facility, Vo specificVo, Service specificService) Returns all resources assigned to the facility with optionally VO and Service specifiedgetAssignedRichResources
(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 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 sess, 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 attributesGets all enriched facilities.getFacilities
(PerunSession sess) 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 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.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
Get count of all facilities.Gets the facilitiesManagerImpl 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 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 sess, Owner owner) Returns list of all facilities owned by the owner.getOwners
(PerunSession sess, Facility facility) Returns owners of the facility.Gets the perunBl.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.boolean
hostExists
(PerunSession sess, Host host) 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 sess, 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 sess, 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 sess, Facility facility, List<Owner> owners) Updates owners of facilityvoid
setPerunBl
(PerunBl perunBl) updateBan
(PerunSession sess, BanOnFacility banOnFacility) Update description and validity timestamp of specific ban.updateFacility
(PerunSession sess, Facility facility) Updates facility.
-
Constructor Details
-
FacilitiesManagerBlImpl
-
-
Method Details
-
addHost
Description copied from interface:FacilitiesManagerBl
Adds host to the Facility.- Specified by:
addHost
in interfaceFacilitiesManagerBl
facility
- return host
-
addHosts
public List<Host> addHosts(PerunSession sess, List<Host> hosts, Facility facility) throws HostExistsException Description copied from interface:FacilitiesManagerBl
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. - Specified by:
addHosts
in interfaceFacilitiesManagerBl
hosts
- ID of any host doesn't need to be filled. Hosts will be created.- Returns:
- Hosts with ID's set.
- Throws:
HostExistsException
-
addHosts
public List<Host> addHosts(PerunSession sess, Facility facility, List<String> hosts) throws HostExistsException, WrongPatternException Description copied from interface:FacilitiesManagerBl
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].- Specified by:
addHosts
in interfaceFacilitiesManagerBl
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
public void addOwner(PerunSession sess, Facility facility, Owner owner) throws OwnerAlreadyAssignedException Description copied from interface:FacilitiesManagerBl
Add owner of the facility- Specified by:
addOwner
in interfaceFacilitiesManagerBl
- Throws:
OwnerAlreadyAssignedException
-
assignSecurityTeam
Description copied from interface:FacilitiesManagerBl
Assign given security team to given facility (means the facility trusts the security team)- Specified by:
assignSecurityTeam
in interfaceFacilitiesManagerBl
-
banExists
Description copied from interface:FacilitiesManagerBl
Get true if any ban for user and facility exists.- Specified by:
banExists
in interfaceFacilitiesManagerBl
userId
- id of userfacilityId
- id of facility- Returns:
- true if ban exists
-
banExists
Description copied from interface:FacilitiesManagerBl
Get true if any band defined by id exists for any user and facility.- Specified by:
banExists
in interfaceFacilitiesManagerBl
banId
- id of ban- Returns:
- true if ban exists
-
checkBanExists
public void checkBanExists(PerunSession sess, int userId, int facilityId) throws BanNotExistsException Description copied from interface:FacilitiesManagerBl
Check if ban already exists.Throw exception if no.
- Specified by:
checkBanExists
in interfaceFacilitiesManagerBl
userId
- user idfacilityId
- facility id- Throws:
BanNotExistsException
-
checkBanExists
Description copied from interface:FacilitiesManagerBl
Check if ban already exists.Throw exception if no.
- Specified by:
checkBanExists
in interfaceFacilitiesManagerBl
banId
- ban id- Throws:
BanNotExistsException
-
checkFacilityExists
public void checkFacilityExists(PerunSession sess, Facility facility) throws FacilityNotExistsException - Specified by:
checkFacilityExists
in interfaceFacilitiesManagerBl
- Throws:
FacilityNotExistsException
-
checkHostExists
- Specified by:
checkHostExists
in interfaceFacilitiesManagerBl
- Throws:
HostNotExistsException
-
checkSecurityTeamAssigned
public void checkSecurityTeamAssigned(PerunSession sess, Facility facility, SecurityTeam securityTeam) throws SecurityTeamNotAssignedException Description copied from interface:FacilitiesManagerBl
Check if security team is assigned to facility. Throw exception info not.- Specified by:
checkSecurityTeamAssigned
in interfaceFacilitiesManagerBl
- Throws:
SecurityTeamNotAssignedException
-
checkSecurityTeamNotAssigned
public void checkSecurityTeamNotAssigned(PerunSession sess, Facility facility, SecurityTeam securityTeam) throws SecurityTeamAlreadyAssignedException Description copied from interface:FacilitiesManagerBl
Check if security team is not assigned to facility. Throw exception info is.- Specified by:
checkSecurityTeamNotAssigned
in interfaceFacilitiesManagerBl
- Throws:
SecurityTeamAlreadyAssignedException
-
copyAttributes
public void copyAttributes(PerunSession sess, Facility sourceFacility, Facility destinationFacility) throws WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException Description copied from interface:FacilitiesManagerBl
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.- Specified by:
copyAttributes
in interfaceFacilitiesManagerBl
- Throws:
WrongAttributeAssignmentException
- if there is no facility attributeWrongAttributeValueException
- if the attribute value is illegalWrongReferenceAttributeValueException
- if the attribute value is illegal
-
copyManagers
Description copied from interface:FacilitiesManagerBl
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.- Specified by:
copyManagers
in interfaceFacilitiesManagerBl
-
copyOwners
Description copied from interface:FacilitiesManagerBl
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.- Specified by:
copyOwners
in interfaceFacilitiesManagerBl
-
createFacility
public Facility createFacility(PerunSession sess, Facility facility) throws FacilityExistsException, ConsentHubExistsException Description copied from interface:FacilitiesManagerBl
Store the facility.- Specified by:
createFacility
in interfaceFacilitiesManagerBl
- Returns:
- Throws:
FacilityExistsException
ConsentHubExistsException
-
deleteFacility
public void deleteFacility(PerunSession sess, Facility facility, Boolean force) throws RelationExistsException, FacilityAlreadyRemovedException, HostAlreadyRemovedException, ResourceAlreadyRemovedException, GroupAlreadyRemovedFromResourceException Description copied from interface:FacilitiesManagerBl
Delete the facility by id.- Specified by:
deleteFacility
in interfaceFacilitiesManagerBl
- Throws:
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
Description copied from interface:FacilitiesManagerBl
Gets list of all group administrators of the Facility.- Specified by:
getAdminGroups
in interfaceFacilitiesManagerBl
- Returns:
- list of Groups that are admins in the facility
-
getAdmins
Description copied from interface:FacilitiesManagerBl
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
- Specified by:
getAdmins
in interfaceFacilitiesManagerBl
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
-
getAdmins
Deprecated.Description copied from interface:FacilitiesManagerBl
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.- Specified by:
getAdmins
in interfaceFacilitiesManagerBl
- Returns:
- list of Users who are admins in the facility
-
getAllExpiredBansOnFacilities
Description copied from interface:FacilitiesManagerBl
Get all expired bans on any facility to now date- Specified by:
getAllExpiredBansOnFacilities
in interfaceFacilitiesManagerBl
- Returns:
- list of expired bans for any facility
-
getAllowedFacilities
Description copied from interface:FacilitiesManagerBl
Get facilities where the user is allowed.- Specified by:
getAllowedFacilities
in interfaceFacilitiesManagerBl
- Returns:
- List of allowed facilities of the user.
-
getAllowedFacilities
Description copied from interface:FacilitiesManagerBl
Get facilities where member is allowed.- Specified by:
getAllowedFacilities
in interfaceFacilitiesManagerBl
- Returns:
- List of allowed facilities of the member.
-
getAllowedGroups
public List<Group> getAllowedGroups(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService) Description copied from interface:FacilitiesManagerBl
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)- Specified by:
getAllowedGroups
in interfaceFacilitiesManagerBl
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
-
getAllowedMembers
Description copied from interface:FacilitiesManagerBl
Return all members, which are "allowed" on facility.- Specified by:
getAllowedMembers
in interfaceFacilitiesManagerBl
- Returns:
- list of allowed members
-
getAllowedMembers
Description copied from interface:FacilitiesManagerBl
Return all members, which are "allowed" on facility through any resource assigned to the given service disregarding their possible expired status in a group. All members include all group statuses, through which they can be filtered if necessary.- Specified by:
getAllowedMembers
in interfaceFacilitiesManagerBl
- Returns:
- list of allowed members
-
getAllowedMembersNotExpiredInGroups
public List<Member> getAllowedMembersNotExpiredInGroups(PerunSession sess, Facility facility, Service service) Description copied from interface:FacilitiesManagerBl
Return all members, which are "allowed" on facility through any resource assigned to the given service and have ACTIVE status in a group.- Specified by:
getAllowedMembersNotExpiredInGroups
in interfaceFacilitiesManagerBl
- Returns:
- list of allowed members
-
getAllowedRichGroupsWithAttributes
public List<RichGroup> getAllowedRichGroupsWithAttributes(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService, List<String> attrNames) Description copied from interface:FacilitiesManagerBl
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.- Specified by:
getAllowedRichGroupsWithAttributes
in interfaceFacilitiesManagerBl
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
-
getAllowedUsers
Description copied from interface:FacilitiesManagerBl
Return all users who can use this facility- Specified by:
getAllowedUsers
in interfaceFacilitiesManagerBl
- Returns:
- list of users
-
getAllowedUsers
public List<User> getAllowedUsers(PerunSession sess, Facility facility, Vo specificVo, Service specificService) Description copied from interface:FacilitiesManagerBl
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)- Specified by:
getAllowedUsers
in interfaceFacilitiesManagerBl
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
-
getAllowedUsersNotExpiredInGroups
public List<User> getAllowedUsersNotExpiredInGroups(PerunSession sess, Facility facility, Vo specificVo, Service specificService) Description copied from interface:FacilitiesManagerBl
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)- Specified by:
getAllowedUsersNotExpiredInGroups
in interfaceFacilitiesManagerBl
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
-
getAllowedVos
Description copied from interface:FacilitiesManagerBl
Return all VO which can use this facility. (VO must have the resource which belongs to this facility)- Specified by:
getAllowedVos
in interfaceFacilitiesManagerBl
- Returns:
- list of Vos
-
getAssignedFacilities
Description copied from interface:FacilitiesManagerBl
Get facilities which are assigned to Group (via resource).- Specified by:
getAssignedFacilities
in interfaceFacilitiesManagerBl
- Returns:
-
getAssignedFacilities
Description copied from interface:FacilitiesManagerBl
Get facilities which have the member access on.- Specified by:
getAssignedFacilities
in interfaceFacilitiesManagerBl
- Returns:
-
getAssignedFacilities
Description copied from interface:FacilitiesManagerBl
Get facilities where the user is assigned.- Specified by:
getAssignedFacilities
in interfaceFacilitiesManagerBl
- Returns:
-
getAssignedFacilities
Description copied from interface:FacilitiesManagerBl
Get facilities where the services is defined.- Specified by:
getAssignedFacilities
in interfaceFacilitiesManagerBl
- Returns:
-
getAssignedFacilities
Description copied from interface:FacilitiesManagerBl
Get facilities where the security team is assigned- Specified by:
getAssignedFacilities
in interfaceFacilitiesManagerBl
- Returns:
-
getAssignedResources
Description copied from interface:FacilitiesManagerBl
Returns all resources assigned to the facility.- Specified by:
getAssignedResources
in interfaceFacilitiesManagerBl
- Returns:
- list of resources assigned to the facility
-
getAssignedResources
public List<Resource> getAssignedResources(PerunSession sess, Facility facility, Vo specificVo, Service specificService) Description copied from interface:FacilitiesManagerBl
Returns all resources assigned to the facility with optionally VO and Service specified- Specified by:
getAssignedResources
in interfaceFacilitiesManagerBl
- Returns:
- list of resources assigned to the facility
-
getAssignedRichResources
Description copied from interface:FacilitiesManagerBl
Returns all rich resources assigned to the facility with VO property filled- Specified by:
getAssignedRichResources
in interfaceFacilitiesManagerBl
- Returns:
- list of resources assigned to the facility
-
getAssignedRichResources
public List<RichResource> getAssignedRichResources(PerunSession sess, Facility facility, Service service) Description copied from interface:FacilitiesManagerBl
Returns all rich resources assigned to the facility and service with VO property filled- Specified by:
getAssignedRichResources
in interfaceFacilitiesManagerBl
- Returns:
- list of resources assigned to the facility and service
-
getAssignedSecurityTeams
Description copied from interface:FacilitiesManagerBl
Return all security teams which specific facility trusts- Specified by:
getAssignedSecurityTeams
in interfaceFacilitiesManagerBl
facility
- specific facility- Returns:
- list of assigned security teams
-
getAssignedUsers
Description copied from interface:FacilitiesManagerBl
Returns list of Users assigned to chosen Facility.- Specified by:
getAssignedUsers
in interfaceFacilitiesManagerBl
- Returns:
- list of Users
-
getAssignedUsers
Description copied from interface:FacilitiesManagerBl
Returns list of Users assigned with chosen Facility containing resources where service is assigned.- Specified by:
getAssignedUsers
in interfaceFacilitiesManagerBl
- Returns:
- list of Users
-
getAssociatedMembers
Description copied from interface:FacilitiesManagerBl
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.- Specified by:
getAssociatedMembers
in interfaceFacilitiesManagerBl
- Returns:
- list of associated members
-
getAssociatedUsers
Description copied from interface:FacilitiesManagerBl
Return all users, which are associated with facility through any member/resource. Does not require ACTIVE group-resource status.- Specified by:
getAssociatedUsers
in interfaceFacilitiesManagerBl
- Returns:
- list of associated users
-
getBan
public BanOnFacility getBan(PerunSession sess, int userId, int faclityId) throws BanNotExistsException Description copied from interface:FacilitiesManagerBl
Get specific facility ban.- Specified by:
getBan
in interfaceFacilitiesManagerBl
userId
- the user idfaclityId
- the facility id- Returns:
- specific facility ban
- Throws:
BanNotExistsException
-
getBanById
Description copied from interface:FacilitiesManagerBl
Get Ban for user on facility by it's id- Specified by:
getBanById
in interfaceFacilitiesManagerBl
banId
- the ban id- Returns:
- facility ban by it's id
- Throws:
BanNotExistsException
-
getBansForFacility
Description copied from interface:FacilitiesManagerBl
Get all users bans for facility- Specified by:
getBansForFacility
in interfaceFacilitiesManagerBl
facilityId
- the facility id- Returns:
- list of all users bans on facility
-
getBansForUser
Description copied from interface:FacilitiesManagerBl
Get all facilities bans for user.- Specified by:
getBansForUser
in interfaceFacilitiesManagerBl
userId
- the user id- Returns:
- list of bans for user on any facility
-
getDirectAdmins
Deprecated.Description copied from interface:FacilitiesManagerBl
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.- Specified by:
getDirectAdmins
in interfaceFacilitiesManagerBl
-
getDirectRichAdmins
Deprecated.Description copied from interface:FacilitiesManagerBl
Get all Facility admins, which are assigned directly (not by group membership) without attributes.- Specified by:
getDirectRichAdmins
in interfaceFacilitiesManagerBl
- Returns:
- return list of RichUsers without attributes.
-
getDirectRichAdminsWithSpecificAttributes
@Deprecated public List<RichUser> getDirectRichAdminsWithSpecificAttributes(PerunSession perunSession, Facility facility, List<String> specificAttributes) Deprecated.Description copied from interface:FacilitiesManagerBl
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)- Specified by:
getDirectRichAdminsWithSpecificAttributes
in interfaceFacilitiesManagerBl
- Returns:
- list of RichUsers with specific attributes.
-
getEnrichedBansForFacility
public List<EnrichedBanOnFacility> getEnrichedBansForFacility(PerunSession sess, Facility facility, List<String> attrNames) throws AttributeNotExistsException Description copied from interface:FacilitiesManagerBl
Get all enriched bans for members on the resource with user and member attributes- Specified by:
getEnrichedBansForFacility
in interfaceFacilitiesManagerBl
facility
- facilityattrNames
- names of attributes- Returns:
- list of all enriched bans on facility
- Throws:
AttributeNotExistsException
-
getEnrichedBansForUser
public List<EnrichedBanOnFacility> getEnrichedBansForUser(PerunSession sess, User user, List<String> attrNames) throws AttributeNotExistsException Description copied from interface:FacilitiesManagerBl
Get enriched bans for user on all resources where user is assigned with user and member attributes- Specified by:
getEnrichedBansForUser
in interfaceFacilitiesManagerBl
user
- userattrNames
- names of attributes- Returns:
- list of all user's bans on facility
- Throws:
AttributeNotExistsException
-
getEnrichedFacilities
Description copied from interface:FacilitiesManagerBl
Gets all enriched facilities.- Specified by:
getEnrichedFacilities
in interfaceFacilitiesManagerBl
- Returns:
- List of all EnrichedFacilities
-
getFacilities
Description copied from interface:FacilitiesManagerBl
List all facilities.- Specified by:
getFacilities
in interfaceFacilitiesManagerBl
- Returns:
- List of all Facilities within the Perun
-
getFacilitiesByAttribute
public List<Facility> getFacilitiesByAttribute(PerunSession sess, String attributeName, String attributeValue) throws WrongAttributeAssignmentException Description copied from interface:FacilitiesManagerBl
Returns 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:
getFacilitiesByAttribute
in interfaceFacilitiesManagerBl
- Parameters:
sess
- perun sessionattributeName
- attribute name to be searched byattributeValue
- attribute value to be searched by- Returns:
- Throws:
WrongAttributeAssignmentException
-
getFacilitiesByAttributeWithAttributes
public List<FacilityWithAttributes> getFacilitiesByAttributeWithAttributes(PerunSession sess, String searchAttributeName, String searchAttributeValue, List<String> attrNames) throws AttributeNotExistsException Description copied from interface:FacilitiesManagerBl
Searches (partially!) for facilities with the attribute 'searchAttributeName' and its value 'searchAttributeValue'. Found Facilities are returned along with attributes listed in 'attrNames'.- Specified by:
getFacilitiesByAttributeWithAttributes
in interfaceFacilitiesManagerBl
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
public List<Facility> getFacilitiesByDestination(PerunSession sess, String destination) throws FacilityNotExistsException Description copied from interface:FacilitiesManagerBl
Searches for the Facilities by theirs destination.- Specified by:
getFacilitiesByDestination
in interfaceFacilitiesManagerBl
- Returns:
- Facility with specified name
- Throws:
FacilityNotExistsException
-
getFacilitiesByHostName
Description copied from interface:FacilitiesManagerBl
Return all facilities where exists host with the specific hostname- Specified by:
getFacilitiesByHostName
in interfaceFacilitiesManagerBl
hostname
- specific hostname- Returns:
-
getFacilitiesByIds
Description copied from interface:FacilitiesManagerBl
Searches for the Facilities with specified ids.- Specified by:
getFacilitiesByIds
in interfaceFacilitiesManagerBl
- Returns:
- list of Facilities with specified ids
-
getFacilitiesByPerunBean
Description copied from interface:FacilitiesManagerBl
Returns list of facilities connected with a group- Specified by:
getFacilitiesByPerunBean
in interfaceFacilitiesManagerBl
- Returns:
- list of facilities connected with group
-
getFacilitiesByPerunBean
Description copied from interface:FacilitiesManagerBl
Returns list of facilities connected with a member- Specified by:
getFacilitiesByPerunBean
in interfaceFacilitiesManagerBl
- Returns:
- list of facilities connected with member
-
getFacilitiesByPerunBean
Description copied from interface:FacilitiesManagerBl
Returns list of facilities connected with a resource- Specified by:
getFacilitiesByPerunBean
in interfaceFacilitiesManagerBl
- Returns:
- list of facilities connected with resource
-
getFacilitiesByPerunBean
Description copied from interface:FacilitiesManagerBl
Returns list of facilities connected with a user- Specified by:
getFacilitiesByPerunBean
in interfaceFacilitiesManagerBl
- Returns:
- list of facilities connected with user
-
getFacilitiesByPerunBean
Description copied from interface:FacilitiesManagerBl
Returns list of facilities connected with a host- Specified by:
getFacilitiesByPerunBean
in interfaceFacilitiesManagerBl
- Returns:
- list of facilities connected with host
-
getFacilitiesByPerunBean
Description copied from interface:FacilitiesManagerBl
Returns list of facilities connected with a vo- Specified by:
getFacilitiesByPerunBean
in interfaceFacilitiesManagerBl
- Returns:
- list of facilities connected with vo
-
getFacilitiesCount
Description copied from interface:FacilitiesManagerBl
Get count of all facilities.- Specified by:
getFacilitiesCount
in interfaceFacilitiesManagerBl
- Returns:
- count of all facilities
-
getFacilitiesManagerImpl
Gets the facilitiesManagerImpl for this instance.- Returns:
- The facilitiesManagerImpl.
-
getFacilitiesWhereUserIsAdmin
Description copied from interface:FacilitiesManagerBl
Get all facilities where the user is admin. Including facilities, where the user is a VALID member of authorized group.- Specified by:
getFacilitiesWhereUserIsAdmin
in interfaceFacilitiesManagerBl
- Returns:
- list of Facilities, where the user is an admin.
-
getFacilityById
Description copied from interface:FacilitiesManagerBl
Searches for the Facility with specified id.- Specified by:
getFacilityById
in interfaceFacilitiesManagerBl
- Returns:
- Facility with specified id
- Throws:
FacilityNotExistsException
-
getFacilityByName
Description copied from interface:FacilitiesManagerBl
Searches for the Facility by its name.- Specified by:
getFacilityByName
in interfaceFacilitiesManagerBl
- Returns:
- Facility with specified name
- Throws:
FacilityNotExistsException
-
getFacilityForHost
Description copied from interface:FacilitiesManagerBl
Return facility which has the host.- Specified by:
getFacilityForHost
in interfaceFacilitiesManagerBl
- Returns:
- facility
-
getHostById
Description copied from interface:FacilitiesManagerBl
Get the host by its ID.- Specified by:
getHostById
in interfaceFacilitiesManagerBl
- Returns:
- host
- Throws:
HostNotExistsException
-
getHosts
Description copied from interface:FacilitiesManagerBl
List hosts of Facility.- Specified by:
getHosts
in interfaceFacilitiesManagerBl
- Returns:
- hosts
-
getHostsByHostname
Description copied from interface:FacilitiesManagerBl
Get all hosts with this hostname (from all facilities).- Specified by:
getHostsByHostname
in interfaceFacilitiesManagerBl
- Returns:
- list of hosts by hostname
-
getHostsCount
Description copied from interface:FacilitiesManagerBl
Count hosts in the facility.- Specified by:
getHostsCount
in interfaceFacilitiesManagerBl
- Returns:
- the number of hosts present in the Cluster.
-
getOwnerFacilities
Description copied from interface:FacilitiesManagerBl
Returns list of all facilities owned by the owner.- Specified by:
getOwnerFacilities
in interfaceFacilitiesManagerBl
- Returns:
- list of facilities owned by the owner
-
getOwners
Description copied from interface:FacilitiesManagerBl
Returns owners of the facility.- Specified by:
getOwners
in interfaceFacilitiesManagerBl
- Returns:
- owners of specified facility
-
getPerunBl
Gets the perunBl.- Returns:
- The perunBl.
-
getRichAdmins
public List<RichUser> getRichAdmins(PerunSession perunSession, Facility facility, List<String> specificAttributes, boolean allUserAttributes, boolean onlyDirectAdmins) throws UserNotExistsException Description copied from interface:FacilitiesManagerBl
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.
- Specified by:
getRichAdmins
in interfaceFacilitiesManagerBl
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:
UserNotExistsException
-
getRichAdmins
Deprecated.Description copied from interface:FacilitiesManagerBl
Get all Facility admins without attributes.- Specified by:
getRichAdmins
in interfaceFacilitiesManagerBl
- Returns:
- return list of RichUsers without attributes.
-
getRichAdminsWithAttributes
@Deprecated public List<RichUser> getRichAdminsWithAttributes(PerunSession sess, Facility facility) throws UserNotExistsException Deprecated.Description copied from interface:FacilitiesManagerBl
Get all Facility admins with attributes.- Specified by:
getRichAdminsWithAttributes
in interfaceFacilitiesManagerBl
- Returns:
- list of Rich Users who are admins in the facility WITH ATTRIBUTES
- Throws:
UserNotExistsException
-
getRichAdminsWithSpecificAttributes
@Deprecated public List<RichUser> getRichAdminsWithSpecificAttributes(PerunSession perunSession, Facility facility, List<String> specificAttributes) Deprecated.Description copied from interface:FacilitiesManagerBl
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)- Specified by:
getRichAdminsWithSpecificAttributes
in interfaceFacilitiesManagerBl
- Returns:
- list of RichUsers with specific attributes.
-
getRichFacilities
Description copied from interface:FacilitiesManagerBl
Get all rich Facilities with all their owners.- Specified by:
getRichFacilities
in interfaceFacilitiesManagerBl
- Returns:
- list of RichFacilities with owners
-
getRichFacilities
Description copied from interface:FacilitiesManagerBl
Get all RichFacilities with all their owners from list of Facilities.- Specified by:
getRichFacilities
in interfaceFacilitiesManagerBl
facilities
- list of facilities- Returns:
- list of RichFacilities with owners
-
hostExists
-
removeAllExpiredBansOnFacilities
Description copied from interface:FacilitiesManagerBl
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.
- Specified by:
removeAllExpiredBansOnFacilities
in interfaceFacilitiesManagerBl
-
removeBan
Description copied from interface:FacilitiesManagerBl
Remove ban by id from facilities bans.- Specified by:
removeBan
in interfaceFacilitiesManagerBl
banId
- id of specific ban- Throws:
BanNotExistsException
-
removeBan
Description copied from interface:FacilitiesManagerBl
Remove ban by user_id and facility_id.- Specified by:
removeBan
in interfaceFacilitiesManagerBl
userId
- the id of userfacilityId
- the id of facility- Throws:
BanNotExistsException
-
removeHost
public void removeHost(PerunSession sess, Host host, Facility facility) throws HostAlreadyRemovedException Description copied from interface:FacilitiesManagerBl
Remove hosts from the Facility.- Specified by:
removeHost
in interfaceFacilitiesManagerBl
- Throws:
HostAlreadyRemovedException
- if 0 rows was affected by deleting from DB
-
removeHosts
public void removeHosts(PerunSession sess, List<Host> hosts, Facility facility) throws HostAlreadyRemovedException Description copied from interface:FacilitiesManagerBl
Remove hosts from the Facility.- Specified by:
removeHosts
in interfaceFacilitiesManagerBl
- Throws:
HostAlreadyRemovedException
- if there is at least 1 not removed host (not affected by removing from DB)
-
removeOwner
public void removeOwner(PerunSession sess, Facility facility, Owner owner) throws OwnerAlreadyRemovedException Description copied from interface:FacilitiesManagerBl
Remove owner of the facility- Specified by:
removeOwner
in interfaceFacilitiesManagerBl
- Throws:
OwnerAlreadyRemovedException
-
removeSecurityTeam
Description copied from interface:FacilitiesManagerBl
Remove (Unassign) given security team from given facility- Specified by:
removeSecurityTeam
in interfaceFacilitiesManagerBl
-
setBan
public BanOnFacility setBan(PerunSession sess, BanOnFacility banOnFacility) throws BanAlreadyExistsException Description copied from interface:FacilitiesManagerBl
Set ban for user on facility- Specified by:
setBan
in interfaceFacilitiesManagerBl
banOnFacility
- the ban- Returns:
- ban on facility
- Throws:
BanAlreadyExistsException
-
setOwners
Description copied from interface:FacilitiesManagerBl
Updates owners of facility- Specified by:
setOwners
in interfaceFacilitiesManagerBl
-
setPerunBl
-
updateBan
Description copied from interface:FacilitiesManagerBl
Update description and validity timestamp of specific ban.- Specified by:
updateBan
in interfaceFacilitiesManagerBl
banOnFacility
- ban to be updated- Returns:
- updated ban
-
updateFacility
public Facility updateFacility(PerunSession sess, Facility facility) throws FacilityExistsException, ConsentHubExistsException Description copied from interface:FacilitiesManagerBl
Updates facility.- Specified by:
updateFacility
in interfaceFacilitiesManagerBl
facility
- to update- Returns:
- updated facility
- Throws:
FacilityExistsException
ConsentHubExistsException
-