Class LdapCli


  • public class LdapCli
    extends AbstractCli
    Command line interface for ldap operations.
    Version:
    $Revision: 1330 $
    Author:
    Middleware Services
    • Field Detail

      • OPT_QUERY

        protected static final java.lang.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​(java.lang.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 java.lang.Exception
        Initialize an LdapConfig with command line options.
        Parameters:
        line - Parsed command line arguments container.
        Returns:
        LdapConfig that has been initialized
        Throws:
        java.lang.Exception - On errors thrown by handler.
      • dispatch

        protected void dispatch​(org.apache.commons.cli.CommandLine line)
                         throws java.lang.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:
        java.lang.Exception - On errors thrown by handler.
      • search

        protected void search​(LdapConfig config,
                              java.lang.String filter,
                              java.lang.String[] attrs)
                       throws java.lang.Exception
        Executes the ldap search operation.
        Parameters:
        config - Ldap configuration.
        filter - Ldap filter to search on.
        attrs - Ldap attributes to return.
        Throws:
        java.lang.Exception - On errors.
      • getCommandName

        protected java.lang.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.