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

Jean-Noël Rouvignac
12.24.2016 eee460507c52a633964f40b2b9ed797872fdc2e2
use DN in the installer

AuthenticationData now uses DN.
4 files modified
21 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/AuthenticationData.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/DataReplicationOptions.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/Installer.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/Utils.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/AuthenticationData.java
@@ -16,6 +16,7 @@
 */
package org.opends.quicksetup.installer;
import org.forgerock.opendj.ldap.DN;
import org.opends.server.types.HostPort;
/**
@@ -27,7 +28,7 @@
public class AuthenticationData
{
  private HostPort hostPort = new HostPort(null, 0);
  private String dn;
  private DN dn;
  private String pwd;
  private boolean useSecureConnection;
@@ -53,7 +54,7 @@
   * Returns the Authentication DN.
   * @return the Authentication DN.
   */
  public String getDn()
  public DN getDn()
  {
    return dn;
  }
@@ -62,7 +63,7 @@
   * Sets the Authentication DN.
   * @param dn the Authentication DN.
   */
  public void setDn(String dn)
  public void setDn(DN dn)
  {
    this.dn = dn;
  }
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/DataReplicationOptions.java
@@ -16,6 +16,7 @@
 */
package org.opends.quicksetup.installer;
import org.forgerock.opendj.ldap.DN;
import org.opends.quicksetup.Constants;
import org.opends.quicksetup.util.Utils;
@@ -44,7 +45,7 @@
  private boolean secureReplication;
  private AuthenticationData authenticationData = new AuthenticationData();
  {
    authenticationData.setDn(Constants.DIRECTORY_MANAGER_DN);
    authenticationData.setDn(DN.valueOf(Constants.DIRECTORY_MANAGER_DN));
    authenticationData.setPort(4444);
  }
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/Installer.java
@@ -2766,7 +2766,7 @@
  private ConnectionWrapper createConnection(AuthenticationData auth) throws NamingException
  {
    String ldapUrl = auth.getLdapUrl();
    DN dn = DN.valueOf(auth.getDn());
    DN dn = auth.getDn();
    String pwd = auth.getPwd();
    if (auth.useSecureConnection())
@@ -3265,7 +3265,7 @@
    {
      AuthenticationData auth = new AuthenticationData();
      auth.setHostPort(new HostPort("".equals(host) ? null : host, port != null ? port : 0));
      auth.setDn(dn.toString());
      auth.setDn(dn);
      auth.setPwd(pwd);
      auth.setUseSecureConnection(true);
@@ -4130,8 +4130,7 @@
      }
      server.setAdsProperties(adsProperties);
    }
    return getRemoteConnection(server, DN.valueOf(auth.getDn()), auth.getPwd(), getConnectTimeout(),
        getPreferredConnections());
    return getRemoteConnection(server, auth.getDn(), auth.getPwd(), getConnectTimeout(), getPreferredConnections());
  }
  /**
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/Utils.java
@@ -1607,10 +1607,10 @@
    cmdLine.add(String.valueOf(server.getEnabledAdministrationPorts().get(0)));
    AuthenticationData authData = userData.getReplicationOptions().getAuthenticationData();
    if (!DN.valueOf(authData.getDn()).equals(ADSContext.getAdministratorDN(userData.getGlobalAdministratorUID())))
    if (!authData.getDn().equals(ADSContext.getAdministratorDN(userData.getGlobalAdministratorUID())))
    {
      cmdLine.add("--bindDN1");
      cmdLine.add(authData.getDn());
      cmdLine.add(authData.getDn().toString());
      cmdLine.add("--bindPassword1");
      cmdLine.add(OBFUSCATED_VALUE);
    }