Class MyServiceManager
java.lang.Object
de.iip_ecosphere.platform.services.AbstractServiceManager<MyArtifactDescriptor,MyServiceDescriptor>
test.de.iip_ecosphere.platform.services.MyServiceManager
- All Implemented Interfaces:
de.iip_ecosphere.platform.services.ServiceManager,de.iip_ecosphere.platform.services.ServiceOperations
class MyServiceManager
extends de.iip_ecosphere.platform.services.AbstractServiceManager<MyArtifactDescriptor,MyServiceDescriptor>
A test service manager.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested classes/interfaces inherited from class de.iip_ecosphere.platform.services.AbstractServiceManager
de.iip_ecosphere.platform.services.AbstractServiceManager.TypedDataConnectionNested classes/interfaces inherited from interface de.iip_ecosphere.platform.services.ServiceOperations
de.iip_ecosphere.platform.services.ServiceOperations.StreamLogMode -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static intprivate intprivate booleanFields inherited from interface de.iip_ecosphere.platform.services.ServiceManager
PROGRESS_COMPONENT_IDFields inherited from interface de.iip_ecosphere.platform.services.ServiceOperations
EXC_ALREADY_KNOWN, OPTION_ARGS, OPTION_ENSEMBLE, OPTION_MEMLIMITS, OPTION_PARAMS, OPTION_SERVERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateService(String serviceId) addArtifact(URI location) voidcloneArtifact(String artifactId, URI location) private StringCreates an artifact id.private StringCreates a service id.protected Predicate<de.iip_ecosphere.platform.services.TypedDataConnectorDescriptor> Returns the last options received throughstartService(Map, String...).protected MyServiceDescriptorinstantiateFromTemplate(MyServiceDescriptor template, String serviceId) voidmigrateService(String id, String resourceId) voidpassivateService(String serviceId) voidreconfigureService(String serviceId, Map<String, String> values) voidremoveArtifact(String id) private MyServiceDescriptorsetupData(MyServiceDescriptor sd, MyServiceDescriptor... out) Adds some data to test against.voidstartService(String... serviceIds) voidstartService(Map<String, String> options, String... serviceIds) voidstopService(String... serviceIds) voidswitchToService(String id, String targetId) voidupdateService(String id, URI location) Methods inherited from class de.iip_ecosphere.platform.services.AbstractServiceManager
addArtifact, checkId, checkServiceInstances, clear, determineExternalConnections, determineFunctionalConnections, determineInternalConnections, getArtifact, getArtifactDescriptor, getArtifactIds, getArtifacts, getInputDataConnectors, getOutputDataConnectors, getParameters, getService, getServiceDescriptor, getServiceIds, getServiceInstanceCount, getServices, getServiceState, getStub, handleInstantiatedServices, isValidId, isValidIdBut, pruneServers, setServiceState, setState, sortByDependency, sortByDependency, topLevelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.services.ServiceOperations
streamLog
-
Field Details
-
connectorCount
private static int connectorCount -
artifactId
private int artifactId -
serviceId
private int serviceId -
small
private boolean small -
lastOptions
-
-
Constructor Details
-
MyServiceManager
MyServiceManager(boolean small) Prevents external creation.- Parameters:
small- "small" setup for usual tests or "big" setup for external connection tests
-
-
Method Details
-
createArtifactId
Creates an artifact id.- Returns:
- the artifact id
-
createServiceId
Creates a service id.- Returns:
- the service id
-
addArtifact
- Throws:
ExecutionException
-
setupData
Adds some data to test against.- Parameters:
sd- the descriptor instanceout- the outgoing services- Returns:
sd
-
startService
- Throws:
ExecutionException
-
getLastOptions
Returns the last options received throughstartService(Map, String...).- Returns:
- the last options, may be null
-
startService
public void startService(Map<String, String> options, String... serviceIds) throws ExecutionException- Throws:
ExecutionException
-
stopService
- Throws:
ExecutionException
-
updateService
- Throws:
ExecutionException
-
removeArtifact
- Specified by:
removeArtifactin interfacede.iip_ecosphere.platform.services.ServiceOperations- Overrides:
removeArtifactin classde.iip_ecosphere.platform.services.AbstractServiceManager<MyArtifactDescriptor,MyServiceDescriptor> - Throws:
ExecutionException
-
switchToService
- Specified by:
switchToServicein interfacede.iip_ecosphere.platform.services.ServiceOperations- Overrides:
switchToServicein classde.iip_ecosphere.platform.services.AbstractServiceManager<MyArtifactDescriptor,MyServiceDescriptor> - Throws:
ExecutionException
-
migrateService
- Specified by:
migrateServicein interfacede.iip_ecosphere.platform.services.ServiceOperations- Overrides:
migrateServicein classde.iip_ecosphere.platform.services.AbstractServiceManager<MyArtifactDescriptor,MyServiceDescriptor> - Throws:
ExecutionException
-
cloneArtifact
- Throws:
ExecutionException
-
activateService
- Specified by:
activateServicein interfacede.iip_ecosphere.platform.services.ServiceOperations- Overrides:
activateServicein classde.iip_ecosphere.platform.services.AbstractServiceManager<MyArtifactDescriptor,MyServiceDescriptor> - Throws:
ExecutionException
-
passivateService
- Specified by:
passivateServicein interfacede.iip_ecosphere.platform.services.ServiceOperations- Overrides:
passivateServicein classde.iip_ecosphere.platform.services.AbstractServiceManager<MyArtifactDescriptor,MyServiceDescriptor> - Throws:
ExecutionException
-
reconfigureService
public void reconfigureService(String serviceId, Map<String, String> values) throws ExecutionException- Specified by:
reconfigureServicein interfacede.iip_ecosphere.platform.services.ServiceOperations- Overrides:
reconfigureServicein classde.iip_ecosphere.platform.services.AbstractServiceManager<MyArtifactDescriptor,MyServiceDescriptor> - Throws:
ExecutionException
-
getAvailablePredicate
protected Predicate<de.iip_ecosphere.platform.services.TypedDataConnectorDescriptor> getAvailablePredicate()- Specified by:
getAvailablePredicatein classde.iip_ecosphere.platform.services.AbstractServiceManager<MyArtifactDescriptor,MyServiceDescriptor>
-
instantiateFromTemplate
protected MyServiceDescriptor instantiateFromTemplate(MyServiceDescriptor template, String serviceId) - Specified by:
instantiateFromTemplatein classde.iip_ecosphere.platform.services.AbstractServiceManager<MyArtifactDescriptor,MyServiceDescriptor>
-