[metacat-cvs] metacat/src/edu/ucsb/nceas/metacat ReplicationHandler.java

Jing Tao tao at ecoinformatics.org
Tue Nov 1 17:01:21 PST 2005


tao         05/11/01 17:01:21

  Modified:    src/edu/ucsb/nceas/metacat ReplicationHandler.java
  Log:
  Add code to handle replication document in xml_document table.
  
  Revision  Changes    Path
  1.69      +16 -6     metacat/src/edu/ucsb/nceas/metacat/ReplicationHandler.java
  
  Index: ReplicationHandler.java
  ===================================================================
  RCS file: /cvs/metacat/src/edu/ucsb/nceas/metacat/ReplicationHandler.java,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- ReplicationHandler.java	10 Oct 2005 17:50:28 -0000	1.68
  +++ ReplicationHandler.java	2 Nov 2005 01:01:21 -0000	1.69
  @@ -6,9 +6,9 @@
    *    Authors: Chad Berkley
    *    Release: @release@
    *
  - *   '$Author: sgarg $'
  - *     '$Date: 2005/10/10 17:50:28 $'
  - * '$Revision: 1.68 $'
  + *   '$Author: tao $'
  + *     '$Date: 2005/11/02 01:01:21 $'
  + * '$Revision: 1.69 $'
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
  @@ -1012,9 +1012,19 @@
          //local DB, it might be out of date.
          if (localrev == -1)
          {
  -         //insert this document as new because it is not in the local DB
  -         action = "INSERT";
  -         flag = true;
  +          // check if the revision is in the revision table
  +         Vector localRevVector = DBUtil.getRevListFromRevisionTable(docid);
  +         if (localRevVector != null && localRevVector.contains(new Integer(rev)))
  +         {
  +             // this version was deleted, so don't need replicate
  +             flag = false;
  +         }
  +         else
  +         {
  +           //insert this document as new because it is not in the local DB
  +           action = "INSERT";
  +           flag = true;
  +         }
          }
          else
          {
  
  
  


More information about the Metacat-cvs mailing list