|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.cli.AbstractCli
public abstract class AbstractCli
Abstract base class for all CLI classes.
| Field Summary | |
|---|---|
protected static String |
OPT_HELP
option to print usage. |
protected static String |
OPT_PROVIDER_PROPERTIES
option for provider properties. |
protected org.apache.commons.cli.Options |
options
command line options. |
protected boolean |
outputDsmlv1
whether to output dsml version 1, the default is ldif. |
| Constructor Summary | |
|---|---|
AbstractCli()
|
|
| Method Summary | |
|---|---|
protected abstract int |
dispatch(org.apache.commons.cli.CommandLine line)
Dispatch command line data to the active that can perform the operation requested on the command line. |
protected Map<String,String> |
getArgDesc(Class<?>... classes)
Returns the command line argument descriptions for this CLI. |
protected abstract String |
getCommandName()
Returns the name of the command for which this class provides a CLI interface. |
protected Properties |
getPropertiesFromOptions(String domain,
org.apache.commons.cli.CommandLine line)
Reads the options from the supplied command line and returns a properties containing those options. |
protected ConnectionFactory |
initConnectionFactory(org.apache.commons.cli.CommandLine line)
Initialize a connection factory with command line options. |
protected void |
initOptions()
Initialize CLI options. |
int |
performAction(String[] args)
Parses command line options and dispatches to the requested action, or the default action if no action is specified. |
protected void |
printExamples()
Prints CLI usage examples. |
protected void |
printHelp()
Prints CLI help text. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String OPT_HELP
protected static final String OPT_PROVIDER_PROPERTIES
protected final org.apache.commons.cli.Options options
protected boolean outputDsmlv1
| Constructor Detail |
|---|
public AbstractCli()
| Method Detail |
|---|
public final int performAction(String[] args)
args - command line arguments
protected void initOptions()
protected ConnectionFactory initConnectionFactory(org.apache.commons.cli.CommandLine line)
line - parsed command line arguments
protected abstract String getCommandName()
protected abstract int dispatch(org.apache.commons.cli.CommandLine line)
throws Exception
line - parsed command line arguments
Exception - on errors thrown by actionprotected void printHelp()
protected void printExamples()
protected Map<String,String> getArgDesc(Class<?>... classes)
classes - that contain arguments used by this CLI
protected Properties getPropertiesFromOptions(String domain,
org.apache.commons.cli.CommandLine line)
domain - to place property names inline - command line
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||