public class RemoteCommand extends CLICommand
argv, ASADMIN, commandModel, CONNECTION_ERROR, env, ERROR, INVALID_COMMAND_ERROR, lineReader, logger, metadataErrors, name, operands, options, passwords, programOpts, SUCCESS, terminal, WARNING| Constructor and Description |
|---|
RemoteCommand()
Construct a new remote command object.
|
RemoteCommand(String name,
ProgramOptions po,
Environment env)
Construct a new remote command object.
|
RemoteCommand(String name,
ProgramOptions po,
Environment env,
String responseFormatType,
OutputStream userOut)
Construct a new remote command object.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkHelp()
We do all our help processing in executeCommand.
|
int |
execute(String... argv)
Execute this command with the given arguemnts.
|
Map<String,String> |
executeAndReturnAttributes(String... args)
Execute the command and return the main attributes from the manifest
instead of writing out the output.
|
String |
executeAndReturnOutput(String... args)
Execute the command and return the output as a string
instead of writing it out.
|
protected int |
executeCommand()
Execute the command using the options in options and the
operands in operands.
|
BufferedReader |
getManPage()
Get the man page from the server.
|
String |
getUsage()
Get the usage text.
|
protected void |
inject()
Inject this instance with the final values of all the command
parameters.
|
protected void |
prepare()
The prepare method must ensure that the commandModel field is set.
|
protected void |
prevalidate()
The prevalidate method supplies missing options from
the environment.
|
void |
setFileOutputDirectory(File dir)
Set the directory in which any returned files will be stored.
|
protected void |
validate()
The validate method can be used by a subclass to validate
that the type and quantity of parameters and operands matches
the requirements for this command.
|
buildLineReader, buildTerminal, closeTerminal, execute, expandManPage, getBooleanOption, getBriefCommandUsage, getCommand, getCommand, getCommandScope, getCommandUsage, getName, getOperandModel, getOption, getOptions, getPassword, getPassword, getProgramOptions, getSystemProperties, getSystemProperty, initializeLogger, initializePasswords, ok, parse, postConstruct, printExceptionStackTrace, processProgramOptions, quote, readPassword, setCommandScope, toString, usageOptionspublic RemoteCommand()
throws CommandException
CommandExceptionpublic RemoteCommand(String name, ProgramOptions po, Environment env) throws CommandException
name - po - env - CommandExceptionRemoteCLICommand.RemoteCLICommand(String, ProgramOptions, Environment)public RemoteCommand(String name, ProgramOptions po, Environment env, String responseFormatType, OutputStream userOut) throws CommandException
name - po - env - responseFormatType - userOut - CommandExceptionRemoteCLICommand.RemoteCLICommand(String, ProgramOptions, Environment, String, OutputStream)public int execute(String... argv) throws CommandException
CLICommandexecute in class CLICommandargv - Arguments to execute command withCommandException - if execution of the command failsCommandValidationException - if there's something wrong
with the options or argumentspublic void setFileOutputDirectory(File dir)
dir - protected void prepare()
throws CommandException,
CommandValidationException
CLICommandprepare in class CLICommandCommandExceptionCommandValidationExceptionprotected void prevalidate()
throws CommandException
CLICommandprevalidate in class CLICommandCommandException - if execution of the command failsCommandValidationException - if there's something wrong
with the options or argumentsprotected void validate()
throws CommandException,
CommandValidationException
CLICommandvalidate in class CLICommandCommandException - if execution of the command failsCommandValidationException - if there's something wrong
with the options or argumentsprotected void inject()
throws CommandException
CLICommandinject in class CLICommandCommandException - if execution of the command failsCommandValidationException - if there's something wrong
with the options or argumentsprotected boolean checkHelp()
throws CommandException,
CommandValidationException
checkHelp in class CLICommandCommandExceptionCommandValidationExceptionprotected int executeCommand()
throws CommandException,
CommandValidationException
CLICommandexecuteCommand in class CLICommandCommandException - if execution of the command failsCommandValidationException - if there's something wrong
with the options or argumentspublic String executeAndReturnOutput(String... args) throws CommandException, CommandValidationException
args - CommandValidationExceptionCommandExceptionpublic Map<String,String> executeAndReturnAttributes(String... args) throws CommandException, CommandValidationException
args - CommandExceptionCommandValidationExceptionpublic String getUsage()
getUsage in class CLICommandpublic BufferedReader getManPage()
getManPage in class CLICommandCopyright © 2019. All rights reserved.