Class ServicesManagerBlImpl
- All Implemented Interfaces:
ServicesManagerBl
- Author:
- Michal Prochazka <michalp@ics.muni.cz>, Slavek Licehammer <glory@ics.muni.cz>
-
Constructor Summary
-
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.void
addRequiredAttribute
(PerunSession sess, Service service, AttributeDefinition attribute) Mark the attribute as required for the service.void
addRequiredAttributes
(PerunSession sess, Service service, List<? extends AttributeDefinition> attributes) Batch version of addRequiredAttributevoid
addServiceToServicesPackage
(PerunSession sess, ServicesPackage servicesPackage, Service service) Add the service to the packagevoid
blockAllServicesOnDestination
(PerunSession sess, int destinationId) Block all services currently assigned on this destination.void
blockAllServicesOnFacility
(PerunSession sess, Facility facility) Block all services currently assigned on this facility.void
blockServiceOnDestination
(PerunSession sess, Service service, int destinationId) Bans Service on destination.void
blockServiceOnFacility
(PerunSession sess, Service service, Facility facility) Bans Service on facility.void
checkServiceExists
(PerunSession sess, Service service) Check if the service exits.void
checkServicesPackageExists
(PerunSession sess, ServicesPackage servicesPackage) Check if the service package exists.createDestination
(PerunSession sess, Destination destination) createService
(PerunSession sess, Service service) Creates new service.createServicesPackage
(PerunSession sess, ServicesPackage servicesPackage) Insert a new packagevoid
deleteDestination
(PerunSession sess, Destination destination) Deletes destination.void
deleteService
(PerunSession perunSession, Service service, boolean forceFlag) Deletes the service.void
deleteServicesPackage
(PerunSession sess, ServicesPackage servicesPackage) Remove the packageboolean
forceServicePropagation
(PerunSession sess, Facility facility, Service service) Forces service propagation on defined facility.boolean
forceServicePropagation
(PerunSession sess, Service service) Forces service propagation on all facilities where the service is defined on.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 idint
getDestinationIdByName
(PerunSession sess, String name, String type) Returns Destinations ID based on destination name and type.getDestinations
(PerunSession perunSession) Get list of all destinations.getDestinations
(PerunSession perunSession, Facility facility) Get lists of all destinations for specific FacilitygetDestinations
(PerunSession sess, Service service, Facility facility) Get list of all destinations defined for the service and facility.int
Get 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).getHashedDataWithGroups
(PerunSession sess, Service service, Facility facility, boolean consentEval, int taskRunId) Generates hashed data with group structure for given service and resource.getHashedHierarchicalData
(PerunSession sess, Service service, Facility facility, boolean consentEval, int taskRunId) Generates hashed hierarchical data structure for given service and resource.Gets the perunBl.getRichDestinations
(PerunSession perunSession, Facility facility, Service service) Get list of all rich destinations defined for the service and the facilitygetServiceById
(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 perunSession, 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.getServicesFromServicesPackage
(PerunSession sess, ServicesPackage servicesPackage) List services stored in the packagesgetServicesPackageById
(PerunSession sess, int servicesPackageId) Get package by IdgetServicesPackageByName
(PerunSession sess, String name) Get package by nameList packagesboolean
isServiceAssignedToFacility
(PerunSession sess, Facility facility, Service service) Checks whether given service is assigned to given facility (through some resource).boolean
isServiceBlockedOnDestination
(Service service, int destinationId) Is this Service denied on the destination?boolean
isServiceBlockedOnFacility
(Service service, Facility facility) Is this Service denied on the facility?boolean
planServicePropagation
(PerunSession perunSession, Facility facility, Service service) Plans service propagation on defined facility.boolean
planServicePropagation
(PerunSession perunSession, Service service) Forces service propagation on all facilities where the service is defined on.void
removeAllDestinations
(PerunSession perunSession, Facility facility) Removes all defined destinations for the facility.void
removeAllDestinations
(PerunSession sess, Service service, Facility facility) Removes all defined destinations for the service and facility.void
removeAllRequiredAttributes
(PerunSession sess, Service service) Detate all required attributes from service.void
removeDestination
(PerunSession sess, Service service, Facility facility, Destination destination) Removes an destination from the facility and service.void
removeRequiredAttribute
(PerunSession sess, Service service, AttributeDefinition attribute) Remove required attribute from service.void
removeRequiredAttributes
(PerunSession sess, Service service, List<? extends AttributeDefinition> attributes) Batch version of removeRequiredAttributevoid
removeServiceFromServicesPackage
(PerunSession sess, ServicesPackage servicesPackage, Service service) Remove Service from Services Packagevoid
setPerunBl
(PerunBl perunBl) void
unblockAllServicesOnDestination
(PerunSession sess, int destinationId) Erase all the possible denials on this destination.void
unblockAllServicesOnDestination
(PerunSession sess, String destinationName) Erase all the possible denials on destinations defined by the destinationName.void
unblockAllServicesOnFacility
(PerunSession sess, Facility facility) Erase all the possible denials on this facility.void
unblockServiceOnDestination
(PerunSession sess, Service service, int destinationId) Free the denial of the Service on this destination.void
unblockServiceOnFacility
(PerunSession sess, Service service, Facility facility) Free the denial of the Service on this facility.void
updateService
(PerunSession sess, Service service) Updates the service.void
updateServicesPackage
(PerunSession sess, ServicesPackage servicesPackage) Update package
-
Constructor Details
-
ServicesManagerBlImpl
-
-
Method Details
-
addDestination
public Destination addDestination(PerunSession sess, Service service, Facility facility, Destination destination) throws DestinationAlreadyAssignedException Description copied from interface:ServicesManagerBl
Adds 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:
addDestination
in interfaceServicesManagerBl
destination
- (Id of this destination doesn't need to be filled.)- Returns:
- destination with it's id set.
- Throws:
DestinationAlreadyAssignedException
-
addDestination
public Destination addDestination(PerunSession perunSession, List<Service> services, Facility facility, Destination destination) Description copied from interface:ServicesManagerBl
Adds 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:
addDestination
in interfaceServicesManagerBl
destination
- (id of this destination doesn't need to be filled.)- Returns:
- destination with it's id set
-
addDestinationsDefinedByHostsOnFacility
public List<Destination> addDestinationsDefinedByHostsOnFacility(PerunSession perunSession, Service service, Facility facility) throws DestinationAlreadyAssignedException Description copied from interface:ServicesManagerBl
Defines service destination for all hosts using theirs hostnames.- Specified by:
addDestinationsDefinedByHostsOnFacility
in interfaceServicesManagerBl
- Returns:
- list of added destinations
- Throws:
DestinationAlreadyAssignedException
-
addDestinationsDefinedByHostsOnFacility
public List<Destination> addDestinationsDefinedByHostsOnFacility(PerunSession perunSession, List<Service> services, Facility facility) Description copied from interface:ServicesManagerBl
Defines 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:
addDestinationsDefinedByHostsOnFacility
in interfaceServicesManagerBl
- Returns:
- list of added destinations (even if they already was added before)
-
addDestinationsDefinedByHostsOnFacility
public List<Destination> addDestinationsDefinedByHostsOnFacility(PerunSession perunSession, Facility facility) Description copied from interface:ServicesManagerBl
Defines 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:
addDestinationsDefinedByHostsOnFacility
in interfaceServicesManagerBl
- Returns:
- list of added destinations (even if they already was added before)
-
addDestinationsForAllServicesOnFacility
public List<Destination> addDestinationsForAllServicesOnFacility(PerunSession sess, Facility facility, Destination destination) throws DestinationAlreadyAssignedException Description copied from interface:ServicesManagerBl
Adds destination for all services defined on the facility.- Specified by:
addDestinationsForAllServicesOnFacility
in interfaceServicesManagerBl
- Returns:
- list of added destinations
- Throws:
DestinationAlreadyAssignedException
-
addRequiredAttribute
public void addRequiredAttribute(PerunSession sess, Service service, AttributeDefinition attribute) throws AttributeAlreadyAssignedException, ServiceAttributesCannotExtend Description copied from interface:ServicesManagerBl
Mark the attribute as required for the service. Required attributes 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:
addRequiredAttribute
in interfaceServicesManagerBl
- Throws:
AttributeAlreadyAssignedException
ServiceAttributesCannotExtend
-
addRequiredAttributes
public void addRequiredAttributes(PerunSession sess, Service service, List<? extends AttributeDefinition> attributes) throws AttributeAlreadyAssignedException, ServiceAttributesCannotExtend Description copied from interface:ServicesManagerBl
Batch version of addRequiredAttribute- Specified by:
addRequiredAttributes
in interfaceServicesManagerBl
- Throws:
AttributeAlreadyAssignedException
ServiceAttributesCannotExtend
- See Also:
-
addServiceToServicesPackage
public void addServiceToServicesPackage(PerunSession sess, ServicesPackage servicesPackage, Service service) throws ServiceAlreadyAssignedException Description copied from interface:ServicesManagerBl
Add the service to the package- Specified by:
addServiceToServicesPackage
in interfaceServicesManagerBl
servicesPackage
- services package to which the service supposed to be addedservice
- service to be added to the services package- Throws:
ServiceAlreadyAssignedException
-
blockAllServicesOnDestination
public void blockAllServicesOnDestination(PerunSession sess, int destinationId) throws PrivilegeException, DestinationNotExistsException Description copied from interface:ServicesManagerBl
Block 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:
blockAllServicesOnDestination
in interfaceServicesManagerBl
destinationId
- The id of a destination we want to block all services on.- Throws:
PrivilegeException
DestinationNotExistsException
-
blockAllServicesOnFacility
Description copied from interface:ServicesManagerBl
Block 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:
blockAllServicesOnFacility
in interfaceServicesManagerBl
facility
- Facility we want to block all services on.
-
blockServiceOnDestination
public void blockServiceOnDestination(PerunSession sess, Service service, int destinationId) throws ServiceAlreadyBannedException Description copied from interface:ServicesManagerBl
Bans 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:
blockServiceOnDestination
in interfaceServicesManagerBl
service
- The Service to be banned on this particular destinationdestinationId
- The destination on which we want to ban the Service- Throws:
ServiceAlreadyBannedException
-
blockServiceOnFacility
public void blockServiceOnFacility(PerunSession sess, Service service, Facility facility) throws ServiceAlreadyBannedException Description copied from interface:ServicesManagerBl
Bans 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:
blockServiceOnFacility
in interfaceServicesManagerBl
service
- The Service to be banned on the facilityfacility
- The facility on which we want to ban the Service- Throws:
ServiceAlreadyBannedException
-
checkServiceExists
Description copied from interface:ServicesManagerBl
Check if the service exits.- Specified by:
checkServiceExists
in interfaceServicesManagerBl
- Throws:
ServiceNotExistsException
-
checkServicesPackageExists
public void checkServicesPackageExists(PerunSession sess, ServicesPackage servicesPackage) throws ServicesPackageNotExistsException Description copied from interface:ServicesManagerBl
Check if the service package exists.- Specified by:
checkServicesPackageExists
in interfaceServicesManagerBl
- Throws:
ServicesPackageNotExistsException
-
createDestination
public Destination createDestination(PerunSession sess, Destination destination) throws DestinationExistsException - Throws:
DestinationExistsException
-
createService
Description copied from interface:ServicesManagerBl
Creates new service.- Specified by:
createService
in interfaceServicesManagerBl
- Returns:
- new service
- Throws:
ServiceExistsException
-
createServicesPackage
public ServicesPackage createServicesPackage(PerunSession sess, ServicesPackage servicesPackage) throws ServicesPackageExistsException Description copied from interface:ServicesManagerBl
Insert a new package- Specified by:
createServicesPackage
in interfaceServicesManagerBl
servicesPackage
- package to be inserted- Returns:
- ServicesPackage object completely filled (including Id)
- Throws:
ServicesPackageExistsException
-
deleteDestination
public void deleteDestination(PerunSession sess, Destination destination) throws DestinationAlreadyRemovedException, RelationExistsException Description copied from interface:ServicesManagerBl
Deletes destination.- Specified by:
deleteDestination
in interfaceServicesManagerBl
destination
- destination to be deleted- Throws:
DestinationAlreadyRemovedException
- if there are 0 rows affected by deleting from DBRelationExistsException
- if the destination is used by some services and facilities
-
deleteService
public void deleteService(PerunSession perunSession, Service service, boolean forceFlag) throws RelationExistsException, ServiceAlreadyRemovedException Description copied from interface:ServicesManagerBl
Deletes the service.- Specified by:
deleteService
in interfaceServicesManagerBl
forceFlag
- if set to true, removes the service with all dependendant objects from db instead of raising exception- Throws:
RelationExistsException
ServiceAlreadyRemovedException
- if there are 0 rows affected by deleting from DB
-
deleteServicesPackage
public void deleteServicesPackage(PerunSession sess, ServicesPackage servicesPackage) throws RelationExistsException Description copied from interface:ServicesManagerBl
Remove the package- Specified by:
deleteServicesPackage
in interfaceServicesManagerBl
servicesPackage
- services package to be removed.- Throws:
RelationExistsException
-
forceServicePropagation
Description copied from interface:ServicesManagerBl
Forces service propagation on defined facility.- Specified by:
forceServicePropagation
in interfaceServicesManagerBl
- Returns:
- true if it is possible, false if not
-
forceServicePropagation
Description copied from interface:ServicesManagerBl
Forces service propagation on all facilities where the service is defined on.- Specified by:
forceServicePropagation
in interfaceServicesManagerBl
- Returns:
- true if it is possible, false if not
-
getAllRichDestinations
Description copied from interface:ServicesManagerBl
Get list of all rich destinations defined for the facility.- Specified by:
getAllRichDestinations
in interfaceServicesManagerBl
- Returns:
- list of rich destinations defined for the facility
-
getAllRichDestinations
Description copied from interface:ServicesManagerBl
Get list of all rich destinations defined for the service.- Specified by:
getAllRichDestinations
in interfaceServicesManagerBl
- Returns:
- list of rich destinations defined for the service
-
getAssignedResources
Description copied from interface:ServicesManagerBl
Get all resources where the service is defined.- Specified by:
getAssignedResources
in interfaceServicesManagerBl
- Returns:
- list of resources where the service is defined
-
getAssignedServices
Description copied from interface:ServicesManagerBl
List all services associated with the facility (via resource).- Specified by:
getAssignedServices
in interfaceServicesManagerBl
- Returns:
- list of services assigned to facility
-
getAssignedServices
Description copied from interface:ServicesManagerBl
List all services associated with the facility and vo (via resource).- Specified by:
getAssignedServices
in interfaceServicesManagerBl
- Returns:
- list of services assigned to facility and vo
-
getDestinationById
public Destination getDestinationById(PerunSession sess, int id) throws DestinationNotExistsException Description copied from interface:ServicesManagerBl
Get destination by id- Specified by:
getDestinationById
in interfaceServicesManagerBl
- Returns:
- Destination with the id
- Throws:
DestinationNotExistsException
-
getDestinationIdByName
public int getDestinationIdByName(PerunSession sess, String name, String type) throws DestinationNotExistsException Description copied from interface:ServicesManagerBl
Returns Destinations ID based on destination name and type.- Specified by:
getDestinationIdByName
in interfaceServicesManagerBl
name
- Name (value) of destinationtype
- type of destination- Returns:
- Throws:
DestinationNotExistsException
-
getDestinations
Description copied from interface:ServicesManagerBl
Get list of all destinations defined for the service and facility.- Specified by:
getDestinations
in interfaceServicesManagerBl
- Returns:
- list list of destinations defined for the service and facility
-
getDestinations
Description copied from interface:ServicesManagerBl
Get list of all destinations.- Specified by:
getDestinations
in interfaceServicesManagerBl
- Returns:
- list of all destinations for session
-
getDestinations
Description copied from interface:ServicesManagerBl
Get lists of all destinations for specific Facility- Specified by:
getDestinations
in interfaceServicesManagerBl
facility
- the facility- Returns:
- lists of all destinations for specific Facility
-
getDestinationsCount
Description copied from interface:ServicesManagerBl
Get count of all destinations.- Specified by:
getDestinationsCount
in interfaceServicesManagerBl
- Returns:
- count of all destinations
-
getFacilitiesDestinations
Description copied from interface:ServicesManagerBl
List all destinations for all facilities which are joined by resources to the VO.- Specified by:
getFacilitiesDestinations
in interfaceServicesManagerBl
vo
- vo for which we are searching destinations- Returns:
- list of destinations
-
getFacilityAssignedServicesForGUI
public List<ServiceForGUI> getFacilityAssignedServicesForGUI(PerunSession perunSession, Facility facility) Description copied from interface:ServicesManagerBl
Return list of ServiceForGUI assigned on facility, (Service with "allowedOnFacility" property filled). 1 - allowed / 0 - service is denied).- Specified by:
getFacilityAssignedServicesForGUI
in interfaceServicesManagerBl
- Returns:
- list of assigned services with allowed property
-
getHashedDataWithGroups
public HashedGenData getHashedDataWithGroups(PerunSession sess, Service service, Facility facility, boolean consentEval, int taskRunId) Description copied from interface:ServicesManagerBl
Generates hashed data with group structure for given service and resource. 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:
getHashedDataWithGroups
in interfaceServicesManagerBl
- 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
-
getHashedHierarchicalData
public HashedGenData getHashedHierarchicalData(PerunSession sess, Service service, Facility facility, boolean consentEval, int taskRunId) Description copied from interface:ServicesManagerBl
Generates hashed hierarchical data structure for given service and resource. 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:
getHashedHierarchicalData
in interfaceServicesManagerBl
- 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
-
getPerunBl
Gets the perunBl.- Returns:
- The perunBl.
-
getRichDestinations
public List<RichDestination> getRichDestinations(PerunSession perunSession, Facility facility, Service service) Description copied from interface:ServicesManagerBl
Get list of all rich destinations defined for the service and the facility- Specified by:
getRichDestinations
in interfaceServicesManagerBl
- Returns:
- list of rich destinations defined for the service and the facility
-
getServiceById
Description copied from interface:ServicesManagerBl
Get service by id.- Specified by:
getServiceById
in interfaceServicesManagerBl
- Returns:
- service with specified id
- Throws:
ServiceNotExistsException
-
getServiceByName
Description copied from interface:ServicesManagerBl
Get service by name.- Specified by:
getServiceByName
in interfaceServicesManagerBl
name
- name of the service- Returns:
- service with specified name
- Throws:
ServiceNotExistsException
-
getServices
Description copied from interface:ServicesManagerBl
get all services in perun- Specified by:
getServices
in interfaceServicesManagerBl
- Returns:
- all services in perun
-
getServicesBlockedOnDestination
Description copied from interface:ServicesManagerBl
List all the Services that are banned on this destination.- Specified by:
getServicesBlockedOnDestination
in interfaceServicesManagerBl
- Returns:
- a list of Services that are denied on the destination
-
getServicesBlockedOnFacility
Description copied from interface:ServicesManagerBl
List all the Services that are banned on this facility.- Specified by:
getServicesBlockedOnFacility
in interfaceServicesManagerBl
- Returns:
- a list of Services that are denied on the facility
-
getServicesByAttributeDefinition
public List<Service> getServicesByAttributeDefinition(PerunSession sess, AttributeDefinition attributeDefinition) Description copied from interface:ServicesManagerBl
Get all services with given attribute.- Specified by:
getServicesByAttributeDefinition
in interfaceServicesManagerBl
- Parameters:
sess
- perun session- Returns:
- all services with given attribute
-
getServicesFromServicesPackage
public List<Service> getServicesFromServicesPackage(PerunSession sess, ServicesPackage servicesPackage) Description copied from interface:ServicesManagerBl
List services stored in the packages- Specified by:
getServicesFromServicesPackage
in interfaceServicesManagerBl
servicesPackage
- the package from which we want to list the services- Returns:
- list consisting services
-
getServicesPackageById
public ServicesPackage getServicesPackageById(PerunSession sess, int servicesPackageId) throws ServicesPackageNotExistsException Description copied from interface:ServicesManagerBl
Get package by Id- Specified by:
getServicesPackageById
in interfaceServicesManagerBl
servicesPackageId
- id of the package we want to retrieve- Returns:
- package
- Throws:
ServicesPackageNotExistsException
-
getServicesPackageByName
public ServicesPackage getServicesPackageByName(PerunSession sess, String name) throws ServicesPackageNotExistsException Description copied from interface:ServicesManagerBl
Get package by name- Specified by:
getServicesPackageByName
in interfaceServicesManagerBl
name
- name of the services package- Returns:
- package
- Throws:
ServicesPackageNotExistsException
-
getServicesPackages
Description copied from interface:ServicesManagerBl
List packages- Specified by:
getServicesPackages
in interfaceServicesManagerBl
- Returns:
- list of packages in the DB
-
isServiceAssignedToFacility
Description copied from interface:ServicesManagerBl
Checks whether given service is assigned to given facility (through some resource).- Specified by:
isServiceAssignedToFacility
in interfaceServicesManagerBl
- Parameters:
sess
- sessionfacility
- facilityservice
- service- Returns:
- true if service is assigned to given facility, false otherwise
-
isServiceBlockedOnDestination
Description copied from interface:ServicesManagerBl
Is this Service denied on the destination?- Specified by:
isServiceBlockedOnDestination
in interfaceServicesManagerBl
- 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
-
isServiceBlockedOnFacility
Description copied from interface:ServicesManagerBl
Is this Service denied on the facility?- Specified by:
isServiceBlockedOnFacility
in interfaceServicesManagerBl
- 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
-
planServicePropagation
public boolean planServicePropagation(PerunSession perunSession, Facility facility, Service service) Description copied from interface:ServicesManagerBl
Plans service propagation on defined facility.- Specified by:
planServicePropagation
in interfaceServicesManagerBl
- Returns:
- true if it is possible, false if not
-
planServicePropagation
Description copied from interface:ServicesManagerBl
Forces service propagation on all facilities where the service is defined on.- Specified by:
planServicePropagation
in interfaceServicesManagerBl
- Returns:
- true if it is possible, false if not
-
removeAllDestinations
Description copied from interface:ServicesManagerBl
Removes all defined destinations for the service and facility.- Specified by:
removeAllDestinations
in interfaceServicesManagerBl
-
removeAllDestinations
Description copied from interface:ServicesManagerBl
Removes all defined destinations for the facility.- Specified by:
removeAllDestinations
in interfaceServicesManagerBl
facility
- the facility
-
removeAllRequiredAttributes
Description copied from interface:ServicesManagerBl
Detate all required attributes from service.- Specified by:
removeAllRequiredAttributes
in interfaceServicesManagerBl
-
removeDestination
public void removeDestination(PerunSession sess, Service service, Facility facility, Destination destination) throws DestinationAlreadyRemovedException Description copied from interface:ServicesManagerBl
Removes an destination from the facility and service.- Specified by:
removeDestination
in interfaceServicesManagerBl
destination
- string contains destination address (mail, url, hostname, ...)- Throws:
DestinationAlreadyRemovedException
-
removeRequiredAttribute
public void removeRequiredAttribute(PerunSession sess, Service service, AttributeDefinition attribute) throws AttributeNotAssignedException Description copied from interface:ServicesManagerBl
Remove required attribute from service. TODO If you try to remove attribute which is default for other Required attribute ...- Specified by:
removeRequiredAttribute
in interfaceServicesManagerBl
- Throws:
AttributeNotAssignedException
-
removeRequiredAttributes
public void removeRequiredAttributes(PerunSession sess, Service service, List<? extends AttributeDefinition> attributes) throws AttributeNotAssignedException Description copied from interface:ServicesManagerBl
Batch version of removeRequiredAttribute- Specified by:
removeRequiredAttributes
in interfaceServicesManagerBl
- Throws:
AttributeNotAssignedException
- See Also:
-
removeServiceFromServicesPackage
public void removeServiceFromServicesPackage(PerunSession sess, ServicesPackage servicesPackage, Service service) throws ServiceAlreadyRemovedFromServicePackageException Description copied from interface:ServicesManagerBl
Remove Service from Services Package- Specified by:
removeServiceFromServicesPackage
in interfaceServicesManagerBl
servicesPackage
- services package from which the service supposed to be removedservice
- service that will be removed from the services package- Throws:
ServiceAlreadyRemovedFromServicePackageException
- there are 0 rows affected by removing service from servicePackage in DB
-
setPerunBl
-
unblockAllServicesOnDestination
Description copied from interface:ServicesManagerBl
Erase 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:
unblockAllServicesOnDestination
in interfaceServicesManagerBl
destinationName
- The name of destinations we want to clear of all the denials.
-
unblockAllServicesOnDestination
Description copied from interface:ServicesManagerBl
Erase all the possible denials on this destination. From this moment on, there are no Services being denied on this destination.- Specified by:
unblockAllServicesOnDestination
in interfaceServicesManagerBl
destinationId
- The id of a destination we want to clear of all the denials.
-
unblockAllServicesOnFacility
Description copied from interface:ServicesManagerBl
Erase all the possible denials on this facility. From this moment on, there are no Services being denied on this facility.- Specified by:
unblockAllServicesOnFacility
in interfaceServicesManagerBl
facility
- Facility we want to clear of all the denials.
-
unblockServiceOnDestination
Description copied from interface:ServicesManagerBl
Free 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:
unblockServiceOnDestination
in interfaceServicesManagerBl
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.
-
unblockServiceOnFacility
Description copied from interface:ServicesManagerBl
Free 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:
unblockServiceOnFacility
in interfaceServicesManagerBl
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.
-
updateService
Description copied from interface:ServicesManagerBl
Updates the service.- Specified by:
updateService
in interfaceServicesManagerBl
-
updateServicesPackage
Description copied from interface:ServicesManagerBl
Update package- Specified by:
updateServicesPackage
in interfaceServicesManagerBl
servicesPackage
- with which is the old one supposed to be updated :-)
-