Class AbstractDockerCommand<C extends AbstractDockerCommand>
- java.lang.Object
-
- com.oracle.bedrock.runtime.docker.commands.AbstractDockerCommand<C>
-
- All Implemented Interfaces:
com.oracle.bedrock.runtime.MetaClass<com.oracle.bedrock.runtime.Application>
- Direct Known Subclasses:
Build,CommandWithArgumentList,Events,Run,SimpleDockerCommand
public abstract class AbstractDockerCommand<C extends AbstractDockerCommand> extends Object implements com.oracle.bedrock.runtime.MetaClass<com.oracle.bedrock.runtime.Application>
AMetaClassrepresenting a Docker command.Instances of
AbstractDockerCommandare immutable. All mutating operations return new instances ofAbstractDockerCommandwith the mutations applied.Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.- Author:
- Jonathan Knight
-
-
Constructor Summary
Constructors Constructor Description AbstractDockerCommand(com.oracle.bedrock.runtime.options.Arguments commandArguments)Constructs aAbstractDockerCommandgiven the specifiedArguments.AbstractDockerCommand(String command)Constructs aAbstractDockerCommandfor a given Docker command.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description com.oracle.bedrock.runtime.options.ArgumentsgetCommandArguments()Obtain theArgumentsfor this command.Class<? extends com.oracle.bedrock.runtime.Application>getImplementationClass(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.OptionsByType optionsByType)com.oracle.bedrock.options.TimeoutgetTimeout()Obtain theTimeoutto use when executing the command.voidonLaunch(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.OptionsByType optionsByType)voidonLaunched(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.runtime.Application application, com.oracle.bedrock.OptionsByType optionsByType)voidonLaunching(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.OptionsByType optionsByType)CtimeoutAfter(long duration, TimeUnit units)Set theTimeoutto use when running the command.CtimeoutAfter(com.oracle.bedrock.options.Timeout timeout)Set theTimeoutto use when running the command.abstract CwithCommandArguments(com.oracle.bedrock.runtime.options.Argument... args)Obtain a copy of thisAbstractDockerCommandwith the addition of the specified command argumentsArguments.abstract CwithoutCommandArguments(com.oracle.bedrock.runtime.options.Argument... args)Obtain a copy of thisAbstractDockerCommandwithout the specified command argumentsArguments.
-
-
-
Constructor Detail
-
AbstractDockerCommand
public AbstractDockerCommand(com.oracle.bedrock.runtime.options.Arguments commandArguments)
Constructs aAbstractDockerCommandgiven the specifiedArguments.- Parameters:
commandArguments- theArguments representing the options for the command
-
AbstractDockerCommand
public AbstractDockerCommand(String command)
Constructs aAbstractDockerCommandfor a given Docker command.- Parameters:
command- the Docker command that will be executed
-
-
Method Detail
-
getImplementationClass
public Class<? extends com.oracle.bedrock.runtime.Application> getImplementationClass(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.OptionsByType optionsByType)
- Specified by:
getImplementationClassin interfacecom.oracle.bedrock.runtime.MetaClass<C extends AbstractDockerCommand>
-
onLaunching
public void onLaunching(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.OptionsByType optionsByType)- Specified by:
onLaunchingin interfacecom.oracle.bedrock.runtime.MetaClass<C extends AbstractDockerCommand>
-
onLaunch
public void onLaunch(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.OptionsByType optionsByType)- Specified by:
onLaunchin interfacecom.oracle.bedrock.runtime.MetaClass<C extends AbstractDockerCommand>
-
onLaunched
public void onLaunched(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.runtime.Application application, com.oracle.bedrock.OptionsByType optionsByType)- Specified by:
onLaunchedin interfacecom.oracle.bedrock.runtime.MetaClass<C extends AbstractDockerCommand>
-
withCommandArguments
public abstract C withCommandArguments(com.oracle.bedrock.runtime.options.Argument... args)
Obtain a copy of thisAbstractDockerCommandwith the addition of the specified command argumentsArguments.Command arguments in Docker come after the command name on the command line, e.g. docker [options...] COMMAND_NAME [args...] Parts of the Docker documentation that refer to these parameters as both arguments and options. In our case we refer to them as arguments and the are applied after the command name on the command line.
- Parameters:
args- the additionalArguments- Returns:
- a copy of this
AbstractDockerCommandwith the addition of the specifiedArguments
-
withoutCommandArguments
public abstract C withoutCommandArguments(com.oracle.bedrock.runtime.options.Argument... args)
Obtain a copy of thisAbstractDockerCommandwithout the specified command argumentsArguments.Command arguments in Docker come after the command name on the command line, e.g. docker [options...] COMMAND_NAME [args...] Parts of the Docker documentation that refer to these parameters as both arguments and options. In our case we refer to them as arguments and the are applied after the command name on the command line.
- Parameters:
args- the additionalArguments- Returns:
- a copy of this
AbstractDockerCommandwithout the specifiedArguments
-
getCommandArguments
public com.oracle.bedrock.runtime.options.Arguments getCommandArguments()
Obtain theArgumentsfor this command.- Returns:
- the
Argumentsfor this command
-
timeoutAfter
public C timeoutAfter(long duration, TimeUnit units)
Set theTimeoutto use when running the command.- Parameters:
duration- the duration for theTimeoutunits- theTimeUnits for the duration of theTimeout- Returns:
- a copy of this
AbstractDockerCommandwith the addition of the specified timeout
-
timeoutAfter
public C timeoutAfter(com.oracle.bedrock.options.Timeout timeout)
Set theTimeoutto use when running the command.- Parameters:
timeout- theTimeoutto use when executing the command- Returns:
- a copy of this
AbstractDockerCommandwith the addition of the specified timeout
-
getTimeout
public com.oracle.bedrock.options.Timeout getTimeout()
Obtain theTimeoutto use when executing the command.- Returns:
- the
Timeoutto use when executing the command
-
-