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

Jean-Noël Rouvignac
03.27.2016 6a60952f916a84257b0d2ac585a81fdf98d46c9a
ConnectionWrapper: isSSL() => isLdaps(), isStartTLS() => isStartTls()
6 files modified
56 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java 14 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionWrapper.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/BrowserController.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/LDAPConnectionPool.java 14 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/NodeRefresher.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/Task.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java
@@ -208,7 +208,7 @@
      @Override
      public void run() {
        try {
          if (conn.isSSL() || conn.isStartTLS())
          if (conn.isLdaps() || conn.isStartTls())
          {
            TrustedSocketFactory.setCurrentThreadTrustManager(trustManager, keyManager);
          }
@@ -463,25 +463,25 @@
  /**
   * Returns the LDAP URL for the provided parameters.
   * @param hostPort the host name and LDAP port.
   * @param useSSL whether to use SSL or not.
   * @param useLdaps whether to use LDAPS.
   * @return the LDAP URL for the provided parameters.
   */
  public static String getLDAPUrl(HostPort hostPort, boolean useSSL)
  public static String getLDAPUrl(HostPort hostPort, boolean useLdaps)
  {
    return getLDAPUrl(hostPort.getHost(), hostPort.getPort(), useSSL);
    return getLDAPUrl(hostPort.getHost(), hostPort.getPort(), useLdaps);
  }
  /**
   * Returns the LDAP URL for the provided parameters.
   * @param host the host name.
   * @param port the LDAP port.
   * @param useSSL whether to use SSL or not.
   * @param useLdaps whether to use LDAPS.
   * @return the LDAP URL for the provided parameters.
   */
  public static String getLDAPUrl(String host, int port, boolean useSSL)
  public static String getLDAPUrl(String host, int port, boolean useLdaps)
  {
    host = Utils.getHostNameForLdapUrl(host);
    return (useSSL ? "ldaps://" : "ldap://") + host + ":" + port;
    return (useLdaps ? "ldaps" : "ldap") + "://" + host + ":" + port;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionWrapper.java
@@ -277,11 +277,11 @@
  }
  /**
   * Returns whether this connection uses SSL.
   * Returns whether this connection uses LDAPS.
   *
   * @return {@code true} if this connection uses SSL {@code false} otherwise.
   * @return {@code true} if this connection uses LDAPS, {@code false} otherwise.
   */
  public boolean isSSL()
  public boolean isLdaps()
  {
    return getConnectionType() == LDAPS;
  }
@@ -289,9 +289,9 @@
  /**
   * Returns whether this connection uses StartTLS.
   *
   * @return {@code true} if this connection uses StartTLS {@code false} otherwise.
   * @return {@code true} if this connection uses StartTLS, {@code false} otherwise.
   */
  public boolean isStartTLS()
  public boolean isStartTls()
  {
    return getConnectionType() == START_TLS;
  }
@@ -308,7 +308,7 @@
  private InitialLdapContext createAdministrativeContext0() throws NamingException
  {
    final String ldapUrl = getLDAPUrl(getHostPort(), isSSL());
    final String ldapUrl = getLDAPUrl(getHostPort(), isLdaps());
    final String bindDnStr = bindDn.toString();
    switch (connectionType)
    {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/BrowserController.java
@@ -1030,7 +1030,7 @@
   */
  LDAPURL findUrlForLocalEntry(BasicNode node) {
    if (node == rootNode) {
      return LDAPConnectionPool.makeLDAPUrl(connConfig.getHostPort(), "", connConfig.isSSL());
      return LDAPConnectionPool.makeLDAPUrl(connConfig.getHostPort(), "", connConfig.isLdaps());
    }
    final BasicNode parent = (BasicNode) node.getParent();
    if (parent != null)
@@ -1038,7 +1038,7 @@
      final LDAPURL parentUrl = findUrlForDisplayedEntry(parent);
      return LDAPConnectionPool.makeLDAPUrl(parentUrl, node.getDN());
    }
    return LDAPConnectionPool.makeLDAPUrl(connConfig.getHostPort(), node.getDN(), connConfig.isSSL());
    return LDAPConnectionPool.makeLDAPUrl(connConfig.getHostPort(), node.getDN(), connConfig.isLdaps());
  }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/LDAPConnectionPool.java
@@ -347,8 +347,7 @@
   */
  private void disconnectAndRemove(ConnectionRecord cr)
  {
    String key = makeKeyFromRecord(cr);
    connectionTable.remove(key);
    connectionTable.remove(makeKeyFromRecord(cr));
    cr.conn.close();
  }
@@ -378,8 +377,7 @@
   * @return the key to be used in Maps for the provided connection record.
   */
  private static String makeKeyFromRecord(ConnectionRecord rec) {
    String protocol = rec.conn.isSSL() ? "LDAPS" : "LDAP";
    return protocol + ":" + rec.conn.getHostPort();
    return (rec.conn.isLdaps() ? "LDAPS" : "LDAP") + ":" + rec.conn.getHostPort();
  }
  /**
@@ -457,20 +455,20 @@
  }
  private LDAPURL makeLDAPUrl(ConnectionWrapper conn) {
    return makeLDAPUrl(conn.getHostPort(), "", conn.isSSL());
    return makeLDAPUrl(conn.getHostPort(), "", conn.isLdaps());
  }
  /**
   * Make an url from the specified arguments.
   * @param hostPort the host name and port of the server.
   * @param dn the base DN of the URL.
   * @param isSSL whether the connection uses SSL
   * @param isLdaps whether the connection uses LDAPS
   * @return an LDAP URL from the specified arguments.
   */
  public static LDAPURL makeLDAPUrl(HostPort hostPort, String dn, boolean isSSL)
  public static LDAPURL makeLDAPUrl(HostPort hostPort, String dn, boolean isLdaps)
  {
    return new LDAPURL(
        isSSL ? "ldaps" : LDAPURL.DEFAULT_SCHEME,
        isLdaps ? "ldaps" : LDAPURL.DEFAULT_SCHEME,
               hostPort.getHost(),
               hostPort.getPort(),
               dn,
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/NodeRefresher.java
@@ -490,7 +490,7 @@
          HostPort hostPort = conn.getHostPort();
          url.setHost(hostPort.getHost());
          url.setPort(hostPort.getPort());
          url.setScheme(conn.isSSL() ? "ldaps" : "ldap");
          url.setScheme(conn.isLdaps() ? "ldaps" : "ldap");
        }
        conn = connectionPool.getConnection(url);
        remoteDn = url.getRawBaseDN();
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/Task.java
@@ -711,8 +711,8 @@
      {
        hostName = hostPort.getHost();
      }
      boolean isSSL = conn.isSSL();
      boolean isStartTLS = conn.isStartTLS();
      boolean isLdaps = conn.isLdaps();
      boolean isStartTls = conn.isStartTls();
      String bindDN = conn.getBindDn().toString();
      String bindPwd = conn.getBindPassword();
      args.add("--hostName");
@@ -723,15 +723,15 @@
      args.add(bindDN);
      args.add("--bindPassword");
      args.add(bindPwd);
      if (isSSL || isStartTLS)
      if (isLdaps || isStartTls)
      {
        args.add("--trustAll");
      }
      if (isSSL && addConnectionTypeParameters)
      if (isLdaps && addConnectionTypeParameters)
      {
        args.add("--useSSL");
      }
      else if (isStartTLS && addConnectionTypeParameters)
      else if (isStartTls && addConnectionTypeParameters)
      {
        args.add("--useStartTLS");
      }