T - Generic for getArg method which should return command-specific paramters which it would be run with.public interface Command<T>
| Modifier and Type | Method and Description |
|---|---|
T |
arg() |
default String |
confirmationPrompt() |
Object |
execute(GridClientConfiguration clientCfg,
Logger logger)
Actual command execution.
|
default Object |
execute(GridClientConfiguration clientCfg,
Logger logger,
boolean verbose)
Actual command execution with verbose mode if needed.
|
default boolean |
experimental()
Return
true if the command is experimental or false
otherwise. |
static String |
extendToLen(String s,
int targetLen)
Appends spaces to end of input string for extending to needed length.
|
String |
name() |
default void |
parseArguments(CommandArgIterator argIterator)
Parse command-specific arguments.
|
default void |
prepareConfirmation(GridClientConfiguration clientCfg)
Prepares confirmation for the command.
|
void |
printUsage(Logger logger)
Print info for user about command (parameters, use cases and so on).
|
static GridClient |
startClient(GridClientConfiguration clientCfg)
Method to create thin client for communication with cluster.
|
static GridClientBeforeNodeStart |
startClientBeforeNodeStart(GridClientConfiguration clientCfg)
Method to create thin client for communication with node before it starts.
|
default void |
usage(Logger logger,
String desc,
CommandList cmd,
@Nullable Map<String,String> paramsDesc,
String... args)
Print command usage.
|
default void |
usage(Logger logger,
String desc,
CommandList cmd,
String... args)
Print command usage.
|
default void |
usageParams(Map<String,String> paramsDesc,
String indent,
Logger logger)
Print cache command arguments usage.
|
static GridClient startClient(GridClientConfiguration clientCfg) throws Exception
clientCfg - Thin client configuration.Exception - If error occur.static GridClientBeforeNodeStart startClientBeforeNodeStart(GridClientConfiguration clientCfg) throws Exception
clientCfg - Thin client configuration.Exception - If error occur.default void usage(Logger logger, String desc, CommandList cmd, String... args)
logger - Logger to use.desc - Command description.cmd - Command.args - Arguments.default void usage(Logger logger, String desc, CommandList cmd, @Nullable @Nullable Map<String,String> paramsDesc, String... args)
logger - Logger to use.desc - Command description.cmd - Command.paramsDesc - Description of parameters (optional).args - Arguments.default void usageParams(Map<String,String> paramsDesc, String indent, Logger logger)
paramsDesc - Cache command arguments description.indent - Indent string.logger - Logger to use.static String extendToLen(String s, int targetLen)
s - Input string.targetLen - Needed length.Object execute(GridClientConfiguration clientCfg, Logger logger) throws Exception
clientCfg - Thin client configuration if connection to cluster is necessary.logger - Logger to use.Exception - If error occur.default Object execute(GridClientConfiguration clientCfg, Logger logger, boolean verbose) throws Exception
clientCfg - Thin client configuration if connection to cluster is necessary.logger - Logger to use.verbose - Use verbose mode or notException - If error occur.execute(GridClientConfiguration, Logger)default void prepareConfirmation(GridClientConfiguration clientCfg) throws Exception
clientCfg - Thin client configuration.Exception - If error occur.default String confirmationPrompt()
default void parseArguments(CommandArgIterator argIterator)
argIterator - Argument iterator.T arg()
parseArguments(CommandArgIterator) call.void printUsage(Logger logger)
logger - Logger to use.String name()
default boolean experimental()
true if the command is experimental or false
otherwise.true if the command is experimental or false
otherwise.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.13.0 Release Date : April 20 2022