Class Launcher


  • @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class Launcher
    extends java.lang.Object
    This class provides an entry point that may be used to launch other tools provided as part of the LDAP SDK. This is primarily a convenience for someone who just has the jar file and none of the scripts, since you can run "java -jar unboundid-ldapsdk.jar {tool-name} {tool-args}" in order to invoke any of the example tools. Running just "java -jar unboundid-ldapsdk.jar" will display version information about the LDAP SDK.
    NOTE: This class, and other classes within the com.unboundid.ldap.sdk.unboundidds package structure, are only supported for use against Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 server products. These classes provide support for proprietary functionality or for external specifications that are not considered stable or mature enough to be guaranteed to work in an interoperable way with other types of LDAP servers.

    The tool names are case-insensitive. Supported tool names include:
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.Class<? extends CommandLineTool>> getToolClasses()
      Retrieves a list of all of the classes that provide the implementations for all of the command-line tools included with the LDAP SDK.
      static CommandLineTool getToolInstance​(java.lang.Class<?> toolClass, java.io.OutputStream outStream, java.io.OutputStream errStream)
      Retrieves an instance of the specified type of command-line tool with the given output and error streams.
      static ResultCode main​(java.io.OutputStream outStream, java.io.OutputStream errStream, java.lang.String... args)
      Parses the command-line arguments and performs any appropriate processing for this program.
      static void main​(java.lang.String... args)
      Parses the command-line arguments and performs any appropriate processing for this program.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • main

        public static void main​(java.lang.String... args)
        Parses the command-line arguments and performs any appropriate processing for this program.
        Parameters:
        args - The command-line arguments provided to this program.
      • main

        public static ResultCode main​(java.io.OutputStream outStream,
                                      java.io.OutputStream errStream,
                                      java.lang.String... args)
        Parses the command-line arguments and performs any appropriate processing for this program.
        Parameters:
        outStream - The output stream to which standard out should be written. It may be null if output should be suppressed.
        errStream - The output stream to which standard error should be written. It may be null if error messages should be suppressed.
        args - The command-line arguments provided to this program.
        Returns:
        A result code with information about the status of processing.
      • getToolClasses

        public static java.util.List<java.lang.Class<? extends CommandLineTool>> getToolClasses()
        Retrieves a list of all of the classes that provide the implementations for all of the command-line tools included with the LDAP SDK.
        Returns:
        A list of all of the classes that provide the implementations for all of the command-line tools included with the LDAP SDK.
      • getToolInstance

        public static CommandLineTool getToolInstance​(java.lang.Class<?> toolClass,
                                                      java.io.OutputStream outStream,
                                                      java.io.OutputStream errStream)
                                               throws LDAPException
        Retrieves an instance of the specified type of command-line tool with the given output and error streams. The tool class must provide a two-argument constructor in which the first argument is a possibly-null OutputStream to use for standard output, and the second argument is a possibly-null OutputStream to use for standard error.
        Parameters:
        toolClass - The class that provides the implementation for the desired command-line tool.
        outStream - The output stream to which standard out should be written. It may be null if output should be suppressed.
        errStream - The output stream to which standard error should be written. It may be null if error messages should be suppressed.
        Returns:
        An instance of the specified command-line tool.
        Throws:
        LDAPException - If a problem occurs while attempting to create an instance of the requested tool.