From 72650d4cc41c64136d064967d7fec3726d850fee Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Thu, 14 Oct 2010 11:52:28 +0000
Subject: [PATCH] Multiple enhancements and bug fixes to the SDK (update from OpenDS by matthew_swift):
---
sdk/src/org/opends/sdk/ServerConnection.java | 43 ++++++++++++++++++++++++++++++++++---------
1 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/sdk/src/org/opends/sdk/ServerConnection.java b/sdk/src/org/opends/sdk/ServerConnection.java
index 950f6dc..b7c560d 100644
--- a/sdk/src/org/opends/sdk/ServerConnection.java
+++ b/sdk/src/org/opends/sdk/ServerConnection.java
@@ -39,9 +39,21 @@
/**
* A handler interface for processing requests from clients.
+ * <p>
+ * Implementations should always return results via the provided
+ * {@code RequestHandler} when processing requests unless otherwise indicated by
+ * the component passing requests to the {@code ServerConnection}. For example,
+ * an {@link LDAPListener} does not require {@code ServerConnection}
+ * implementations to return results, which may be useful when implementing
+ * abandon operation functionality.
+ * <p>
+ * Note that {@code ServerConnection}s may be stacked, and that a lower
+ * {@code ServerConnection} implementation, such as a logger, may require upper
+ * {@code ServerConnection} implementations to always return results.
*
* @param <C>
* The type of request context.
+ * @see ServerConnectionFactory
*/
public interface ServerConnection<C>
{
@@ -137,7 +149,8 @@
* request.
*
* @param requestContext
- * The request context.
+ * The request context which should be ignored if there was no
+ * associated unbind request.
* @param request
* The unbind request, which may be {@code null} if one was not sent
* before the connection was closed.
@@ -147,12 +160,28 @@
/**
+ * Invoked when the server disconnects the client connection, possibly using a
+ * disconnect notification.
+ *
+ * @param resultCode
+ * The result code which was included with the disconnect
+ * notification, or {@code null} if no disconnect notification was
+ * sent.
+ * @param message
+ * The diagnostic message, which may be empty or {@code null}
+ * indicating that none was provided.
+ */
+ void handleConnectionDisconnected(ResultCode resultCode, String message);
+
+
+
+ /**
* Invoked when an error occurs on the connection and it is no longer usable.
*
* @param error
* The exception describing the problem that occurred.
*/
- void handleConnectionException(Throwable error);
+ void handleConnectionError(Throwable error);
@@ -258,11 +287,8 @@
* @param request
* The search request.
* @param resultHandler
- * The handler which should be used to send back the result to the
- * client.
- * @param searchResulthandler
- * The handler which should be used to send back the search result
- * entries and references to the client.
+ * The handler which should be used to send back the search results
+ * to the client.
* @param intermediateResponseHandler
* The handler which should be used to send back any intermediate
* responses to the client.
@@ -270,8 +296,7 @@
* If this server connection does not handle search requests.
*/
void handleSearch(C requestContext, SearchRequest request,
- ResultHandler<? super Result> resultHandler,
- SearchResultHandler searchResulthandler,
+ SearchResultHandler resultHandler,
IntermediateResponseHandler intermediateResponseHandler)
throws UnsupportedOperationException;
}
--
Gitblit v1.10.0