Class UnixSystemCommandExecuterImpl
- java.lang.Object
-
- com.github.toolarium.system.command.executer.impl.AbstractSystemCommandExecuterImpl
-
- com.github.toolarium.system.command.executer.impl.UnixSystemCommandExecuterImpl
-
- All Implemented Interfaces:
ISystemCommandExecuter
,ISystemCommandExecuterPlatformSupport
- Direct Known Subclasses:
LinuxSystemCommandExecuterImpl
public class UnixSystemCommandExecuterImpl extends AbstractSystemCommandExecuterImpl
Implements a unix based system command executerto proper use under linux you have to close streams:
my.log 2>&1 </dev/zero &
-
-
Field Summary
-
Fields inherited from class com.github.toolarium.system.command.executer.impl.AbstractSystemCommandExecuterImpl
DEFAULT_POLL_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description UnixSystemCommandExecuterImpl(ISystemCommandGroupList systemCommandGroupList)
Constructor for WindowsSystemCommandExecuterImpl
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCommandOnErrorEnd()
Get the end command on errorjava.lang.String
getCommandOnErrorStart()
Get the start command on errorjava.lang.String
getCommandOnSuccessEnd()
Get the end command on successjava.lang.String
getCommandOnSuccessStart()
Get the start command on successjava.lang.String
getEndOfLine()
Get the end of linejava.lang.String
getEnvironmentAssignCommand()
Get the environment assign commandjava.lang.String
getEnvironmentAssignCommandEnd()
Get the environment assign command endjava.lang.String
getEnvironmentChangeDirectoryCommand()
Get the environment change directory commandjava.lang.String
getEnvironmentSetCommand()
Get the environment set commandjava.lang.String
getEnvironmentUnsetCommand()
Get the environment unset commandjava.lang.String
getNotExistEnvironmentVariableCommand(java.lang.String envVariable)
Get the if not exist environment variable commandjava.lang.String
getScriptFileComment()
Get the script file commentjava.lang.String
getScriptFileExtension()
Get the script file extensionjava.lang.String
getScriptFileFooter()
Get the script file footerjava.lang.String
getScriptFileHeader()
Get the script file headerjava.util.List<java.lang.String>
getShellEndCommand(java.lang.String id, ISystemCommand systemCommand)
Get the end shell commandjava.util.List<java.lang.String>
getShellStartCommand(java.lang.String id, ISystemCommand systemCommand)
Get the start shell commandjava.util.List<java.lang.String>
getSudo(java.lang.String username)
Get the substitute user command-
Methods inherited from class com.github.toolarium.system.command.executer.impl.AbstractSystemCommandExecuterImpl
getSystemCommandGroupList, prepareDuration, runAsynchronous, runAsynchronous, runAsynchronous, runAsynchronous, runAsynchronous, runSynchronous, runSynchronous, runSynchronous, writeToFile
-
-
-
-
Constructor Detail
-
UnixSystemCommandExecuterImpl
public UnixSystemCommandExecuterImpl(ISystemCommandGroupList systemCommandGroupList)
Constructor for WindowsSystemCommandExecuterImpl- Parameters:
systemCommandGroupList
- the system command group list
-
-
Method Detail
-
getShellStartCommand
public java.util.List<java.lang.String> getShellStartCommand(java.lang.String id, ISystemCommand systemCommand)
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the start shell command- Parameters:
id
- the id of this command groupsystemCommand
- the system command- Returns:
- the shell command
- See Also:
ISystemCommandExecuterPlatformSupport.getShellStartCommand(java.lang.String, com.github.toolarium.system.command.dto.ISystemCommand)
-
getShellEndCommand
public java.util.List<java.lang.String> getShellEndCommand(java.lang.String id, ISystemCommand systemCommand)
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the end shell command- Parameters:
id
- the id of this command groupsystemCommand
- the system command- Returns:
- the shell command
- See Also:
ISystemCommandExecuterPlatformSupport.getShellEndCommand(java.lang.String, com.github.toolarium.system.command.dto.ISystemCommand)
-
getScriptFileExtension
public java.lang.String getScriptFileExtension()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the script file extension- Returns:
- the script file extension
- See Also:
ISystemCommandExecuterPlatformSupport.getScriptFileExtension()
-
getScriptFileHeader
public java.lang.String getScriptFileHeader()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the script file header- Returns:
- the script file header
- See Also:
ISystemCommandExecuterPlatformSupport.getScriptFileHeader()
-
getScriptFileFooter
public java.lang.String getScriptFileFooter()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the script file footer- Returns:
- the script file footer
- See Also:
ISystemCommandExecuterPlatformSupport.getScriptFileFooter()
-
getScriptFileComment
public java.lang.String getScriptFileComment()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the script file comment- Returns:
- the script file comment
- See Also:
ISystemCommandExecuterPlatformSupport.getScriptFileComment()
-
getNotExistEnvironmentVariableCommand
public java.lang.String getNotExistEnvironmentVariableCommand(java.lang.String envVariable)
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the if not exist environment variable command- Parameters:
envVariable
- the environment variable- Returns:
- the if exist environment variable command
- See Also:
ISystemCommandExecuterPlatformSupport.getNotExistEnvironmentVariableCommand(java.lang.String)
-
getEnvironmentSetCommand
public java.lang.String getEnvironmentSetCommand()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the environment set command- Returns:
- the environment set command
- See Also:
ISystemCommandExecuterPlatformSupport.getEnvironmentSetCommand()
-
getEnvironmentUnsetCommand
public java.lang.String getEnvironmentUnsetCommand()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the environment unset command- Returns:
- the environment unset command
- See Also:
ISystemCommandExecuterPlatformSupport.getEnvironmentUnsetCommand()
-
getEnvironmentChangeDirectoryCommand
public java.lang.String getEnvironmentChangeDirectoryCommand()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the environment change directory command- Returns:
- the environment change directory command
- See Also:
ISystemCommandExecuterPlatformSupport.getEnvironmentChangeDirectoryCommand()
-
getEnvironmentAssignCommand
public java.lang.String getEnvironmentAssignCommand()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the environment assign command- Returns:
- the environment assign command
- See Also:
ISystemCommandExecuterPlatformSupport.getEnvironmentAssignCommand()
-
getEnvironmentAssignCommandEnd
public java.lang.String getEnvironmentAssignCommandEnd()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the environment assign command end- Returns:
- the assign command
- See Also:
ISystemCommandExecuterPlatformSupport.getEnvironmentAssignCommandEnd()
-
getEndOfLine
public java.lang.String getEndOfLine()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the end of line- Returns:
- the end of line
- See Also:
ISystemCommandExecuterPlatformSupport.getEndOfLine()
-
getCommandOnSuccessStart
public java.lang.String getCommandOnSuccessStart()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the start command on success- Returns:
- the start command on success
- See Also:
ISystemCommandExecuterPlatformSupport.getCommandOnSuccessStart()
-
getCommandOnSuccessEnd
public java.lang.String getCommandOnSuccessEnd()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the end command on success- Returns:
- the end command on success
- See Also:
ISystemCommandExecuterPlatformSupport.getCommandOnSuccessEnd()
-
getCommandOnErrorStart
public java.lang.String getCommandOnErrorStart()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the start command on error- Returns:
- the start command on error
- See Also:
ISystemCommandExecuterPlatformSupport.getCommandOnErrorStart()
-
getCommandOnErrorEnd
public java.lang.String getCommandOnErrorEnd()
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the end command on error- Returns:
- the end command on error
- See Also:
ISystemCommandExecuterPlatformSupport.getCommandOnErrorEnd()
-
getSudo
public java.util.List<java.lang.String> getSudo(java.lang.String username)
Description copied from interface:ISystemCommandExecuterPlatformSupport
Get the substitute user command- Parameters:
username
- the username to use- Returns:
- the substitute user command
- See Also:
ISystemCommandExecuterPlatformSupport.getSudo(java.lang.String)
-
-