From 43cd5f921108cfca9337ab5bdb8ff24b632ac54d Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 15 Jul 2013 07:44:51 +0000
Subject: [PATCH] Refactoring on the LocalBackend*Operation classes: - Moved BooleanHolder out of LocalBackendAddOperation. - Extracted process*() methods from the processLocal*() methods for the LocalBackend*Operation classes. - Transformed plain comments into javadocs. - Used interfaces instead of concrete classes. - Made all protected members be private. - Used StatisUtils.collectionToString()

---
 opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java |   27 ++++++---------------------
 1 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
index 90b6a6f..2d988ab 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
@@ -27,8 +27,6 @@
  */
 package org.opends.server.workflowelement.localbackend;
 
-
-
 import static org.opends.messages.CoreMessages.*;
 import static org.opends.server.config.ConfigConstants.*;
 import static org.opends.server.loggers.ErrorLogger.*;
@@ -58,8 +56,6 @@
 import org.opends.server.types.operation.PreOperationAddOperation;
 import org.opends.server.util.TimeThread;
 
-
-
 /**
  * This class defines an operation used to add an entry in a local backend
  * of the Directory Server.
@@ -75,14 +71,6 @@
   private static final DebugTracer TRACER = getTracer();
 
   /**
-   * Simple boolean helper class.
-   */
-  private static final class BooleanHolder
-  {
-    boolean value;
-  }
-
-  /**
    * The backend in which the entry is to be added.
    */
   private Backend backend;
@@ -169,17 +157,15 @@
     this.backend = wfe.getBackend();
     ClientConnection clientConnection = getClientConnection();
 
-    // Get the plugin config manager that will be used for invoking plugins.
-    PluginConfigManager pluginConfigManager =
-         DirectoryServer.getPluginConfigManager();
-
     // Check for a request to cancel this operation.
     checkIfCanceled(false);
 
 
     BooleanHolder executePostOpPlugins = new BooleanHolder();
-    processAdd(clientConnection, executePostOpPlugins, pluginConfigManager);
+    processAdd(clientConnection, executePostOpPlugins);
 
+    PluginConfigManager pluginConfigManager =
+        DirectoryServer.getPluginConfigManager();
 
     // Invoke the post-operation or post-synchronization add plugins.
     if (isSynchronizationOperation())
@@ -245,9 +231,7 @@
   }
 
   private void processAdd(ClientConnection clientConnection,
-      BooleanHolder executePostOpPlugins,
-      PluginConfigManager pluginConfigManager)
-      throws CanceledOperationException
+      BooleanHolder executePostOpPlugins) throws CanceledOperationException
   {
     // Process the entry DN and set of attributes to convert them from their
     // raw forms as provided by the client to the forms required for the rest
@@ -488,7 +472,8 @@
       {
         executePostOpPlugins.value = true;
         PluginResult.PreOperation preOpResult =
-            pluginConfigManager.invokePreOperationAddPlugins(this);
+            DirectoryServer.getPluginConfigManager()
+                .invokePreOperationAddPlugins(this);
         if (!preOpResult.continueProcessing())
         {
           setResultCode(preOpResult.getResultCode());

--
Gitblit v1.10.0