Class YamlArtifact
java.lang.Object
de.iip_ecosphere.platform.services.environment.AbstractYamlArtifact
de.iip_ecosphere.platform.services.environment.YamlArtifact
Information about an artifact containing services. The artifact is to be deployed. We assume that the underlying
yaml file is generated, i.e., repeated information such as relations can be consistently specified.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a YAML server information object based on the given id.Returns the server specification instances.getService(String id) Returns a YAML service information object based on the given service id.Returns the services.getServiceSafe(String id) Returns a YAML service information object based on the given service id.static YamlArtifactReads anYamlArtifactfrom a YAML input stream.static YamlArtifactReads from the given YAML input stream, closes the stream.voidsetServers(List<YamlServer> servers) Sets the server specification instances.voidsetServices(List<YamlService> services) Sets the service instances.Methods inherited from class de.iip_ecosphere.platform.services.environment.AbstractYamlArtifact
getApplication, getId, getName, getVersion, setApplication, setId, setName, setVersion
-
Field Details
-
services
-
servers
-
-
Constructor Details
-
YamlArtifact
public YamlArtifact()
-
-
Method Details
-
getServices
Returns the services.- Returns:
- the services
-
setServices
Sets the service instances. [required by SnakeYaml]- Parameters:
services- the services
-
getServers
Returns the server specification instances. [required by SnakeYaml]- Returns:
- the servers
-
setServers
Sets the server specification instances. [required by SnakeYaml]- Parameters:
servers- the servers
-
getService
Returns a YAML service information object based on the given service id.- Parameters:
id- the service id- Returns:
- the YamlService, null if none was found
-
getServer
Returns a YAML server information object based on the given id.- Parameters:
id- the server id- Returns:
- the YamlServer, null if none was found
-
getServiceSafe
Returns a YAML service information object based on the given service id.- Parameters:
id- the service id- Returns:
- the YamlService, a default instance if none was found
-
readFromYaml
Reads anYamlArtifactfrom a YAML input stream. The returned artifact may be invalid.- Parameters:
in- the input stream (may be null)- Returns:
- the artifact info
- Throws:
IOException- if the data cannot be read, the configuration class cannot be instantiated
-
readFromYamlSafe
Reads from the given YAML input stream, closes the stream. Logs errors and returns a default instance in case of failures.- Parameters:
in- the input stream (may be null)- Returns:
- the YAML artifact
-