Class EdCli


  • public class EdCli
    extends Object
    Provides a command line interface to ED operations.
    Author:
    Middleware Services
    • Constructor Detail

      • EdCli

        public EdCli()
        Creates a new instance able to handle command line operations.
    • Method Detail

      • getOptions

        public org.apache.commons.cli.Options getOptions()
        Gets the Commons CLI options available for this command line client.
        Returns:
        Available options.
      • query

        public void query​(org.apache.commons.cli.CommandLine cmd)
                   throws Exception
        Executes a query specified on the command line and displays the requested attributes on standard out.
        Parameters:
        cmd - Command line.
        Throws:
        Exception - On any failure
      • authenticate

        public org.ldaptive.LdapEntry authenticate​(org.apache.commons.cli.CommandLine cmd,
                                                   String... attributes)
                                            throws Exception
        Authenticates the user specified on the command line. If no credential was supplied on the command line, it is prompted to be read from standard input.
        Parameters:
        cmd - Command line.
        attributes - Attributes to return
        Returns:
        Found LdapEntry
        Throws:
        Exception - On any failure
      • authorize

        public final void authorize​(org.apache.commons.cli.CommandLine cmd,
                                    org.ldaptive.LdapEntry entry)
                             throws Exception
        Authenticates and authorizes the user using command line options. If no credential was supplied on the command line, it is prompted to be read from standard input.
        Parameters:
        cmd - Command line.
        entry - LdapEntry of authenticated use information, may be null
        Throws:
        Exception - On any failure
      • displayGroupMembership

        public void displayGroupMembership​(org.apache.commons.cli.CommandLine cmd,
                                           org.ldaptive.LdapEntry entry)
                                    throws Exception
        Authenticates the user specified on the command line and displays their group membership. If no credential was supplied on the command line, it is prompted to be read from standard input.
        Parameters:
        cmd - Command line.
        entry - LdapEntry of authenticated use information, may be null
        Throws:
        Exception - On any failure
      • displayAffiliations

        public void displayAffiliations​(org.apache.commons.cli.CommandLine cmd,
                                        org.ldaptive.LdapEntry entry)
                                 throws Exception
        Authenticates the user specified on the command line and displays their affiliations. If no credential was supplied on the command line, it is prompted to be read from standard input.
        Parameters:
        cmd - Command line.
        entry - LdapEntry of authenticated use information, may be null
        Throws:
        Exception - On any failure
      • main

        public static void main​(String[] args)
                         throws Exception
        Application entry point for command line operations.
        Parameters:
        args - command line arguments
        Throws:
        Exception - if an error occurs