mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Gaetan Boismal
04.18.2014 84e187d76943fe5bb6f9537968e351d36add94d8
opendj-cli/src/main/java/com/forgerock/opendj/cli/ConnectionFactoryProvider.java
@@ -155,9 +155,6 @@
    /** The console application linked to this connection in interactive mode. */
    private final ConsoleApplication app;
    /** The LDAP options for this connection. */
    private LDAPOptions options;
    /** If this connection should be an admin connection. */
    private boolean isAdminConnection = false;
@@ -174,25 +171,7 @@
     */
    public ConnectionFactoryProvider(final ArgumentParser argumentParser,
            final ConsoleApplication app) throws ArgumentException {
        this(argumentParser, app, CliConstants.DEFAULT_ROOT_USER_DN, DEFAULT_LDAP_PORT, false, null);
    }
    /**
     * Default constructor to create a connection factory designed for use with command line tools,
     * adding basic LDAP connection arguments to the specified parser (e.g: hostname, bindname...etc).
     *
     * @param argumentParser
     *            The argument parser.
     * @param app
     *            The console application linked to this connection factory.
     * @param options
     *            The common options for this LDAP client connection.
     * @throws ArgumentException
     *             If an error occurs during parsing the arguments.
     */
    public ConnectionFactoryProvider(final ArgumentParser argumentParser, final ConsoleApplication app,
            final LDAPOptions options) throws ArgumentException {
        this(argumentParser, app, CliConstants.DEFAULT_ROOT_USER_DN, DEFAULT_LDAP_PORT, false, options);
        this(argumentParser, app, "", DEFAULT_LDAP_PORT, false);
    }
    /**
@@ -209,16 +188,13 @@
     *            The LDAP port default's value.
     * @param alwaysSSL
     *            {@code true} if this connection should be used with SSL.
     * @param options
     *            The LDAP options of this connection factory.
     * @throws ArgumentException
     *             If an error occurs during parsing the elements.
     */
    public ConnectionFactoryProvider(final ArgumentParser argumentParser,
            final ConsoleApplication app, final String defaultBindDN, final int defaultPort,
            final boolean alwaysSSL, final LDAPOptions options) throws ArgumentException {
            final boolean alwaysSSL) throws ArgumentException {
        this.app = app;
        this.options = options == null ? new LDAPOptions() : options;
        useSSLArg = CommonArguments.getUseSSL();
        if (!alwaysSSL) {
@@ -450,6 +426,8 @@
                        e);
            }
            LDAPOptions options = new LDAPOptions();
            if (sslContext != null) {
                options.setSSLContext(sslContext).setUseStartTLS(useStartTLSArg.isPresent());
            }