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/LDAPClientContext.java | 64 ++++++++++----------------------
1 files changed, 20 insertions(+), 44 deletions(-)
diff --git a/sdk/src/org/opends/sdk/LDAPClientContext.java b/sdk/src/org/opends/sdk/LDAPClientContext.java
index 878e020..22a2f93 100644
--- a/sdk/src/org/opends/sdk/LDAPClientContext.java
+++ b/sdk/src/org/opends/sdk/LDAPClientContext.java
@@ -38,36 +38,20 @@
/**
- * An LDAP client which has connected to a {@link ServerConnectionFactory}. The
+ * An LDAP client which has connected to a {@link ServerConnectionFactory}. An
* LDAP client context can be used to query information about the client's
* connection such as their network address, as well as managing the state of
* the connection.
*/
public interface LDAPClientContext
{
- /**
- * Registers the provided connection event listener so that it will be
- * notified when the underlying connection is closed by the client, receives
- * an unsolicited notification, or experiences a fatal error.
- * <p>
- * This method provides a event notification mechanism which can be used by
- * asynchronous request handler implementations to detect connection
- * termination.
- *
- * @param listener
- * The listener which wants to be notified when events occur on the
- * underlying connection.
- * @throws NullPointerException
- * If the {@code listener} was {@code null}.
- * @see #isClosed
- */
- void addConnectionEventListener(ConnectionEventListener listener)
- throws NullPointerException;
-
-
/**
* Disconnects the client without sending a disconnect notification.
+ * <p>
+ * <b>Server connections:</b> invoking this method causes
+ * {@link ServerConnection#handleConnectionDisconnected
+ * handleConnectionDisconnected} to be called before this method returns.
*/
void disconnect();
@@ -76,6 +60,10 @@
/**
* Disconnects the client and sends a disconnect notification, if possible,
* containing the provided result code and diagnostic message.
+ * <p>
+ * <b>Server connections:</b> invoking this method causes
+ * {@link ServerConnection#handleConnectionDisconnected
+ * handleConnectionDisconnected} to be called before this method returns.
*
* @param resultCode
* The result code which should be included with the disconnect
@@ -118,39 +106,27 @@
/**
- * Returns {@code true} if the underlying connection is closed by the client,
- * receives an unsolicited notification, or experiences a fatal error.
+ * Returns {@code true} if the underlying connection has been closed as a
+ * result of a client disconnect, a fatal connection error, or a server-side
+ * {@link #disconnect}.
* <p>
* This method provides a polling mechanism which can be used by synchronous
* request handler implementations to detect connection termination.
+ * <p>
+ * <b>Server connections:</b> this method will always return {@code true} when
+ * called from within {@link ServerConnection#handleConnectionClosed
+ * handleConnectionClosed},
+ * {@link ServerConnection#handleConnectionDisconnected
+ * handleConnectionDisconnected}, or
+ * {@link ServerConnection#handleConnectionError handleConnectionError}.
*
- * @return {@code true} if the underlying connection is closed by the client,
- * receives an unsolicited notification, or experiences a fatal error,
- * otherwise {@code false}.
- * @see #addConnectionEventListener
+ * @return {@code true} if the underlying connection has been closed.
*/
boolean isClosed();
/**
- * Removes the provided connection event listener from this client context so
- * that it will no longer be notified when the underlying connection is closed
- * by the application, receives an unsolicited notification, or experiences a
- * fatal error.
- *
- * @param listener
- * The listener which no longer wants to be notified when events
- * occur on the underlying connection.
- * @throws NullPointerException
- * If the {@code listener} was {@code null}.
- */
- void removeConnectionEventListener(ConnectionEventListener listener)
- throws NullPointerException;
-
-
-
- /**
* Sends an unsolicited notification to the client.
*
* @param notification
--
Gitblit v1.10.0