public class GenericTypeOperationHandler extends BatchModeCommandHandler
Modifier and Type | Field and Description |
---|---|
protected String |
commandName |
protected Set<String> |
excludedOps |
protected ArgumentWithoutValue |
helpCommands |
protected ArgumentWithoutValue |
helpProperties |
protected String |
idProperty |
protected ArgumentWithValue |
name |
protected String |
nodeType |
protected ArgumentWithValue |
operation |
protected ArgumentWithValue |
profile |
accessRequirement, headers, params, requiredAddress
helpArg
Constructor and Description |
---|
GenericTypeOperationHandler(CommandContext ctx,
String nodeType,
String idProperty) |
GenericTypeOperationHandler(CommandContext ctx,
String nodeType,
String idProperty,
String... excludeOperations) |
Modifier and Type | Method and Description |
---|---|
void |
addArgument(CommandArgument arg) |
void |
addHandler(String name,
OperationCommandWithDescription handler) |
void |
addValueCompleter(String propertyName,
CommandLineCompleter completer) |
void |
addValueConverter(String propertyName,
ArgumentValueConverter converter) |
protected org.jboss.dmr.ModelType |
asType(org.jboss.dmr.ModelNode type) |
org.jboss.dmr.ModelNode |
buildRequestWithoutHeaders(CommandContext ctx) |
void |
cliEvent(CliEvent event,
CommandContext ctx) |
protected void |
formatProperty(CommandContext ctx,
String argName,
CharSequence descr) |
protected StringBuilder |
formatResponse(CommandContext ctx,
org.jboss.dmr.ModelNode opResponse,
boolean composite,
StringBuilder buf) |
protected void |
formatText(CommandContext ctx,
CharSequence text,
int offset) |
CommandArgument |
getArgument(CommandContext ctx,
String name)
Returns command argument declared by the command handler
corresponding to the argument name.
|
Collection<CommandArgument> |
getArguments(CommandContext ctx)
Returns a collection of the command arguments the handler supports in the current context.
|
protected Iterator<org.jboss.as.cli.handlers.GenericTypeOperationHandler.AttributeDescription> |
getAttributeIterator(List<org.jboss.dmr.Property> props,
org.jboss.dmr.ModelNode accessControl) |
protected Iterator<org.jboss.as.cli.handlers.GenericTypeOperationHandler.AttributeDescription> |
getNodeProperties(CommandContext ctx) |
protected org.jboss.dmr.ModelNode |
getOperationDescription(CommandContext ctx,
String operationName) |
protected List<String> |
getSupportedCommands(CommandContext ctx) |
protected void |
handleResponse(CommandContext ctx,
org.jboss.dmr.ModelNode opResponse,
boolean composite) |
boolean |
hasArgument(CommandContext ctx,
int index)
Checks whether the command handler accepts an argument with the specified index.
|
boolean |
hasArgument(CommandContext ctx,
String name)
Checks whether the command handler recognizes the argument by the name.
|
protected org.jboss.dmr.ModelNode |
initRequest(CommandContext ctx) |
protected void |
printHelp(CommandContext ctx) |
protected void |
printNodeDescription(CommandContext ctx) |
protected void |
printProperties(CommandContext ctx,
Iterator<org.jboss.as.cli.handlers.GenericTypeOperationHandler.AttributeDescription> props) |
protected void |
printSupportedCommands(CommandContext ctx) |
protected void |
recognizeArguments(CommandContext ctx) |
isBatchMode
addHeaders, addRequiredPath, addRequiredPath, buildRequest, buildRequestWOValidation, displayResponseHeaders, doHandle, getRequiredAddress, getRequiredType, handleAttachedFile, handleResponse, isAddressValid, isAvailable, isDependsOnProfile, setParams, setupAccessRequirement
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, String... excludeOperations)
public void addValueConverter(String propertyName, ArgumentValueConverter converter)
public void addValueCompleter(String propertyName, CommandLineCompleter completer)
public void addHandler(String name, OperationCommandWithDescription handler)
public CommandArgument getArgument(CommandContext ctx, String name)
CommandHandler
getArgument
in interface CommandHandler
getArgument
in class CommandHandlerWithArguments
ctx
- the current contextname
- the name of the argumentpublic Collection<CommandArgument> getArguments(CommandContext ctx)
CommandHandler
getArguments
in interface CommandHandler
getArguments
in class CommandHandlerWithArguments
ctx
- current command line contextprotected org.jboss.dmr.ModelType asType(org.jboss.dmr.ModelNode type)
public boolean hasArgument(CommandContext ctx, String name)
CommandHandler
hasArgument
in interface CommandHandler
hasArgument
in class CommandHandlerWithArguments
ctx
- the current contextname
- argument name to checkpublic boolean hasArgument(CommandContext ctx, int index)
CommandHandler
hasArgument
in interface CommandHandler
hasArgument
in class CommandHandlerWithArguments
ctx
- the current contextindex
- argument index to checkpublic void addArgument(CommandArgument arg)
addArgument
in class BaseOperationCommand
protected void recognizeArguments(CommandContext ctx) throws CommandFormatException
recognizeArguments
in class CommandHandlerWithArguments
CommandFormatException
public org.jboss.dmr.ModelNode buildRequestWithoutHeaders(CommandContext ctx) throws CommandFormatException
buildRequestWithoutHeaders
in class BaseOperationCommand
CommandFormatException
public void cliEvent(CliEvent event, CommandContext ctx)
cliEvent
in interface CliEventListener
cliEvent
in class BaseOperationCommand
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 void printHelp(CommandContext ctx) throws CommandLineException
printHelp
in class CommandHandlerWithHelp
CommandLineException
protected void printProperties(CommandContext ctx, Iterator<org.jboss.as.cli.handlers.GenericTypeOperationHandler.AttributeDescription> props)
protected void printNodeDescription(CommandContext ctx) throws CommandFormatException
CommandFormatException
protected void formatText(CommandContext ctx, CharSequence text, int offset)
protected void formatProperty(CommandContext ctx, String argName, CharSequence descr)
protected void printSupportedCommands(CommandContext ctx) throws CommandLineException
CommandLineException
protected List<String> getSupportedCommands(CommandContext ctx) throws CommandLineException
CommandLineException
protected Iterator<org.jboss.as.cli.handlers.GenericTypeOperationHandler.AttributeDescription> getNodeProperties(CommandContext ctx) throws CommandLineException
CommandLineException
protected Iterator<org.jboss.as.cli.handlers.GenericTypeOperationHandler.AttributeDescription> getAttributeIterator(List<org.jboss.dmr.Property> props, org.jboss.dmr.ModelNode accessControl)
protected org.jboss.dmr.ModelNode getOperationDescription(CommandContext ctx, String operationName) throws CommandLineException
CommandLineException
protected org.jboss.dmr.ModelNode initRequest(CommandContext ctx) throws CommandFormatException
CommandFormatException
Copyright © 2023 JBoss by Red Hat. All rights reserved.