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/PostResponsePluginResult.java |   57 +++++++++++++--------------------------------------------
 1 files changed, 13 insertions(+), 44 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/api/plugin/PostResponsePluginResult.java b/opendj-sdk/opends/src/server/org/opends/server/api/plugin/PostResponsePluginResult.java
index c839724..b8a5bec 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/api/plugin/PostResponsePluginResult.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/api/plugin/PostResponsePluginResult.java
@@ -46,13 +46,22 @@
 
 
 
+  /**
+   * A post-response plugin result instance that indicates all
+   * processing was successful.
+   */
+  public static final PostResponsePluginResult SUCCESS =
+       new PostResponsePluginResult();
+
+
+
   // Indicates whether any further post-response plugins should be
   // invoked for this operation.
-  private boolean continuePluginProcessing;
+  private final boolean continuePluginProcessing;
 
   // Indicates whether the post-response plugin terminated the client
   // connection.
-  private boolean connectionTerminated;
+  private final boolean connectionTerminated;
 
 
 
@@ -62,12 +71,9 @@
    * not been terminated and that further post-response plugin
    * processing should be allowed.
    */
-  public PostResponsePluginResult()
+  private PostResponsePluginResult()
   {
-    assert debugConstructor(CLASS_NAME);
-
-    this.connectionTerminated     = false;
-    this.continuePluginProcessing = true;
+    this(false, true);
   }
 
 
@@ -114,25 +120,6 @@
 
 
   /**
-   * Specifies whether any further post-response plugins should be
-   * invoked for this operation.
-   *
-   * @param  continuePluginProcessing  Specifies whether any further
-   *                                   post-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 post-response plugin terminated the client
    * connection.
    *
@@ -149,24 +136,6 @@
 
 
   /**
-   * Specifies whether the post-response plugin terminated the client
-   * connection.
-   *
-   * @param  connectionTerminated  Specifies whether the post-response
-   *                               plugin terminated the client
-   *                               connection.
-   */
-  public void setConnectionTerminated(boolean connectionTerminated)
-  {
-    assert debugEnter(CLASS_NAME, "setConnectionTerminated",
-                      String.valueOf(connectionTerminated));
-
-    this.connectionTerminated = connectionTerminated;
-  }
-
-
-
-  /**
    * Retrieves a string representation of this post-response plugin
    * result.
    *

--
Gitblit v1.10.0