Package org.jboss.as.cli.handlers
Class ResourceCompositeOperationHandler
- java.lang.Object
-
- org.jboss.as.cli.handlers.CommandHandlerWithArguments
-
- org.jboss.as.cli.handlers.CommandHandlerWithHelp
-
- org.jboss.as.cli.handlers.BaseOperationCommand
-
- org.jboss.as.cli.handlers.ResourceCompositeOperationHandler
-
- All Implemented Interfaces:
CliEventListener,CommandHandler,OperationCommand
- Direct Known Subclasses:
DataSourceAddCompositeHandler,XADataSourceAddCompositeHandler
public class ResourceCompositeOperationHandler extends BaseOperationCommand
A command that is composed of several operations performed against the same resource.- Author:
- Alexey Loubyansky
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.as.cli.OperationCommand
OperationCommand.HandledRequest
-
-
Field Summary
Fields Modifier and Type Field Description protected StringidPropertyprotected ArgumentWithValuenameprotected ArgumentWithValueprofile-
Fields inherited from class org.jboss.as.cli.handlers.BaseOperationCommand
accessRequirement, headers, params, requiredAddress
-
Fields inherited from class org.jboss.as.cli.handlers.CommandHandlerWithHelp
helpArg
-
-
Constructor Summary
Constructors Constructor Description ResourceCompositeOperationHandler(CommandContext ctx, String command, String nodeType, String idProperty, String... operations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValueCompleter(String propertyName, CommandLineCompleter completer)voidaddValueConverter(String propertyName, ArgumentValueConverter converter)protected org.jboss.dmr.ModelTypeasType(org.jboss.dmr.ModelNode type)protected org.jboss.dmr.ModelNodebuildOperationAddress(CommandContext ctx)protected org.jboss.dmr.ModelNodebuildRequestWithoutHeaders(CommandContext ctx)protected Map<String,CommandArgument>getAllArguments(CommandContext ctx)CommandArgumentgetArgument(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 Map<String,ArgumentWithValue>getOperationArguments(CommandContext ctx, String opName)protected org.jboss.dmr.ModelNodegetOperationDescription(CommandContext ctx, String operationName)protected org.jboss.dmr.ModelTypegetType(org.jboss.dmr.ModelNode descr)protected org.jboss.dmr.ModelNodeinitRequest(CommandContext ctx)protected Map<String,CommandArgument>loadArguments(CommandContext ctx)protected voidrecognizeArguments(CommandContext ctx)-
Methods inherited from class org.jboss.as.cli.handlers.BaseOperationCommand
addArgument, addHeaders, addRequiredPath, addRequiredPath, buildRequest, buildRequestWOValidation, cliEvent, displayResponseHeaders, doHandle, getAttachments, getRequiredAddress, getRequiredType, handleAttachedFile, handleResponse, handleResponse, isAddressValid, isAvailable, isDependsOnProfile, setParams, setupAccessRequirement
-
Methods inherited from class org.jboss.as.cli.handlers.CommandHandlerWithHelp
displayHelp, handle, isBatchMode, printHelp, printList
-
Methods inherited from class org.jboss.as.cli.handlers.CommandHandlerWithArguments
getArgumentsMap, hasArgument, hasArgument
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.as.cli.CommandHandler
handle, hasArgument, hasArgument, isBatchMode
-
Methods inherited from interface org.jboss.as.cli.OperationCommand
buildHandledRequest, buildRequest
-
-
-
-
Field Detail
-
idProperty
protected final String idProperty
-
name
protected final ArgumentWithValue name
-
profile
protected final ArgumentWithValue profile
-
-
Constructor Detail
-
ResourceCompositeOperationHandler
public ResourceCompositeOperationHandler(CommandContext ctx, String command, String nodeType, String idProperty, String... operations)
-
-
Method Detail
-
addValueConverter
public void addValueConverter(String propertyName, ArgumentValueConverter converter)
-
addValueCompleter
public void addValueCompleter(String propertyName, CommandLineCompleter completer)
-
buildRequestWithoutHeaders
protected org.jboss.dmr.ModelNode buildRequestWithoutHeaders(CommandContext ctx) throws CommandFormatException
- Specified by:
buildRequestWithoutHeadersin classBaseOperationCommand- Throws:
CommandFormatException
-
buildOperationAddress
protected org.jboss.dmr.ModelNode buildOperationAddress(CommandContext ctx) throws CommandFormatException
- Throws:
CommandFormatException
-
getArgument
public CommandArgument getArgument(CommandContext ctx, String name)
Description copied from interface:CommandHandlerReturns command argument declared by the command handler corresponding to the argument name. Or null if the argument wasn't found among the accepted arguments.- Specified by:
getArgumentin interfaceCommandHandler- Overrides:
getArgumentin classCommandHandlerWithArguments- Parameters:
ctx- the current contextname- the name of the argument- Returns:
- command argument corresponding to the argument name or null if the argument name wasn't recognized.
-
getArguments
public Collection<CommandArgument> getArguments(CommandContext ctx)
Description copied from interface:CommandHandlerReturns a collection of the command arguments the handler supports in the current context.- Specified by:
getArgumentsin interfaceCommandHandler- Overrides:
getArgumentsin classCommandHandlerWithArguments- Parameters:
ctx- current command line context- Returns:
- list of the command arguments supported in the current context
-
recognizeArguments
protected void recognizeArguments(CommandContext ctx) throws CommandFormatException
- Overrides:
recognizeArgumentsin classCommandHandlerWithArguments- Throws:
CommandFormatException
-
getAllArguments
protected Map<String,CommandArgument> getAllArguments(CommandContext ctx)
-
loadArguments
protected Map<String,CommandArgument> loadArguments(CommandContext ctx)
-
getOperationArguments
protected Map<String,ArgumentWithValue> getOperationArguments(CommandContext ctx, String opName) throws CommandLineException
- Throws:
CommandLineException
-
getOperationDescription
protected org.jboss.dmr.ModelNode getOperationDescription(CommandContext ctx, String operationName) throws CommandLineException
- Throws:
CommandLineException
-
initRequest
protected org.jboss.dmr.ModelNode initRequest(CommandContext ctx) throws CommandLineException
- Throws:
CommandLineException
-
getType
protected org.jboss.dmr.ModelType getType(org.jboss.dmr.ModelNode descr)
-
asType
protected org.jboss.dmr.ModelType asType(org.jboss.dmr.ModelNode type)
-
-