Class ServicesManagerEntry
- All Implemented Interfaces:
- ServicesManager
- Author:
- Slavek Licehammer invalid input: '<'glory@ics.muni.cz>
- 
Field SummaryFields inherited from interface cz.metacentrum.perun.core.api.ServicesManagerSERVICE_NAME_REGEXP
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddDestination(PerunSession sess, Service service, Facility facility, Destination destination) Adds an destination for the facility and service.addDestination(PerunSession perunSession, List<Service> services, Facility facility, Destination destination) Adds an destination for the facility and all services.addDestinationsDefinedByHostsOnFacility(PerunSession perunSession, Facility facility) Defines services destination for all hosts using their hostnames.addDestinationsDefinedByHostsOnFacility(PerunSession perunSession, Service service, Facility facility) Defines service destination for all hosts using theirs hostnames.addDestinationsDefinedByHostsOnFacility(PerunSession perunSession, List<Service> services, Facility facility) Defines services destination for all hosts using their hostnames.addDestinationsForAllServicesOnFacility(PerunSession sess, Facility facility, Destination destination) Adds destination for all services defined on the facility.voidaddRequiredAttribute(PerunSession sess, Service service, AttributeDefinition attribute) Mark the attribute as required for the service.voidaddRequiredAttributes(PerunSession sess, Service service, List<? extends AttributeDefinition> attributes) Batch version of addRequiredAttributevoidblockAllServicesOnDestination(PerunSession sess, int destinationId) Block all services currently assigned on this destination.voidblockAllServicesOnFacility(PerunSession sess, Facility facility) Block all services currently assigned on this facility.voidblockServiceOnDestination(PerunSession sess, Service service, int destinationId) Bans Service on destination.voidblockServiceOnFacility(PerunSession sess, Service service, Facility facility) Bans Service on facility.voidblockServicesOnDestinations(PerunSession sess, List<RichDestination> richDestinations) Bans the Service on the destination - each pair defined by the rich destination.voidblockServicesOnFacility(PerunSession sess, List<Service> services, Facility facility) Bans services on facility.createService(PerunSession sess, Service service) Creates new service.voiddeleteService(PerunSession sess, Service service, boolean forceFlag) Deletes the service.voiddeleteServices(PerunSession sess, List<Service> services, boolean forceFlag) Deletes given services.booleanforceServicePropagation(PerunSession sess, Facility facility, Service service) Forces service propagation on defined facility.booleanforceServicePropagation(PerunSession sess, Service service) Forces service propagation on all facilities where the service is defined on.voidforceServicePropagationBulk(PerunSession sess, Facility facility, List<Service> services) Forces services propagation on defined facility.voidforceServicePropagationBulk(PerunSession sess, List<Service> services) Forces services propagation on all facilities where the services are defined on.forceServicePropagationForHostname(PerunSession sess, String hostname) Forces service propagation on all facilities for all services where hostname is used.getAllRichDestinations(PerunSession perunSession, Facility facility) Get list of all rich destinations defined for the facility.getAllRichDestinations(PerunSession perunSession, Service service) Get list of all rich destinations defined for the service.getAssignedResources(PerunSession sess, Service service) Get all resources where the service is defined.getAssignedServices(PerunSession sess, Facility facility) List all services associated with the facility (via resource).getAssignedServices(PerunSession sess, Facility facility, Vo vo) List all services associated with the facility and vo (via resource).getDestinationById(PerunSession sess, int id) Get destination by idintgetDestinationIdByName(PerunSession sess, String name, String type) Return ID of Destination by its value (name) and type.getDestinations(PerunSession perunSession) Get list of all destinations.getDestinations(PerunSession sess, Service service, Facility facility) Get list of all destinations defined for the service and facility.intGet count of all destinations.getFacilitiesDestinations(PerunSession sess, Vo vo) List all destinations for all facilities which are joined by resources to the VO.getFacilityAssignedServicesForGUI(PerunSession perunSession, Facility facility) Return list of ServiceForGUI assigned on facility, (Service with "allowedOnFacility" property filled). 1 - allowed / 0 - service is denied).getHashedDataWithGroups(PerunSession sess, Service service, Facility facility, boolean consentEval, int taskRunId) Generates hashed data with group structure for given service and facility.getHashedHierarchicalData(PerunSession sess, Service service, Facility facility, boolean consentEval, int taskRunId) Generates hashed hierarchical data structure for given service and facility.getRichDestinations(PerunSession perunSession, Facility facility, Service service) Get list of all rich destinations defined for the facility and the service.getServiceById(PerunSession sess, int id) Get service by id.getServiceByName(PerunSession sess, String name) Get service by name.getServices(PerunSession sess) get all services in perungetServicesBlockedOnDestination(PerunSession sess, int destinationId) List all the Services that are banned on this destination.getServicesBlockedOnFacility(PerunSession perunSession, Facility facility) List all the Services that are banned on this facility.getServicesByAttributeDefinition(PerunSession sess, AttributeDefinition attributeDefinition) Get all services with given attribute.booleanisServiceBlockedOnDestination(PerunSession sess, Service service, int destinationId) Is this Service denied on the destination?booleanisServiceBlockedOnFacility(PerunSession sess, Service service, Facility facility) Is this Service denied on the facility?booleanplanServicePropagation(PerunSession sess, Facility facility, Service service) Plans service propagation on defined facility.booleanplanServicePropagation(PerunSession perunSession, Service service) Forces service propagation on all facilities where the service is defined on.voidremoveAllDestinations(PerunSession sess, Service service, Facility facility) Removes all defined destinations for the service and facility.voidremoveAllRequiredAttributes(PerunSession sess, Service service) Detate all required attributes from servicevoidremoveDestination(PerunSession sess, Service service, Facility facility, Destination destination) Removes an destination from the facility and service.voidremoveDestinationsByRichDestinations(PerunSession sess, List<RichDestination> richDestinations) Removes destinations defined by list of rich destinations.voidremoveRequiredAttribute(PerunSession sess, Service service, AttributeDefinition attribute) Remove required attribute from service.voidremoveRequiredAttributes(PerunSession sess, Service service, List<? extends AttributeDefinition> attributes) Batch version of removeRequiredAttributevoidsetPerunBl(PerunBl perunBl) Sets the perunBl for this instance.voidsetServicesManagerBl(ServicesManagerBl servicesManagerBl) Sets the servicesManagerBl for this instance.voidunblockAllServicesOnDestination(PerunSession sess, int destinationId) Erase all the possible denials on this destination.voidunblockAllServicesOnDestination(PerunSession sess, String destinationName) Erase all the possible denials on destinations defined by the destinationName.voidunblockAllServicesOnFacility(PerunSession sess, Facility facility) Erase all the possible denials on this facility.voidunblockServiceOnDestination(PerunSession sess, Service service, int destinationId) Free the denial of the Service on this destination.voidunblockServiceOnFacility(PerunSession sess, Service service, Facility facility) Free the denial of the Service on this facility.voidunblockServicesOnDestinations(PerunSession sess, List<RichDestination> richDestinations) Free the denial of the Service on the destination - each pair defined by the rich destination.voidunblockServicesOnFacility(PerunSession sess, List<Service> services, Facility facility) Free the denial of the services on this facility.voidupdateService(PerunSession sess, Service service) Updates the service.
- 
Constructor Details- 
ServicesManagerEntry
- 
ServicesManagerEntrypublic ServicesManagerEntry()
 
