Interface LoadBalancerEventListener

  • All Superinterfaces:
    EventListener

    public interface LoadBalancerEventListener
    extends EventListener
    An object that registers to be notified when an LDAP client associated with a load-balancer changes state from offline to online or vice-versa.

    NOTE 1: Since listeners are prone to race conditions they should only be used for monitoring and alerts. Specifically, an application should not use this mechanism to deduce whether a request can be sent or not. It should send the request and hope for the best.

    NOTE 2: load-balancer implementations must ensure that only one event is sent at a time. Event listener implementations should not need to be thread safe.

    See Also:
    LdapClients.LOAD_BALANCER_EVENT_LISTENER
    • Method Detail

      • handleLdapClientOffline

        void handleLdapClientOffline​(LdapClient client,
                                     LdapException error)
        Invoked when the load-balancer is unable to obtain a connection from the specified LDAP client. The LDAP client will be removed from the load-balancer and monitored periodically in order to determine when it is available again, at which point an online notification event will occur.
        Parameters:
        client - The LDAP client which has failed.
        error - The last error that occurred.
      • handleLdapClientOnline

        void handleLdapClientOnline​(LdapClient client)
        Invoked when the load-balancer detects that a previously offline LDAP client is available for use again.
        Parameters:
        client - The LDAP client which is now available for use.