public class RdbmsCoordinationStrategy extends Object implements CoordinationStrategy
| Constructor and Description |
|---|
RdbmsCoordinationStrategy(RdbmsCoordinationDaoImpl rdbmsCoordinationDaoImpl,
Map<String,String> rdbmsCoordinationOptions)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCoordinationListener(RdbmsCoordinationListener rdbmsCoordinationListener)
Method to set listeners expecting notifications regarding changes in the coordinator.
|
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 |
removeCoordinationListener(RdbmsCoordinationListener rdbmsCoordinationListener)
Method to remove a listener set expecting notifications regarding changes in the coordinator.
|
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, Map<String,String> rdbmsCoordinationOptions)
rdbmsCoordinationDaoImpl - the RdbmsCoordinationDaoImpl to use for communication with the databaserdbmsCoordinationOptions - the configuration for RDBMS coordinationpublic 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 CoordinationStrategypublic void addCoordinationListener(RdbmsCoordinationListener rdbmsCoordinationListener)
rdbmsCoordinationListener - a listener to setpublic void removeCoordinationListener(RdbmsCoordinationListener rdbmsCoordinationListener)
rdbmsCoordinationListener - the listener to removeCopyright © 2018 WSO2. All rights reserved.