Module com.aoapps.appcluster.core
Package com.aoapps.appcluster
Class ResourceSynchronizer<R extends Resource<R,N>,N extends ResourceNode<R,N>>
java.lang.Object
com.aoapps.appcluster.ResourceSynchronizer<R,N>
- Direct Known Subclasses:
CronResourceSynchronizer
public abstract class ResourceSynchronizer<R extends Resource<R,N>,N extends ResourceNode<R,N>>
extends Object
Each resource has one synchronizer between it and any other node for the
resource.
Every resource type should support testing. The test should ensure point-in-time consistency between two nodes as much as possible.
Resources are only required to support synchronization when is a master. They may optionally support synchronization when a slave (such as a csync2 master on a slave node).
- Author:
- AO Industries, Inc.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedResourceSynchronizer(N localResourceNode, N remoteResourceNode) -
Method Summary
Modifier and TypeMethodDescriptionabstract ResourceSynchronizationResultGets the last synchronization result ornullif unavailable.Gets the local resource node.Gets the remote resource node.Gets the synchronization result status.abstract ResourceSynchronizerStategetState()Gets the current synchronization state.abstract StringGets a description of the current state ornullfor no specific message.protected abstract voidstart()Starts the synchronizer.protected abstract voidstop()Stops the synchronizer.abstract voidSchedules an immediate synchronization if possible.toString()
-
Field Details
-
localResourceNode
-
remoteResourceNode
-
-
Constructor Details
-
ResourceSynchronizer
-
-
Method Details
-
toString
-
getLocalResourceNode
Gets the local resource node. -
getRemoteResourceNode
Gets the remote resource node. -
getState
Gets the current synchronization state. -
getStateMessage
Gets a description of the current state ornullfor no specific message. -
synchronizeNow
Schedules an immediate synchronization if possible. -
getLastResult
Gets the last synchronization result ornullif unavailable. -
getResultStatus
Gets the synchronization result status. Considered as STOPPED/DISABLED/STARTING if last result is not available. -
start
protected abstract void start()Starts the synchronizer. -
stop
protected abstract void stop()Stops the synchronizer.
-
