edu.ucsb.nceas.metacat.replication

## Class ForceReplicationHandler

- java.lang.Object
- - edu.ucsb.nceas.metacat.replication.ForceReplicationHandler

- All Implemented Interfaces:
    java.lang.Runnable

      public class ForceReplicationHandler
      extends java.lang.Object
      implements java.lang.Runnable

  A class to asyncronously force the replication of each server that has an entry in the xml_replication table. When run, this thread communicates with each server in the list and solicites a read of an updated or newly inserted document with a certain docid.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ForceReplicationHandler(java.lang.String docid, boolean xml, java.lang.String myNotificationServer)` Use this constructor when the action is implied.
    `ForceReplicationHandler(java.lang.String docid, java.lang.String action, boolean xml, java.lang.String myNotificationServer)` Constructor of ForceReplicationHandler

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `run()` Method to send force replication command to other server to get a new or updated docid

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ForceReplicationHandler

          public ForceReplicationHandler(java.lang.String docid,
                                         java.lang.String action,
                                         boolean xml,
                                         java.lang.String myNotificationServer)

      Constructor of ForceReplicationHandler
      Parameters:
        `docid` - the docid to force replicate
        `the` - action that is being performed on the document (either INSERT or UPDATE)
        `xml` - the docid is a xml document or not (data file)
        `notificationServer,` - when a metacat A got forcereplication notification from B, then A will update its record. And A will notification other metacat in its serverlist to update this docid if A is a hub. But we don't want A to notify B again. B is nofitification of A.

    - #### ForceReplicationHandler

          public ForceReplicationHandler(java.lang.String docid,
                                         boolean xml,
                                         java.lang.String myNotificationServer)

      Use this constructor when the action is implied.

  - ### Method Detail

    - #### run

          public void run()

      Method to send force replication command to other server to get a new or updated docid
      Specified by:
        `run` in interface `java.lang.Runnable`

Copyright © 2020 Regents of the University of California. All Rights Reserved.