Package org.apache.accumulo.shell
Class Shell.Command
- java.lang.Object
-
- org.apache.accumulo.shell.Shell.Command
-
- Direct Known Subclasses:
AboutCommand,AddAuthsCommand,AddSplitsCommand,AuthenticateCommand,ClasspathCommand,ClearCommand,CloneTableCommand,ConfigCommand,ConstraintCommand,CreateNamespaceCommand,CreateTableCommand,CreateUserCommand,DebugCommand,DeleteAuthsCommand,DeleteCommand,DeleteIterCommand,DeleteNamespaceCommand,DeleteRowsCommand,DeleteScanIterCommand,DeleteShellIterCommand,DropUserCommand,DUCommand,ExecfileCommand,ExitCommand,ExportTableCommand,ExtensionCommand,FateCommand,GetAuthsCommand,GetGroupsCommand,GetSplitsCommand,HelpCommand,HiddenCommand,HistoryCommand,ImportDirectoryCommand,ImportTableCommand,InsertCommand,ListBulkCommand,ListCompactionsCommand,ListIterCommand,ListScansCommand,ListShellIterCommand,ListTabletsCommand,MergeCommand,NamespacePermissionsCommand,NamespacesCommand,NoTableCommand,PasswdCommand,PingCommand,RenameNamespaceCommand,RenameTableCommand,ScanCommand,ScriptCommand,SetAuthsCommand,SetGroupsCommand,SetIterCommand,ShellPluginConfigurationCommand,SleepCommand,SystemPermissionsCommand,TableCommand,TableOperation,TablePermissionsCommand,TablesCommand,TraceCommand,UserCommand,UserPermissionsCommand,UsersCommand,WhoAmICommand
- Enclosing class:
- Shell
public abstract static class Shell.Command extends Object
The Command class represents a command to be run in the shell. It contains the methods to execute along with some methods to help tab completion, and return the command name, help, and usage.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classShell.Command.CompletionSet
-
Constructor Summary
Constructors Constructor Description Command()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Stringdescription()abstract intexecute(String fullCommand, org.apache.commons.cli.CommandLine cl, Shell shellState)StringgetName()org.apache.commons.cli.OptionsgetOptions()org.apache.commons.cli.OptionsgetOptionsWithHelp()abstract intnumArgs()If the number of arguments is not always zero (not including those arguments handled through Options), make sure to override theusage()method.voidprintHelp(Shell shellState)voidprintHelp(Shell shellState, int width)voidregisterCompletion(Token root, Map<Shell.Command.CompletionSet,Set<String>> completion_set)voidregisterCompletionForCommands(Token root, Map<Shell.Command.CompletionSet,Set<String>> completionSet)voidregisterCompletionForNamespaces(Token root, Map<Shell.Command.CompletionSet,Set<String>> completionSet)voidregisterCompletionForTables(Token root, Map<Shell.Command.CompletionSet,Set<String>> completionSet)voidregisterCompletionForUsers(Token root, Map<Shell.Command.CompletionSet,Set<String>> completionSet)voidregisterCompletionGeneral(Token root, Set<String> args, boolean caseSens)Stringusage()
-
-
-
Method Detail
-
registerCompletionGeneral
public void registerCompletionGeneral(Token root, Set<String> args, boolean caseSens)
-
registerCompletionForTables
public void registerCompletionForTables(Token root, Map<Shell.Command.CompletionSet,Set<String>> completionSet)
-
registerCompletionForUsers
public void registerCompletionForUsers(Token root, Map<Shell.Command.CompletionSet,Set<String>> completionSet)
-
registerCompletionForCommands
public void registerCompletionForCommands(Token root, Map<Shell.Command.CompletionSet,Set<String>> completionSet)
-
registerCompletionForNamespaces
public void registerCompletionForNamespaces(Token root, Map<Shell.Command.CompletionSet,Set<String>> completionSet)
-
execute
public abstract int execute(String fullCommand, org.apache.commons.cli.CommandLine cl, Shell shellState) throws Exception
- Throws:
Exception
-
description
public abstract String description()
-
numArgs
public abstract int numArgs()
-
getName
public String getName()
-
registerCompletion
public void registerCompletion(Token root, Map<Shell.Command.CompletionSet,Set<String>> completion_set)
-
printHelp
public final void printHelp(Shell shellState)
-
printHelp
public final void printHelp(Shell shellState, int width)
-
getOptionsWithHelp
public final org.apache.commons.cli.Options getOptionsWithHelp()
-
usage
public String usage()
-
getOptions
public org.apache.commons.cli.Options getOptions()
-
-