Project

General

Profile

« Previous | Next » 

Revision 1040

Added by Jing Tao over 22 years ago

Add a hashtable - server list as a class variable. So programmer have a control to the server list which will be forced to replicate.

View differences:

src/edu/ucsb/nceas/metacat/ForceReplicationHandler.java
54 54
  private String action;
55 55
  private boolean xmlDocument;
56 56
  private boolean dbactionFlag = true;
57
  private Hashtable serverList;
57 58
  
58 59
  
59 60
  /**
......
61 62
   * @param the action that is being performed on the document (either 
62 63
   *        INSERT or UPDATE)
63 64
   */
64
  public ForceReplicationHandler(String docid, String action, boolean xml )
65
  public ForceReplicationHandler(String docid, String action, boolean xml, 
66
                                                          Hashtable server )
65 67
  {
66 68
    this.docid = docid;
67 69
    this.action = action;
68 70
    this.xmlDocument =xml;
71
    this.serverList = server;
69 72
    
70 73
    if(this.action.equals(""))
71 74
    {
......
80 83
  /**
81 84
   * Use this constructor when the action is implied.
82 85
   */
83
  public ForceReplicationHandler(String docid, boolean xml)
86
  public ForceReplicationHandler(String docid, boolean xml, Hashtable server)
84 87
  {
85 88
    this.docid = docid;
86 89
    this.xmlDocument = xml;
87 90
    dbactionFlag = false;
91
    this.serverList = server;
88 92
    btThread = new Thread(this);
89 93
    btThread.setPriority(Thread.MIN_PRIORITY);
90 94
    btThread.start();
......
107 111
      {
108 112
        return;
109 113
      }
110
      Enumeration keys = (ReplicationHandler.buildServerList(conn)).keys();
114
      //Enumeration keys = (ReplicationHandler.buildServerList(conn)).keys();
115
      //Make sure that server list is not empty
116
      if (serverList==null || serverList.isEmpty())
117
      {
118
        return;
119
      }
120
      
121
      Enumeration keys = serverList.keys();
111 122
      //get the list of servers
112 123
      while(keys.hasMoreElements())
113 124
      {

Also available in: Unified diff