From 05dfa5fee15b191c3ee1afae0010b70733b1a35b Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Mon, 25 Jun 2007 15:51:57 +0000
Subject: [PATCH] Update the pre-parse and pre-operation plugin results to add the ability to skip core processing without skipping post-operation plugins.  Also, make sure that post-response plugins are always invoked for all operations that get far enough in their processing to have called the pre-parse plugins.

---
 opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 58 insertions(+), 1 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 5a2b289..449720c 100644
--- a/opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java
+++ b/opends/src/server/org/opends/server/api/plugin/PreParsePluginResult.java
@@ -55,6 +55,10 @@
   // from this plugin to the client with no further processing.
   private final boolean sendResponseImmediately;
 
+  // Indicates whether the server should skip the core processing for
+  // the associated operation.
+  private final boolean skipCoreProcessing;
+
 
 
   /**
@@ -67,7 +71,7 @@
    */
   private PreParsePluginResult()
   {
-    this(false, true, false);
+    this(false, true, false, false);
   }
 
 
@@ -92,9 +96,44 @@
                               boolean continuePluginProcessing,
                               boolean sendResponseImmediately)
   {
+    this(connectionTerminated, continuePluginProcessing,
+         sendResponseImmediately, false);
+  }
+
+
+
+  /**
+   * Creates a new pre-operation plugin result with the provided
+   * information.
+   *
+   * @param  connectionTerminated      Indicates whether the
+   *                                   post-response plugin terminated
+   *                                   the client connection.
+   * @param  continuePluginProcessing  Indicates whether any further
+   *                                   pre-operation plugins should be
+   *                                   invoked for this 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.
+   * @param  skipCoreProcessing        Indicates whether the server
+   *                                   should skip the core processing
+   *                                   for the operation.  If
+   *                                   {@code sendResponseImmediately}
+   *                                   is {@code false}, then any
+   *                                   post-operation plugins will
+   *                                   still be invoked.
+   */
+  public PreParsePluginResult(boolean connectionTerminated,
+                              boolean continuePluginProcessing,
+                              boolean sendResponseImmediately,
+                              boolean skipCoreProcessing)
+  {
     this.connectionTerminated     = connectionTerminated;
     this.continuePluginProcessing = continuePluginProcessing;
     this.sendResponseImmediately  = sendResponseImmediately;
+    this.skipCoreProcessing       = skipCoreProcessing;
   }
 
 
@@ -146,6 +185,22 @@
 
 
   /**
+   * Indicates whether the server should skip core processing for the
+   * operation.  If {@code sendResponseImmediately} is {@code false},
+   * then the server will still process any post-operation plugins
+   * that may be registered with the server.
+   *
+   * @return  {@code true} if the server should skip core processing
+   *          for the operation, or {@code false} if not.
+   */
+  public boolean skipCoreProcessing()
+  {
+    return skipCoreProcessing;
+  }
+
+
+
+  /**
    * Retrieves a string representation of this post-response plugin
    * result.
    *
@@ -176,6 +231,8 @@
     buffer.append(continuePluginProcessing);
     buffer.append(", sendResponseImmediately=");
     buffer.append(sendResponseImmediately);
+    buffer.append(", skipCoreProcessing=");
+    buffer.append(skipCoreProcessing);
     buffer.append(")");
   }
 }

--
Gitblit v1.10.0