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, or when the failover load-balancer performs a failover or a failback.

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 unless they are used by multiple load balancers.

See Also:
  • Field Details

  • Method Details

    • 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.
    • handleFailover

      void handleFailover(LdapClient fromServer, LdapClient toServer)
      Invoked when the failover load-balancer performs a failover.
      Parameters:
      fromServer - The previous server to which all requests were routed
      toServer - The new server to which all requests must be routed
    • handleFailback

      void handleFailback(LdapClient fromServer, LdapClient toServer)
      Invoked when the failover load-balancer performs a failback.
      Parameters:
      fromServer - The previous server to which all requests were routed
      toServer - The new server to which all requests must be routed