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

Violette Roche-Montane
03.21.2014 d48666a047490384cdbebdcbc7d02acfb60b4c62
opendj-cli/src/main/java/com/forgerock/opendj/cli/ConnectionFactoryProvider.java
@@ -47,7 +47,6 @@
import javax.net.ssl.X509TrustManager;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.ldap.ConnectionFactory;
import org.forgerock.opendj.ldap.KeyManagers;
import org.forgerock.opendj.ldap.LDAPConnectionFactory;
@@ -67,7 +66,7 @@
/**
 * A connection factory designed for use with command line tools.
 */
public class ConnectionFactoryProvider extends AbstractAuthenticatedConnectionFactory {
public class ConnectionFactoryProvider {
    /**
     * The Logger.
     */
@@ -312,11 +311,41 @@
    }
    /**
     * Returns the connection factory.
     * Returns the host name.
     *
     * @return The host name value.
     */
    public String getHostname() {
        if (hostNameArg.isPresent()) {
            return hostNameArg.getValue();
        }
        return hostNameArg.getDefaultValue();
    }
    /**
     * Get the port which has to be used for the command.
     *
     * @return The port specified by the command line argument, or the default value, if not specified.
     */
    public int getPort() {
        if (portArg.isPresent()) {
            try {
                return portArg.getIntValue();
            } catch (ArgumentException e) {
                return Integer.valueOf(portArg.getDefaultValue());
            }
        }
        return Integer.valueOf(portArg.getDefaultValue());
    }
    /**
     * Checks if any conflicting arguments are present, build the connection with
     * selected arguments and returns the connection factory.
     *
     * @return The connection factory.
     * @throws ArgumentException
     *             If an error occurs during the parsing of the arguments.
     *             If an error occurs during the parsing of the arguments. (conflicting
     *             arguments or if an error occurs during building SSL context).
     */
    public ConnectionFactory getConnectionFactory() throws ArgumentException {
        if (connFactory == null) {
@@ -437,7 +466,7 @@
            authenticatedConnFactory = getConnectionFactory();
            final BindRequest bindRequest = getBindRequest();
            if (bindRequest != null) {
                authenticatedConnFactory = newAuthenticatedConnectionFactory(authenticatedConnFactory, bindRequest);
                authenticatedConnFactory = new AuthenticatedConnectionFactory(authenticatedConnFactory, bindRequest);
            }
        }
        return authenticatedConnFactory;
@@ -771,11 +800,4 @@
        return option.substring(equalPos + 1, option.length());
    }
    /** {@inheritDoc} */
    @Override
    public ConnectionFactory newAuthenticatedConnectionFactory(final ConnectionFactory connection,
            final BindRequest request) throws ArgumentException {
        return null;
    }
}