Interface ServicesManagerImplApi
- All Known Implementing Classes:
- ServicesManagerImpl
public interface ServicesManagerImplApi
- Author:
- Michal Prochazka invalid input: '<'michalp@ics.muni.cz>, Slavek Licehammer invalid input: '<'glory@ics.muni.cz>
 Note: ServicesManager is not to be used directly by any client. ServicesManager's functionality is going to be encapsulated in the Controller's GeneralServiceManager. 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddDestination(PerunSession perunSession, Service service, Facility facility, Destination destination) Adds an destination for the facility and service.voidaddRequiredAttribute(PerunSession perunSession, Service service, AttributeDefinition attribute) Mark the attribute as required for the service.voidaddRequiredAttributes(PerunSession perunSession, Service service, List<? extends AttributeDefinition> attributes) Batch version of addRequiredAttributevoidblockServiceOnDestination(PerunSession session, int serviceId, int destinationId) Block Service on specific Destination.voidblockServiceOnFacility(PerunSession session, int serviceId, int facilityId) Block Service on Facility.voidcheckServiceExists(PerunSession perunSession, Service service) Check if service exists in underlaying data source.createDestination(PerunSession sess, Destination destination) createService(PerunSession perunSession, Service service) Creates new service.voiddeleteDestination(PerunSession sess, Destination destination) Deletes destination.voiddeleteService(PerunSession perunSession, Service service) Deletes the service.booleandestinationExists(PerunSession sess, Destination destination) booleandestinationExists(PerunSession sess, Service service, Facility facility, Destination destination) Determine if destination exists for specified facility and service.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 which use this service.getAssignedServices(PerunSession perunSession, Facility facility) List all services associated with the facility (via resource).getAssignedServices(PerunSession perunSession, Facility facility, Vo vo) List all services associated with the facility and vo (via resource).getDestination(PerunSession sess, String destination, String type) Get destination by String destination and typegetDestinationById(PerunSession perunSession, int id) Get destination by idgetDestinations(PerunSession perunSession) Get list of all destinations.getDestinations(PerunSession perunSession, Facility facility) Get lists of all destinations for specific FacilitygetDestinations(PerunSession perunSession, Service service, Facility facility) Get list of all destinations defined for the service and facility.intgetDestinationsCount(PerunSession perunSession) Get count of all destinations.getFacilitiesDestinations(PerunSession sess, Vo vo) List all destinations for all facilities which are joined by resources to the VO.getRichDestinations(PerunSession perunSession, Facility facility, Service service) Get list of all rich destinations defined for the service and the facilitygetServiceById(PerunSession perunSession, int id) Get service by id.getServiceByName(PerunSession perunSession, String name) Get service by name.getServices(PerunSession perunSession) get all services in perungetServicesBlockedOnDestination(int destinationId) Get Services blocked on Destination.getServicesBlockedOnFacility(int facilityId) Get Services blocked on Facility.getServicesByAttributeDefinition(PerunSession sess, AttributeDefinition attributeDefinition) Get all services with given attribute.getServicesFromDestination(int destinationId) Return list of services this destination points to.booleanisServiceAssignedToFacility(PerunSession sess, Facility facility, Service service) Checks whether given service is assigned to given facility (through some resource).booleanisServiceBlockedOnDestination(int serviceId, int destinationId) Return TRUE if Service is blocked on Destination.booleanisServiceBlockedOnFacility(int serviceId, int facilityId) Return TRUE if Service is blocked on Facility.voidremoveAllDestinations(PerunSession perunSession, Facility facility) Removes all defined destinations for the facility.voidremoveAllDestinations(PerunSession perunSession, Service service, Facility facility) Removes all defined destinations for the service and facility.voidremoveAllRequiredAttributes(PerunSession perunSession, Service service) Detate all required attributes from servicevoidremoveDestination(PerunSession perunSession, Service service, Facility facility, Destination destination) Removes an destination from the facility and service.voidremoveRequiredAttribute(PerunSession perunSession, Service service, AttributeDefinition attribute) Remove required attribute from service.voidremoveRequiredAttributes(PerunSession perunSession, Service service, List<? extends AttributeDefinition> attributes) Batch version of removeRequiredAttributebooleanserviceExists(PerunSession perunSession, Service service) Check if service exists in underlaying data source.voidunblockAllServicesOnDestination(int destination) Unblock all blocked Services on specified Destination.voidunblockAllServicesOnFacility(int facility) Unblock all blocked Services on Facility.voidunblockService(int serviceId) Unblock Service everywhere.voidunblockServiceOnDestination(int serviceId, int destinationId) Unblock Service on specific Destination.voidunblockServiceOnFacility(int serviceId, int facilityId) Unblock Service on whole Facility.voidupdateService(PerunSession perunSession, Service service) Updates the service.
