public abstract class BaseOperationCommand extends CommandHandlerWithHelp implements OperationCommand, CliEventListener
Modifier and Type | Field and Description |
---|---|
protected ArgumentWithValue |
headers |
protected List<RequestParameterArgument> |
params |
protected OperationRequestAddress |
requiredAddress |
helpArg
Constructor and Description |
---|
BaseOperationCommand(CommandContext ctx,
String command,
boolean connectionRequired) |
Modifier and Type | Method and Description |
---|---|
void |
addArgument(CommandArgument arg) |
protected void |
addHeaders(CommandContext ctx,
org.jboss.dmr.ModelNode request) |
protected void |
addRequiredPath(OperationRequestAddress requiredPath)
Adds a node path which is required to exist before the command can be used.
|
protected void |
addRequiredPath(String requiredPath)
Adds a node path which is required to exist before the command can be used.
|
org.jboss.dmr.ModelNode |
buildRequest(CommandContext ctx) |
protected abstract org.jboss.dmr.ModelNode |
buildRequestWithoutHeaders(CommandContext ctx) |
void |
cliEvent(CliEvent event,
CommandContext ctx) |
protected void |
doHandle(CommandContext ctx) |
protected OperationRequestAddress |
getRequiredAddress() |
protected String |
getRequiredType() |
protected void |
handleResponse(CommandContext ctx,
org.jboss.dmr.ModelNode response,
boolean composite) |
boolean |
isAvailable(CommandContext ctx)
Checks whether the command is available in the current context
(e.g.
|
protected boolean |
isDependsOnProfile() |
protected void |
setParams(CommandContext ctx,
org.jboss.dmr.ModelNode request) |
handle, isBatchMode, printHelp, printList
getArguments, hasArgument, hasArgument
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getArguments, handle, hasArgument, hasArgument, isBatchMode
protected List<RequestParameterArgument> params
protected OperationRequestAddress requiredAddress
protected ArgumentWithValue headers
public BaseOperationCommand(CommandContext ctx, String command, boolean connectionRequired)
protected void addRequiredPath(String requiredPath)
requiredPath
- node path which is required to exist before the command can be used.protected void addRequiredPath(OperationRequestAddress requiredPath)
requiredPath
- node path which is required to exist before the command can be used.protected boolean isDependsOnProfile()
protected OperationRequestAddress getRequiredAddress()
protected String getRequiredType()
public boolean isAvailable(CommandContext ctx)
CommandHandler
isAvailable
in interface CommandHandler
isAvailable
in class CommandHandlerWithHelp
ctx
- current contextpublic void cliEvent(CliEvent event, CommandContext ctx)
cliEvent
in interface CliEventListener
protected void doHandle(CommandContext ctx) throws CommandLineException
doHandle
in class CommandHandlerWithHelp
CommandLineException
public org.jboss.dmr.ModelNode buildRequest(CommandContext ctx) throws CommandFormatException
buildRequest
in interface OperationCommand
CommandFormatException
protected abstract org.jboss.dmr.ModelNode buildRequestWithoutHeaders(CommandContext ctx) throws CommandFormatException
CommandFormatException
protected void addHeaders(CommandContext ctx, org.jboss.dmr.ModelNode request) throws CommandFormatException
CommandFormatException
protected void handleResponse(CommandContext ctx, org.jboss.dmr.ModelNode response, boolean composite) throws CommandFormatException
CommandFormatException
public void addArgument(CommandArgument arg)
addArgument
in class CommandHandlerWithArguments
protected void setParams(CommandContext ctx, org.jboss.dmr.ModelNode request) throws CommandFormatException
CommandFormatException
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.