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/PreParsePluginResult.java | 82 +++++++----------------------------------
1 files changed, 14 insertions(+), 68 deletions(-)
diff --git a/opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java b/opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java
index 7a9c519..fef1403 100644
--- a/opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java
@@ -46,17 +46,26 @@
+ /**
+ * A pre-parse plugin result instance that indicates all processing
+ * was successful.
+ */
+ public static final PreParsePluginResult SUCCESS =
+ new PreParsePluginResult();
+
+
+
// Indicates whether any further pre-operation plugins should be
// invoked for this operation.
- private boolean continuePluginProcessing;
+ private final boolean continuePluginProcessing;
// Indicates whether the pre-operation plugin terminated the client
// connection.
- private boolean connectionTerminated;
+ private final boolean connectionTerminated;
// Indicates whether the server should immediately send the response
// from this plugin to the client with no further processing.
- private boolean sendResponseImmediately;
+ private final boolean sendResponseImmediately;
@@ -68,13 +77,9 @@
* that the pre-operation and post-operation plugin processing
* should not be skipped.
*/
- public PreParsePluginResult()
+ private PreParsePluginResult()
{
- assert debugConstructor(CLASS_NAME);
-
- this.connectionTerminated = false;
- this.continuePluginProcessing = true;
- this.sendResponseImmediately = false;
+ this(false, true, false);
}
@@ -128,24 +133,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;
- }
-
-
-
- /**
* Indicates whether any further post-response plugins should be
* invoked for this operation.
*
@@ -163,25 +150,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 server should send the response set by this
* plugin to the client immediately with no further processing on
* the operation.
@@ -201,28 +169,6 @@
/**
- * Specifies whether the server should send the response set by this
- * plugin to the client immediately with no further processing on
- * the operation.
- *
- * @param sendResponseImmediately Indicates whether the server
- * should send the response set by
- * this plugin to the client
- * immediately with no further
- * processing on the operation.
- */
- public void setSendResponseImmediately(
- boolean sendResponseImmediately)
- {
- assert debugEnter(CLASS_NAME, "setSendResponseImmediately",
- String.valueOf(sendResponseImmediately));
-
- this.sendResponseImmediately = sendResponseImmediately;
- }
-
-
-
- /**
* Retrieves a string representation of this post-response plugin
* result.
*
--
Gitblit v1.10.0