java.lang.Object
de.iip_ecosphere.platform.services.environment.AbstractYamlArtifact
de.iip_ecosphere.platform.services.environment.YamlArtifact

public class YamlArtifact extends AbstractYamlArtifact
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 Details

  • Constructor Details

    • YamlArtifact

      public YamlArtifact()
  • Method Details

    • getServices

      public List<YamlService> getServices()
      Returns the services.
      Returns:
      the services
    • setServices

      public void setServices(List<YamlService> services)
      Sets the service instances. [required by SnakeYaml]
      Parameters:
      services - the services
    • getServers

      public List<YamlServer> getServers()
      Returns the server specification instances. [required by SnakeYaml]
      Returns:
      the servers
    • setServers

      public void setServers(List<YamlServer> servers)
      Sets the server specification instances. [required by SnakeYaml]
      Parameters:
      servers - the servers
    • getService

      public YamlService getService(String id)
      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

      public YamlServer getServer(String id)
      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

      public YamlService getServiceSafe(String id)
      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

      public static YamlArtifact readFromYaml(InputStream in) throws IOException
      Reads an YamlArtifact from 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

      public static YamlArtifact readFromYamlSafe(InputStream in)
      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