Class YamlProcess
- 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 fromYamlProcess.getHomePath(). For the execution in a shell, the home directory will be set to the folder where the files inYamlProcess.getHomePath()are located.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private YamlEndpointaasEndpointprivate YamlEndpointserviceStreamEndpointprivate YamlEndpointstreamEndpointprivate intwaitTime
-
Constructor Summary
Constructors Constructor Description YamlProcess()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description YamlEndpointgetAasEndpoint()Returns AAS endpoint (port/host) the service shall communicate with for commands.java.util.List<java.lang.String>getCmdArg(int port, java.lang.String protocol)Returns additional/optional command line arguments required to start the service.YamlEndpointgetServiceStreamEndpoint()Returns streaming endpoint (port/host) on the service side the process shall communicate with.YamlEndpointgetStreamEndpoint()Returns streaming endpoint (port/host) on the process side the service shall communicate with.intgetWaitTime()Returns the time to wait for the process before going on with starting other services.voidsetAasEndpoint(YamlEndpoint aasEndpoint)Defines communication endpoint (port/host) the service shall communicate with.voidsetServiceStreamEndpoint(YamlEndpoint serviceStreamEndpoint)Defines communication endpoint (port/host) for streaming on the service side (to communicate with the process side).voidsetStreamEndpoint(YamlEndpoint streamEndpoint)Defines communication endpoint (port/host) on the process side the service shall communicate with.voidsetWaitTime(int waitTime)Defines the time to wait for the process before going on with starting other services.static java.util.List<java.lang.String>substCmdArg(java.util.List<java.lang.String> cmdArg, int port, java.lang.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, getExecutable, getExecutablePath, getHomePath, getLocationKey, getSubstCmdArg, isStarted, setArtifacts, setCmdArg, setExecutable, setExecutablePath, setExecutablePath, setHomePath, setHomePath, setLocationKey, setStarted, toSubstFileName, toSubstFilePath
-
-
-
-
Field Detail
-
serviceStreamEndpoint
private YamlEndpoint serviceStreamEndpoint
-
streamEndpoint
private YamlEndpoint streamEndpoint
-
aasEndpoint
private YamlEndpoint aasEndpoint
-
waitTime
private int waitTime
-
-
Method Detail
-
getCmdArg
public java.util.List<java.lang.String> getCmdArg(int port, java.lang.String protocol)Description copied from interface:ProcessSpecReturns additional/optional command line arguments required to start the service. The port placeholderEndpoint.PORT_PLACEHOLDERwill be replaced with the command port the platform is using to send administrative commands to the service (seeService).- Specified by:
getCmdArgin interfaceProcessSpec- Parameters:
port- the port used for the command communicationprotocol- the protocol used for the command communication- Returns:
- the resolved command line arguments (may be empty for none)
-
substCmdArg
public static java.util.List<java.lang.String> substCmdArg(java.util.List<java.lang.String> cmdArg, int port, java.lang.String protocol)Returns additional/optional command line arguments required to start the service. The port placeholderEndpoint.PORT_PLACEHOLDERwill be replaced with the command port the platform is using to send administrative commands to the service (seeService).- Parameters:
cmdArg- the command line arguments to be used as basis for substitutionport- the port used for the command communicationprotocol- 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:ProcessSpecReturns streaming endpoint (port/host) on the service side the process shall communicate with. Counterpart ofProcessSpec.getStreamEndpoint().- Specified by:
getServiceStreamEndpointin interfaceProcessSpec- Returns:
- the streaming endpoint
-
getStreamEndpoint
public YamlEndpoint getStreamEndpoint()
Description copied from interface:ProcessSpecReturns streaming endpoint (port/host) on the process side the service shall communicate with. Counterpart ofProcessSpec.getServiceStreamEndpoint().- Specified by:
getStreamEndpointin interfaceProcessSpec- Returns:
- the streaming endpoint
-
getAasEndpoint
public YamlEndpoint getAasEndpoint()
Description copied from interface:ProcessSpecReturns AAS endpoint (port/host) the service shall communicate with for commands.- Specified by:
getAasEndpointin interfaceProcessSpec- Returns:
- the AAS endpoint
-
getWaitTime
public int getWaitTime()
Description copied from interface:ProcessSpecReturns the time to wait for the process before going on with starting other services.- Specified by:
getWaitTimein interfaceProcessSpec- 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
-
-