com.cloudtran.replicator
Class ReplicatorState

java.lang.Object
  extended by com.cloudtran.replicator.ReplicatorState

public class ReplicatorState
extends Object

This class is available on all members of the cluster. It gives the cluster enabled state, active (i.e. not paused) state, and the memberId of the current replicator.


Field Summary
static boolean canReplicate
          tells whether a node in the Isolator service can act as a replicator.
static Integer INVALID_MEMBER_ID
           
static int maxObjectSize
           
static int maxObjectSizeKb
           
 
Constructor Summary
ReplicatorState()
           
 
Method Summary
static void disable()
          DCConnectionManager calls this if there are no remote DCs configured in 'ct.replicator.remote' config properties
static String getLocalDataCenterName()
           
static Member getReplicatorMember()
           
static Integer getReplicatorMemberId()
           
static Set getReplicatorMemberSet()
           
static boolean isActive()
           
static boolean isEnabled()
          By default, replication is enabled at start of day and then disabled if there are no remote managers defined via 'ct.replicator.remote' in the config properties.
static Integer readReplicatorMemberId()
          Locks the ReplicatorIsolatorSide.REPLICATOR_MEMBER_ID_KEY key on the Isolator cache and then retrieves the current value of that entry, which is the primary replicator's member Id
static void setActive(boolean activeState)
           
static void setReplicatorMember(Member newReplicatorMember)
           
static void updateReplicatorMemberIfNecessary()
          This is called to get the replicator Member and MemberId updated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_MEMBER_ID

public static final Integer INVALID_MEMBER_ID

canReplicate

public static boolean canReplicate
tells whether a node in the Isolator service can act as a replicator. It is only relevant to Isolators and only relevant if 'ct.replicator.enabled' is true.


maxObjectSizeKb

public static int maxObjectSizeKb

maxObjectSize

public static int maxObjectSize
Constructor Detail

ReplicatorState

public ReplicatorState()
Method Detail

setActive

public static void setActive(boolean activeState)

isActive

public static boolean isActive()

getReplicatorMemberId

public static Integer getReplicatorMemberId()

setReplicatorMember

public static void setReplicatorMember(Member newReplicatorMember)

updateReplicatorMemberIfNecessary

public static void updateReplicatorMemberIfNecessary()
This is called to get the replicator Member and MemberId updated. It only does something if there is a problem with a replicator call, and we've internally set the replicatorMemberId to null.

Throws:
RuntimeException - when the replicator is in the process of changing

readReplicatorMemberId

public static Integer readReplicatorMemberId()
Locks the ReplicatorIsolatorSide.REPLICATOR_MEMBER_ID_KEY key on the Isolator cache and then retrieves the current value of that entry, which is the primary replicator's member Id

Returns:
the Coherence member Id of the isolator acting as primary replicator or null if there is currently no primary replicator

getReplicatorMember

public static Member getReplicatorMember()

getReplicatorMemberSet

public static Set getReplicatorMemberSet()

isEnabled

public static boolean isEnabled()
By default, replication is enabled at start of day and then disabled if there are no remote managers defined via 'ct.replicator.remote' in the config properties.

Returns:
true if the replicator service is running or should be started.

disable

public static void disable()
DCConnectionManager calls this if there are no remote DCs configured in 'ct.replicator.remote' config properties


getLocalDataCenterName

public static String getLocalDataCenterName()