public class NodeStateListenerBase extends Object implements NodeStateListener
| Constructor and Description |
|---|
NodeStateListenerBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
onAdd(Node node)
Invoked when a node is first added to the cluster.
|
void |
onDown(Node node)
Invoked when a node's state switches to
NodeState.DOWN or NodeState.FORCED_DOWN. |
void |
onRemove(Node node)
Invoked when a node leaves the cluster.
|
void |
onUp(Node node)
Invoked when a node's state switches to
NodeState.UP. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonSessionReadypublic void onAdd(@NonNull
Node node)
NodeStateListenerThe node is not up yet at this point. NodeStateListener.onUp(Node) will be notified later if the
driver successfully connects to the node (provided that a session is opened and the node is not
ignored), or receives a topology event for it.
This method is not invoked for the contact points provided at initialization. It is however for new nodes discovered during the full node list refresh after the first connection.
onAdd in interface NodeStateListenerpublic void onUp(@NonNull
Node node)
NodeStateListenerNodeState.UP.onUp in interface NodeStateListenerpublic void onDown(@NonNull
Node node)
NodeStateListenerNodeState.DOWN or NodeState.FORCED_DOWN.onDown in interface NodeStateListenerpublic void onRemove(@NonNull
Node node)
NodeStateListenerThis can be triggered by a topology event, or during a full node list refresh if the node is absent from the new list.
onRemove in interface NodeStateListenerpublic void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2017–2025. All rights reserved.