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 voidchildBuild(SystemCommandGroupList systemCommandGroupList)Build the java commandDockerSystemCommandExecuterBuilderdockerCommand(java.lang.String dockerCommand)Set the docker commandDockerSystemCommandExecuterBuilderdockerExecutable(java.lang.String dockerExecutable)Set the docker imageDockerSystemCommandExecuterBuilderenvironmentVariable(java.lang.String key, java.lang.String value)Add an environment variableDockerSystemCommandExecuterBuilderimages()Get docker imagesDockerSystemCommandExecuterBuilderimages(java.lang.String name)Get docker imagesDockerSystemCommandExecuterBuilderinteractive(boolean interactive)InteractiveDockerSystemCommandExecuterBuilderlock()Lock the current system command group list (default timeout).DockerSystemCommandExecuterBuilderlock(java.lang.Integer lockTimeoutInSeconds)Lock the current system command group list.DockerSystemCommandExecuterBuildername(java.lang.String name)Set the docker nameDockerSystemCommandExecuterBuilderparameter(java.lang.String parameter)Add a program parameterDockerSystemCommandExecuterBuilderport(java.lang.Integer port)Set the docker portDockerSystemCommandExecuterBuilderremove(boolean remove)Automatically remove the container when it exitsDockerSystemCommandExecuterBuilderrun(java.lang.String image)Run a docker containerDockerSystemCommandExecuterBuildershell(java.lang.String... shell)Set the shell of the current commandDockerSystemCommandExecuterBuilderstop(java.lang.String name)Stop a docker containerDockerSystemCommandExecuterBuilderuser(java.lang.String user)Set the user of the current commandDockerSystemCommandExecuterBuilderworkingPath(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:ISystemCommandExecuterBuilderSet the shell of the current command- Specified by:
shellin interfaceISystemCommandExecuterBuilder- Overrides:
shellin 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:ISystemCommandExecuterBuilderSet the user of the current command- Specified by:
userin interfaceISystemCommandExecuterBuilder- Overrides:
userin 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:ISystemCommandExecuterBuilderSet the working path of the current command- Specified by:
workingPathin interfaceISystemCommandExecuterBuilder- Overrides:
workingPathin 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:ISystemCommandExecuterBuilderAdd an environment variable- Specified by:
environmentVariablein interfaceISystemCommandExecuterBuilder- Overrides:
environmentVariablein 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:ISystemCommandExecuterBuilderLock the current system command group list (default timeout).- Specified by:
lockin interfaceISystemCommandExecuterBuilder- Overrides:
lockin classAbstractCommandExecuterBuilder- Returns:
- the system command executer builder
- See Also:
ISystemCommandExecuterBuilder.lock()
-
lock
public DockerSystemCommandExecuterBuilder lock(java.lang.Integer lockTimeoutInSeconds)
Description copied from interface:ISystemCommandExecuterBuilderLock the current system command group list.- Specified by:
lockin interfaceISystemCommandExecuterBuilder- Overrides:
lockin 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:AbstractCommandExecuterBuilderBuild the java command- Specified by:
childBuildin 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)
-
-