- 
Method Details- 
addDestinationvoid addDestination(PerunSession perunSession, Service service, Facility facility, Destination destination) throws DestinationAlreadyAssignedException Adds an destination for the facility and service.- Parameters:
- perunSession-
- service-
- facility-
- destination- string contains destination address (mail, url, hostname, ...)
- Throws:
- InternalErrorException
- DestinationAlreadyAssignedException- when the combination already exists
 
- 
addRequiredAttributevoid addRequiredAttribute(PerunSession perunSession, Service service, AttributeDefinition attribute) throws AttributeAlreadyAssignedException Mark 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.- Parameters:
- perunSession- perunSession
- service- service to which the attribute will be added
- attribute- attribute to add
- Throws:
- InternalErrorException- if an exception raise in concrete implementation, the exception is wrapped in InternalErrorException
- AttributeAlreadyAssignedException- if the attribute is already added
 
- 
addRequiredAttributesvoid addRequiredAttributes(PerunSession perunSession, Service service, List<? extends AttributeDefinition> attributes) throws AttributeAlreadyAssignedException Batch version of addRequiredAttribute- Throws:
- AttributeAlreadyAssignedException
- See Also:
 
- 
blockServiceOnDestinationvoid blockServiceOnDestination(PerunSession session, int serviceId, int destinationId) throws ServiceAlreadyBannedException Block Service on specific Destination. Service still can be propagated to other facility Destinations.- Parameters:
- session-
- serviceId- The Service to be blocked on this particular destination
- destinationId- The destination on which we want to block the Service
- Throws:
- InternalErrorException
- ServiceAlreadyBannedException
 
- 
blockServiceOnFacilityvoid blockServiceOnFacility(PerunSession session, int serviceId, int facilityId) throws ServiceAlreadyBannedException Block Service on Facility. It won't be possible to propagate service on whole facility or any of its destinations.- Parameters:
- session-
- serviceId- The Service to be blocked on the Facility
- facilityId- The Facility on which we want to block the Service
- Throws:
- InternalErrorException
- ServiceAlreadyBannedException
 
- 
checkServiceExistsvoid checkServiceExists(PerunSession perunSession, Service service) throws ServiceNotExistsException Check if service exists in underlaying data source.- Parameters:
- perunSession- perun session
- service- service to check
- Throws:
- InternalErrorException- if unexpected error occured
- ServiceNotExistsException- if service doesn't exists
 
- 
createDestination
- 
createServiceCreates new service.- Parameters:
- perunSession-
- service-
- Returns:
- new service
 
- 
deleteDestinationvoid deleteDestination(PerunSession sess, Destination destination) throws DestinationAlreadyRemovedException, RelationExistsException Deletes destination.- Parameters:
- sess-
- destination- destination to be deleted
- Throws:
- InternalErrorException
- DestinationAlreadyRemovedException- if there are 0 rows affected by deleting from DB
- RelationExistsException- if the destination has some existing relations in DB
 
- 
deleteServicevoid deleteService(PerunSession perunSession, Service service) throws ServiceAlreadyRemovedException Deletes the service.- Parameters:
- perunSession-
- service-
- Throws:
- ServiceAlreadyRemovedException- if there are 0 rows affected by deleting from DB
 
- 
destinationExistsboolean destinationExists(PerunSession sess, Service service, Facility facility, Destination destination) Determine if destination exists for specified facility and service.- Parameters:
- sess-
- service-
- facility-
- destination-
- Returns:
- true if the destination exists for the facility and the resource
- Throws:
- InternalErrorException
 
- 
destinationExists
- 
getAllRichDestinationsGet list of all rich destinations defined for the facility.- Parameters:
- perunSession-
- facility-
- Returns:
- list of rich destinations defined for the facility
- Throws:
- InternalErrorException
 
