Package org.forgerock.opendj.ldap
Interface ConnectionEventListener
-
- All Superinterfaces:
EventListener
public interface ConnectionEventListener extends EventListener
An object that registers to be notified when a connection is closed by the application, receives an unsolicited notification, or experiences a fatal error.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidhandleConnectionClosed()Notifies this connection event listener that the application has calledcloseon the connection.voidhandleConnectionError(boolean isDisconnectNotification, LdapException error)Notifies this connection event listener that a fatal error has occurred and the connection can no longer be used - the server has crashed, for example.voidhandleUnsolicitedNotification(ExtendedResult notification)Notifies this connection event listener that the connection has just received the provided unsolicited notification from the server.
-
-
-
Method Detail
-
handleConnectionClosed
void handleConnectionClosed()
Notifies this connection event listener that the application has calledcloseon the connection. The connection event listener will be notified immediately after the application calls theclosemethod on the associated connection.
-
handleConnectionError
void handleConnectionError(boolean isDisconnectNotification, LdapException error)Notifies this connection event listener that a fatal error has occurred and the connection can no longer be used - the server has crashed, for example. The connection implementation makes this notification just before it throws the providedLdapExceptionto the application.Note: disconnect notifications are treated as fatal connection errors and are handled by this method. In this case
isDisconnectNotificationwill betrueanderrorwill contain the result code and any diagnostic information contained in the notification message.- Parameters:
isDisconnectNotification-trueif the error was triggered by a disconnect notification sent by the server, otherwisefalse.error- The exception that is about to be thrown to the application.
-
handleUnsolicitedNotification
void handleUnsolicitedNotification(ExtendedResult notification)
Notifies this connection event listener that the connection has just received the provided unsolicited notification from the server.Note: disconnect notifications are treated as fatal connection errors and are handled by the
handleConnectionError(boolean, org.forgerock.opendj.ldap.LdapException)method.- Parameters:
notification- The unsolicited notification.
-
-