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/SearchEntryPluginResult.java | 99 +++++++------------------------------------------
1 files changed, 15 insertions(+), 84 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/api/plugin/SearchEntryPluginResult.java b/opendj-sdk/opends/src/server/org/opends/server/api/plugin/SearchEntryPluginResult.java
index 6d7972e..2244ca0 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/api/plugin/SearchEntryPluginResult.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/api/plugin/SearchEntryPluginResult.java
@@ -46,21 +46,30 @@
+ /**
+ * A search entry plugin result instance that indicates all
+ * processing was successful.
+ */
+ public static final SearchEntryPluginResult SUCCESS =
+ new SearchEntryPluginResult();
+
+
+
// Indicates whether any further search result entry plugins should
// be invoked for this operation.
- private boolean continuePluginProcessing;
+ private final boolean continuePluginProcessing;
// Indicates whether processing should continue for the associated
// search operation.
- private boolean continueSearch;
+ private final boolean continueSearch;
// Indicates whether the search result entry plugin terminated the
// client connection.
- private boolean connectionTerminated;
+ private final boolean connectionTerminated;
// Indicates whether the associated entry should be sent to the
// client.
- private boolean sendEntry;
+ private final boolean sendEntry;
@@ -71,14 +80,9 @@
* should continue, that the entry should be returned to the client,
* and that processing on the search operation should continue.
*/
- public SearchEntryPluginResult()
+ private SearchEntryPluginResult()
{
- assert debugConstructor(CLASS_NAME);
-
- this.connectionTerminated = false;
- this.continuePluginProcessing = true;
- this.sendEntry = true;
- this.continueSearch = true;
+ this(false, true, true, true);
}
@@ -136,24 +140,6 @@
/**
- * Specifies whether the search result entry plugin terminated the
- * client connection.
- *
- * @param connectionTerminated Specifies whether the search result
- * entry 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 search result entry plugins should
* be invoked for this operation.
*
@@ -171,26 +157,6 @@
/**
- * Specifies whether any further search result entry plugins should
- * be invoked for this operation.
- *
- * @param continuePluginProcessing Specifies whether any further
- * search result entry 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 search result entry should be
* sent to the client.
*
@@ -208,23 +174,6 @@
/**
- * Specifies whether the associated search result entry should be
- * sent to the client.
- *
- * @param sendEntry Specifies whether the associated search result
- * entry should be sent to the client.
- */
- public void setSendEntry(boolean sendEntry)
- {
- assert debugEnter(CLASS_NAME, "setSendEntry",
- String.valueOf(sendEntry));
-
- this.sendEntry = sendEntry;
- }
-
-
-
- /**
* Indicates whether processing should continue for the associated
* search operation (i.e., if it should continue looking for more
* matching entries).
@@ -242,24 +191,6 @@
/**
- * Specifies whether processing should continue for the associated
- * search operation.
- *
- * @param continueSearch Specifies whether processing should
- * continue for the associated search
- * operation.
- */
- public void setContinueSearch(boolean continueSearch)
- {
- assert debugEnter(CLASS_NAME, "setContinueSearch",
- String.valueOf(continueSearch));
-
- this.continueSearch = continueSearch;
- }
-
-
-
- /**
* Retrieves a string representation of this search result entry
* plugin result.
*
--
Gitblit v1.10.0