org.apache.accumulo.core.util.shell
Class Shell.Command
java.lang.Object
org.apache.accumulo.core.util.shell.Shell.Command
- Direct Known Subclasses:
- AboutCommand, AddAuthsCommand, AddSplitsCommand, AuthenticateCommand, ClasspathCommand, ClearCommand, CloneTableCommand, ConfigCommand, ConstraintCommand, CreateNamespaceCommand, CreateTableCommand, CreateUserCommand, DebugCommand, DeleteCommand, DeleteIterCommand, DeleteNamespaceCommand, DeleteRowsCommand, DeleteScanIterCommand, DeleteShellIterCommand, DropUserCommand, DUCommand, ExecfileCommand, ExitCommand, ExportTableCommand, ExtensionCommand, FateCommand, GetAuthsCommand, GetGroupsCommand, GetSplitsCommand, HelpCommand, HiddenCommand, HistoryCommand, ImportDirectoryCommand, ImportTableCommand, InsertCommand, ListCompactionsCommand, ListIterCommand, ListScansCommand, ListShellIterCommand, MergeCommand, NamespacePermissionsCommand, NamespacesCommand, NoTableCommand, PasswdCommand, PingCommand, RenameNamespaceCommand, RenameTableCommand, ScanCommand, ScriptCommand, SetAuthsCommand, SetGroupsCommand, SetIterCommand, ShellPluginConfigurationCommand, SleepCommand, SystemPermissionsCommand, TableCommand, TableOperation, TablePermissionsCommand, TablesCommand, 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.
Method Summary |
abstract String |
description()
|
abstract int |
execute(String fullCommand,
org.apache.commons.cli.CommandLine cl,
Shell shellState)
|
String |
getName()
|
org.apache.commons.cli.Options |
getOptions()
|
org.apache.commons.cli.Options |
getOptionsWithHelp()
|
abstract int |
numArgs()
If the number of arguments is not always zero (not including those arguments handled through Options), make sure to override the usage() method. |
void |
printHelp(Shell shellState)
|
void |
printHelp(Shell shellState,
int width)
|
void |
registerCompletion(Token root,
Map<Shell.Command.CompletionSet,Set<String>> completion_set)
|
void |
registerCompletionForCommands(Token root,
Map<Shell.Command.CompletionSet,Set<String>> completionSet)
|
void |
registerCompletionForNamespaces(Token root,
Map<Shell.Command.CompletionSet,Set<String>> completionSet)
|
void |
registerCompletionForTables(Token root,
Map<Shell.Command.CompletionSet,Set<String>> completionSet)
|
void |
registerCompletionForUsers(Token root,
Map<Shell.Command.CompletionSet,Set<String>> completionSet)
|
void |
registerCompletionGeneral(Token root,
Set<String> args,
boolean caseSens)
|
String |
usage()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Shell.Command
public Shell.Command()
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()
- If the number of arguments is not always zero (not including those arguments handled through Options), make sure to override the
usage()
method.
Otherwise, usage()
does need to be overridden.
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()
Copyright © 2015 Apache Accumulo Project. All rights reserved.