From 343e9de6f8f2bbf0ae32b8bd140964583fefd825 Mon Sep 17 00:00:00 2001
From: abobrov <abobrov@localhost>
Date: Tue, 20 Oct 2009 15:57:03 +0000
Subject: [PATCH] - RFC 3672 Subentries Control implementation : make earlier drafts based implementation obsolete; keep ldapSubEntry OC search matching criteria for backward compatibility.

---
 opends/src/server/org/opends/server/tools/LDAPSearch.java |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/tools/LDAPSearch.java b/opends/src/server/org/opends/server/tools/LDAPSearch.java
index 9a79ba3..13b131a 100644
--- a/opends/src/server/org/opends/server/tools/LDAPSearch.java
+++ b/opends/src/server/org/opends/server/tools/LDAPSearch.java
@@ -712,6 +712,7 @@
     StringArgument    effectiveRightsAttrs     = null;
     StringArgument    propertiesFileArgument   = null;
     BooleanArgument   noPropertiesFileArgument = null;
+    BooleanArgument   subEntriesArgument       = null;
 
 
     // Create the command-line argument parser for use with this program.
@@ -984,6 +985,12 @@
       controlStr.setPropertyName("control");
       argParser.addArgument(controlStr);
 
+      subEntriesArgument = new BooleanArgument("subEntries",
+              OPTION_SHORT_SUBENTRIES, OPTION_LONG_SUBENTRIES,
+              INFO_DESCRIPTION_SUBENTRIES.get());
+      useSSL.setPropertyName(OPTION_LONG_SUBENTRIES);
+      argParser.addArgument(subEntriesArgument);
+
       effectiveRightsUser =
               new StringArgument("effectiveRightsUser",
                       OPTION_SHORT_EFFECTIVERIGHTSUSER,
@@ -1599,6 +1606,13 @@
       }
     }
 
+    if (subEntriesArgument.isPresent())
+    {
+      Control subentriesControl =
+          new SubentriesControl(true, true);
+      searchOptions.getControls().add(subentriesControl);
+    }
+
     // Set the connection options.
     connectionOptions.setSASLExternal(saslExternal.isPresent());
     if(saslOptions.isPresent())

--
Gitblit v1.10.0