Interface ConnectionEventListener

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void handleConnectionClosed()
      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 handleUnsolicitedNotification​(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 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, org.forgerock.opendj.ldap.LdapException) method.

        Parameters:
        notification - The unsolicited notification.