public class GenericTypeOperationHandler extends BatchModeCommandHandler
Modifier and Type | Field and Description |
---|---|
protected String |
commandName |
protected List<String> |
excludeOps |
protected ArgumentWithoutValue |
helpCommands |
protected ArgumentWithoutValue |
helpProperties |
protected String |
idProperty |
protected ArgumentWithValue |
name |
protected String |
nodeType |
protected ArgumentWithValue |
operation |
protected ArgumentWithValue |
profile |
headers, params, requiredAddress
helpArg
Constructor and Description |
---|
GenericTypeOperationHandler(CommandContext ctx,
String nodeType,
String idProperty) |
GenericTypeOperationHandler(CommandContext ctx,
String nodeType,
String idProperty,
List<String> excludeOperations) |
Modifier and Type | Method and Description |
---|---|
void |
addArgument(CommandArgument arg) |
void |
addValueCompleter(String propertyName,
CommandLineCompleter completer) |
void |
addValueConverter(String propertyName,
ArgumentValueConverter converter) |
protected org.jboss.dmr.ModelNode |
buildOperationRequest(CommandContext ctx,
String operation) |
org.jboss.dmr.ModelNode |
buildRequestWithoutHeaders(CommandContext ctx) |
protected org.jboss.dmr.ModelNode |
buildWritePropertyRequest(CommandContext ctx) |
protected StringBuilder |
formatResponse(CommandContext ctx,
org.jboss.dmr.ModelNode opResponse,
boolean composite,
StringBuilder buf) |
Collection<CommandArgument> |
getArguments(CommandContext ctx)
Returns a collection of the command arguments the handler supports in the current context.
|
protected List<org.jboss.dmr.Property> |
getNodeProperties(CommandContext ctx) |
protected org.jboss.dmr.ModelNode |
getOperationDescription(CommandContext ctx,
String operationName) |
protected void |
handleResponse(CommandContext ctx,
org.jboss.dmr.ModelNode opResponse,
boolean composite) |
boolean |
hasArgument(int index)
Checks whether the command handler accepts an argument with the specified index.
|
boolean |
hasArgument(String name)
Checks whether the command handler recognizes the argument by the name.
|
protected org.jboss.dmr.ModelNode |
initRequest(CommandContext ctx) |
protected void |
printCommands(CommandContext ctx) |
protected void |
printHelp(CommandContext ctx) |
protected void |
printNodeDescription(CommandContext ctx) |
protected void |
printProperties(CommandContext ctx,
List<org.jboss.dmr.Property> props) |
isBatchMode
addHeaders, addRequiredPath, addRequiredPath, buildRequest, cliEvent, doHandle, getRequiredAddress, getRequiredType, isAvailable, isDependsOnProfile, setParams
handle, printList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handle
protected final String commandName
protected final String idProperty
protected final String nodeType
protected final ArgumentWithValue profile
protected final ArgumentWithValue name
protected final ArgumentWithValue operation
protected final ArgumentWithoutValue helpProperties
protected final ArgumentWithoutValue helpCommands
public GenericTypeOperationHandler(CommandContext ctx, String nodeType, String idProperty)
public GenericTypeOperationHandler(CommandContext ctx, String nodeType, String idProperty, List<String> excludeOperations)
public void addValueConverter(String propertyName, ArgumentValueConverter converter)
public void addValueCompleter(String propertyName, CommandLineCompleter completer)
public Collection<CommandArgument> getArguments(CommandContext ctx)
CommandHandler
getArguments
in interface CommandHandler
getArguments
in class CommandHandlerWithArguments
ctx
- current command line contextpublic boolean hasArgument(String name)
CommandHandler
hasArgument
in interface CommandHandler
hasArgument
in class CommandHandlerWithArguments
name
- argument name to checkpublic boolean hasArgument(int index)
CommandHandler
hasArgument
in interface CommandHandler
hasArgument
in class CommandHandlerWithArguments
index
- argument index to checkpublic void addArgument(CommandArgument arg)
addArgument
in class BaseOperationCommand
public org.jboss.dmr.ModelNode buildRequestWithoutHeaders(CommandContext ctx) throws CommandFormatException
buildRequestWithoutHeaders
in class BaseOperationCommand
CommandFormatException
protected void handleResponse(CommandContext ctx, org.jboss.dmr.ModelNode opResponse, boolean composite) throws CommandFormatException
handleResponse
in class BaseOperationCommand
CommandFormatException
protected StringBuilder formatResponse(CommandContext ctx, org.jboss.dmr.ModelNode opResponse, boolean composite, StringBuilder buf) throws CommandFormatException
CommandFormatException
protected org.jboss.dmr.ModelNode buildWritePropertyRequest(CommandContext ctx) throws CommandFormatException
CommandFormatException
protected org.jboss.dmr.ModelNode buildOperationRequest(CommandContext ctx, String operation) throws CommandFormatException
CommandFormatException
protected void printHelp(CommandContext ctx) throws CommandFormatException
printHelp
in class CommandHandlerWithHelp
CommandFormatException
protected void printProperties(CommandContext ctx, List<org.jboss.dmr.Property> props)
protected void printNodeDescription(CommandContext ctx) throws CommandFormatException
CommandFormatException
protected void printCommands(CommandContext ctx) throws CommandFormatException
CommandFormatException
protected List<org.jboss.dmr.Property> getNodeProperties(CommandContext ctx) throws CommandFormatException
CommandFormatException
protected org.jboss.dmr.ModelNode getOperationDescription(CommandContext ctx, String operationName) throws CommandFormatException
CommandFormatException
protected org.jboss.dmr.ModelNode initRequest(CommandContext ctx) throws CommandFormatException
CommandFormatException
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.