- 
getAllRichDestinationsGet list of all rich destinations defined for the service.- Parameters:
- perunSession-
- service-
- Returns:
- list of rich destinations defined for the service
- Throws:
- InternalErrorException
 
- 
getAssignedResourcesGet all resources which use this service.- Parameters:
- sess-
- service-
- Returns:
- list of resources
- Throws:
- InternalErrorException
 
- 
getAssignedServicesList all services associated with the facility (via resource).- Parameters:
- perunSession-
- facility-
- Returns:
- list of services assigned to facility
- Throws:
- InternalErrorException
 
- 
getAssignedServicesList all services associated with the facility and vo (via resource).- Parameters:
- perunSession-
- facility-
- vo-
- Returns:
- list of services assigned to facility and vo
- Throws:
- InternalErrorException
 
- 
getDestinationDestination getDestination(PerunSession sess, String destination, String type) throws DestinationNotExistsException Get destination by String destination and type- Parameters:
- sess-
- destination- Destination string representation
- type- type of destination
- Returns:
- Destination
- Throws:
- InternalErrorException
- DestinationNotExistsException
 
- 
getDestinationByIdDestination getDestinationById(PerunSession perunSession, int id) throws DestinationNotExistsException Get destination by id- Parameters:
- perunSession-
- id-
- Returns:
- Destination with the id
- Throws:
- InternalErrorException
- DestinationNotExistsException
 
- 
getDestinationsGet list of all destinations defined for the service and facility.- Parameters:
- perunSession-
- service-
- facility-
- Returns:
- list list of destinations defined for the service and facility
- Throws:
- InternalErrorException
 
- 
getDestinationsGet list of all destinations.- Parameters:
- perunSession-
- Returns:
- list of all destinations for session
- Throws:
- InternalErrorException
 
- 
getDestinationsGet lists of all destinations for specific Facility- Parameters:
- perunSession-
- facility- the facility
- Returns:
- lists of all destinations for specific Facility
- Throws:
- InternalErrorException
 
- 
getDestinationsCountGet count of all destinations.- Parameters:
- perunSession-
- Returns:
- count of all destinations
- Throws:
- InternalErrorException
 
- 
getFacilitiesDestinationsList all destinations for all facilities which are joined by resources to the VO.- Parameters:
- sess-
- vo- vo for which we are searching destinations
- Returns:
- list of destinations
- Throws:
- InternalErrorException
 
- 
getRichDestinationsList<RichDestination> getRichDestinations(PerunSession perunSession, Facility facility, Service service) Get list of all rich destinations defined for the service and the facility- Parameters:
- perunSession-
- facility-
- service-
- Returns:
- list of rich destinations defined for the service and the facility
- Throws:
- InternalErrorException
 
- 
getServiceByIdGet service by id.- Parameters:
- perunSession-
- id-
- Returns:
- service with specified id
- Throws:
- InternalErrorException
- ServiceNotExistsException
 
- 
getServiceByNameGet service by name.- Parameters:
- perunSession-
- name- name of the service
- Returns:
- service with specified name
- Throws:
- InternalErrorException
- ServiceNotExistsException
 
- 
getServicesget all services in perun- Parameters:
- perunSession-
- Returns:
- all services in perun
- Throws:
- InternalErrorException
 
- 
getServicesBlockedOnDestinationGet Services blocked on Destination.- Parameters:
- destinationId- ID of Destination to get blocked Services for.
- Returns:
- List of blocked Services.
 
- 
getServicesBlockedOnFacilityGet Services blocked on Facility.- Parameters:
- facilityId- ID of Facility to get blocked Services for.
- Returns:
- List of blocked Services.
 
- 
getServicesByAttributeDefinitionList<Service> getServicesByAttributeDefinition(PerunSession sess, AttributeDefinition attributeDefinition) Get all services with given attribute.- Parameters:
- sess- perun session
- attributeDefinition-
- Returns:
- all services with given attribute
- Throws:
- InternalErrorException
 
- 
getServicesFromDestinationReturn list of services this destination points to.- Parameters:
- destinationId- ID of destination
- Returns:
- Services associated with this destination.
 
- 
isServiceAssignedToFacilityChecks whether given service is assigned to given facility (through some resource).- Parameters:
- sess- session
- facility- facility
- service- service
- Returns:
- true if service is assigned to given facility, false otherwise
 
