Class BasicContainerDescriptor
java.lang.Object
de.iip_ecosphere.platform.ecsRuntime.BasicContainerDescriptor
- All Implemented Interfaces:
ContainerDescriptor
Basic
ContainerDescriptor implementation, e.g., including a representation of the ServiceState
statemachine.- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a container descriptor instance.protectedBasicContainerDescriptor(String id, String name, de.iip_ecosphere.platform.support.Version version, URI uri) Creates a container descriptor instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the compressed file with the Docker image.getId()Returns the container id.Returns the name of the (compressed) image file of the container.getName()The name of the container.getState()Returns the state the container is currently in.getUri()Returns the canonical URI the descriptor was loaded from.de.iip_ecosphere.platform.support.VersionThe version of the container.static BasicContainerDescriptorreadFromYaml(InputStream in, URI uri) Returns a DockerContainerDescriptor with a information from a yaml file.static BasicContainerDescriptorreadFromYamlFile(File file) Returns a DockerContainerDescriptor with a information from a yaml file.voidsetDockerImageZipfile(String dockerImageZipfile) Defines the name of the compressed file with the Docker image.voidDefines the container's id.voidsetImageFile(String imageFile) Defines the name of the (compressed) image file of the container.voidDefines the container's name.voidsetState(ContainerState state) Changes the container state.voidSets the URI where the container was loaded from.voidsetVersion(de.iip_ecosphere.platform.support.Version version) Defines the container's version.
-
Field Details
-
id
-
name
-
version
private de.iip_ecosphere.platform.support.Version version -
state
-
uri
-
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 idname- the (file) name of the containerversion- the version of the containeruri- the URI where the descriptor was loaded from- Throws:
IllegalArgumentException- ifid,name,versionoruriis invalid, e.g., null or empty
-
-
Method Details
-
getId
Description copied from interface:ContainerDescriptorReturns the container id.- Specified by:
getIdin interfaceContainerDescriptor- Returns:
- the container id
-
getName
Description copied from interface:ContainerDescriptorThe name of the container.- Specified by:
getNamein interfaceContainerDescriptor- Returns:
- the name
-
getVersion
public de.iip_ecosphere.platform.support.Version getVersion()Description copied from interface:ContainerDescriptorThe version of the container.- Specified by:
getVersionin interfaceContainerDescriptor- Returns:
- the version
-
setId
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
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
Changes the container state. [required by SnakeYaml]- Parameters:
state- the new container state
-
getState
Description copied from interface:ContainerDescriptorReturns the state the container is currently in.- Specified by:
getStatein interfaceContainerDescriptor- Returns:
- the state
-
getUri
Description copied from interface:ContainerDescriptorReturns the canonical URI the descriptor was loaded from.- Specified by:
getUriin interfaceContainerDescriptor- Returns:
- the canonical URI
-
setUri
Sets the URI where the container was loaded from. [required by SnakeYaml]- Parameters:
uri- the URI where the descriptor was loaded from- Throws:
IllegalArgumentException- ifuriis invalid, e.g., null
-
setImageFile
Defines the name of the (compressed) image file of the container. [required by SnakeYaml]- Parameters:
imageFile- the name of the file
-
getImageFile
Returns the name of the (compressed) image file of the container.- Returns:
- name the name of the file
-
setDockerImageZipfile
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
Returns the name of the compressed file with the Docker image. [legacy]- Returns:
- name the name
- See Also:
-
readFromYamlFile
Returns a DockerContainerDescriptor with a information from a yaml file.- Parameters:
file- yaml file- Returns:
- DockerContainerDescriptor (may be null)
-
readFromYaml
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)
-