From 66c1a80d263b71195a525d1c1fdd59e464a606ae Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Fri, 20 Aug 2010 13:39:26 +0000
Subject: [PATCH] Fix all command lines that are doing Searches with JNDI, to avoid them sending systematic Abandon requests.

---
 opends/src/guitools/org/opends/guitools/controlpanel/util/LDAPEntryReader.java |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/util/LDAPEntryReader.java b/opends/src/guitools/org/opends/guitools/controlpanel/util/LDAPEntryReader.java
index 49837fe..eec19fa 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/util/LDAPEntryReader.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/util/LDAPEntryReader.java
@@ -48,9 +48,10 @@
  */
 public class LDAPEntryReader extends BackgroundTask<CustomSearchResult>
 {
-  private String dn;
-  private InitialLdapContext ctx;
-  private Set<EntryReadListener> listeners = new HashSet<EntryReadListener>();
+  private final String dn;
+  private final InitialLdapContext ctx;
+  private final Set<EntryReadListener> listeners =
+    new HashSet<EntryReadListener>();
   private boolean isOver;
   private boolean notifyListeners;
 
@@ -69,6 +70,7 @@
   /**
    * {@inheritDoc}
    */
+  @Override
   public CustomSearchResult processBackgroundTask() throws Throwable
   {
     isOver = false;
@@ -76,7 +78,6 @@
     try
     {
       SearchControls controls = new SearchControls();
-      controls.setCountLimit(1);
 
       String[] attrs = {"*", "+"};
       controls.setReturningAttributes(attrs);
@@ -85,7 +86,11 @@
 
       en = ctx.search(Utilities.getJNDIName(dn), filter, controls);
 
-      SearchResult sr = en.next();
+      SearchResult sr = null;
+      while (en.hasMore())
+      {
+        sr = en.next();
+      }
 
       return new CustomSearchResult(sr, dn);
     }
@@ -105,6 +110,7 @@
   /**
    * {@inheritDoc}
    */
+  @Override
   public void backgroundTaskCompleted(CustomSearchResult sr,
       Throwable throwable)
   {

--
Gitblit v1.10.0