Project

General

Profile

« Previous | Next » 

Revision 3230

Added by Jing Tao about 17 years ago

Somehow the change went to the head rather than branch. So i rollback the change in head.

View differences:

MetacatReplication.java
579 579
  {
580 580
    String server = ((String[])params.get("server"))[0]; // the server that
581 581
    String docid = ((String[])params.get("docid"))[0]; // sent the document
582
    String ipAddress = ((String[])params.get("ipAddress"))[0];
583 582
    String dbaction = "UPDATE"; // the default action is UPDATE
584 583
    boolean override = false;
585 584
    int serverCode = 1;
......
654 653
      DocumentImplWrapper wrapper = new DocumentImplWrapper(parserBase, false);
655 654
      wrapper.writeReplication(dbConn, new StringReader(xmldoc), null, null,
656 655
                               dbaction, docid, user, null, homeServer, 
657
                               server, createdDate, updatedDate, ipAddress);
658
      
656
                               server, createdDate, updatedDate);
657

  
659 658
      MetacatReplication.replLog("document " + docid + " added to DB with " +
660 659
                                 "action " + dbaction);
661
      EventLog.getInstance().log(ipAddress, user, docid, dbaction);
662 660
    }//try
663 661
    catch(Exception e)
664 662
    {
......
668 666
                                       e.getMessage());
669 667
      logMetacat.error("ERROR in MetacatReplication.handleForceReplicate" +
670 668
                         "Request(): " + e.getMessage());
671
      
672 669

  
673 670
    }//catch
674 671
    finally
......
687 684
{
688 685
  String server = ((String[])params.get("server"))[0]; // the server that
689 686
  String docid = ((String[])params.get("docid"))[0]; // sent the document
690
  String user = ((String[])params.get("user"))[0];
691
  String ipAddress = ((String[])params.get("ipAddress"))[0];
692 687
  try
693 688
  {
694 689
    MetacatReplication.replLog("force replication delete request from " + server);
695 690
    MetacatReplication.replLog("force replication delete docid " + docid);
696 691
    logMetacat.info("Force replication delete request from: "+ server);
697 692
    logMetacat.info("Force replication delete docid: "+docid);
698
    DocumentImpl.delete(docid, null, null, server, ipAddress);
693
    DocumentImpl.delete(docid, null, null, server);
699 694
    MetacatReplication.replLog("document " + docid + " was successfully deleted ");
700
    EventLog.getInstance().log(ipAddress, user, docid, "delete");
701 695
    logMetacat.info("document " + docid + " was successfully deleted ");
702 696
  }
703 697
  catch(Exception e)
......
730 724
    String server = ((String[])params.get("server"))[0];
731 725
    // the docid should include rev number
732 726
    String docid = ((String[])params.get("docid"))[0];
733
    String ipAddress = ((String[])params.get("ipAddress"))[0];
734 727
    // Make sure there is a docid and server
735 728
    if (docid==null || server==null || server.equals(""))
736 729
    {
......
809 802
        //into file system
810 803
        DocumentImpl.writeDataFileInReplication(url.openStream(), datafilePath,
811 804
                            docName, docType, docid, user,docHomeServer,server, 
812
                            DocumentImpl.DOCUMENTTABLE, false, createdDate, updatedDate, ipAddress);
805
                            DocumentImpl.DOCUMENTTABLE, false, createdDate, updatedDate);
813 806
                            //false means non-timed replication
814 807
     }
815 808

  
......
817 810

  
818 811
    MetacatReplication.replLog("datafile " + docid + " added to DB with " +
819 812
                                 "action " + dbaction);
820
    EventLog.getInstance().log(ipAddress, user, docid, dbaction);
821 813
    }
822 814
    catch(Exception e)
823 815
    {

Also available in: Unified diff