Class BasicContainerDescriptor

java.lang.Object
de.iip_ecosphere.platform.ecsRuntime.BasicContainerDescriptor
All Implemented Interfaces:
ContainerDescriptor

public class BasicContainerDescriptor extends Object implements ContainerDescriptor
Basic ContainerDescriptor implementation, e.g., including a representation of the ServiceState statemachine.
Author:
Holger Eichelberger, SSE
  • Field Details

    • id

      private String id
    • name

      private String name
    • version

      private de.iip_ecosphere.platform.support.Version version
    • state

      private ContainerState state
    • uri

      private URI uri
    • imageFile

      private String imageFile
  • Constructor Details

    • BasicContainerDescriptor

      public BasicContainerDescriptor()
      Creates a container descriptor instance.
    • BasicContainerDescriptor

      protected BasicContainerDescriptor(String id, String name, de.iip_ecosphere.platform.support.Version version, URI uri)
      Creates a container descriptor instance.
      Parameters:
      id - the container id
      name - the (file) name of the container
      version - the version of the container
      uri - the URI where the descriptor was loaded from
      Throws:
      IllegalArgumentException - if id, name, version or uri is invalid, e.g., null or empty
  • Method Details

    • getId

      public String getId()
      Description copied from interface: ContainerDescriptor
      Returns the container id.
      Specified by:
      getId in interface ContainerDescriptor
      Returns:
      the container id
    • getName

      public String getName()
      Description copied from interface: ContainerDescriptor
      The name of the container.
      Specified by:
      getName in interface ContainerDescriptor
      Returns:
      the name
    • getVersion

      public de.iip_ecosphere.platform.support.Version getVersion()
      Description copied from interface: ContainerDescriptor
      The version of the container.
      Specified by:
      getVersion in interface ContainerDescriptor
      Returns:
      the version
    • setId

      public void setId(String id)
      Defines the container's id. Typically, the id of a container shall not be modified at all. If this is needed for some reason, implementing classes may use this with care. Use the constructor instead. [required by SnakeYaml]
      Parameters:
      id - the container id
    • setName

      public void setName(String name)
      Defines the container's name. Typically, the name of a container shall not be modified at all. If this is needed for some reason, implementing classes may use this with care. Use the constructor instead. [required by SnakeYaml]
      Parameters:
      name - the container name
    • setVersion

      public void setVersion(de.iip_ecosphere.platform.support.Version version)
      Defines the container's version. [required by SnakeYaml]
      Parameters:
      version - the container version
    • setState

      public void setState(ContainerState state)
      Changes the container state. [required by SnakeYaml]
      Parameters:
      state - the new container state
    • getState

      public ContainerState getState()
      Description copied from interface: ContainerDescriptor
      Returns the state the container is currently in.
      Specified by:
      getState in interface ContainerDescriptor
      Returns:
      the state
    • getUri

      public URI getUri()
      Description copied from interface: ContainerDescriptor
      Returns the canonical URI the descriptor was loaded from.
      Specified by:
      getUri in interface ContainerDescriptor
      Returns:
      the canonical URI
    • setUri

      public void setUri(URI uri)
      Sets the URI where the container was loaded from. [required by SnakeYaml]
      Parameters:
      uri - the URI where the descriptor was loaded from
      Throws:
      IllegalArgumentException - if uri is invalid, e.g., null
    • setImageFile

      public void setImageFile(String imageFile)
      Defines the name of the (compressed) image file of the container. [required by SnakeYaml]
      Parameters:
      imageFile - the name of the file
    • getImageFile

      public String getImageFile()
      Returns the name of the (compressed) image file of the container.
      Returns:
      name the name of the file
    • setDockerImageZipfile

      public void setDockerImageZipfile(String dockerImageZipfile)
      Defines the name of the compressed file with the Docker image. [required by SnakeYaml, legacy]
      Parameters:
      dockerImageZipfile - the name of the file
      See Also:
    • getDockerImageZipfile

      public String getDockerImageZipfile()
      Returns the name of the compressed file with the Docker image. [legacy]
      Returns:
      name the name
      See Also:
    • readFromYamlFile

      public static BasicContainerDescriptor readFromYamlFile(File file)
      Returns a DockerContainerDescriptor with a information from a yaml file.
      Parameters:
      file - yaml file
      Returns:
      DockerContainerDescriptor (may be null)
    • readFromYaml

      public static BasicContainerDescriptor readFromYaml(InputStream in, URI uri)
      Returns a DockerContainerDescriptor with a information from a yaml file.
      Parameters:
      in - an inout stream with Yaml contents (may be null)
      uri - the URI the descriptor was read from
      Returns:
      DockerContainerDescriptor (may be null)