Interface ContainerOperations

All Known Subinterfaces:
ContainerManager, EcsClient
All Known Implementing Classes:
AbstractContainerManager, EcsAasClient

public interface ContainerOperations
Basic container operations that a container manager as well as an AAS client shall provide.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Method Details

    • addContainer

      String addContainer(URI location) throws ExecutionException
      Adds a container to the management domain of this instance, e.g., by downloading it from a container registry. This defines the id of the container within the management domain of this instance. After a successful execution, the container id is returned and shall be available and the container shall be in state ContainerState.AVAILABLE.
      Parameters:
      location - the location from where to download the container, e.g., an URL
      Returns:
      the id of the container
      Throws:
      ExecutionException - in case that adding the container fails for some reason
    • getId

      String getId(URI location)
      Returns the container id for a given container location as used in addContainer(URI).
      Parameters:
      location - the location
      Returns:
      the id of the container, may be empty or nullnull if there is none
    • startContainer

      void startContainer(String id) throws ExecutionException
      Starts a container. The container must be already within the management domain of this instance by addContainer(URI). The container shall after some time be in state ContainerState.DEPLOYING, ContainerState.DEPLOYED or ContainerState.FAILED.
      Parameters:
      id - the id of the container
      Throws:
      ExecutionException - in case that starting the container fails for some reason
    • stopContainer

      void stopContainer(String id) throws ExecutionException
      Stops the container. The container shall afterwards be in state ContainerState.STOPPED.
      Parameters:
      id - the id of the container to stop, or as fallback the canonical URI of the container descriptor used for adding
      Throws:
      ExecutionException - if stopping the container fails
    • migrateContainer

      void migrateContainer(String id, String resourceId) throws ExecutionException
      Migrates the container.
      Parameters:
      id - the id of the container
      resourceId - the target resource id, e.g., a device
      Throws:
      ExecutionException - if migration fails
    • undeployContainer

      void undeployContainer(String id) throws ExecutionException
      Removes the container from the management domain of this instance. This operation shall only remove the implementation of a non-operational container and, thus, perform a state transition to ContainerState.UNDEPLOYING and ultimately the container shall be removed and its descriptor shall not be available anymore.
      Parameters:
      id - the id of the container to remove, or as fallback the canonical URI of the container descriptor used for adding
      Throws:
      ExecutionException - if undeploying the container fails, e.g., because it is still running
    • updateContainer

      void updateContainer(String id, URI location) throws ExecutionException
      Updates the container by the container in the given location. This operation is responsible for stopping the running container (if needed), replacing it, starting the new container.
      Parameters:
      id - the id of the container to be updated
      location - the location of the new container, e.g., an URL
      Throws:
      ExecutionException - if the given container cannot be updated for some reason
    • getState

      ContainerState getState(String id)
      Returns the state of the container.
      Parameters:
      id - the id/URI of the container
      Returns:
      the state of the container
    • getContainerSystemName

      String getContainerSystemName()
      Returns the name of the underlying container system, e.g. Docker.
      Returns:
      the name
    • getContainerSystemVersion

      String getContainerSystemVersion()
      Returns the version of the underlying container system. As this version may differ from the syntax conventions of Version, we just return here a string.
      Returns:
      the version