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

ludovicp
27.10.2010 03fe0954e42abf00746b8efa4c79ee74cf514427
opends/src/guitools/org/opends/guitools/controlpanel/browser/LDAPConnectionPool.java
@@ -80,6 +80,7 @@
  private Control[] requestControls = new Control[] {};
  private ApplicationTrustManager trustManager;
  private int connectTimeout = ConnectionUtils.getDefaultLDAPTimeout();
  /**
   * Returns <CODE>true</CODE> if the connection passed is registered in the
@@ -514,13 +515,13 @@
    if (isSecureLDAPUrl(ldapUrl))
    {
      ctx = ConnectionUtils.createLdapsContext(ldapUrl.toString(), ar.dn,
          ar.password, ConnectionUtils.getDefaultLDAPTimeout(), null,
          ar.password, getConnectTimeout(), null,
          getTrustManager() , getKeyManager());
    }
    else
    {
      ctx = ConnectionUtils.createLdapContext(ldapUrl.toString(), ar.dn,
          ar.password, ConnectionUtils.getDefaultLDAPTimeout(), null);
          ar.password, getConnectTimeout(), null);
    }
    return ctx;
  }
@@ -546,6 +547,27 @@
    return trustManager;
  }
  /**
   * Returns the timeout to establish the connection in milliseconds.
   * @return the timeout to establish the connection in milliseconds.
   */
  public int getConnectTimeout()
  {
    return connectTimeout;
  }
  /**
   * Sets the timeout to establish the connection in milliseconds.
   * Use {@code 0} to express no timeout.
   * @param connectTimeout the timeout to establish the connection in
   * milliseconds.
   * Use {@code 0} to express no timeout.
   */
  public void setConnectTimeout(int connectTimeout)
  {
    this.connectTimeout = connectTimeout;
  }
  private KeyManager getKeyManager()
  {
//  TODO: we should get it from ControlPanelInfo