public class CommandConfiguration extends Object
| Modifier and Type | Method and Description |
|---|---|
CommandConfiguration |
addCommands(Collection<String> commands)
Adds the commands to the CLI commands that should be executed.
|
CommandConfiguration |
addJvmOptions(String... jvmOptions)
|
CommandConfiguration |
addPropertiesFiles(Collection<File> propertiesFiles)
Adds the properties files to use when executing CLI scripts or commands.
|
CommandConfiguration |
addScripts(Collection<File> scripts)
Adds the scripts to be executed.
|
CommandConfiguration |
addSystemProperties(Map<String,String> systemProperties)
Adds to the system properties to set before the CLI commands are executed.
|
org.jboss.as.controller.client.ModelControllerClient |
getClient()
Returns the management client.
|
MavenModelControllerClientConfiguration |
getClientConfiguration()
Returns the management client configuration.
|
Collection<String> |
getCommands()
Returns the commands to be executed.
|
Path |
getJBossHome()
Returns the JBoss Home directory.
|
Collection<String> |
getJvmOptions()
|
Collection<Path> |
getPropertiesFiles()
The properties files to use when executing CLI scripts or commands.
|
Collection<Path> |
getScripts()
Returns the scripts to be executed.
|
String |
getStdout()
The pattern used to determine how standard out is handled for a new CLI process.
|
Map<String,String> |
getSystemProperties()
Returns the system properties to set before CLI commands are executed.
|
int |
getTimeout()
Gets the timeout, in seconds, used for the management connection.
|
boolean |
isBatch()
Indicates whether or not the commands should be run in a batch or not.
|
boolean |
isFailOnError()
Indicates whether or not CLI commands should fail if the command ends in an error or not.
|
boolean |
isFork()
Indicates whether or not CLI commands should be executed in a new process.
|
boolean |
isOffline()
Indicates whether or not this should be an offline process.
|
static CommandConfiguration |
of(Supplier<org.jboss.as.controller.client.ModelControllerClient> clientSupplier,
Supplier<MavenModelControllerClientConfiguration> clientConfigurationSupplier)
Creates a new command configuration.
|
CommandConfiguration |
setBatch(boolean batch)
Sets whether or not the commands should be executed in a batch or not.
|
CommandConfiguration |
setFailOnError(boolean failOnError)
Sets whether or not CLI commands should fail if the command ends in an error or not.
|
CommandConfiguration |
setFork(boolean fork)
Sets whether or not the commands should be executed in a new process.
|
CommandConfiguration |
setJBossHome(Path jbossHome)
Sets the JBoss Home directory.
|
CommandConfiguration |
setJBossHome(String jbossHome)
Sets the JBoss Home directory.
|
CommandConfiguration |
setOffline(boolean offline)
Sets whether a client should be associated with the CLI context.
|
CommandConfiguration |
setStdout(String stdout)
|
CommandConfiguration |
setTimeout(int timeout)
Sets the timeout, in seconds, used for the management client connection.
|
public static CommandConfiguration of(Supplier<org.jboss.as.controller.client.ModelControllerClient> clientSupplier, Supplier<MavenModelControllerClientConfiguration> clientConfigurationSupplier)
clientSupplier - the supplier used to get a management clientclientConfigurationSupplier - a supplier used to get the client configurationpublic boolean isBatch()
true if the commands should be executed in a batch, otherwise falsepublic CommandConfiguration setBatch(boolean batch)
batch - true if the commands should be executed in a batch, otherwise falsepublic org.jboss.as.controller.client.ModelControllerClient getClient()
public MavenModelControllerClientConfiguration getClientConfiguration()
public Path getJBossHome()
null if the value was not setpublic CommandConfiguration setJBossHome(String jbossHome)
jbossHome - the JBoss Home directory or null if the value is not requiredpublic CommandConfiguration setJBossHome(Path jbossHome)
jbossHome - the JBoss Home directory or null if the value is not requiredpublic Collection<String> getJvmOptions()
public CommandConfiguration addJvmOptions(String... jvmOptions)
jvmOptions - the JVM options or nullpublic Map<String,String> getSystemProperties()
public CommandConfiguration addSystemProperties(Map<String,String> systemProperties)
systemProperties - the system properties or nullpublic Collection<Path> getPropertiesFiles()
public CommandConfiguration addPropertiesFiles(Collection<File> propertiesFiles)
propertiesFiles - the property files to addpublic Collection<String> getCommands()
public CommandConfiguration addCommands(Collection<String> commands)
commands - the commands to be executedpublic Collection<Path> getScripts()
public CommandConfiguration addScripts(Collection<File> scripts)
scripts - the scripts to be executedpublic boolean isFailOnError()
true if a CLI command fails then the execution should failpublic CommandConfiguration setFailOnError(boolean failOnError)
failOnError - true if a CLI command fails then the execution should failpublic boolean isFork()
true to execute CLI commands in a new processpublic CommandConfiguration setFork(boolean fork)
Note that is isOffline() is set to true this has no effect.
fork - true if commands should be executed in a new processpublic boolean isOffline()
true if this should be an offline process, otherwise falsepublic CommandConfiguration setOffline(boolean offline)
Note this launches CLI in a new process.
offline - true if this should be an offline processpublic String getStdout()
public CommandConfiguration setStdout(String stdout)
stdout - the pattern for standard outpublic int getTimeout()
public CommandConfiguration setTimeout(int timeout)
timeout - the timeout to use in secondsCopyright © 2019 JBoss by Red Hat. All rights reserved.