Package org.forgerock.opendj.ldap
Interface LoadBalancerEventListener
- All Superinterfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final LoadBalancerEventListenerAn event listener implementation which logs events to the LoadBalancingAlgorithm logger.static final LoadBalancerEventListenerAn event listener implementation which ignores all events. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleFailback(LdapClient fromServer, LdapClient toServer) Invoked when the failover load-balancer performs a failback.voidhandleFailover(LdapClient fromServer, LdapClient toServer) Invoked when the failover load-balancer performs a failover.voidhandleLdapClientOffline(LdapClient client, LdapException error) Invoked when the load-balancer is unable to obtain a connection from the specified LDAP client.voidhandleLdapClientOnline(LdapClient client) Invoked when the load-balancer detects that a previously offline LDAP client is available for use again.
-
Field Details
-
LOG_EVENTS
An event listener implementation which logs events to the LoadBalancingAlgorithm logger. This event listener is the default implementation configured using theLdapClients.LOAD_BALANCER_EVENT_LISTENERoption. -
NO_OP
An event listener implementation which ignores all events.
-
-
Method Details
-
handleLdapClientOffline
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
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
Invoked when the failover load-balancer performs a failover.- Parameters:
fromServer- The previous server to which all requests were routedtoServer- The new server to which all requests must be routed
-
handleFailback
Invoked when the failover load-balancer performs a failback.- Parameters:
fromServer- The previous server to which all requests were routedtoServer- The new server to which all requests must be routed
-