From aa9e57a11efc74e6abba5a47da2305ce1f70c65e Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Sun, 08 Jul 2007 00:05:17 +0000
Subject: [PATCH] Update the LDAP and JMX connection handlers so that they attempt to bind a server socket to the configured port for all appropriate addresses during the initialization phase.  This should provide a reliable mechanism for determining whether the connection handler will be allowed to start, and it will be more accurate and faster than the earlier attempt to achieve the same result using SetupUtils.canUseAsPort().

---
 opends/src/server/org/opends/server/messages/ProtocolMessages.java |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/messages/ProtocolMessages.java b/opends/src/server/org/opends/server/messages/ProtocolMessages.java
index 6577ca0..0912149 100644
--- a/opends/src/server/org/opends/server/messages/ProtocolMessages.java
+++ b/opends/src/server/org/opends/server/messages/ProtocolMessages.java
@@ -4659,6 +4659,28 @@
 
 
   /**
+   * The message ID for the message that will be used if the LDAP connection
+   * handler cannot bind to a configured address:port.  This takes four
+   * arguments, which are the configuration entry DN, IP address, port  number,
+   * and a message explaining the problem that occurred.
+   */
+  public static final int MSGID_LDAP_CONNHANDLER_CANNOT_BIND =
+       CATEGORY_MASK_PROTOCOL | SEVERITY_MASK_SEVERE_ERROR | 432;
+
+
+
+  /**
+   * The message ID for the message that will be used if the JMX connection
+   * handler cannot bind to a configured port.  This takes three arguments,
+   * which are the configuration entry DN, port  number, and a message
+   * explaining the problem that occurred.
+   */
+  public static final int MSGID_JMX_CONNHANDLER_CANNOT_BIND =
+       CATEGORY_MASK_PROTOCOL | SEVERITY_MASK_SEVERE_ERROR | 433;
+
+
+
+  /**
    * Associates a set of generic messages with the message IDs defined in this
    * class.
    */
@@ -5914,6 +5936,9 @@
                     " of configuration entry %s has an invalid value %s " +
                     "which does not reference an enabled trust manager " +
                     "provider");
+    registerMessage(MSGID_LDAP_CONNHANDLER_CANNOT_BIND,
+                    "The LDAP connection handler defined in configuration " +
+                    "entry %s was unable to bind to %s:%d:  %s");
     registerMessage(MSGID_LDAP_CONNHANDLER_CANNOT_DETERMINE_TRUSTMANAGER_DN,
                     "An error occurred while processing the " +
                     ATTR_TRUSTMANAGER_DN + " attribute in configuration " +
@@ -6448,6 +6473,9 @@
             ATTR_USE_SSL + " attribute in configuration entry %s, " +
             "which is used to indicate whether to use SSL when " +
             "accepting client connections:  %s");
+    registerMessage(MSGID_JMX_CONNHANDLER_CANNOT_BIND,
+            "The JMX connection handler defined in configuration entry %s " +
+            "was unable to bind to port %d:  %s");
     registerMessage(MSGID_JMX_CONNHANDLER_DESCRIPTION_SSL_CERT_NICKNAME,
             "Specifies the nickname of the certificate that the " +
             "connection handler should use when accepting SSL-based " +

--
Gitblit v1.10.0