Package de.caluga.morphium.replicaset
Class RSMonitor
- java.lang.Object
-
- de.caluga.morphium.replicaset.RSMonitor
-
public class RSMonitor extends Object
Used in a Thread or executor. Checks for the replicaset status periodically. Used in order to get number of currently active nodes and their state
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(ReplicasetStatusListener lst)voidexecute()ReplicaSetStatusgetCurrentStatus()ReplicaSetStatusgetReplicaSetStatus(boolean full)get the current replicaset status - issues the replSetGetStatus command to mongo if full==true, also the configuration is read.voidremoveListener(ReplicasetStatusListener lst)voidstart()voidterminate()
-
-
-
Constructor Detail
-
RSMonitor
public RSMonitor(Morphium morphium)
-
-
Method Detail
-
start
public void start()
-
addListener
public void addListener(ReplicasetStatusListener lst)
-
removeListener
public void removeListener(ReplicasetStatusListener lst)
-
terminate
public void terminate()
-
execute
public void execute()
-
getReplicaSetStatus
public ReplicaSetStatus getReplicaSetStatus(boolean full)
get the current replicaset status - issues the replSetGetStatus command to mongo if full==true, also the configuration is read. This method is called with full==false for every write in case a Replicaset is configured to find out the current number of active nodes- Parameters:
full- - if true- return full status- Returns:
- status
-
getCurrentStatus
public ReplicaSetStatus getCurrentStatus()
-
-