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.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Notifies this connection event listener that the application has called close on the connection.
    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.
    void
    Notifies this connection event listener that the connection has just received the provided unsolicited notification from the server.
  • Method Details

    • handleConnectionClosed

      void handleConnectionClosed()
      Notifies this connection event listener that the application has called close on the connection. The connection event listener will be notified immediately after the application calls the close method 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 provided LdapException to the application.

      Note: disconnect notifications are treated as fatal connection errors and are handled by this method. In this case isDisconnectNotification will be true and error will contain the result code and any diagnostic information contained in the notification message.

      Parameters:
      isDisconnectNotification - true if the error was triggered by a disconnect notification sent by the server, otherwise false.
      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, LdapException) method.

      Parameters:
      notification - The unsolicited notification.