java.lang.Object
de.iip_ecosphere.platform.services.environment.YamlProcess
de.iip_ecosphere.platform.services.spring.yaml.YamlProcess
All Implemented Interfaces:
de.iip_ecosphere.platform.services.environment.ProcessSpec, ProcessSpec

public class YamlProcess extends de.iip_ecosphere.platform.services.environment.YamlProcess 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. The process implementation (whatever it is) will be extracted from YamlProcess.getHomePath(). For the execution in a shell, the home directory will be set to the folder where the files in YamlProcess.getHomePath() are located.
Author:
Holger Eichelberger, SSE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private YamlEndpoint
     
    private YamlEndpoint
     
    private YamlEndpoint
     
    private int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns AAS endpoint (port/host) the service shall communicate with for commands.
    getCmdArg(int port, String protocol)
    Returns additional/optional command line arguments required to start the service.
    Returns streaming endpoint (port/host) on the service side the process shall communicate with.
    Returns streaming endpoint (port/host) on the process side the service shall communicate with.
    int
    Returns the time to wait for the process before going on with starting other services.
    void
    Defines communication endpoint (port/host) the service shall communicate with.
    void
    setServiceStreamEndpoint(YamlEndpoint serviceStreamEndpoint)
    Defines communication endpoint (port/host) for streaming on the service side (to communicate with the process side).
    void
    Defines communication endpoint (port/host) on the process side the service shall communicate with.
    void
    setWaitTime(int waitTime)
    Defines the time to wait for the process before going on with starting other services.
    static List<String>
    substCmdArg(List<String> cmdArg, int port, String protocol)
    Returns additional/optional command line arguments required to start the service.

    Methods inherited from class de.iip_ecosphere.platform.services.environment.YamlProcess

    getArtifacts, getCmdArg, getExecArg, getExecutable, getExecutablePath, getHomePath, getLocationKey, getSubstCmdArg, isStarted, setArtifacts, setCmdArg, setExecArg, setExecutable, setExecutablePath, setExecutablePath, setHomePath, setHomePath, setLocationKey, setStarted, toSubstFileName, toSubstFilePath

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface de.iip_ecosphere.platform.services.environment.ProcessSpec

    getArtifacts, getCmdArg, getExecArg, getExecutable, getExecutablePath, getHomePath, isStarted
  • Field Details

    • serviceStreamEndpoint

      private YamlEndpoint serviceStreamEndpoint
    • streamEndpoint

      private YamlEndpoint streamEndpoint
    • aasEndpoint

      private YamlEndpoint aasEndpoint
    • waitTime

      private int waitTime
  • Constructor Details

    • YamlProcess

      public YamlProcess()
  • Method Details

    • getCmdArg

      public List<String> getCmdArg(int port, String protocol)
      Description copied from interface: ProcessSpec
      Returns additional/optional command line arguments required to start the service. The port placeholder Endpoint.PORT_PLACEHOLDER will be replaced with the command port the platform is using to send administrative commands to the service (see Service).
      Specified by:
      getCmdArg in interface ProcessSpec
      Parameters:
      port - the port used for the command communication
      protocol - the protocol used for the command communication
      Returns:
      the resolved command line arguments (may be empty for none)
    • substCmdArg

      public static List<String> substCmdArg(List<String> cmdArg, int port, String protocol)
      Returns additional/optional command line arguments required to start the service. The port placeholder Endpoint.PORT_PLACEHOLDER will be replaced with the command port the platform is using to send administrative commands to the service (see Service).
      Parameters:
      cmdArg - the command line arguments to be used as basis for substitution
      port - the port used for the command communication
      protocol - the protocol used for the command communication
      Returns:
      the resolved command line arguments (may be empty for none)
    • getServiceStreamEndpoint

      public YamlEndpoint getServiceStreamEndpoint()
      Description copied from interface: ProcessSpec
      Returns streaming endpoint (port/host) on the service side the process shall communicate with. Counterpart of ProcessSpec.getStreamEndpoint().
      Specified by:
      getServiceStreamEndpoint in interface ProcessSpec
      Returns:
      the streaming endpoint
    • getStreamEndpoint

      public YamlEndpoint getStreamEndpoint()
      Description copied from interface: ProcessSpec
      Returns streaming endpoint (port/host) on the process side the service shall communicate with. Counterpart of ProcessSpec.getServiceStreamEndpoint().
      Specified by:
      getStreamEndpoint in interface ProcessSpec
      Returns:
      the streaming endpoint
    • getAasEndpoint

      public YamlEndpoint getAasEndpoint()
      Description copied from interface: ProcessSpec
      Returns AAS endpoint (port/host) the service shall communicate with for commands.
      Specified by:
      getAasEndpoint in interface ProcessSpec
      Returns:
      the AAS endpoint
    • getWaitTime

      public int getWaitTime()
      Description copied from interface: ProcessSpec
      Returns the time to wait for the process before going on with starting other services.
      Specified by:
      getWaitTime in interface ProcessSpec
      Returns:
      the wait time in ms, ignored if not positive
    • setServiceStreamEndpoint

      public void setServiceStreamEndpoint(YamlEndpoint serviceStreamEndpoint)
      Defines communication endpoint (port/host) for streaming on the service side (to communicate with the process side). [required by SnakeYaml]
      Parameters:
      serviceStreamEndpoint - the communication endpoint
    • setStreamEndpoint

      public void setStreamEndpoint(YamlEndpoint streamEndpoint)
      Defines communication endpoint (port/host) on the process side the service shall communicate with. [required by SnakeYaml]
      Parameters:
      streamEndpoint - the communication endpoint
    • setAasEndpoint

      public void setAasEndpoint(YamlEndpoint aasEndpoint)
      Defines communication endpoint (port/host) the service shall communicate with. [required by SnakeYaml]
      Parameters:
      aasEndpoint - the communication endpoint
    • setWaitTime

      public void setWaitTime(int waitTime)
      Defines the time to wait for the process before going on with starting other services.
      Parameters:
      waitTime - the wait time in ms, ignored if not positive