java.lang.Object
de.iip_ecosphere.platform.services.environment.YamlProcess
All Implemented Interfaces:
ProcessSpec
Direct Known Subclasses:
YamlServer

public class YamlProcess extends Object implements ProcessSpec
If the service is not completely implemented rather than delegates functionality to an additional process that must be started and managed along with the service.
Author:
Holger Eichelberger, SSE
  • Field Details

    • executable

      private String executable
    • executablePath

      private String executablePath
    • homePath

      private String homePath
    • locationKey

      private String locationKey
    • execArg

      private List<String> execArg
    • cmdArg

      private List<String> cmdArg
    • artifacts

      private List<String> artifacts
    • started

      private boolean started
  • Constructor Details

    • YamlProcess

      public YamlProcess()
  • Method Details

    • getArtifacts

      public List<String> getArtifacts()
      Description copied from interface: ProcessSpec
      Returns the process implementing artifacts within the containing artifact to be extracted into the process home directory.
      Specified by:
      getArtifacts in interface ProcessSpec
      Returns:
      the relative paths to the artifacts, shall start with "/" as part of ZIP/JAR
    • isStarted

      public boolean isStarted()
      Description copied from interface: ProcessSpec
      Returns whether the underlying process is already started when firing up the service or it will be started through the service implementation. If specified, artifacts will be extracted anyway into the process home directory, assuming that a pre-installed executable will not specify artifacts to be extracted.
      Specified by:
      isStarted in interface ProcessSpec
      Returns:
      true for started, false else (default)
    • setArtifacts

      public void setArtifacts(List<String> artifacts)
      Defines the process implementing artifacts within the containing artifact to be extracted.
      Parameters:
      artifacts - the relative paths to the artifacts
    • setStarted

      public void setStarted(boolean started)
      Changes whether the underlying process is already started when firing up the service. [required by SnakeYaml]
      Parameters:
      started - true for started (default), false else
    • getExecutable

      public String getExecutable()
      Description copied from interface: ProcessSpec
      Returns the system command or relative path within the artifact to be executed.
      Specified by:
      getExecutable in interface ProcessSpec
      Returns:
      the command or relative path
    • getLocationKey

      public String getLocationKey()
      Returns the location key for lookup in InstalledDependenciesSetup.
      Returns:
      the location key, may be null
    • getExecutablePath

      public File getExecutablePath()
      Description copied from interface: ProcessSpec
      Returns an optional path to be prefixed before the executable. Relevance depends on the execution environment.
      Specified by:
      getExecutablePath in interface ProcessSpec
      Returns:
      the optional executable path, may be null for none
    • getHomePath

      public File getHomePath()
      Description copied from interface: ProcessSpec
      Returns the home directory of the process to be executed.
      Specified by:
      getHomePath in interface ProcessSpec
      Returns:
      the home directory, may be null to rely on extracted paths, may be given to explicitly define a home path
    • toSubstFileName

      protected static String toSubstFileName(String path)
      Substitutes "${tmp}" and "${user}" and returns a name for path.
      Parameters:
      path - the path
      Returns:
      the name, may be null if path is null or empty
    • toSubstFilePath

      protected static File toSubstFilePath(String path)
      Substitutes "${tmp}" and "${user}" and returns a file for path.
      Parameters:
      path - the path
      Returns:
      the file, may be null if path is null or empty
    • getCmdArg

      public List<String> getCmdArg()
      Description copied from interface: ProcessSpec
      Returns the command line arguments to start the process. The shell will be executed within the folder where the files from ProcessSpec.getHomePath() are extracted.
      Specified by:
      getCmdArg in interface ProcessSpec
      Returns:
      the command line arguments (may be empty for none)
    • getExecArg

      public List<String> getExecArg()
      Description copied from interface: ProcessSpec
      Returns the arguments to be passed to the executable itself. Executable args and command line args may be the same in many cases, but also may differ for Java (-D arguments) or Python/Conda (conda arguments).
      Specified by:
      getExecArg in interface ProcessSpec
      Returns:
      the command line executable arguments (may be empty for none)
    • getSubstCmdArg

      public List<String> getSubstCmdArg()
      Returns getCmdArg() with substitutions from toSubstFileName(String) for all arguments.
      Returns:
      the substitutions
    • setExecutable

      public void setExecutable(String executable)
      Defines the system command or relative path to be executed. [required by SnakeYaml]
      Parameters:
      executable - the name/path
    • setLocationKey

      public void setLocationKey(String locationKey)
      Changes the location key for lookup in InstalledDependenciesSetup.
      Parameters:
      locationKey - the location key, may be null
    • setExecutablePath

      public void setExecutablePath(String executablePath)
      Changes the optional path to be prefixed before the executable. Relevance depends on the execution environment. May contain "${tmp}" for the system temporary directory path and "${user}" for the user directory path. [required by SnakeYaml]
      Parameters:
      executablePath - the optional executable path, may be null for none
    • setExecutablePath

      public void setExecutablePath(File executablePath)
      Changes the optional path to be prefixed before the executable. Relevance depends on the execution environment. May contain "${tmp}" for the system temporary directory path and "${user}" for the user directory path. [required by SnakeYaml]
      Parameters:
      executablePath - the optional executable path, may be null for none
    • setHomePath

      public void setHomePath(String homePath)
      Changes the home directory of the process to be executed. [required by SnakeYaml] May contain "${tmp}" for the system temporary directory path and "${user}" for the user directory path.
      Parameters:
      homePath - the home directory, may be null to rely on extracted paths, may be given to explicitly define a home path
    • setHomePath

      public void setHomePath(File home)
      Changes the home directory of the process to be executed. [required by SnakeYaml] May contain "${tmp}" for the system temporary directory path and "${user}" for the user directory path.
      Parameters:
      home - the home directory, may be null to rely on extracted paths, may be given to explicitly define a home path
    • setExecArg

      public void setExecArg(List<String> execArg)
      Defines the arguments to be passed to the executable itself. [required by SnakeYaml] Executable args and command line args may be the same in many cases, but also may differ for Java (-D arguments) or Python/Conda (conda arguments).
      Parameters:
      execArg - the command line executable arguments (may be empty for none)
    • setCmdArg

      public void setCmdArg(List<String> cmdArg)
      Defines the command line arguments. [required by SnakeYaml]
      Parameters:
      cmdArg - the command line arguments (may be empty for none)