- 
isServiceBlockedOnDestinationboolean isServiceBlockedOnDestination(int serviceId, int destinationId) Return TRUE if Service is blocked on Destination.- Parameters:
- serviceId- ID of Service to check on.
- destinationId- ID of Destination to check on.
- Returns:
- TRUE if Service is blocked on Destination / FALSE otherwise
 
- 
isServiceBlockedOnFacilityboolean isServiceBlockedOnFacility(int serviceId, int facilityId) Return TRUE if Service is blocked on Facility.- Parameters:
- serviceId- ID of Service to check on.
- facilityId- ID of Facility to check on.
- Returns:
- TRUE if Service is blocked on Facility / FALSE otherwise
 
- 
removeAllDestinationsRemoves all defined destinations for the service and facility.- Parameters:
- perunSession-
- service-
- facility-
- Throws:
- InternalErrorException
 
- 
removeAllDestinationsRemoves all defined destinations for the facility.- Parameters:
- perunSession-
- facility- the facility
- Throws:
- InternalErrorException
 
- 
removeAllRequiredAttributesDetate all required attributes from service- Parameters:
- perunSession- perunSession
- service- service from which the attributes will be removed
- Throws:
- InternalErrorException- if an exception raise in concrete implementation, the exception is wrapped in InternalErrorException
- ServiceNotExistsException- if the service doesn't exists in underlaying data source
 
- 
removeDestinationvoid removeDestination(PerunSession perunSession, Service service, Facility facility, Destination destination) throws DestinationAlreadyRemovedException Removes an destination from the facility and service.- Parameters:
- perunSession-
- service-
- facility-
- destination- string contains destination address (mail, url, hostname, ...)
- Throws:
- InternalErrorException
- DestinationAlreadyRemovedException
 
- 
removeRequiredAttributevoid removeRequiredAttribute(PerunSession perunSession, Service service, AttributeDefinition attribute) throws AttributeNotAssignedException Remove required attribute from service. TODO If you try to remove attribute which is default for other Required attribute ...- Parameters:
- perunSession- perunSession
- service- service from which the attribute will be removed
- attribute- attribute to remove
- Throws:
- InternalErrorException- if an exception raise in concrete implementation, the exception is wrapped in InternalErrorException
- AttributeNotAssignedException
- ServiceNotExistsException- if the service doesn't exists in underlaying data source
 
- 
removeRequiredAttributesvoid removeRequiredAttributes(PerunSession perunSession, Service service, List<? extends AttributeDefinition> attributes) throws AttributeNotAssignedException Batch version of removeRequiredAttribute- Throws:
- AttributeNotAssignedException
- See Also:
 
- 
serviceExistsCheck if service exists in underlaying data source.- Parameters:
- perunSession- perun session
- service- service to check
- Returns:
- true if service exists in underlaying data source, false otherwise
- Throws:
- InternalErrorException- if unexpected error occured
 
- 
unblockAllServicesOnDestinationvoid unblockAllServicesOnDestination(int destination) Unblock all blocked Services on specified Destination.- Parameters:
- destination- ID of Destination we want to unblock all Services.
 
- 
unblockAllServicesOnFacilityvoid unblockAllServicesOnFacility(int facility) Unblock all blocked Services on Facility.- Parameters:
- facility- ID of Facility we want to unblock all Services.
 
- 
unblockServicevoid unblockService(int serviceId) Unblock Service everywhere. If was not blocked, nothing happens.- Parameters:
- serviceId- ID of Service to unblock.
 
- 
unblockServiceOnDestinationvoid unblockServiceOnDestination(int serviceId, int destinationId) Unblock Service on specific Destination. If was not blocked, nothing happens.- Parameters:
- serviceId- ID of Service to unblock on Destination.
- destinationId- ID of Destination to unblock Service on.
 
- 
unblockServiceOnFacilityvoid unblockServiceOnFacility(int serviceId, int facilityId) Unblock Service on whole Facility. If was not blocked, nothing happens.- Parameters:
- serviceId- ID of Service to unblock on Facility.
- facilityId- ID of Facility to unblock Service on.
 
- 
updateServiceUpdates the service.- Parameters:
- perunSession-
- service-
 
 
-