Class ResourceSynchronizer<R extends Resource<R,​RN>,​RN extends ResourceNode<R,​RN>>

  • Direct Known Subclasses:
    CronResourceSynchronizer

    public abstract class ResourceSynchronizer<R extends Resource<R,​RN>,​RN extends ResourceNode<R,​RN>>
    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 Detail

      • localResourceNode

        protected final RN extends ResourceNode<R,​RN> localResourceNode
      • remoteResourceNode

        protected final RN extends ResourceNode<R,​RN> remoteResourceNode
    • Constructor Detail

      • ResourceSynchronizer

        protected ResourceSynchronizer​(RN localResourceNode,
                                       RN remoteResourceNode)
    • Method Detail

      • getLocalResourceNode

        public RN getLocalResourceNode()
        Gets the local resource node.
      • getRemoteResourceNode

        public RN getRemoteResourceNode()
        Gets the remote resource node.
      • getStateMessage

        public abstract String getStateMessage()
        Gets a description of the current state or null for no specific message.
      • synchronizeNow

        public abstract void synchronizeNow​(ResourceSynchronizationMode mode)
        Schedules an immediate synchronization if possible.
      • getResultStatus

        public ResourceStatus 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.