edu.vt.middleware.ldap
Class LdapCli

java.lang.Object
  extended by edu.vt.middleware.ldap.AbstractCli
      extended by edu.vt.middleware.ldap.LdapCli

public class LdapCli
extends AbstractCli

Command line interface for ldap operations.

Version:
$Revision: 1330 $
Author:
Middleware Services

Field Summary
protected static String OPT_QUERY
          Option for ldap query.
 
Fields inherited from class edu.vt.middleware.ldap.AbstractCli
logger, OPT_DSMLV1, OPT_DSMLV2, OPT_HELP, OPT_TRACE, OPT_USE_PROPERTIES, options, opts, outputDsmlv1, outputDsmlv2
 
Constructor Summary
LdapCli()
          Default constructor.
 
Method Summary
protected  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  String getCommandName()
          Gets the name of the command for which this class provides a CLI interface.
protected  LdapConfig initLdapConfig(org.apache.commons.cli.CommandLine line)
          Initialize an LdapConfig with command line options.
protected  void initOptions()
          Initialize CLI options.
static void main(String[] args)
          CLI entry point method.
protected  void search(LdapConfig config, String filter, String[] attrs)
          Executes the ldap search operation.
 
Methods inherited from class edu.vt.middleware.ldap.AbstractCli
getArgs, initLdapProperties, initOptions, performAction, printExamples, printHelp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPT_QUERY

protected static final String OPT_QUERY
Option for ldap query.

See Also:
Constant Field Values
Constructor Detail

LdapCli

public LdapCli()
Default constructor.

Method Detail

main

public static void main(String[] args)
CLI entry point method.

Parameters:
args - Command line arguments.

initOptions

protected void initOptions()
Initialize CLI options.

Specified by:
initOptions in class AbstractCli

initLdapConfig

protected LdapConfig initLdapConfig(org.apache.commons.cli.CommandLine line)
                             throws Exception
Initialize an LdapConfig with command line options.

Parameters:
line - Parsed command line arguments container.
Returns:
LdapConfig that has been initialized
Throws:
Exception - On errors thrown by handler.

dispatch

protected void dispatch(org.apache.commons.cli.CommandLine line)
                 throws Exception
Dispatch command line data to the handler that can perform the operation requested on the command line.

Specified by:
dispatch in class AbstractCli
Parameters:
line - Parsed command line arguments container.
Throws:
Exception - On errors thrown by handler.

search

protected void search(LdapConfig config,
                      String filter,
                      String[] attrs)
               throws Exception
Executes the ldap search operation.

Parameters:
config - Ldap configuration.
filter - Ldap filter to search on.
attrs - Ldap attributes to return.
Throws:
Exception - On errors.

getCommandName

protected String getCommandName()
Gets the name of the command for which this class provides a CLI interface.

Specified by:
getCommandName in class AbstractCli
Returns:
Name of CLI command.


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.