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
-
Constructor Summary
ModifierConstructorDescriptionprotected
ResourceSynchronizer
(N localResourceNode, N remoteResourceNode) -
Method Summary
Modifier and TypeMethodDescriptionabstract ResourceSynchronizationResult
Gets the last synchronization result ornull
if unavailable.Gets the local resource node.Gets the remote resource node.Gets the synchronization result status.abstract ResourceSynchronizerState
getState()
Gets the current synchronization state.abstract String
Gets a description of the current state ornull
for no specific message.protected abstract void
start()
Starts the synchronizer.protected abstract void
stop()
Stops the synchronizer.abstract void
Schedules 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 ornull
for no specific message. -
synchronizeNow
Schedules an immediate synchronization if possible. -
getLastResult
Gets the last synchronization result ornull
if 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.
-