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/server/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java b/opends/src/server/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java
index 665cbaa..f266ad8 100644
--- a/opends/src/server/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java
+++ b/opends/src/server/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2008-2009 Sun Microsystems, Inc.
+ *      Copyright 2008-2010 Sun Microsystems, Inc.
  */
 
 package org.opends.server.util.cli;
@@ -116,6 +116,9 @@
 
   private String truststorePassword;
 
+  // The timeout to be used to connect
+  private int connectTimeout;
+
   private Message heading = INFO_LDAP_CONN_HEADING_CONNECTION_PARAMETERS.get();
 
   // A copy of the secureArgList for convenience.
@@ -796,6 +799,7 @@
           copySecureArgsList.bindPasswordArg);
       }
     }
+    connectTimeout = secureArgsList.connectTimeoutArg.getIntValue();
   }
 
   /**
@@ -1456,6 +1460,15 @@
   }
 
   /**
+   * Returns the timeout to be used to connect with the server.
+   * @return the timeout to be used to connect with the server.
+   */
+  public int getConnectTimeout()
+  {
+    return connectTimeout;
+  }
+
+  /**
    * Indicate if the certificate chain can be trusted.
    *
    * @param chain The certificate chain to validate

--
Gitblit v1.10.0