- 
- 
Method Details- 
addDestinationpublic Destination addDestination(PerunSession perunSession, List<Service> services, Facility facility, Destination destination) throws PrivilegeException, ServiceNotExistsException, FacilityNotExistsException, WrongPatternException Description copied from interface:ServicesManagerAdds an destination for the facility and all services. Destination id doesn't need to be filled. If destination doesn't exist it will be created.- Specified by:
- addDestinationin interface- ServicesManager
- Parameters:
- perunSession-
- services-
- facility-
- destination- (id of this destination doesn't need to be filled.)
- Returns:
- destination with it's id set
- Throws:
- PrivilegeException
- ServiceNotExistsException
- FacilityNotExistsException
- WrongPatternException
 
- 
addDestinationpublic Destination addDestination(PerunSession sess, Service service, Facility facility, Destination destination) throws PrivilegeException, ServiceNotExistsException, FacilityNotExistsException, DestinationAlreadyAssignedException, WrongPatternException Description copied from interface:ServicesManagerAdds an destination for the facility and service. Destination.id doesn't need to be filled. If destination doesn't exist it will be created.- Specified by:
- addDestinationin interface- ServicesManager
- Parameters:
- sess-
- service-
- facility-
- destination- (Id of this destination doesn't need to be filled.)
- Returns:
- destination with it's id set.
- Throws:
- PrivilegeException
- ServiceNotExistsException
- FacilityNotExistsException
- DestinationAlreadyAssignedException
- WrongPatternException
 
- 
addDestinationsDefinedByHostsOnFacilitypublic List<Destination> addDestinationsDefinedByHostsOnFacility(PerunSession perunSession, Service service, Facility facility) throws PrivilegeException, ServiceNotExistsException, FacilityNotExistsException, DestinationAlreadyAssignedException Description copied from interface:ServicesManagerDefines service destination for all hosts using theirs hostnames.- Specified by:
- addDestinationsDefinedByHostsOnFacilityin interface- ServicesManager
- Parameters:
- perunSession-
- service-
- facility-
- Returns:
- list of added destinations
- Throws:
- PrivilegeException
- ServiceNotExistsException
- FacilityNotExistsException
- DestinationAlreadyAssignedException
 
- 
addDestinationsDefinedByHostsOnFacilitypublic List<Destination> addDestinationsDefinedByHostsOnFacility(PerunSession perunSession, List<Service> services, Facility facility) throws PrivilegeException, ServiceNotExistsException, FacilityNotExistsException Description copied from interface:ServicesManagerDefines services destination for all hosts using their hostnames. Do it for all services in List.If some destination for service and facility already exist, do not create it but still return back in the list. - Specified by:
- addDestinationsDefinedByHostsOnFacilityin interface- ServicesManager
- Parameters:
- perunSession-
- services-
- facility-
- Returns:
- list of added destinations (even if they already was added before)
- Throws:
- PrivilegeException
- ServiceNotExistsException
- FacilityNotExistsException
 
- 
addDestinationsDefinedByHostsOnFacilitypublic List<Destination> addDestinationsDefinedByHostsOnFacility(PerunSession perunSession, Facility facility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:ServicesManagerDefines services destination for all hosts using their hostnames. Use all assigned services to resources for the facility.If some destination for service and facility already exist, do not create it but still return back in the list. - Specified by:
- addDestinationsDefinedByHostsOnFacilityin interface- ServicesManager
- Parameters:
- perunSession-
- facility-
- Returns:
- list of added destinations (even if they already was added before)
- Throws:
- PrivilegeException
- FacilityNotExistsException
 
- 
addDestinationsForAllServicesOnFacilitypublic List<Destination> addDestinationsForAllServicesOnFacility(PerunSession sess, Facility facility, Destination destination) throws PrivilegeException, FacilityNotExistsException, DestinationAlreadyAssignedException, WrongPatternException Description copied from interface:ServicesManagerAdds destination for all services defined on the facility.- Specified by:
- addDestinationsForAllServicesOnFacilityin interface- ServicesManager
- Parameters:
- sess-
- facility-
- destination-
- Returns:
- list of added destinations
- Throws:
- PrivilegeException
- FacilityNotExistsException
- DestinationAlreadyAssignedException
- WrongPatternException
 
- 
addRequiredAttributepublic void addRequiredAttribute(PerunSession sess, Service service, AttributeDefinition attribute) throws PrivilegeException, AttributeNotExistsException, ServiceNotExistsException, AttributeAlreadyAssignedException, ServiceAttributesCannotExtend Description copied from interface:ServicesManagerMark the attribute as required for the service. Required attribues are requisite for Service to run. If you add attribute which has a default attribute then this default attribute will be automatically add too.- Specified by:
- addRequiredAttributein interface- ServicesManager
- Parameters:
- sess- perunSession
- service- service to which the attribute will be added
- attribute- attribute to add
- Throws:
- PrivilegeException- if privileges are not given
- AttributeNotExistsException- if the attribute doesn't exists in underlaying data source
- ServiceNotExistsException- if the service doesn't exists in underlaying data source
- AttributeAlreadyAssignedException- if the attribute is already added
- ServiceAttributesCannotExtend- if trying to add user-related attribute that could invalidate consents
 
- 
addRequiredAttributespublic void addRequiredAttributes(PerunSession sess, Service service, List<? extends AttributeDefinition> attributes) throws PrivilegeException, AttributeNotExistsException, ServiceNotExistsException, AttributeAlreadyAssignedException, ServiceAttributesCannotExtend Description copied from interface:ServicesManagerBatch version of addRequiredAttribute- Specified by:
- addRequiredAttributesin interface- ServicesManager
- Throws:
- PrivilegeException
- AttributeNotExistsException
- ServiceNotExistsException
- AttributeAlreadyAssignedException
- ServiceAttributesCannotExtend
- See Also:
 
- 
blockAllServicesOnDestinationpublic void blockAllServicesOnDestination(PerunSession sess, int destinationId) throws PrivilegeException, DestinationNotExistsException, FacilityNotExistsException Description copied from interface:ServicesManagerBlock all services currently assigned on this destination. From this moment on, there are no Services being allowed on this destination. If you assign a new service to the destination, it will be allowed!- Specified by:
- blockAllServicesOnDestinationin interface- ServicesManager
- Parameters:
- sess-
- destinationId- The id of a destination we want to block all services on.
- Throws:
- PrivilegeException
- DestinationNotExistsException
- FacilityNotExistsException
 
- 
blockAllServicesOnFacilitypublic void blockAllServicesOnFacility(PerunSession sess, Facility facility) throws FacilityNotExistsException, PrivilegeException Description copied from interface:ServicesManagerBlock all services currently assigned on this facility. From this moment on, there are no Services being allowed on this facility. If you assign a new service to the facility, it will be allowed!- Specified by:
- blockAllServicesOnFacilityin interface- ServicesManager
- Parameters:
- sess-
- facility- Facility we want to block all services on.
- Throws:
- FacilityNotExistsException
- PrivilegeException
 
- 
blockServiceOnDestinationpublic void blockServiceOnDestination(PerunSession sess, Service service, int destinationId) throws PrivilegeException, DestinationNotExistsException, ServiceAlreadyBannedException, FacilityNotExistsException Description copied from interface:ServicesManagerBans Service on destination. It wouldn't be possible to execute the given Service on this destination, however, it still can be executed on all the other destinations in the facility.- Specified by:
- blockServiceOnDestinationin interface- ServicesManager
- Parameters:
- sess-
- service- The Service to be banned on this particular destination
- destinationId- The destination on which we want to ban the Service
- Throws:
- PrivilegeException
- DestinationNotExistsException
- ServiceAlreadyBannedException
- FacilityNotExistsException
 
- 
blockServiceOnFacilitypublic void blockServiceOnFacility(PerunSession sess, Service service, Facility facility) throws ServiceAlreadyBannedException, PrivilegeException Description copied from interface:ServicesManagerBans Service on facility. It wouldn't be possible to execute the given Service on the whole facility nor on any of its destinations.- Specified by:
- blockServiceOnFacilityin interface- ServicesManager
- Parameters:
- sess-
- service- The Service to be banned on the facility
- facility- The facility on which we want to ban the Service
- Throws:
- ServiceAlreadyBannedException
- PrivilegeException
 
- 
blockServicesOnDestinationspublic void blockServicesOnDestinations(PerunSession sess, List<RichDestination> richDestinations) throws PrivilegeException, DestinationNotExistsException, FacilityNotExistsException Description copied from interface:ServicesManagerBans the Service on the destination - each pair defined by the rich destination. It wouldn't be possible to execute the given Service on this destination, however, it still can be executed on all the other destinations in the facility.- Specified by:
- blockServicesOnDestinationsin interface- ServicesManager
- Parameters:
- sess-
- richDestinations- the list of rich destinations
- Throws:
- PrivilegeException
- DestinationNotExistsException
- FacilityNotExistsException
 
- 
blockServicesOnFacilitypublic void blockServicesOnFacility(PerunSession sess, List<Service> services, Facility facility) throws ServiceAlreadyBannedException, PrivilegeException, FacilityNotExistsException Description copied from interface:ServicesManagerBans services on facility. It wouldn't be possible to execute the given services on the whole facility nor on any of their destinations.- Specified by:
- blockServicesOnFacilityin interface- ServicesManager
- Parameters:
- sess- perun session
- services- list of services
- facility- The facility on which we want to ban services
- Throws:
- ServiceAlreadyBannedException- when service was already banned
- PrivilegeException- insufficient permissions
- FacilityNotExistsException- when facility does not exist
 
- 
createServicepublic Service createService(PerunSession sess, Service service) throws PrivilegeException, ServiceExistsException Description copied from interface:ServicesManagerCreates new service.- Specified by:
- createServicein interface- ServicesManager
- Parameters:
- sess-
- service-
- Returns:
- new service
- Throws:
- PrivilegeException
- ServiceExistsException
 
- 
deleteServicepublic void deleteService(PerunSession sess, Service service, boolean forceFlag) throws ServiceNotExistsException, PrivilegeException, RelationExistsException, ServiceAlreadyRemovedException Description copied from interface:ServicesManagerDeletes the service.- Specified by:
- deleteServicein interface- ServicesManager
- Parameters:
- sess-
- service-
- forceFlag- if true, removes all dependant objects from database instead of raising exception
- Throws:
- ServiceNotExistsException
- PrivilegeException
- RelationExistsException
- ServiceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
 
- 
deleteServicespublic void deleteServices(PerunSession sess, List<Service> services, boolean forceFlag) throws ServiceNotExistsException, PrivilegeException, RelationExistsException, ServiceAlreadyRemovedException Description copied from interface:ServicesManagerDeletes given services.- Specified by:
- deleteServicesin interface- ServicesManager
- Parameters:
- sess-
- services- list of services
- forceFlag- if true, removes all dependant objects from database instead of raising exception
- Throws:
- ServiceNotExistsException
- PrivilegeException
- RelationExistsException
- ServiceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
 
- 
forceServicePropagationpublic boolean forceServicePropagation(PerunSession sess, Facility facility, Service service) throws PrivilegeException Description copied from interface:ServicesManagerForces service propagation on defined facility.- Specified by:
- forceServicePropagationin interface- ServicesManager
- Parameters:
- sess-
- facility-
- service-
- Returns:
- true if it is possible, false if not
- Throws:
- PrivilegeException
 
- 
forceServicePropagationpublic boolean forceServicePropagation(PerunSession sess, Service service) throws PrivilegeException Description copied from interface:ServicesManagerForces service propagation on all facilities where the service is defined on.- Specified by:
- forceServicePropagationin interface- ServicesManager
- Parameters:
- sess-
- service-
- Returns:
- true if it is possible, false if not
- Throws:
- PrivilegeException
 
- 
forceServicePropagationBulkpublic void forceServicePropagationBulk(PerunSession sess, Facility facility, List<Service> services) throws PrivilegeException, FacilityNotExistsException, ForceServicePropagationDisabledException Description copied from interface:ServicesManagerForces services propagation on defined facility.- Specified by:
- forceServicePropagationBulkin interface- ServicesManager
- Parameters:
- sess- perun session
- facility- facility
- services- list of services
- Throws:
- PrivilegeException- insufficient permissions
- FacilityNotExistsException- when facility does not exist
- ForceServicePropagationDisabledException- when forcing propagation is not possible
 
- 
forceServicePropagationBulkpublic void forceServicePropagationBulk(PerunSession sess, List<Service> services) throws PrivilegeException, ForceServicePropagationDisabledException Description copied from interface:ServicesManagerForces services propagation on all facilities where the services are defined on.- Specified by:
- forceServicePropagationBulkin interface- ServicesManager
- Parameters:
- sess- session
- services- list of services
- Throws:
- PrivilegeException- insufficient permissions
- ForceServicePropagationDisabledException- when forcing propagation is not possible
 
- 
forceServicePropagationForHostnamepublic String forceServicePropagationForHostname(PerunSession sess, String hostname) throws PrivilegeException Description copied from interface:ServicesManagerForces service propagation on all facilities for all services where hostname is used. Service must be correctly assigned, have destination matching hostname and not be blocked on any level (globally, facility, destination).- Specified by:
- forceServicePropagationForHostnamein interface- ServicesManager
- Parameters:
- sess-
- hostname- Hostname to get facilities for
- Returns:
- message Space separated list of forced services or error message (no facilities found, services are blocked)
- Throws:
- PrivilegeException
 
- 
getAllRichDestinationspublic List<RichDestination> getAllRichDestinations(PerunSession perunSession, Facility facility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:ServicesManagerGet list of all rich destinations defined for the facility.- Specified by:
- getAllRichDestinationsin interface- ServicesManager
- Parameters:
- perunSession-
- facility-
- Returns:
- Throws:
- PrivilegeException- if privileges are not given
- FacilityNotExistsException- if facility which we get from service and destination not exist
 
- 
getAllRichDestinationspublic List<RichDestination> getAllRichDestinations(PerunSession perunSession, Service service) throws PrivilegeException, ServiceNotExistsException Description copied from interface:ServicesManagerGet list of all rich destinations defined for the service.- Specified by:
- getAllRichDestinationsin interface- ServicesManager
- Parameters:
- perunSession-
- service-
- Returns:
- Throws:
- PrivilegeException- if privileges are not given
- ServiceNotExistsException- if service which we get from facility and destination not exist
 
- 
getAssignedResourcespublic List<Resource> getAssignedResources(PerunSession sess, Service service) throws PrivilegeException, ServiceNotExistsException Description copied from interface:ServicesManagerGet all resources where the service is defined.- Specified by:
- getAssignedResourcesin interface- ServicesManager
- Parameters:
- sess-
- service-
- Returns:
- list of resources where the service is defined
- Throws:
- PrivilegeException
- ServiceNotExistsException
 
- 
getAssignedServicespublic List<Service> getAssignedServices(PerunSession sess, Facility facility) throws FacilityNotExistsException, PrivilegeException Description copied from interface:ServicesManagerList all services associated with the facility (via resource).- Specified by:
- getAssignedServicesin interface- ServicesManager
- Parameters:
- sess-
- facility-
- Returns:
- list of services assigned to facility
- Throws:
- FacilityNotExistsException
- PrivilegeException
 
- 
getAssignedServicespublic List<Service> getAssignedServices(PerunSession sess, Facility facility, Vo vo) throws FacilityNotExistsException, VoNotExistsException, PrivilegeException Description copied from interface:ServicesManagerList all services associated with the facility and vo (via resource).- Specified by:
- getAssignedServicesin interface- ServicesManager
- Parameters:
- sess-
- facility-
- vo-
- Returns:
- list of services assigned to facility and vo
- Throws:
- FacilityNotExistsException
- VoNotExistsException
- PrivilegeException
 
- 
getDestinationByIdpublic Destination getDestinationById(PerunSession sess, int id) throws PrivilegeException, DestinationNotExistsException Description copied from interface:ServicesManagerGet destination by id- Specified by:
- getDestinationByIdin interface- ServicesManager
- Parameters:
- sess-
- id-
- Returns:
- Destination with the id
- Throws:
- PrivilegeException
- DestinationNotExistsException
 
- 
getDestinationIdByNamepublic int getDestinationIdByName(PerunSession sess, String name, String type) throws DestinationNotExistsException Description copied from interface:ServicesManagerReturn ID of Destination by its value (name) and type.- Specified by:
- getDestinationIdByNamein interface- ServicesManager
- Parameters:
- sess-
- name- Name (value) of Destination
- type- Type of destination
- Returns:
- ID of Destination
- Throws:
- DestinationNotExistsException
 
- 
getDestinationspublic List<Destination> getDestinations(PerunSession sess, Service service, Facility facility) throws PrivilegeException, ServiceNotExistsException, FacilityNotExistsException Description copied from interface:ServicesManagerGet list of all destinations defined for the service and facility.- Specified by:
- getDestinationsin interface- ServicesManager
- Parameters:
- sess-
- service-
- facility-
- Returns:
- list list of destinations defined for the service and facility
- Throws:
- PrivilegeException
- ServiceNotExistsException
- FacilityNotExistsException
 
- 
getDestinationsDescription copied from interface:ServicesManagerGet list of all destinations.- Specified by:
- getDestinationsin interface- ServicesManager
- Parameters:
- perunSession-
- Returns:
- list of all destinations for session
- Throws:
- PrivilegeException
 
- 
getDestinationsCountDescription copied from interface:ServicesManagerGet count of all destinations.- Specified by:
- getDestinationsCountin interface- ServicesManager
- Parameters:
- sess- PerunSession
- Returns:
- count of all destinations
 
- 
getFacilitiesDestinationspublic List<Destination> getFacilitiesDestinations(PerunSession sess, Vo vo) throws VoNotExistsException Description copied from interface:ServicesManagerList all destinations for all facilities which are joined by resources to the VO.- Specified by:
- getFacilitiesDestinationsin interface- ServicesManager
- Parameters:
- sess-
- vo- vo for which we are searching destinations
- Returns:
- list of destinations
- Throws:
- VoNotExistsException
 
- 
getFacilityAssignedServicesForGUIpublic List<ServiceForGUI> getFacilityAssignedServicesForGUI(PerunSession perunSession, Facility facility) throws PrivilegeException, FacilityNotExistsException Description copied from interface:ServicesManagerReturn list of ServiceForGUI assigned on facility, (Service with "allowedOnFacility" property filled). 1 - allowed / 0 - service is denied).- Specified by:
- getFacilityAssignedServicesForGUIin interface- ServicesManager
- Parameters:
- perunSession-
- facility-
- Returns:
- list of assigned services with allowed property
- Throws:
- PrivilegeException
- FacilityNotExistsException
 
- 
getHashedDataWithGroupspublic HashedGenData getHashedDataWithGroups(PerunSession sess, Service service, Facility facility, boolean consentEval, int taskRunId) throws FacilityNotExistsException, ServiceNotExistsException, PrivilegeException Description copied from interface:ServicesManagerGenerates hashed data with group structure for given service and facility. If enforcing consents is turned on on the instance and on the resource's consent hub, generates only the users that granted a consent to all the service required attributes. New UNSIGNED consents are created to users that don't have a consent containing all the service required attributes.Generates data in format: attributes: {...hashes...} hierarchy: { "1": { ** facility id ** members: { ** all members on the facility ** "4" : 5, ** member id : user id ** "6" : 7, ** member id : user id ** ... } children: [ "2": { ** resource id ** voId: 99, children: [ "89": { ** group id ** "children": {}, "members": { "91328": 57986, "91330": 60838 } } ], "members": { ** all members on the resource with id 2 ** "91328": 57986, "91330": 60838 } }, "3": { ... } ] } } - Specified by:
- getHashedDataWithGroupsin interface- ServicesManager
- Parameters:
- sess- perun session
- service- service
- facility- facility
- consentEval- if the generator should force evaluation of consents
- taskRunId- Integer id of the task run propagation
- Returns:
- generated hashed data structure
- Throws:
- FacilityNotExistsException- if there is no such facility
- ServiceNotExistsException- if there is no such service
- PrivilegeException- insufficient permissions
 
- 
getHashedHierarchicalDatapublic HashedGenData getHashedHierarchicalData(PerunSession sess, Service service, Facility facility, boolean consentEval, int taskRunId) throws FacilityNotExistsException, ServiceNotExistsException, PrivilegeException Description copied from interface:ServicesManagerGenerates hashed hierarchical data structure for given service and facility. If enforcing consents is turned on on the instance and on the resource's consent hub, generates only the users that granted a consent to all the service required attributes. New UNSIGNED consents are created to users that don't have a consent containing all the service required attributes.attributes: {...hashes...} hierarchy: { "1": { ** facility id ** members: { ** all members on the facility ** "4" : 5, ** member id : user id ** "6" : 7, ** member id : user id ** ... } children: [ "2": { ** resource id ** children: [], voId: 99, members: { ** all members on the resource with id 2 ** "4" : 5 ** member id : user id ** } }, "3": { ... } ] } } - Specified by:
- getHashedHierarchicalDatain interface- ServicesManager
- Parameters:
- sess- perun session
- service- service
- facility- facility
- consentEval- if the generator should force evaluation of consents
- taskRunId- Integer id of the task run propagation
- Returns:
- generated hashed data structure
- Throws:
- FacilityNotExistsException- if there is no such facility
- ServiceNotExistsException- if there is no such service
- PrivilegeException- insufficient permissions
 
- 
getPerunBl
- 
getRichDestinationspublic List<RichDestination> getRichDestinations(PerunSession perunSession, Facility facility, Service service) throws PrivilegeException, FacilityNotExistsException, ServiceNotExistsException Description copied from interface:ServicesManagerGet list of all rich destinations defined for the facility and the service.- Specified by:
- getRichDestinationsin interface- ServicesManager
- Parameters:
- perunSession-
- facility-
- service-
- Returns:
- Throws:
- PrivilegeException- if privileges are not given
- FacilityNotExistsException- if the facility not exist
- ServiceNotExistsException- if the service not exist
 
- 
getServiceByIdpublic Service getServiceById(PerunSession sess, int id) throws PrivilegeException, ServiceNotExistsException Description copied from interface:ServicesManagerGet service by id.- Specified by:
- getServiceByIdin interface- ServicesManager
- Parameters:
- sess-
- id-
- Returns:
- service with specified id
- Throws:
- PrivilegeException
- ServiceNotExistsException
 
- 
getServiceByNamepublic Service getServiceByName(PerunSession sess, String name) throws PrivilegeException, ServiceNotExistsException Description copied from interface:ServicesManagerGet service by name.- Specified by:
- getServiceByNamein interface- ServicesManager
- Parameters:
- sess-
- name- name of the service
- Returns:
- service with specified name
- Throws:
- PrivilegeException
- ServiceNotExistsException
 
- 
getServicesDescription copied from interface:ServicesManagerget all services in perun- Specified by:
- getServicesin interface- ServicesManager
- Parameters:
- sess-
- Returns:
- all services in perun
- Throws:
- PrivilegeException
 
- 
getServicesBlockedOnDestinationpublic List<Service> getServicesBlockedOnDestination(PerunSession sess, int destinationId) throws PrivilegeException, DestinationNotExistsException, FacilityNotExistsException Description copied from interface:ServicesManagerList all the Services that are banned on this destination.- Specified by:
- getServicesBlockedOnDestinationin interface- ServicesManager
- Parameters:
- sess-
- destinationId-
- Returns:
- a list of Services that are denied on the destination
- Throws:
- PrivilegeException
- DestinationNotExistsException
- FacilityNotExistsException
 
- 
getServicesBlockedOnFacilitypublic List<Service> getServicesBlockedOnFacility(PerunSession perunSession, Facility facility) throws PrivilegeException Description copied from interface:ServicesManagerList all the Services that are banned on this facility.- Specified by:
- getServicesBlockedOnFacilityin interface- ServicesManager
- Parameters:
- perunSession-
- facility-
- Returns:
- a list of Services that are denied on the facility
- Throws:
- PrivilegeException
 
- 
getServicesByAttributeDefinitionpublic List<Service> getServicesByAttributeDefinition(PerunSession sess, AttributeDefinition attributeDefinition) throws PrivilegeException Description copied from interface:ServicesManagerGet all services with given attribute.- Specified by:
- getServicesByAttributeDefinitionin interface- ServicesManager
- Parameters:
- sess- perun session
- attributeDefinition-
- Returns:
- all services with given attribute
- Throws:
- PrivilegeException
 
- 
isServiceBlockedOnDestinationpublic boolean isServiceBlockedOnDestination(PerunSession sess, Service service, int destinationId) throws PrivilegeException, DestinationNotExistsException, FacilityNotExistsException Description copied from interface:ServicesManagerIs this Service denied on the destination?- Specified by:
- isServiceBlockedOnDestinationin interface- ServicesManager
- Parameters:
- service- The Service, the denial of which we want to examine
- destinationId- The destination on which we want to look up the denial of the Service
- Returns:
- true - in case the Service is denied on the destination false - in case the Service in NOT denied on the destination
- Throws:
- PrivilegeException
- DestinationNotExistsException
- FacilityNotExistsException
 
- 
isServiceBlockedOnFacilitypublic boolean isServiceBlockedOnFacility(PerunSession sess, Service service, Facility facility) throws PrivilegeException Description copied from interface:ServicesManagerIs this Service denied on the facility?- Specified by:
- isServiceBlockedOnFacilityin interface- ServicesManager
- Parameters:
- service- The Service, the denial of which we want to examine
- facility- The facility on which we want to look up the denial of the Service
- Returns:
- true - in case the Service is denied on the facility false - in case the Service in NOT denied on the facility
- Throws:
- PrivilegeException
 
- 
planServicePropagationpublic boolean planServicePropagation(PerunSession sess, Facility facility, Service service) throws PrivilegeException Description copied from interface:ServicesManagerPlans service propagation on defined facility.- Specified by:
- planServicePropagationin interface- ServicesManager
- Parameters:
- sess-
- facility-
- service-
- Returns:
- true if it is possible, false if not
- Throws:
- PrivilegeException
 
- 
planServicePropagationpublic boolean planServicePropagation(PerunSession perunSession, Service service) throws PrivilegeException Description copied from interface:ServicesManagerForces service propagation on all facilities where the service is defined on.- Specified by:
- planServicePropagationin interface- ServicesManager
- Parameters:
- perunSession-
- service-
- Returns:
- true if it is possible, false if not
- Throws:
- PrivilegeException
 
- 
removeAllDestinationspublic void removeAllDestinations(PerunSession sess, Service service, Facility facility) throws PrivilegeException, ServiceNotExistsException, FacilityNotExistsException Description copied from interface:ServicesManagerRemoves all defined destinations for the service and facility.- Specified by:
- removeAllDestinationsin interface- ServicesManager
- Parameters:
- sess-
- service-
- facility-
- Throws:
- PrivilegeException
- ServiceNotExistsException
- FacilityNotExistsException
 
- 
removeAllRequiredAttributespublic void removeAllRequiredAttributes(PerunSession sess, Service service) throws PrivilegeException, ServiceNotExistsException Description copied from interface:ServicesManagerDetate all required attributes from service- Specified by:
- removeAllRequiredAttributesin interface- ServicesManager
- Parameters:
- sess- perunSession
- service- service from which the attributes will be removed
- Throws:
- PrivilegeException- if privileges are not given
- ServiceNotExistsException- if the service doesn't exists in underlaying data source
 
- 
removeDestinationpublic void removeDestination(PerunSession sess, Service service, Facility facility, Destination destination) throws PrivilegeException, ServiceNotExistsException, FacilityNotExistsException, DestinationAlreadyRemovedException Description copied from interface:ServicesManagerRemoves an destination from the facility and service.- Specified by:
- removeDestinationin interface- ServicesManager
- Parameters:
- sess-
- service-
- facility-
- destination- string contains destination address (mail, url, hostname, ...)
- Throws:
- PrivilegeException
- ServiceNotExistsException
- FacilityNotExistsException
- DestinationAlreadyRemovedException
 
- 
removeDestinationsByRichDestinationspublic void removeDestinationsByRichDestinations(PerunSession sess, List<RichDestination> richDestinations) throws PrivilegeException, ServiceNotExistsException, FacilityNotExistsException, DestinationAlreadyRemovedException Description copied from interface:ServicesManagerRemoves destinations defined by list of rich destinations. Each destination is removed from the rich destination's facility and service.- Specified by:
- removeDestinationsByRichDestinationsin interface- ServicesManager
- Parameters:
- sess-
- richDestinations- list of rich destinations
- Throws:
- PrivilegeException
- ServiceNotExistsException
- FacilityNotExistsException
- DestinationAlreadyRemovedException
 
- 
removeRequiredAttributepublic void removeRequiredAttribute(PerunSession sess, Service service, AttributeDefinition attribute) throws PrivilegeException, AttributeNotExistsException, ServiceNotExistsException, AttributeNotAssignedException Description copied from interface:ServicesManagerRemove required attribute from service. TODO If you try to remove attribute which is default for other Required attribute ...- Specified by:
- removeRequiredAttributein interface- ServicesManager
- Parameters:
- sess- perunSession
- service- service from which the attribute will be removed
- attribute- attribute to remove
- Throws:
- PrivilegeException- if privileges are not given
- AttributeNotExistsException
- ServiceNotExistsException- if the service doesn't exists in underlaying data source
- AttributeNotAssignedException
 
- 
removeRequiredAttributespublic void removeRequiredAttributes(PerunSession sess, Service service, List<? extends AttributeDefinition> attributes) throws PrivilegeException, AttributeNotExistsException, ServiceNotExistsException, AttributeNotAssignedException Description copied from interface:ServicesManagerBatch version of removeRequiredAttribute- Specified by:
- removeRequiredAttributesin interface- ServicesManager
- Throws:
- PrivilegeException
- AttributeNotExistsException
- ServiceNotExistsException
- AttributeNotAssignedException
- See Also:
 
- 
setPerunBlSets the perunBl for this instance.- Parameters:
- perunBl- The perunBl.
 
- 
setServicesManagerBlSets the servicesManagerBl for this instance.- Parameters:
- servicesManagerBl- The servicesManagerBl.
 
- 
unblockAllServicesOnDestinationpublic void unblockAllServicesOnDestination(PerunSession sess, String destinationName) throws FacilityNotExistsException Description copied from interface:ServicesManagerErase all the possible denials on destinations defined by the destinationName. From this moment on, there are no Services being denied on these destinations.- Specified by:
- unblockAllServicesOnDestinationin interface- ServicesManager
- Parameters:
- sess-
- destinationName- The name of destinations we want to clear of all the denials.
- Throws:
- FacilityNotExistsException
 
- 
unblockAllServicesOnDestinationpublic void unblockAllServicesOnDestination(PerunSession sess, int destinationId) throws PrivilegeException, FacilityNotExistsException, DestinationNotExistsException Description copied from interface:ServicesManagerErase all the possible denials on this destination. From this moment on, there are no Services being denied on this destination.- Specified by:
- unblockAllServicesOnDestinationin interface- ServicesManager
- Parameters:
- sess-
- destinationId- The id of a destination we want to clear of all the denials.
- Throws:
- PrivilegeException
- FacilityNotExistsException
- DestinationNotExistsException
 
- 
unblockAllServicesOnFacilitypublic void unblockAllServicesOnFacility(PerunSession sess, Facility facility) throws PrivilegeException Description copied from interface:ServicesManagerErase all the possible denials on this facility. From this moment on, there are no Services being denied on this facility.- Specified by:
- unblockAllServicesOnFacilityin interface- ServicesManager
- Parameters:
- sess-
- facility- Facility we want to clear of all the denials.
- Throws:
- PrivilegeException
 
- 
unblockServiceOnDestinationpublic void unblockServiceOnDestination(PerunSession sess, Service service, int destinationId) throws PrivilegeException, FacilityNotExistsException, DestinationNotExistsException Description copied from interface:ServicesManagerFree the denial of the Service on this destination. If the Service was banned on this destination, it will be freed. In case the Service was not banned on this destination, nothing will happen.- Specified by:
- unblockServiceOnDestinationin interface- ServicesManager
- Parameters:
- sess-
- service- The Service, the denial of which we want to free on this destination.
- destinationId- The id of a destination on which we want to free the denial of the Service.
- Throws:
- PrivilegeException
- FacilityNotExistsException
- DestinationNotExistsException
 
- 
unblockServiceOnFacilitypublic void unblockServiceOnFacility(PerunSession sess, Service service, Facility facility) throws PrivilegeException Description copied from interface:ServicesManagerFree the denial of the Service on this facility. If the Service was banned on this facility, it will be freed. In case the Service was not banned on this facility, nothing will happen.- Specified by:
- unblockServiceOnFacilityin interface- ServicesManager
- Parameters:
- sess-
- service- The Service, the denial of which we want to free on this facility.
- facility- The facility on which we want to free the denial of the Service.
- Throws:
- PrivilegeException
 
- 
unblockServicesOnDestinationspublic void unblockServicesOnDestinations(PerunSession sess, List<RichDestination> richDestinations) throws PrivilegeException, FacilityNotExistsException, DestinationNotExistsException Description copied from interface:ServicesManagerFree the denial of the Service on the destination - each pair defined by the rich destination. If the Service was banned on the destination, it will be freed. In case the Service was not banned on the destination, nothing will happen.- Specified by:
- unblockServicesOnDestinationsin interface- ServicesManager
- Parameters:
- sess-
- richDestinations- the list of rich destinations
- Throws:
- PrivilegeException
- FacilityNotExistsException
- DestinationNotExistsException
 
- 
unblockServicesOnFacilitypublic void unblockServicesOnFacility(PerunSession sess, List<Service> services, Facility facility) throws PrivilegeException, FacilityNotExistsException, ServiceIsNotBannedException Description copied from interface:ServicesManagerFree the denial of the services on this facility.- Specified by:
- unblockServicesOnFacilityin interface- ServicesManager
- Parameters:
- sess- perun session
- services- list of services
- facility- facility
- Throws:
- PrivilegeException- insufficient permissions
- FacilityNotExistsException- when facility does not exist
- ServiceIsNotBannedException- when unblocking service which is not blocked
 
- 
updateServicepublic void updateService(PerunSession sess, Service service) throws ServiceNotExistsException, PrivilegeException Description copied from interface:ServicesManagerUpdates the service.- Specified by:
- updateServicein interface- ServicesManager
- Parameters:
- sess-
- service-
- Throws:
- ServiceNotExistsException
- PrivilegeException
 
 
-