From bb40b9a02cf40af0349d8e3576f51133d264d4b1 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.

---
 opends/src/server/org/opends/server/api/plugin/PostConnectPluginResult.java |   57 +++++++++++++--------------------------------------------
 1 files changed, 13 insertions(+), 44 deletions(-)

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

--
Gitblit v1.10.0