public class RdbmsCoordinationStrategy extends Object implements CoordinationStrategy, RdbmsMembershipListener
| Constructor and Description |
|---|
RdbmsCoordinationStrategy(RdbmsCoordinationDaoImpl rdbmsCoordinationDaoImpl,
CoordinationConfiguration.RdbmsCoordinationConfiguration rdbmsCoordinationConfiguration)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
coordinatorChanged(String coordinator)
Invoked when the coordinator changes in the cluster.
|
List<NodeDetail> |
getAllNodeDetails()
Retrieve node details of all the nodes.
|
List<String> |
getAllNodeIdentifiers()
Retrieve IDs of all the nodes.
|
String |
getNodeIdentifierOfCoordinator()
Retrieve the node ID of the coordinator node.
|
boolean |
isCoordinator()
Used to query if the current node is the coordinator.
|
void |
memberAdded(String nodeID)
Invoked when a new member is added to the cluster.
|
void |
memberRemoved(String nodeID)
Invoked when an existing member leaves the cluster.
|
void |
start()
Meant to be invoked when the coordination algorithm should start working.
|
void |
stop()
Meant to be invoked when the coordination algorithm should stop working.
|
public RdbmsCoordinationStrategy(RdbmsCoordinationDaoImpl rdbmsCoordinationDaoImpl, CoordinationConfiguration.RdbmsCoordinationConfiguration rdbmsCoordinationConfiguration)
rdbmsCoordinationDaoImpl - the RdbmsCoordinationDaoImpl to use for communication with the databaserdbmsCoordinationConfiguration - the configuration for RDBMS coordinationpublic void memberAdded(String nodeID)
memberAdded in interface RdbmsMembershipListenernodeID - node ID of the new nodepublic void memberRemoved(String nodeID)
memberRemoved in interface RdbmsMembershipListenernodeID - node ID of the removed nodepublic void coordinatorChanged(String coordinator)
coordinatorChanged in interface RdbmsMembershipListenercoordinator - node ID of the new coordinator nodepublic void start()
start in interface CoordinationStrategypublic boolean isCoordinator()
isCoordinator in interface CoordinationStrategypublic String getNodeIdentifierOfCoordinator() throws CoordinationException
getNodeIdentifierOfCoordinator in interface CoordinationStrategyCoordinationExceptionpublic List<String> getAllNodeIdentifiers() throws CoordinationException
getAllNodeIdentifiers in interface CoordinationStrategyCoordinationExceptionpublic List<NodeDetail> getAllNodeDetails() throws CoordinationException
getAllNodeDetails in interface CoordinationStrategyCoordinationExceptionpublic void stop()
stop in interface CoordinationStrategyCopyright © 2017 WSO2. All rights reserved.