From 11c5b708d2668174a94512c0936dbcbc3cfeeca8 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Fri, 02 Nov 2007 16:04:31 +0000
Subject: [PATCH] Update the server root DSE to include the supportedLDAPVersion attribute.

---
 opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java b/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
index 20d188e..2cb92b1 100644
--- a/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
+++ b/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
@@ -289,6 +289,15 @@
       enabledSSLProtocols = protocols.toArray(new String[0]);
     }
 
+    if (config.isAllowLDAPV2())
+    {
+      DirectoryServer.registerSupportedLDAPVersion(2, this);
+    }
+    else
+    {
+      DirectoryServer.deregisterSupportedLDAPVersion(2, this);
+    }
+
     return new ConfigChangeResult(resultCode, adminActionRequired,
         messages);
   }
@@ -317,6 +326,9 @@
     shutdownRequested = true;
     currentConfig.removeLDAPChangeListener(this);
 
+    DirectoryServer.deregisterSupportedLDAPVersion(2, this);
+    DirectoryServer.deregisterSupportedLDAPVersion(3, this);
+
     try {
       selector.wakeup();
     } catch (Exception e) {
@@ -744,6 +756,14 @@
     }
 
 
+    // Register the set of supported LDAP versions.
+    DirectoryServer.registerSupportedLDAPVersion(3, this);
+    if (config.isAllowLDAPV2())
+    {
+      DirectoryServer.registerSupportedLDAPVersion(2, this);
+    }
+
+
     // Register this as a change listener.
     config.addLDAPChangeListener(this);
   }

--
Gitblit v1.10.0