From b8c43b0c23cd70929e906c574bc88ebc8017c559 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 10 Oct 2006 15:23:18 +0000
Subject: [PATCH] Make all of the plugin result objects immutable, and create a default SUCCESS instance for each of them that may be used if all processing completed successfully.  Update all uses of the plugin result objects to use this SUCCESS instance where applicable.

---
 opendj-sdk/opends/src/server/org/opends/server/api/plugin/IntermediateResponsePluginResult.java |  101 +++++++-------------------------------------------
 1 files changed, 15 insertions(+), 86 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/api/plugin/IntermediateResponsePluginResult.java b/opendj-sdk/opends/src/server/org/opends/server/api/plugin/IntermediateResponsePluginResult.java
index 9b4fbdc..816fd6e 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/api/plugin/IntermediateResponsePluginResult.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/api/plugin/IntermediateResponsePluginResult.java
@@ -47,21 +47,30 @@
 
 
 
+  /**
+   * An intermediate response plugin result instance that indicates
+   * all processing was successful.
+   */
+  public static final IntermediateResponsePluginResult SUCCESS =
+       new IntermediateResponsePluginResult();
+
+
+
   // Indicates whether any further intermediate response plugins
   // should be invoked for this operation.
-  private boolean continuePluginProcessing;
+  private final boolean continuePluginProcessing;
 
   // Indicates whether processing should continue for the associated
   // operation.
-  private boolean continueOperation;
+  private final boolean continueOperation;
 
   // Indicates whether the intermediate response plugin terminated the
   // client connection.
-  private boolean connectionTerminated;
+  private final boolean connectionTerminated;
 
   // Indicates whether the associated intermediate response message
   // should be sent to the client.
-  private boolean sendIntermediateResponse;
+  private final boolean sendIntermediateResponse;
 
 
 
@@ -73,14 +82,9 @@
    * be returned to the client, and that processing on the associated
    * operation should continue.
    */
-  public IntermediateResponsePluginResult()
+  private IntermediateResponsePluginResult()
   {
-    assert debugConstructor(CLASS_NAME);
-
-    this.connectionTerminated     = false;
-    this.continuePluginProcessing = true;
-    this.sendIntermediateResponse = true;
-    this.continueOperation        = true;
+    this(false, true, true, true);
   }
 
 
@@ -142,24 +146,6 @@
 
 
   /**
-   * Specifies whether the intermediate response plugin terminated the
-   * client connection.
-   *
-   * @param  connectionTerminated  Specifies whether the intermediate
-   *                               response plugin terminated the
-   *                               client connection.
-   */
-  public void setConnectionTerminated(boolean connectionTerminated)
-  {
-    assert debugEnter(CLASS_NAME, "setConnectionTerminated",
-                      String.valueOf(connectionTerminated));
-
-    this.connectionTerminated = connectionTerminated;
-  }
-
-
-
-  /**
    * Indicates whether any further intermediate response plugins
    * should be invoked for this operation.
    *
@@ -177,26 +163,6 @@
 
 
   /**
-   * Specifies whether any further intermediate response plugins
-   * should be invoked for this operation.
-   *
-   * @param  continuePluginProcessing  Specifies whether any further
-   *                                   intermediate response plugins
-   *                                   should be invoked for this
-   *                                   operation.
-   */
-  public void setContinuePluginProcessing(
-                   boolean continuePluginProcessing)
-  {
-    assert debugEnter(CLASS_NAME, "setContinuePluginProcessing",
-                      String.valueOf(continuePluginProcessing));
-
-    this.continuePluginProcessing = continuePluginProcessing;
-  }
-
-
-
-  /**
    * Indicates whether the associated intermediate response message
    * should be sent to the client.
    *
@@ -214,26 +180,6 @@
 
 
   /**
-   * Specifies whether the associated intermediate response message
-   * should be sent to the client.
-   *
-   * @param  sendIntermediateResponse  Specifies whether the
-   *                                   associated intermediate
-   *                                   response message should be sent
-   *                                   to the client.
-   */
-  public void setSendIntermediateResponse(
-                   boolean sendIntermediateResponse)
-  {
-    assert debugEnter(CLASS_NAME, "setSendIntermediateResponse",
-                      String.valueOf(sendIntermediateResponse));
-
-    this.sendIntermediateResponse = sendIntermediateResponse;
-  }
-
-
-
-  /**
    * Indicates whether processing should continue for the associated
    * operation.
    *
@@ -250,23 +196,6 @@
 
 
   /**
-   * Specifies whether processing should continue for the associated
-   * operation.
-   *
-   * @param  continueOperation  Specifies whether processing should
-   *                            continue for the associated operation.
-   */
-  public void setContinueOperation(boolean continueOperation)
-  {
-    assert debugEnter(CLASS_NAME, "setContinueOperation",
-                      String.valueOf(continueOperation));
-
-    this.continueOperation = continueOperation;
-  }
-
-
-
-  /**
    * Retrieves a string representation of this intermediate response
    * plugin result.
    *

--
Gitblit v1.10.0