From f24118fad27564bc163fd5c4a2955ca36c73489c Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 12 Oct 2006 15:08:00 +0000
Subject: [PATCH] Update the server code to eliminate the need for a 5-second delay when attempting to terminate a client connection from within an operation plugin. The issue arose when the attempt to terminate the connection tried to cancel the operation that initiated the disconnect, which made it necessary to wait for a 5-second timeout before continuing.
---
opends/src/server/org/opends/server/core/Operation.java | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/core/Operation.java b/opends/src/server/org/opends/server/core/Operation.java
index 443c48d..fc49f53 100644
--- a/opends/src/server/org/opends/server/core/Operation.java
+++ b/opends/src/server/org/opends/server/core/Operation.java
@@ -38,6 +38,7 @@
import org.opends.server.types.CancelRequest;
import org.opends.server.types.CancelResult;
import org.opends.server.types.Control;
+import org.opends.server.types.DisconnectReason;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.OperationType;
@@ -196,6 +197,28 @@
/**
+ * Terminates the client connection being used to process this operation. The
+ * plugin must return a result indicating that the client connection has been
+ * teriminated.
+ *
+ * @param disconnectReason The disconnect reason that provides the generic
+ * cause for the disconnect.
+ * @param sendNotification Indicates whether to try to provide notification
+ * to the client that the connection will be closed.
+ * @param message The message to send to the client. It may be
+ * <CODE>null</CODE> if no notification is to be
+ * sent.
+ * @param messageID The unique identifier associated with the message
+ * to send to the client. It may be -1 if no
+ * notification is to be sent.
+ */
+ public abstract void disconnectClient(DisconnectReason disconnectReason,
+ boolean sendNotification,
+ String message, int messageID);
+
+
+
+ /**
* Retrieves a set of standard elements that should be logged in all requests
* and responses for all types of operations. Each element in the array will
* itself be a two-element array in which the first element is the name of the
--
Gitblit v1.10.0