public abstract class BaseOperationCommand extends CommandHandlerWithHelp implements OperationCommand, CliEventListener
Modifier and Type | Field and Description |
---|---|
protected AccessRequirement |
accessRequirement |
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) |
protected org.jboss.dmr.ModelNode |
buildRequestWOValidation(CommandContext ctx) |
void |
cliEvent(CliEvent event,
CommandContext ctx) |
protected void |
displayResponseHeaders(CommandContext ctx,
org.jboss.dmr.ModelNode response) |
protected void |
doHandle(CommandContext ctx) |
protected OperationRequestAddress |
getRequiredAddress() |
protected String |
getRequiredType() |
protected void |
handleAttachedFile(CommandContext ctx,
OperationResponse operationResponse) |
protected void |
handleResponse(CommandContext ctx,
org.jboss.dmr.ModelNode response,
boolean composite) |
protected void |
handleResponse(CommandContext ctx,
OperationResponse response,
boolean composite) |
protected boolean |
isAddressValid(CommandContext ctx) |
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) |
protected AccessRequirement |
setupAccessRequirement(CommandContext ctx) |
handle, isBatchMode, printHelp, printList
getArgument, getArguments, hasArgument, hasArgument, recognizeArguments
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getArgument, getArguments, handle, hasArgument, hasArgument, isBatchMode
protected List<RequestParameterArgument> params
protected OperationRequestAddress requiredAddress
protected final ArgumentWithValue headers
protected AccessRequirement accessRequirement
public BaseOperationCommand(CommandContext ctx, String command, boolean connectionRequired)
protected AccessRequirement setupAccessRequirement(CommandContext ctx)
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 contextprotected boolean isAddressValid(CommandContext ctx)
public 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 org.jboss.dmr.ModelNode buildRequestWOValidation(CommandContext ctx) throws CommandFormatException
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, OperationResponse response, boolean composite) throws CommandLineException
CommandLineException
protected void handleAttachedFile(CommandContext ctx, OperationResponse operationResponse) throws CommandLineException
CommandLineException
protected void handleResponse(CommandContext ctx, org.jboss.dmr.ModelNode response, boolean composite) throws CommandLineException
CommandLineException
protected void displayResponseHeaders(CommandContext ctx, org.jboss.dmr.ModelNode response)
public void addArgument(CommandArgument arg)
addArgument
in class CommandHandlerWithArguments
protected void setParams(CommandContext ctx, org.jboss.dmr.ModelNode request) throws CommandFormatException
CommandFormatException
Copyright © 2023 JBoss by Red Hat. All rights reserved.