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, wait
onSessionReady
public void onAdd(@NonNull Node node)
NodeStateListener
The 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 NodeStateListener
public void onUp(@NonNull Node node)
NodeStateListener
NodeState.UP
.onUp
in interface NodeStateListener
public void onDown(@NonNull Node node)
NodeStateListener
NodeState.DOWN
or NodeState.FORCED_DOWN
.onDown
in interface NodeStateListener
public void onRemove(@NonNull Node node)
NodeStateListener
This 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 NodeStateListener
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2017–2024. All rights reserved.