From 6b3ef14a652f6be0d559365d2fd2c78a61524fec Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 17 Sep 2010 22:06:25 +0000
Subject: [PATCH] Minimize Historical Data (dsreplication/client side). The purge historical can be executed on the local server even when it is stopped. This is matches the functionality provided by utilities such import-ldif, backup, etc.

---
 opends/src/guitools/org/opends/guitools/controlpanel/util/ConfigFromDirContext.java |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/util/ConfigFromDirContext.java b/opends/src/guitools/org/opends/guitools/controlpanel/util/ConfigFromDirContext.java
index 789d655..9bde4e1 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/util/ConfigFromDirContext.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/util/ConfigFromDirContext.java
@@ -96,7 +96,7 @@
 
   private boolean isLocal = true;
 
-  private Map<String, CustomSearchResult> hmConnectionHandlersMonitor =
+  private final Map<String, CustomSearchResult> hmConnectionHandlersMonitor =
     new HashMap<String, CustomSearchResult>();
 
   /**
@@ -784,11 +784,13 @@
    * @param sr the search result.
    * @param searchBaseDN the base search.
    * @param taskEntries the collection of TaskEntries to be updated.
+   * @param ex the list of exceptions to be updated if an error occurs.
    * @throws NamingException if there is an error retrieving the values of the
    * search result.
    */
-  protected void handleTaskSearchResult(SearchResult sr, String searchBaseDN,
-      Collection<TaskEntry> taskEntries)
+  private void handleTaskSearchResult(SearchResult sr,
+      String searchBaseDN,
+      Collection<TaskEntry> taskEntries, List<OpenDsException> ex)
   throws NamingException
   {
     CustomSearchResult csr = new CustomSearchResult(sr, searchBaseDN);
@@ -801,7 +803,7 @@
     }
     catch (OpenDsException ode)
     {
-      exceptions.add(ode);
+      ex.add(ode);
     }
   }
 
@@ -847,7 +849,15 @@
     }
   }
 
-  private void updateTaskInformation(InitialLdapContext ctx,
+  /**
+   * Updates the provided list of TaskEntry with the task entries found in
+   * a server.
+   * @param ctx the connection to the server.
+   * @param ex the list of exceptions encountered while retrieving the task
+   * entries.
+   * @param ts the list of task entries to be updated.
+   */
+  public void updateTaskInformation(InitialLdapContext ctx,
       List<OpenDsException> ex, Collection<TaskEntry> ts)
   {
     // Read monitoring information: since it is computed, it is faster
@@ -870,7 +880,7 @@
         while (taskEntries.hasMore())
         {
           SearchResult sr = taskEntries.next();
-          handleTaskSearchResult(sr, ConfigConstants.DN_TASK_ROOT, ts);
+          handleTaskSearchResult(sr, ConfigConstants.DN_TASK_ROOT, ts, ex);
         }
       }
       finally
@@ -1052,7 +1062,8 @@
     return isConnectionHandler;
   }
 
-  private boolean isTaskEntry(CustomSearchResult csr) throws OpenDsException
+  private static boolean isTaskEntry(CustomSearchResult csr)
+  throws OpenDsException
   {
     boolean isTaskEntry = false;
     List<Object> vs = csr.getAttributeValues("objectclass");

--
Gitblit v1.10.0