From 03fe0954e42abf00746b8efa4c79ee74cf514427 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Thu, 27 May 2010 15:10:50 +0000
Subject: [PATCH] Fix an issue with connection timeouts in CLI. The timeout is now configurable on CLI with the --connectTimeout option (expressed in milliseconds), the default is 30 000 milliseconds. This solves Issue 4196.

---
 opends/src/quicksetup/org/opends/quicksetup/util/Utils.java |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
index 0e48c73..5911286 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -1134,13 +1134,16 @@
    * @param ldapUrl the ldap URL of the server.
    * @param dn the dn to be used.
    * @param pwd the password to be used.
+   * @param timeout the timeout to establish the connection in milliseconds.
+   * Use {@code 0} to express no timeout.
    * @return <CODE>true</CODE> if we can connect and read the configuration and
    * <CODE>false</CODE> otherwise.
    */
   public static boolean canConnectAsAdministrativeUser(String ldapUrl,
-      String dn, String pwd)
+      String dn, String pwd, int timeout)
   {
-    return ConnectionUtils.canConnectAsAdministrativeUser(ldapUrl, dn, pwd);
+    return ConnectionUtils.canConnectAsAdministrativeUser(ldapUrl, dn, pwd,
+        timeout);
   }
 
 /**
@@ -1246,17 +1249,6 @@
     return msg;
   }
 
-  /**
-   * Returns the default LDAP timeout in milliseconds when we try to connect to
-   * a server.
-   * @return the default LDAP timeout in milliseconds when we try to connect to
-   * a server.
-   */
-  public static int getDefaultLDAPTimeout()
-  {
-    return ConnectionUtils.getDefaultLDAPTimeout();
-  }
-
 
   /**
    * Returns the path of the installation of the directory server.  Note that

--
Gitblit v1.10.0