Class DockerSystemCommandExecuterBuilder
- java.lang.Object
-
- com.github.toolarium.system.command.builder.system.AbstractCommandExecuterBuilder
-
- com.github.toolarium.system.command.builder.docker.DockerSystemCommandExecuterBuilder
-
- All Implemented Interfaces:
ISystemCommandExecuterBuilder
public class DockerSystemCommandExecuterBuilder extends AbstractCommandExecuterBuilder
The docker system command executer builder
-
-
Constructor Summary
Constructors Constructor Description DockerSystemCommandExecuterBuilder(SystemCommandGroupList systemCommandGroupList)
Constructor for DockerSystemCommandExecuterBuilder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
childBuild(SystemCommandGroupList systemCommandGroupList)
Build the java commandDockerSystemCommandExecuterBuilder
dockerCommand(java.lang.String dockerCommand)
Set the docker commandDockerSystemCommandExecuterBuilder
dockerExecutable(java.lang.String dockerExecutable)
Set the docker imageDockerSystemCommandExecuterBuilder
environmentVariable(java.lang.String key, java.lang.String value)
Add an environment variableDockerSystemCommandExecuterBuilder
images()
Get docker imagesDockerSystemCommandExecuterBuilder
images(java.lang.String name)
Get docker imagesDockerSystemCommandExecuterBuilder
interactive(boolean interactive)
InteractiveDockerSystemCommandExecuterBuilder
lock()
Lock the current system command group list (default timeout).DockerSystemCommandExecuterBuilder
lock(java.lang.Integer lockTimeoutInSeconds)
Lock the current system command group list.DockerSystemCommandExecuterBuilder
name(java.lang.String name)
Set the docker nameDockerSystemCommandExecuterBuilder
parameter(java.lang.String parameter)
Add a program parameterDockerSystemCommandExecuterBuilder
port(java.lang.Integer port)
Set the docker portDockerSystemCommandExecuterBuilder
remove(boolean remove)
Automatically remove the container when it exitsDockerSystemCommandExecuterBuilder
run(java.lang.String image)
Run a docker containerDockerSystemCommandExecuterBuilder
shell(java.lang.String... shell)
Set the shell of the current commandDockerSystemCommandExecuterBuilder
stop(java.lang.String name)
Stop a docker containerDockerSystemCommandExecuterBuilder
user(java.lang.String user)
Set the user of the current commandDockerSystemCommandExecuterBuilder
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
-
DockerSystemCommandExecuterBuilder
public DockerSystemCommandExecuterBuilder(SystemCommandGroupList systemCommandGroupList)
Constructor for DockerSystemCommandExecuterBuilder- Parameters:
systemCommandGroupList
- the system command group list
-
-
Method Detail
-
shell
public DockerSystemCommandExecuterBuilder 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 DockerSystemCommandExecuterBuilder 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 DockerSystemCommandExecuterBuilder 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 DockerSystemCommandExecuterBuilder 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)
-
dockerExecutable
public DockerSystemCommandExecuterBuilder dockerExecutable(java.lang.String dockerExecutable)
Set the docker image- Parameters:
dockerExecutable
- the docker image- Returns:
- the docker system command executer builder
-
dockerCommand
public DockerSystemCommandExecuterBuilder dockerCommand(java.lang.String dockerCommand)
Set the docker command- Parameters:
dockerCommand
- the docker command- Returns:
- the docker system command executer builder
-
interactive
public DockerSystemCommandExecuterBuilder interactive(boolean interactive)
Interactive- Parameters:
interactive
- true for interactive- Returns:
- the docker system command executer builder
-
remove
public DockerSystemCommandExecuterBuilder remove(boolean remove)
Automatically remove the container when it exits- Parameters:
remove
- true to automatically remove the container when it exits- Returns:
- the docker system command executer builder
-
name
public DockerSystemCommandExecuterBuilder name(java.lang.String name)
Set the docker name- Parameters:
name
- the docker name- Returns:
- the docker system command executer builder
-
port
public DockerSystemCommandExecuterBuilder port(java.lang.Integer port)
Set the docker port- Parameters:
port
- the docker port- Returns:
- the docker system command executer builder
-
run
public DockerSystemCommandExecuterBuilder run(java.lang.String image)
Run a docker container- Parameters:
image
- the image- Returns:
- the docker system command executer builder
-
stop
public DockerSystemCommandExecuterBuilder stop(java.lang.String name)
Stop a docker container- Parameters:
name
- the conatiner name to stop- Returns:
- the docker system command executer builder
-
images
public DockerSystemCommandExecuterBuilder images()
Get docker images- Returns:
- the docker system command executer builder
-
images
public DockerSystemCommandExecuterBuilder images(java.lang.String name)
Get docker images- Parameters:
name
- the conatiner name to filter- Returns:
- the docker system command executer builder
-
parameter
public DockerSystemCommandExecuterBuilder parameter(java.lang.String parameter)
Add a program parameter- Parameters:
parameter
- program parameter to add- Returns:
- the docker system command executer builder
-
lock
public DockerSystemCommandExecuterBuilder 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 DockerSystemCommandExecuterBuilder 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)
-
-