Interface ServicesClient

All Superinterfaces:
ServiceOperations
All Known Implementing Classes:
ServicesAasClient

public interface ServicesClient extends ServiceOperations
Services client operations.
Author:
Holger Eichelberger, SSE
  • Method Details

    • getServices

      String[] getServices(String artifactId, boolean topLevelOnly)
      Returns the services associated to a given artifactId.
      Parameters:
      artifactId - the artifactId to search for
      topLevelOnly - whether only top-level services or all shall be returned
      Returns:
      the associated service ids, empty if none was found
    • getServices

      de.iip_ecosphere.platform.support.aas.SubmodelElementCollection getServices()
      Returns the collection with all services of the resources this client was created for.
      Returns:
      the services collection, may be null for none
    • getArtifacts

      de.iip_ecosphere.platform.support.aas.SubmodelElementCollection getArtifacts()
      Returns the collection with all artifacts of the resources this client was created for.
      Returns:
      the artifacts collection, may be null for none
    • startServiceAsTask

      void startServiceAsTask(String taskId, String... serviceId) throws ExecutionException
      Like ServiceOperations.startService(String...) but reporting on the given taskId.
      Parameters:
      taskId - the task id to report on (may be null, leads to ServiceOperations.startService(String...))
      serviceId - the id(s) of the service(s)
      Throws:
      ExecutionException - in case that starting the service fails for some reason
    • startServiceAsTask

      void startServiceAsTask(String taskId, Map<String,String> options, String... serviceId) throws ExecutionException
      Like ServiceOperations.startService(Map, String...) but reporting on the given taskId.
      Parameters:
      taskId - the task id to report on (may be null, leads to ServiceOperations.startService(Map, String...))
      options - optional map of optional options, see ServiceOperations.startService(Map, String...)
      serviceId - the id(s) of the service(s)
      Throws:
      ExecutionException - in case that starting the service fails for some reason
    • stopServiceAsTask

      void stopServiceAsTask(String taskId, String... serviceId) throws ExecutionException
      Like ServiceOperations.stopService(String...) but reporting on the given taskId.
      Parameters:
      taskId - the task id to report on (may be null, leads to ServiceOperations.stopService(String...))
      serviceId - the id(s) of the service(s) to stop
      Throws:
      ExecutionException - if stopping the service fails
    • addArtifactAsTask

      String addArtifactAsTask(String taskId, URI location) throws ExecutionException
      Adds an artifact (and transitively the contained services) to the management domain of this instance, e.g., by downloading it from an artifact/service store. This defines the id of the service within the management domain of this instance. After a successful execution, the artifact id is returned, artifact and service(s) shall be available and the service(s) shall be in state ServiceState.AVAILABLE.
      Parameters:
      taskId - the task id to report on (may be null, leads to ServiceOperations.addArtifact(URI))
      location - the location from where to download the service, e.g., an URL
      Returns:
      the id of the artifact
      Throws:
      ExecutionException - in case that adding the service fails for some reason
    • removeArtifactAsTask

      void removeArtifactAsTask(String taskId, String artifactId) throws ExecutionException
      Removes the artifact (and transitively its services) from the management domain of this instance. This operation shall only remove the implementation of non-operational services and, thus, perform a state transition to ServiceState.UNDEPLOYING and ultimately the service(s) shall be removed and their descriptors (including the artifact descriptor) shall not be available anymore.
      Parameters:
      taskId - the task id to report on (may be null, leads to ServiceOperations.removeArtifact(String))
      artifactId - the id of the artifact to remove, or as fallback the canonical URI of the artifact
      Throws:
      ExecutionException - if removing the service fails, e.g., because it is still running