Class ServiceMgrAndDescriptorTest.MockServiceManager

java.lang.Object
test.de.iip_ecosphere.platform.services.spring.ServiceMgrAndDescriptorTest.MockServiceManager
All Implemented Interfaces:
de.iip_ecosphere.platform.services.ServiceManager, de.iip_ecosphere.platform.services.ServiceOperations
Enclosing class:
ServiceMgrAndDescriptorTest

private static class ServiceMgrAndDescriptorTest.MockServiceManager extends Object implements de.iip_ecosphere.platform.services.ServiceManager
A mocking service manager for a given service artifact. Only selected functions are implemented!
Author:
Holger Eichelberger, SSE
  • Field Details

    • arts

      private Map<String,de.iip_ecosphere.platform.services.spring.SpringCloudArtifactDescriptor> arts
    • svc

      private Map<String,de.iip_ecosphere.platform.services.spring.SpringCloudServiceDescriptor> svc
  • Constructor Details

    • MockServiceManager

      private MockServiceManager(de.iip_ecosphere.platform.services.spring.SpringCloudArtifactDescriptor aDesc)
      Creates a service manager instance for the given artifact descriptor.
      Parameters:
      aDesc - the artifact descriptor to analyze
  • Method Details

    • updateService

      public void updateService(String serviceId, URI location) throws ExecutionException
      Specified by:
      updateService in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • switchToService

      public void switchToService(String serviceId, String targetId) throws ExecutionException
      Specified by:
      switchToService in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • stopService

      public void stopService(String... serviceId) throws ExecutionException
      Specified by:
      stopService in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • startService

      public void startService(String... serviceId) throws ExecutionException
      Specified by:
      startService in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • startService

      public void startService(Map<String,String> options, String... serviceId) throws ExecutionException
      Specified by:
      startService in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • setServiceState

      public void setServiceState(String serviceId, de.iip_ecosphere.platform.services.environment.ServiceState state) throws ExecutionException
      Specified by:
      setServiceState in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • removeArtifact

      public void removeArtifact(String artifactId) throws ExecutionException
      Specified by:
      removeArtifact in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • reconfigureService

      public void reconfigureService(String serviceId, Map<String,String> values) throws ExecutionException
      Specified by:
      reconfigureService in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • passivateService

      public void passivateService(String serviceId) throws ExecutionException
      Specified by:
      passivateService in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • migrateService

      public void migrateService(String serviceId, String resourceId) throws ExecutionException
      Specified by:
      migrateService in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • getServiceState

      public de.iip_ecosphere.platform.services.environment.ServiceState getServiceState(String serviceId)
      Specified by:
      getServiceState in interface de.iip_ecosphere.platform.services.ServiceOperations
    • addArtifact

      public String addArtifact(URI location) throws ExecutionException
      Specified by:
      addArtifact in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • activateService

      public void activateService(String serviceId) throws ExecutionException
      Specified by:
      activateService in interface de.iip_ecosphere.platform.services.ServiceOperations
      Throws:
      ExecutionException
    • getServices

      public Collection<? extends de.iip_ecosphere.platform.services.ServiceDescriptor> getServices()
      Specified by:
      getServices in interface de.iip_ecosphere.platform.services.ServiceManager
    • getServiceIds

      public Set<String> getServiceIds()
      Specified by:
      getServiceIds in interface de.iip_ecosphere.platform.services.ServiceManager
    • getService

      public de.iip_ecosphere.platform.services.ServiceDescriptor getService(String serviceId)
      Specified by:
      getService in interface de.iip_ecosphere.platform.services.ServiceManager
    • getParameters

      public List<de.iip_ecosphere.platform.services.TypedDataDescriptor> getParameters(String serviceId)
      Specified by:
      getParameters in interface de.iip_ecosphere.platform.services.ServiceManager
    • getOutputDataConnectors

      public List<de.iip_ecosphere.platform.services.TypedDataConnectorDescriptor> getOutputDataConnectors(String serviceId)
      Specified by:
      getOutputDataConnectors in interface de.iip_ecosphere.platform.services.ServiceManager
    • getInputDataConnectors

      public List<de.iip_ecosphere.platform.services.TypedDataConnectorDescriptor> getInputDataConnectors(String serviceId)
      Specified by:
      getInputDataConnectors in interface de.iip_ecosphere.platform.services.ServiceManager
    • getArtifacts

      public Collection<? extends de.iip_ecosphere.platform.services.ArtifactDescriptor> getArtifacts()
      Specified by:
      getArtifacts in interface de.iip_ecosphere.platform.services.ServiceManager
    • getArtifactIds

      public Set<String> getArtifactIds()
      Specified by:
      getArtifactIds in interface de.iip_ecosphere.platform.services.ServiceManager
    • getArtifact

      public de.iip_ecosphere.platform.services.ArtifactDescriptor getArtifact(String artifactId)
      Specified by:
      getArtifact in interface de.iip_ecosphere.platform.services.ServiceManager
    • cloneArtifact

      public void cloneArtifact(String artifactId, URI location) throws ExecutionException
      Specified by:
      cloneArtifact in interface de.iip_ecosphere.platform.services.ServiceManager
      Throws:
      ExecutionException
    • getServiceInstanceCount

      public int getServiceInstanceCount(String serviceId)
      Specified by:
      getServiceInstanceCount in interface de.iip_ecosphere.platform.services.ServiceOperations