Class ServicesManagerEntry
- All Implemented Interfaces:
ServicesManager
- Author:
- Slavek Licehammer invalid input: '<'glory@ics.muni.cz>
-
Field Summary
Fields inherited from interface cz.metacentrum.perun.core.api.ServicesManager
SERVICE_NAME_REGEXP -
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
ServicesManagerEntry
public ServicesManagerEntry()
-
-
Method Details
-
addDestination
public 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 interfaceServicesManager- Parameters:
perunSession-services-facility-destination- (id of this destination doesn't need to be filled.)- Returns:
- destination with it's id set
- Throws:
PrivilegeExceptionServiceNotExistsExceptionFacilityNotExistsExceptionWrongPatternException
-
addDestination
public 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 interfaceServicesManager- Parameters:
sess-service-facility-destination- (Id of this destination doesn't need to be filled.)- Returns:
- destination with it's id set.
- Throws:
PrivilegeExceptionServiceNotExistsExceptionFacilityNotExistsExceptionDestinationAlreadyAssignedExceptionWrongPatternException
-
addDestinationsDefinedByHostsOnFacility
public 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 interfaceServicesManager- Parameters:
perunSession-service-facility-- Returns:
- list of added destinations
- Throws:
PrivilegeExceptionServiceNotExistsExceptionFacilityNotExistsExceptionDestinationAlreadyAssignedException
-
addDestinationsDefinedByHostsOnFacility
public 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 interfaceServicesManager- Parameters:
perunSession-services-facility-- Returns:
- list of added destinations (even if they already was added before)
- Throws:
PrivilegeExceptionServiceNotExistsExceptionFacilityNotExistsException
-
addDestinationsDefinedByHostsOnFacility
public 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 interfaceServicesManager- Parameters:
perunSession-facility-- Returns:
- list of added destinations (even if they already was added before)
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
addDestinationsForAllServicesOnFacility
public 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 interfaceServicesManager- Parameters:
sess-facility-destination-- Returns:
- list of added destinations
- Throws:
PrivilegeExceptionFacilityNotExistsExceptionDestinationAlreadyAssignedExceptionWrongPatternException
-
addRequiredAttribute
public 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 interfaceServicesManager- Parameters:
sess- perunSessionservice- service to which the attribute will be addedattribute- attribute to add- Throws:
PrivilegeException- if privileges are not givenAttributeNotExistsException- if the attribute doesn't exists in underlaying data sourceServiceNotExistsException- if the service doesn't exists in underlaying data sourceAttributeAlreadyAssignedException- if the attribute is already addedServiceAttributesCannotExtend- if trying to add user-related attribute that could invalidate consents
-
addRequiredAttributes
public 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 interfaceServicesManager- Throws:
PrivilegeExceptionAttributeNotExistsExceptionServiceNotExistsExceptionAttributeAlreadyAssignedExceptionServiceAttributesCannotExtend- See Also:
-
blockAllServicesOnDestination
public 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 interfaceServicesManager- Parameters:
sess-destinationId- The id of a destination we want to block all services on.- Throws:
PrivilegeExceptionDestinationNotExistsExceptionFacilityNotExistsException
-
blockAllServicesOnFacility
public 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 interfaceServicesManager- Parameters:
sess-facility- Facility we want to block all services on.- Throws:
FacilityNotExistsExceptionPrivilegeException
-
blockServiceOnDestination
public 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 interfaceServicesManager- Parameters:
sess-service- The Service to be banned on this particular destinationdestinationId- The destination on which we want to ban the Service- Throws:
PrivilegeExceptionDestinationNotExistsExceptionServiceAlreadyBannedExceptionFacilityNotExistsException
-
blockServiceOnFacility
public 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 interfaceServicesManager- Parameters:
sess-service- The Service to be banned on the facilityfacility- The facility on which we want to ban the Service- Throws:
ServiceAlreadyBannedExceptionPrivilegeException
-
blockServicesOnDestinations
public 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 interfaceServicesManager- Parameters:
sess-richDestinations- the list of rich destinations- Throws:
PrivilegeExceptionDestinationNotExistsExceptionFacilityNotExistsException
-
blockServicesOnFacility
public 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 interfaceServicesManager- Parameters:
sess- perun sessionservices- list of servicesfacility- The facility on which we want to ban services- Throws:
ServiceAlreadyBannedException- when service was already bannedPrivilegeException- insufficient permissionsFacilityNotExistsException- when facility does not exist
-
createService
public Service createService(PerunSession sess, Service service) throws PrivilegeException, ServiceExistsException Description copied from interface:ServicesManagerCreates new service.- Specified by:
createServicein interfaceServicesManager- Parameters:
sess-service-- Returns:
- new service
- Throws:
PrivilegeExceptionServiceExistsException
-
deleteService
public void deleteService(PerunSession sess, Service service, boolean forceFlag) throws ServiceNotExistsException, PrivilegeException, RelationExistsException, ServiceAlreadyRemovedException Description copied from interface:ServicesManagerDeletes the service.- Specified by:
deleteServicein interfaceServicesManager- Parameters:
sess-service-forceFlag- if true, removes all dependant objects from database instead of raising exception- Throws:
ServiceNotExistsExceptionPrivilegeExceptionRelationExistsExceptionServiceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
-
deleteServices
public void deleteServices(PerunSession sess, List<Service> services, boolean forceFlag) throws ServiceNotExistsException, PrivilegeException, RelationExistsException, ServiceAlreadyRemovedException Description copied from interface:ServicesManagerDeletes given services.- Specified by:
deleteServicesin interfaceServicesManager- Parameters:
sess-services- list of servicesforceFlag- if true, removes all dependant objects from database instead of raising exception- Throws:
ServiceNotExistsExceptionPrivilegeExceptionRelationExistsExceptionServiceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
-
forceServicePropagation
public boolean forceServicePropagation(PerunSession sess, Facility facility, Service service) throws PrivilegeException Description copied from interface:ServicesManagerForces service propagation on defined facility.- Specified by:
forceServicePropagationin interfaceServicesManager- Parameters:
sess-facility-service-- Returns:
- true if it is possible, false if not
- Throws:
PrivilegeException
-
forceServicePropagation
public 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 interfaceServicesManager- Parameters:
sess-service-- Returns:
- true if it is possible, false if not
- Throws:
PrivilegeException
-
forceServicePropagationBulk
public 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 interfaceServicesManager- Parameters:
sess- perun sessionfacility- facilityservices- list of services- Throws:
PrivilegeException- insufficient permissionsFacilityNotExistsException- when facility does not existForceServicePropagationDisabledException- when forcing propagation is not possible
-
forceServicePropagationBulk
public 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 interfaceServicesManager- Parameters:
sess- sessionservices- list of services- Throws:
PrivilegeException- insufficient permissionsForceServicePropagationDisabledException- when forcing propagation is not possible
-
forceServicePropagationForHostname
public 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 interfaceServicesManager- 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
-
getAllRichDestinations
public 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 interfaceServicesManager- Parameters:
perunSession-facility-- Returns:
- Throws:
PrivilegeException- if privileges are not givenFacilityNotExistsException- if facility which we get from service and destination not exist
-
getAllRichDestinations
public 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 interfaceServicesManager- Parameters:
perunSession-service-- Returns:
- Throws:
PrivilegeException- if privileges are not givenServiceNotExistsException- if service which we get from facility and destination not exist
-
getAssignedResources
public 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 interfaceServicesManager- Parameters:
sess-service-- Returns:
- list of resources where the service is defined
- Throws:
PrivilegeExceptionServiceNotExistsException
-
getAssignedServices
public 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 interfaceServicesManager- Parameters:
sess-facility-- Returns:
- list of services assigned to facility
- Throws:
FacilityNotExistsExceptionPrivilegeException
-
getAssignedServices
public 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 interfaceServicesManager- Parameters:
sess-facility-vo-- Returns:
- list of services assigned to facility and vo
- Throws:
FacilityNotExistsExceptionVoNotExistsExceptionPrivilegeException
-
getDestinationById
public Destination getDestinationById(PerunSession sess, int id) throws PrivilegeException, DestinationNotExistsException Description copied from interface:ServicesManagerGet destination by id- Specified by:
getDestinationByIdin interfaceServicesManager- Parameters:
sess-id-- Returns:
- Destination with the id
- Throws:
PrivilegeExceptionDestinationNotExistsException
-
getDestinationIdByName
public 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 interfaceServicesManager- Parameters:
sess-name- Name (value) of Destinationtype- Type of destination- Returns:
- ID of Destination
- Throws:
DestinationNotExistsException
-
getDestinations
public 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 interfaceServicesManager- Parameters:
sess-service-facility-- Returns:
- list list of destinations defined for the service and facility
- Throws:
PrivilegeExceptionServiceNotExistsExceptionFacilityNotExistsException
-
getDestinations
Description copied from interface:ServicesManagerGet list of all destinations.- Specified by:
getDestinationsin interfaceServicesManager- Parameters:
perunSession-- Returns:
- list of all destinations for session
- Throws:
PrivilegeException
-
getDestinationsCount
Description copied from interface:ServicesManagerGet count of all destinations.- Specified by:
getDestinationsCountin interfaceServicesManager- Parameters:
sess- PerunSession- Returns:
- count of all destinations
-
getFacilitiesDestinations
public 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 interfaceServicesManager- Parameters:
sess-vo- vo for which we are searching destinations- Returns:
- list of destinations
- Throws:
VoNotExistsException
-
getFacilityAssignedServicesForGUI
public 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 interfaceServicesManager- Parameters:
perunSession-facility-- Returns:
- list of assigned services with allowed property
- Throws:
PrivilegeExceptionFacilityNotExistsException
-
getHashedDataWithGroups
public 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 interfaceServicesManager- Parameters:
sess- perun sessionservice- servicefacility- facilityconsentEval- if the generator should force evaluation of consentstaskRunId- Integer id of the task run propagation- Returns:
- generated hashed data structure
- Throws:
FacilityNotExistsException- if there is no such facilityServiceNotExistsException- if there is no such servicePrivilegeException- insufficient permissions
-
getHashedHierarchicalData
public 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 interfaceServicesManager- Parameters:
sess- perun sessionservice- servicefacility- facilityconsentEval- if the generator should force evaluation of consentstaskRunId- Integer id of the task run propagation- Returns:
- generated hashed data structure
- Throws:
FacilityNotExistsException- if there is no such facilityServiceNotExistsException- if there is no such servicePrivilegeException- insufficient permissions
-
getPerunBl
-
getRichDestinations
public 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 interfaceServicesManager- Parameters:
perunSession-facility-service-- Returns:
- Throws:
PrivilegeException- if privileges are not givenFacilityNotExistsException- if the facility not existServiceNotExistsException- if the service not exist
-
getServiceById
public Service getServiceById(PerunSession sess, int id) throws PrivilegeException, ServiceNotExistsException Description copied from interface:ServicesManagerGet service by id.- Specified by:
getServiceByIdin interfaceServicesManager- Parameters:
sess-id-- Returns:
- service with specified id
- Throws:
PrivilegeExceptionServiceNotExistsException
-
getServiceByName
public Service getServiceByName(PerunSession sess, String name) throws PrivilegeException, ServiceNotExistsException Description copied from interface:ServicesManagerGet service by name.- Specified by:
getServiceByNamein interfaceServicesManager- Parameters:
sess-name- name of the service- Returns:
- service with specified name
- Throws:
PrivilegeExceptionServiceNotExistsException
-
getServices
Description copied from interface:ServicesManagerget all services in perun- Specified by:
getServicesin interfaceServicesManager- Parameters:
sess-- Returns:
- all services in perun
- Throws:
PrivilegeException
-
getServicesBlockedOnDestination
public 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 interfaceServicesManager- Parameters:
sess-destinationId-- Returns:
- a list of Services that are denied on the destination
- Throws:
PrivilegeExceptionDestinationNotExistsExceptionFacilityNotExistsException
-
getServicesBlockedOnFacility
public 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 interfaceServicesManager- Parameters:
perunSession-facility-- Returns:
- a list of Services that are denied on the facility
- Throws:
PrivilegeException
-
getServicesByAttributeDefinition
public List<Service> getServicesByAttributeDefinition(PerunSession sess, AttributeDefinition attributeDefinition) throws PrivilegeException Description copied from interface:ServicesManagerGet all services with given attribute.- Specified by:
getServicesByAttributeDefinitionin interfaceServicesManager- Parameters:
sess- perun sessionattributeDefinition-- Returns:
- all services with given attribute
- Throws:
PrivilegeException
-
isServiceBlockedOnDestination
public 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 interfaceServicesManager- Parameters:
service- The Service, the denial of which we want to examinedestinationId- 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:
PrivilegeExceptionDestinationNotExistsExceptionFacilityNotExistsException
-
isServiceBlockedOnFacility
public boolean isServiceBlockedOnFacility(PerunSession sess, Service service, Facility facility) throws PrivilegeException Description copied from interface:ServicesManagerIs this Service denied on the facility?- Specified by:
isServiceBlockedOnFacilityin interfaceServicesManager- Parameters:
service- The Service, the denial of which we want to examinefacility- 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
-
planServicePropagation
public boolean planServicePropagation(PerunSession sess, Facility facility, Service service) throws PrivilegeException Description copied from interface:ServicesManagerPlans service propagation on defined facility.- Specified by:
planServicePropagationin interfaceServicesManager- Parameters:
sess-facility-service-- Returns:
- true if it is possible, false if not
- Throws:
PrivilegeException
-
planServicePropagation
public 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 interfaceServicesManager- Parameters:
perunSession-service-- Returns:
- true if it is possible, false if not
- Throws:
PrivilegeException
-
removeAllDestinations
public 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 interfaceServicesManager- Parameters:
sess-service-facility-- Throws:
PrivilegeExceptionServiceNotExistsExceptionFacilityNotExistsException
-
removeAllRequiredAttributes
public void removeAllRequiredAttributes(PerunSession sess, Service service) throws PrivilegeException, ServiceNotExistsException Description copied from interface:ServicesManagerDetate all required attributes from service- Specified by:
removeAllRequiredAttributesin interfaceServicesManager- Parameters:
sess- perunSessionservice- service from which the attributes will be removed- Throws:
PrivilegeException- if privileges are not givenServiceNotExistsException- if the service doesn't exists in underlaying data source
-
removeDestination
public 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 interfaceServicesManager- Parameters:
sess-service-facility-destination- string contains destination address (mail, url, hostname, ...)- Throws:
PrivilegeExceptionServiceNotExistsExceptionFacilityNotExistsExceptionDestinationAlreadyRemovedException
-
removeDestinationsByRichDestinations
public 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 interfaceServicesManager- Parameters:
sess-richDestinations- list of rich destinations- Throws:
PrivilegeExceptionServiceNotExistsExceptionFacilityNotExistsExceptionDestinationAlreadyRemovedException
-
removeRequiredAttribute
public 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 interfaceServicesManager- Parameters:
sess- perunSessionservice- service from which the attribute will be removedattribute- attribute to remove- Throws:
PrivilegeException- if privileges are not givenAttributeNotExistsExceptionServiceNotExistsException- if the service doesn't exists in underlaying data sourceAttributeNotAssignedException
-
removeRequiredAttributes
public 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 interfaceServicesManager- Throws:
PrivilegeExceptionAttributeNotExistsExceptionServiceNotExistsExceptionAttributeNotAssignedException- See Also:
-
setPerunBl
Sets the perunBl for this instance.- Parameters:
perunBl- The perunBl.
-
setServicesManagerBl
Sets the servicesManagerBl for this instance.- Parameters:
servicesManagerBl- The servicesManagerBl.
-
unblockAllServicesOnDestination
public 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 interfaceServicesManager- Parameters:
sess-destinationName- The name of destinations we want to clear of all the denials.- Throws:
FacilityNotExistsException
-
unblockAllServicesOnDestination
public 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 interfaceServicesManager- Parameters:
sess-destinationId- The id of a destination we want to clear of all the denials.- Throws:
PrivilegeExceptionFacilityNotExistsExceptionDestinationNotExistsException
-
unblockAllServicesOnFacility
public 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 interfaceServicesManager- Parameters:
sess-facility- Facility we want to clear of all the denials.- Throws:
PrivilegeException
-
unblockServiceOnDestination
public 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 interfaceServicesManager- 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:
PrivilegeExceptionFacilityNotExistsExceptionDestinationNotExistsException
-
unblockServiceOnFacility
public 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 interfaceServicesManager- 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
-
unblockServicesOnDestinations
public 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 interfaceServicesManager- Parameters:
sess-richDestinations- the list of rich destinations- Throws:
PrivilegeExceptionFacilityNotExistsExceptionDestinationNotExistsException
-
unblockServicesOnFacility
public 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 interfaceServicesManager- Parameters:
sess- perun sessionservices- list of servicesfacility- facility- Throws:
PrivilegeException- insufficient permissionsFacilityNotExistsException- when facility does not existServiceIsNotBannedException- when unblocking service which is not blocked
-
updateService
public void updateService(PerunSession sess, Service service) throws ServiceNotExistsException, PrivilegeException Description copied from interface:ServicesManagerUpdates the service.- Specified by:
updateServicein interfaceServicesManager- Parameters:
sess-service-- Throws:
ServiceNotExistsExceptionPrivilegeException
-