From 3eda3cff54108292450f4d270e187596bc8f307e 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.

---
 opendj-sdk/opends/src/server/org/opends/server/backends/RootDSEBackend.java |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/RootDSEBackend.java b/opendj-sdk/opends/src/server/org/opends/server/backends/RootDSEBackend.java
index 83138eb..959d022 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/RootDSEBackend.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/RootDSEBackend.java
@@ -36,6 +36,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.opends.messages.Message;
@@ -636,6 +637,32 @@
     }
 
 
+    // Add the "supportedLDAPVersions" attribute.
+    TreeSet<String> versionStrings = new TreeSet<String>();
+    for (Integer ldapVersion : DirectoryServer.getSupportedLDAPVersions())
+    {
+      versionStrings.add(ldapVersion.toString());
+    }
+    Attribute supportedLDAPVersionAttr =
+         createAttribute(ATTR_SUPPORTED_LDAP_VERSION,
+                         ATTR_SUPPORTED_LDAP_VERSION_LC,
+                         versionStrings);
+    ArrayList<Attribute> supportedLDAPVersionAttrs =
+         new ArrayList<Attribute>(1);
+    supportedLDAPVersionAttrs.add(supportedLDAPVersionAttr);
+    if (showAllAttributes ||
+        (! supportedLDAPVersionAttr.getAttributeType().isOperational()))
+    {
+      dseUserAttrs.put(supportedLDAPVersionAttr.getAttributeType(),
+                       supportedLDAPVersionAttrs);
+    }
+    else
+    {
+      dseOperationalAttrs.put(supportedLDAPVersionAttr.getAttributeType(),
+                              supportedLDAPVersionAttrs);
+    }
+
+
     // Add the "supportedAuthPasswordSchemes" attribute.
     Set<String> authPWSchemes =
          DirectoryServer.getAuthPasswordStorageSchemes().keySet();

--
Gitblit v1.10.0