From 259609ae49cea8d8e189bfcefd9e3d87d8c5ee1b Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Fri, 06 Sep 2013 07:02:28 +0000
Subject: [PATCH] CR-2260 Implement Rebuild all indexes Upgrade task - removed start task action (unused) - removed verifyTaskType function (unused) - used LDIF.search to retrieve backends (rebuild index works only on 'enabled' backend). - added rebuild all index task.  - In case of an upgrade where a rebuild all task is present :     . All the other single rebuild indexes are bypass.     . Rebuild-all is launched only if the the user wants to.

---
 opendj-sdk/opends/src/server/org/opends/server/tools/upgrade/Upgrade.java |   58 ++++++++++++----------------------------------------------
 1 files changed, 12 insertions(+), 46 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/upgrade/Upgrade.java b/opendj-sdk/opends/src/server/org/opends/server/tools/upgrade/Upgrade.java
index c946268..8622fdc 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/upgrade/Upgrade.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/upgrade/Upgrade.java
@@ -301,6 +301,8 @@
             rebuildSingleIndex(INFO_UPGRADE_TASK_9013_DESCRIPTION.get(),
                 "ds-sync-hist")));
 
+
+
     /*
      * All upgrades will refresh the server configuration schema and generate
      * a new upgrade folder.
@@ -384,15 +386,21 @@
      * and the application is non-interactive then, the process
      * may abort immediately.
      */
-    verify(context, tasks);
+    for (final UpgradeTask task : tasks)
+    {
+      task.verify(context);
+    }
 
     /*
-     * Asking upgrade requirements if needed to user.
+     * Let tasks interact with the user in order to obtain user's selection.
      */
     context.notify(INFO_UPGRADE_REQUIREMENTS.get(), TITLE_CALLBACK);
-    interact(context, tasks);
+    for (final UpgradeTask task : tasks)
+    {
+      task.interact(context);
+    }
 
-    // Starts upgrade.
+    // Starts upgrade
     final int userResponse = context.confirmYN(
         INFO_UPGRADE_DISPLAY_CONFIRM_START.get(), ConfirmationCallback.YES);
     if (userResponse == ConfirmationCallback.NO)
@@ -408,18 +416,6 @@
        */
       context.notify(INFO_UPGRADE_PERFORMING_TASKS.get(),
           TITLE_CALLBACK);
-
-      /*
-       * Notify each task that the upgrade is about to be started.
-       */
-      for (final UpgradeTask task : tasks)
-      {
-        task.start(context);
-      }
-
-      /*
-       * Perform each task.
-       */
       for (final UpgradeTask task : tasks)
       {
         task.perform(context);
@@ -516,36 +512,6 @@
     MANDATORY_TASKS.addAll(Arrays.asList(tasks));
   }
 
-  private static void interact(final UpgradeContext context,
-      final List<UpgradeTask> tasks)
-      throws ClientException
-  {
-    /*
-     * Let tasks interact with the user in order to obtain user's selection.
-     */
-    for (final UpgradeTask task : tasks)
-    {
-      task.interact(context);
-    }
-  }
-
-
-
-  private static void verify(final UpgradeContext context,
-      final List<UpgradeTask> tasks)
-      throws ClientException
-  {
-    /*
-     * Let tasks interact with CLI to check if command line is correct.
-     */
-    for (final UpgradeTask task : tasks)
-    {
-      task.verify(context);
-    }
-  }
-
-
-
   /**
    * The server must be offline during the upgrade.
    *

--
Gitblit v1.10.0