Class AbstractJavaSystemCommandExecuteBuilder
- java.lang.Object
-
- com.github.toolarium.system.command.builder.system.AbstractCommandExecuterBuilder
-
- com.github.toolarium.system.command.builder.java.AbstractJavaSystemCommandExecuteBuilder
-
- All Implemented Interfaces:
ISystemCommandExecuterBuilder
- Direct Known Subclasses:
JarSystemCommandExecuterBuilder
,JavaSystemCommandExecuterBuilder
public abstract class AbstractJavaSystemCommandExecuteBuilder extends AbstractCommandExecuterBuilder
The abstract java system command executer builder
-
-
Constructor Summary
Constructors Constructor Description AbstractJavaSystemCommandExecuteBuilder(SystemCommandGroupList systemCommandGroupList)
Constructor for AbstractJavaSystemCommandExecuteBuilder
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
childBuild(SystemCommandGroupList systemCommandGroupList)
Build the java commandAbstractJavaSystemCommandExecuteBuilder
classPath(java.lang.String classPath)
Set the java executable to setAbstractJavaSystemCommandExecuteBuilder
environmentVariable(java.lang.String key, java.lang.String value)
Add an environment variableprotected void
finalizeJavaExecutable()
Finalize the java executableAbstractJavaSystemCommandExecuteBuilder
inheritClassPath()
Inherit class pathAbstractJavaSystemCommandExecuteBuilder
inheritJre()
Inherit jre pathAbstractJavaSystemCommandExecuteBuilder
javaAgent(java.lang.String javaAgent)
Set the java agent to setAbstractJavaSystemCommandExecuteBuilder
javaExecutable(java.lang.String javaExecutable)
Set the java executable to setAbstractJavaSystemCommandExecuteBuilder
javaHeadless()
Set the java headlessprotected abstract java.lang.String
javaMain()
Get the java mainAbstractJavaSystemCommandExecuteBuilder
javaMemory(java.lang.String initialSize, java.lang.String maxSize)
Set the java memory settingsAbstractJavaSystemCommandExecuteBuilder
javaTempPath(java.lang.String tempPath)
Set the java temp pathAbstractJavaSystemCommandExecuteBuilder
javaUser(java.lang.String user)
Set the jvm userAbstractJavaSystemCommandExecuteBuilder
jrePath(java.lang.String jrePath)
Set the jre pathAbstractJavaSystemCommandExecuteBuilder
lock()
Lock the current system command group list (default timeout).AbstractJavaSystemCommandExecuteBuilder
lock(java.lang.Integer lockTimeoutInSeconds)
Lock the current system command group list.AbstractJavaSystemCommandExecuteBuilder
parameter(java.lang.String parameter)
Add a program parameterAbstractJavaSystemCommandExecuteBuilder
shell(java.lang.String... shell)
Set the shell of the current commandAbstractJavaSystemCommandExecuteBuilder
systemProperty(java.lang.String key, java.lang.String value)
Add a system propertyAbstractJavaSystemCommandExecuteBuilder
systemProperty(java.lang.String key, java.lang.String value, boolean isSenstivieValue)
Add a system propertyAbstractJavaSystemCommandExecuteBuilder
user(java.lang.String user)
Set the user of the current commandAbstractJavaSystemCommandExecuteBuilder
workingPath(java.lang.String workingPath)
Set the working path of the current command-
Methods inherited from class com.github.toolarium.system.command.builder.system.AbstractCommandExecuterBuilder
addSystemCommand, addSystemCommandGroup, build, command, command, command, command, equals, getProcessEnvironment, getSystemCommand, hashCode, onError, onSuccess, onSuccessOrError, pipe
-
-
-
-
Constructor Detail
-
AbstractJavaSystemCommandExecuteBuilder
public AbstractJavaSystemCommandExecuteBuilder(SystemCommandGroupList systemCommandGroupList)
Constructor for AbstractJavaSystemCommandExecuteBuilder- Parameters:
systemCommandGroupList
- the system command group list
-
-
Method Detail
-
shell
public AbstractJavaSystemCommandExecuteBuilder shell(java.lang.String... shell)
Description copied from interface:ISystemCommandExecuterBuilder
Set the shell of the current command- Specified by:
shell
in interfaceISystemCommandExecuterBuilder
- Overrides:
shell
in classAbstractCommandExecuterBuilder
- Parameters:
shell
- the shell- Returns:
- the system command executer builder
- See Also:
ISystemCommandExecuterBuilder.shell(java.lang.String[])
-
user
public AbstractJavaSystemCommandExecuteBuilder user(java.lang.String user)
Description copied from interface:ISystemCommandExecuterBuilder
Set the user of the current command- Specified by:
user
in interfaceISystemCommandExecuterBuilder
- Overrides:
user
in classAbstractCommandExecuterBuilder
- Parameters:
user
- the user- Returns:
- the system command executer builder
- See Also:
ISystemCommandExecuterBuilder.user(java.lang.String)
-
workingPath
public AbstractJavaSystemCommandExecuteBuilder workingPath(java.lang.String workingPath)
Description copied from interface:ISystemCommandExecuterBuilder
Set the working path of the current command- Specified by:
workingPath
in interfaceISystemCommandExecuterBuilder
- Overrides:
workingPath
in classAbstractCommandExecuterBuilder
- Parameters:
workingPath
- the workingPath- Returns:
- the system command executer builder
- See Also:
ISystemCommandExecuterBuilder.workingPath(java.lang.String)
-
environmentVariable
public AbstractJavaSystemCommandExecuteBuilder environmentVariable(java.lang.String key, java.lang.String value)
Description copied from interface:ISystemCommandExecuterBuilder
Add an environment variable- Specified by:
environmentVariable
in interfaceISystemCommandExecuterBuilder
- Overrides:
environmentVariable
in classAbstractCommandExecuterBuilder
- Parameters:
key
- the keyvalue
- the value- Returns:
- the system command executer builder
- See Also:
ISystemCommandExecuterBuilder.environmentVariable(java.lang.String, java.lang.String)
-
jrePath
public AbstractJavaSystemCommandExecuteBuilder jrePath(java.lang.String jrePath)
Set the jre path- Parameters:
jrePath
- the jre path- Returns:
- the java system command executer builder
-
inheritJre
public AbstractJavaSystemCommandExecuteBuilder inheritJre()
Inherit jre path- Returns:
- the java system command executer builder
-
javaExecutable
public AbstractJavaSystemCommandExecuteBuilder javaExecutable(java.lang.String javaExecutable)
Set the java executable to set- Parameters:
javaExecutable
- the java executable to set- Returns:
- the java system command executer builder
-
inheritClassPath
public AbstractJavaSystemCommandExecuteBuilder inheritClassPath()
Inherit class path- Returns:
- the java system command executer builder
-
classPath
public AbstractJavaSystemCommandExecuteBuilder classPath(java.lang.String classPath)
Set the java executable to set- Parameters:
classPath
- the java classpath to add- Returns:
- the java system command executer builder
-
javaAgent
public AbstractJavaSystemCommandExecuteBuilder javaAgent(java.lang.String javaAgent)
Set the java agent to set- Parameters:
javaAgent
- the java agent to set- Returns:
- the java system command executer builder
-
javaMemory
public AbstractJavaSystemCommandExecuteBuilder javaMemory(java.lang.String initialSize, java.lang.String maxSize)
Set the java memory settings- Parameters:
initialSize
- The initiali size in bytes, e.g. 512M. Sets the initial size of the Java heap. The default size is 2097152 (2MB). The values must be a multiple of, and greater than, 1024 bytes (1KB). (The -server flag increases the default size to 32M.). Sets the initial Java heap size for the Eden generation. The default value is 640K.maxSize
- The max size in bytes, e.g. 4G. Sets the maximum size to which the Java heap can grow. The default size is 64M. (The -server flag increases the default size to 128M.)- Returns:
- the java system command executer builder
-
javaUser
public AbstractJavaSystemCommandExecuteBuilder javaUser(java.lang.String user)
Set the jvm user- Parameters:
user
- the jvm user- Returns:
- the java system command executer builder
-
javaTempPath
public AbstractJavaSystemCommandExecuteBuilder javaTempPath(java.lang.String tempPath)
Set the java temp path- Parameters:
tempPath
- the temp path- Returns:
- the java system command executer builder
-
javaHeadless
public AbstractJavaSystemCommandExecuteBuilder javaHeadless()
Set the java headless- Returns:
- the java system command executer builder
-
systemProperty
public AbstractJavaSystemCommandExecuteBuilder systemProperty(java.lang.String key, java.lang.String value)
Add a system property- Parameters:
key
- the keyvalue
- the value- Returns:
- the java system command executer builder
-
systemProperty
public AbstractJavaSystemCommandExecuteBuilder systemProperty(java.lang.String key, java.lang.String value, boolean isSenstivieValue)
Add a system property- Parameters:
key
- the keyvalue
- the valueisSenstivieValue
- true if the value is sensitive- Returns:
- the java system command executer builder
-
parameter
public AbstractJavaSystemCommandExecuteBuilder parameter(java.lang.String parameter)
Add a program parameter- Parameters:
parameter
- program parameter to add- Returns:
- the java system command executer builder
-
lock
public AbstractJavaSystemCommandExecuteBuilder lock()
Description copied from interface:ISystemCommandExecuterBuilder
Lock the current system command group list (default timeout).- Specified by:
lock
in interfaceISystemCommandExecuterBuilder
- Overrides:
lock
in classAbstractCommandExecuterBuilder
- Returns:
- the system command executer builder
- See Also:
ISystemCommandExecuterBuilder.lock()
-
lock
public AbstractJavaSystemCommandExecuteBuilder lock(java.lang.Integer lockTimeoutInSeconds)
Description copied from interface:ISystemCommandExecuterBuilder
Lock the current system command group list.- Specified by:
lock
in interfaceISystemCommandExecuterBuilder
- Overrides:
lock
in classAbstractCommandExecuterBuilder
- Parameters:
lockTimeoutInSeconds
- the period in seconds- Returns:
- the system command executer builder
- See Also:
ISystemCommandExecuterBuilder.lock(java.lang.Integer)
-
childBuild
protected void childBuild(SystemCommandGroupList systemCommandGroupList) throws java.lang.IllegalArgumentException
Description copied from class:AbstractCommandExecuterBuilder
Build the java command- Specified by:
childBuild
in classAbstractCommandExecuterBuilder
- Parameters:
systemCommandGroupList
- the- Throws:
java.lang.IllegalArgumentException
- In case of an invalid argument- See Also:
AbstractCommandExecuterBuilder.childBuild(com.github.toolarium.system.command.dto.list.SystemCommandGroupList)
-
finalizeJavaExecutable
protected void finalizeJavaExecutable()
Finalize the java executable
-
javaMain
protected abstract java.lang.String javaMain()
Get the java main- Returns:
- the java main
- Throws:
java.lang.IllegalArgumentException
- In case of an invalid input
-
-