com.datastax.driver.core
Interface Host.StateListener

All Known Subinterfaces:
LoadBalancingPolicy
All Known Implementing Classes:
DCAwareRoundRobinPolicy, LatencyAwarePolicy, RoundRobinPolicy, TokenAwarePolicy
Enclosing class:
Host

public static interface Host.StateListener

Interface for listeners that are interested in hosts added, up, down and removed events.

It is possible for the same event to be fired multiple times, particularly for up or down events. Therefore, a listener should ignore the same event if it has already been notified of a node's state.


Method Summary
 void onAdd(Host host)
          Called when a new node is added to the cluster.
 void onDown(Host host)
          Called when a node is determined to be down.
 void onRemove(Host host)
          Called when a node is removed from the cluster.
 void onUp(Host host)
          Called when a node is determined to be up.
 

Method Detail

onAdd

void onAdd(Host host)
Called when a new node is added to the cluster.

The newly added node should be considered up.

Parameters:
host - the host that has been newly added.

onUp

void onUp(Host host)
Called when a node is determined to be up.

Parameters:
host - the host that has been detected up.

onDown

void onDown(Host host)
Called when a node is determined to be down.

Parameters:
host - the host that has been detected down.

onRemove

void onRemove(Host host)
Called when a node is removed from the cluster.

Parameters:
host - the removed host.


Copyright © 2013. All rights reserved.