|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.ldap.AbstractCli
public abstract class AbstractCli
Abstract base class for all CLI handlers.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
Log. |
protected static String |
OPT_DSMLV1
Option for dsmlv1 output. |
protected static String |
OPT_DSMLV2
Option for dsmlv2 output. |
protected static String |
OPT_HELP
Option to print usage. |
protected static String |
OPT_TRACE
Option for ldap trace. |
protected static String |
OPT_USE_PROPERTIES
Option for loading ldap configuration from properties. |
protected org.apache.commons.cli.Options |
options
Command line options. |
protected List<String> |
opts
List of command options. |
protected boolean |
outputDsmlv1
Whether to output dsml version 1, the default is ldif. |
protected boolean |
outputDsmlv2
Whether to output dsml version 2, the default is ldif. |
| Constructor Summary | |
|---|---|
AbstractCli()
Default constructor. |
|
| Method Summary | |
|---|---|
protected abstract void |
dispatch(org.apache.commons.cli.CommandLine line)
Dispatch command line data to the handler that can perform the operation requested on the command line. |
protected Map<String,String> |
getArgs()
Returns the command line arguments for this cli. |
protected abstract String |
getCommandName()
Gets the name of the command for which this class provides a CLI interface. |
protected void |
initLdapProperties(PropertyConfig config,
org.apache.commons.cli.CommandLine line)
Initialize the supplied config with command line options. |
protected abstract void |
initOptions()
Initialize CLI options. |
protected void |
initOptions(LdapConfigPropertyInvoker invoker)
Initialize CLI options with the supplied invoker. |
void |
performAction(String[] args)
Parses command line options and invokes the proper handler to perform 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_TRACE
protected static final String OPT_USE_PROPERTIES
protected static final String OPT_DSMLV1
protected static final String OPT_DSMLV2
protected List<String> opts
protected final org.apache.commons.logging.Log logger
protected org.apache.commons.cli.Options options
protected boolean outputDsmlv1
protected boolean outputDsmlv2
| Constructor Detail |
|---|
public AbstractCli()
| Method Detail |
|---|
public final void performAction(String[] args)
args - Command line arguments.protected abstract void initOptions()
protected void initOptions(LdapConfigPropertyInvoker invoker)
invoker - PropertyInvokerprotected abstract String getCommandName()
protected abstract void dispatch(org.apache.commons.cli.CommandLine line)
throws Exception
line - Parsed command line arguments container.
Exception - On errors thrown by handler.protected void printHelp()
protected void printExamples()
protected Map<String,String> getArgs()
protected void initLdapProperties(PropertyConfig config,
org.apache.commons.cli.CommandLine line)
throws Exception
config - property config to configureline - Parsed command line arguments container.
Exception - On errors thrown by handler.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||