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 Summary
Modifier and TypeMethodDescriptionvoid
addDestination
(PerunSession perunSession, Service service, Facility facility, Destination destination) Adds an destination for the facility and service.void
addRequiredAttribute
(PerunSession perunSession, Service service, AttributeDefinition attribute) Mark the attribute as required for the service.void
addRequiredAttributes
(PerunSession perunSession, Service service, List<? extends AttributeDefinition> attributes) Batch version of addRequiredAttributevoid
addServiceToServicesPackage
(PerunSession perunSession, ServicesPackage servicesPackage, Service service) Add the service to the packagevoid
blockServiceOnDestination
(PerunSession session, int serviceId, int destinationId) Block Service on specific Destination.void
blockServiceOnFacility
(PerunSession session, int serviceId, int facilityId) Block Service on Facility.void
checkServiceExists
(PerunSession perunSession, Service service) Check if service exists in underlaying data source.void
checkServicesPackageExists
(PerunSession perunSession, ServicesPackage servicesPackage) Check if services package exists in underlaying data source.createDestination
(PerunSession sess, Destination destination) createService
(PerunSession perunSession, Service service) Creates new service.createServicesPackage
(PerunSession perunSession, ServicesPackage servicesPackage) Insert a new packagevoid
deleteDestination
(PerunSession sess, Destination destination) Deletes destination.void
deleteService
(PerunSession perunSession, Service service) Deletes the service.void
deleteServicesPackage
(PerunSession perunSession, ServicesPackage servicesPackage) Remove the packageboolean
destinationExists
(PerunSession sess, Destination destination) boolean
destinationExists
(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.int
getDestinationsCount
(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.getServicesFromServicesPackage
(PerunSession perunSession, ServicesPackage servicesPackage) List services stored in the packagesgetServicesPackageById
(PerunSession perunSession, int servicesPackageId) Get package by IdgetServicesPackageByName
(PerunSession sess, String name) Get services package by name.getServicesPackages
(PerunSession perunSession) List packagesboolean
isServiceAssignedToFacility
(PerunSession sess, Facility facility, Service service) Checks whether given service is assigned to given facility (through some resource).boolean
isServiceBlockedOnDestination
(int serviceId, int destinationId) Return TRUE if Service is blocked on Destination.boolean
isServiceBlockedOnFacility
(int serviceId, int facilityId) Return TRUE if Service is blocked on Facility.void
removeAllDestinations
(PerunSession perunSession, Facility facility) Removes all defined destinations for the facility.void
removeAllDestinations
(PerunSession perunSession, Service service, Facility facility) Removes all defined destinations for the service and facility.void
removeAllRequiredAttributes
(PerunSession perunSession, Service service) Detate all required attributes from servicevoid
removeDestination
(PerunSession perunSession, Service service, Facility facility, Destination destination) Removes an destination from the facility and service.void
removeRequiredAttribute
(PerunSession perunSession, Service service, AttributeDefinition attribute) Remove required attribute from service.void
removeRequiredAttributes
(PerunSession perunSession, Service service, List<? extends AttributeDefinition> attributes) Batch version of removeRequiredAttributevoid
removeServiceFromAllServicesPackages
(PerunSession sess, Service service) Remove Service from all Services Packagesvoid
removeServiceFromServicesPackage
(PerunSession perunSession, ServicesPackage servicesPackage, Service service) Remove Service from Services Packageboolean
serviceExists
(PerunSession perunSession, Service service) Check if service exists in underlaying data source.boolean
servicesPackageExists
(PerunSession perunSession, ServicesPackage servicesPackage) Check if services package exists in underlaying data source.void
unblockAllServicesOnDestination
(int destination) Unblock all blocked Services on specified Destination.void
unblockAllServicesOnFacility
(int facility) Unblock all blocked Services on Facility.void
unblockService
(int serviceId) Unblock Service everywhere.void
unblockServiceOnDestination
(int serviceId, int destinationId) Unblock Service on specific Destination.void
unblockServiceOnFacility
(int serviceId, int facilityId) Unblock Service on whole Facility.void
updateService
(PerunSession perunSession, Service service) Updates the service.void
updateServicesPackage
(PerunSession perunSession, ServicesPackage servicesPackage) Update package
-
Method Details
-
addDestination
void 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
-
addRequiredAttribute
void 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
- perunSessionservice
- service to which the attribute will be addedattribute
- attribute to add- Throws:
InternalErrorException
- if an exception raise in concrete implementation, the exception is wrapped in InternalErrorExceptionAttributeAlreadyAssignedException
- if the attribute is already added
-
addRequiredAttributes
void addRequiredAttributes(PerunSession perunSession, Service service, List<? extends AttributeDefinition> attributes) throws AttributeAlreadyAssignedException Batch version of addRequiredAttribute- Throws:
AttributeAlreadyAssignedException
- See Also:
-
addServiceToServicesPackage
void addServiceToServicesPackage(PerunSession perunSession, ServicesPackage servicesPackage, Service service) throws ServiceAlreadyAssignedException Add the service to the package- Parameters:
perunSession
-servicesPackage
- services package to which the service supposed to be addedservice
- service to be added to the services package- Throws:
InternalErrorException
ServicesPackageNotExistsException
ServiceNotExistsException
ServiceAlreadyAssignedException
-
blockServiceOnDestination
void 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 destinationdestinationId
- The destination on which we want to block the Service- Throws:
InternalErrorException
ServiceAlreadyBannedException
-
blockServiceOnFacility
void 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 FacilityfacilityId
- The Facility on which we want to block the Service- Throws:
InternalErrorException
ServiceAlreadyBannedException
-
checkServiceExists
void checkServiceExists(PerunSession perunSession, Service service) throws ServiceNotExistsException Check if service exists in underlaying data source.- Parameters:
perunSession
- perun sessionservice
- service to check- Throws:
InternalErrorException
- if unexpected error occuredServiceNotExistsException
- if service doesn't exists
-
checkServicesPackageExists
void checkServicesPackageExists(PerunSession perunSession, ServicesPackage servicesPackage) throws ServicesPackageNotExistsException Check if services package exists in underlaying data source.- Parameters:
perunSession
- perun sessionservicesPackage
- services package to check- Throws:
InternalErrorException
- if unexpected error occurServicesPackageNotExistsException
- if service doesn't exists
-
createDestination
-
createService
Creates new service.- Parameters:
perunSession
-service
-- Returns:
- new service
-
createServicesPackage
Insert a new package- Parameters:
perunSession
-servicesPackage
- package to be inserted- Returns:
- ServicesPackage object completely filled (including Id)
- Throws:
InternalErrorException
-
deleteDestination
void 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 DBRelationExistsException
- if the destination has some existing relations in DB
-
deleteService
void 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
-
deleteServicesPackage
Remove the package- Parameters:
perunSession
-servicesPackage
- services package to be removed.- Throws:
ServicesPackageNotExistsException
-
destinationExists
boolean 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
-
getAllRichDestinations
Get list of all rich destinations defined for the facility.- Parameters:
perunSession
-facility
-- Returns:
- list of rich destinations defined for the facility
- Throws:
InternalErrorException
-
getAllRichDestinations
Get list of all rich destinations defined for the service.- Parameters:
perunSession
-service
-- Returns:
- list of rich destinations defined for the service
- Throws:
InternalErrorException
-
getAssignedResources
Get all resources which use this service.- Parameters:
sess
-service
-- Returns:
- list of resources
- Throws:
InternalErrorException
-
getAssignedServices
List all services associated with the facility (via resource).- Parameters:
perunSession
-facility
-- Returns:
- list of services assigned to facility
- Throws:
InternalErrorException
-
getAssignedServices
List 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
-
getDestination
Destination getDestination(PerunSession sess, String destination, String type) throws DestinationNotExistsException Get destination by String destination and type- Parameters:
sess
-destination
- Destination string representationtype
- type of destination- Returns:
- Destination
- Throws:
InternalErrorException
DestinationNotExistsException
-
getDestinationById
Destination getDestinationById(PerunSession perunSession, int id) throws DestinationNotExistsException Get destination by id- Parameters:
perunSession
-id
-- Returns:
- Destination with the id
- Throws:
InternalErrorException
DestinationNotExistsException
-
getDestinations
Get 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
-
getDestinations
Get list of all destinations.- Parameters:
perunSession
-- Returns:
- list of all destinations for session
- Throws:
InternalErrorException
-
getDestinations
Get lists of all destinations for specific Facility- Parameters:
perunSession
-facility
- the facility- Returns:
- lists of all destinations for specific Facility
- Throws:
InternalErrorException
-
getDestinationsCount
Get count of all destinations.- Parameters:
perunSession
-- Returns:
- count of all destinations
- Throws:
InternalErrorException
-
getFacilitiesDestinations
List 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
-
getRichDestinations
List<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
-
getServiceById
Get service by id.- Parameters:
perunSession
-id
-- Returns:
- service with specified id
- Throws:
InternalErrorException
ServiceNotExistsException
-
getServiceByName
Get service by name.- Parameters:
perunSession
-name
- name of the service- Returns:
- service with specified name
- Throws:
InternalErrorException
ServiceNotExistsException
-
getServices
get all services in perun- Parameters:
perunSession
-- Returns:
- all services in perun
- Throws:
InternalErrorException
-
getServicesBlockedOnDestination
Get Services blocked on Destination.- Parameters:
destinationId
- ID of Destination to get blocked Services for.- Returns:
- List of blocked Services.
-
getServicesBlockedOnFacility
Get Services blocked on Facility.- Parameters:
facilityId
- ID of Facility to get blocked Services for.- Returns:
- List of blocked Services.
-
getServicesByAttributeDefinition
List<Service> getServicesByAttributeDefinition(PerunSession sess, AttributeDefinition attributeDefinition) Get all services with given attribute.- Parameters:
sess
- perun sessionattributeDefinition
-- Returns:
- all services with given attribute
- Throws:
InternalErrorException
-
getServicesFromDestination
Return list of services this destination points to.- Parameters:
destinationId
- ID of destination- Returns:
- Services associated with this destination.
-
getServicesFromServicesPackage
List<Service> getServicesFromServicesPackage(PerunSession perunSession, ServicesPackage servicesPackage) List services stored in the packages- Parameters:
servicesPackage
- the package from which we want to list the services- Returns:
- list consisting services
- Throws:
InternalErrorException
ServicesPackageNotExistsException
-
getServicesPackageById
ServicesPackage getServicesPackageById(PerunSession perunSession, int servicesPackageId) throws ServicesPackageNotExistsException Get package by Id- Parameters:
perunSession
-servicesPackageId
- id of the package we want to retrieve- Returns:
- package
- Throws:
InternalErrorException
ServicesPackageNotExistsException
-
getServicesPackageByName
ServicesPackage getServicesPackageByName(PerunSession sess, String name) throws ServicesPackageNotExistsException Get services package by name.- Parameters:
sess
-name
-- Returns:
- package
- Throws:
InternalErrorException
ServicesPackageNotExistsException
-
getServicesPackages
List packages- Parameters:
perunSession
-- Returns:
- list of packages in the DB
- Throws:
InternalErrorException
-
isServiceAssignedToFacility
Checks whether given service is assigned to given facility (through some resource).- Parameters:
sess
- sessionfacility
- facilityservice
- service- Returns:
- true if service is assigned to given facility, false otherwise
-
isServiceBlockedOnDestination
boolean 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
-
isServiceBlockedOnFacility
boolean 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
-
removeAllDestinations
Removes all defined destinations for the service and facility.- Parameters:
perunSession
-service
-facility
-- Throws:
InternalErrorException
-
removeAllDestinations
Removes all defined destinations for the facility.- Parameters:
perunSession
-facility
- the facility- Throws:
InternalErrorException
-
removeAllRequiredAttributes
Detate all required attributes from service- Parameters:
perunSession
- perunSessionservice
- service from which the attributes will be removed- Throws:
InternalErrorException
- if an exception raise in concrete implementation, the exception is wrapped in InternalErrorExceptionServiceNotExistsException
- if the service doesn't exists in underlaying data source
-
removeDestination
void 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
-
removeRequiredAttribute
void 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
- perunSessionservice
- service from which the attribute will be removedattribute
- attribute to remove- Throws:
InternalErrorException
- if an exception raise in concrete implementation, the exception is wrapped in InternalErrorExceptionAttributeNotAssignedException
ServiceNotExistsException
- if the service doesn't exists in underlaying data source
-
removeRequiredAttributes
void removeRequiredAttributes(PerunSession perunSession, Service service, List<? extends AttributeDefinition> attributes) throws AttributeNotAssignedException Batch version of removeRequiredAttribute- Throws:
AttributeNotAssignedException
- See Also:
-
removeServiceFromAllServicesPackages
Remove Service from all Services Packages- Parameters:
service
- service that will be removed from the services packageperunSession
-- Throws:
InternalErrorException
ServiceNotExistsException
ServiceAlreadyRemovedFromServicePackageException
- there are 0 rows affected by removing service from service package in DB
-
removeServiceFromServicesPackage
void removeServiceFromServicesPackage(PerunSession perunSession, ServicesPackage servicesPackage, Service service) throws ServiceAlreadyRemovedFromServicePackageException Remove Service from Services Package- Parameters:
perunSession
-servicesPackage
- services package from which the service supposed to be removedservice
- service that will be removed from the services package- Throws:
InternalErrorException
ServicesPackageNotExistsException
ServiceNotExistsException
ServiceAlreadyRemovedFromServicePackageException
- there are 0 rows affected by removing service from service package in DB
-
serviceExists
Check if service exists in underlaying data source.- Parameters:
perunSession
- perun sessionservice
- service to check- Returns:
- true if service exists in underlaying data source, false otherwise
- Throws:
InternalErrorException
- if unexpected error occured
-
servicesPackageExists
Check if services package exists in underlaying data source.- Parameters:
perunSession
- perun sessionservicesPackage
- services package to check- Returns:
- true if services package exists in underlaying data source, false otherwise
- Throws:
InternalErrorException
- if unexpected error occur
-
unblockAllServicesOnDestination
void unblockAllServicesOnDestination(int destination) Unblock all blocked Services on specified Destination.- Parameters:
destination
- ID of Destination we want to unblock all Services.
-
unblockAllServicesOnFacility
void unblockAllServicesOnFacility(int facility) Unblock all blocked Services on Facility.- Parameters:
facility
- ID of Facility we want to unblock all Services.
-
unblockService
void unblockService(int serviceId) Unblock Service everywhere. If was not blocked, nothing happens.- Parameters:
serviceId
- ID of Service to unblock.
-
unblockServiceOnDestination
void 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.
-
unblockServiceOnFacility
void 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.
-
updateService
Updates the service.- Parameters:
perunSession
-service
-
-
updateServicesPackage
Update package- Parameters:
perunSession
-servicesPackage
- with which is the old one supposed to be updated :-)- Throws:
InternalErrorException
ServicesPackageNotExistsException
-