Package ca.carleton.gcrc.couch.app

Examples of ca.carleton.gcrc.couch.app.DocumentDigest


      Document sourceDoc
      ,JSONObject targetDoc
      ) throws Exception {
   
    DigestComputerSha1 digestComputer = new DigestComputerSha1();
    DocumentDigest dd = digestComputer.computeDocumentDigest(sourceDoc);
   
    return computeUpdateSpecifier(
        sourceDoc
        ,dd
        ,targetDoc
View Full Code Here


  public DocumentDigest computeDocumentDigest(Document doc) throws Exception {
    try {
      JSONObject json = doc.getJSONObject();
 
      // Initialize digest
      DocumentDigest dd = new DocumentDigest();
      dd.setType(DIGEST_COMPUTER_TYPE);
   
      // Compute digest of main document
      String mainDigest = this.computeDigestFromJsonObject(json);
      dd.setDocDigest(mainDigest);
     
      // Process each attachment
      Collection<Attachment> attachments = doc.getAttachments();
      if( null != attachments ) {
        for(Attachment attachment : attachments){
          String digest = computeAttachmentDigest(attachment);
          dd.addAttachmentDigest(attachment.getName(), digest);
        }
      }
     
      return dd;
     
View Full Code Here

      Document sourceDoc
      ,JSONObject targetDoc
      ) throws Exception {
   
    DigestComputerSha1 digestComputer = new DigestComputerSha1();
    DocumentDigest dd = digestComputer.computeDocumentDigest(sourceDoc);
   
    return computeUpdateSpecifier(
        sourceDoc
        ,dd
        ,targetDoc
View Full Code Here

  public DocumentDigest computeDocumentDigest(Document doc) throws Exception {
    try {
      JSONObject json = doc.getJSONObject();
 
      // Initialize digest
      DocumentDigest dd = new DocumentDigest();
      dd.setType(DIGEST_COMPUTER_TYPE);
   
      // Compute digest of main document
      String mainDigest = this.computeDigestFromJsonObject(json);
      dd.setDocDigest(mainDigest);
     
      // Process each attachment
      Collection<Attachment> attachments = doc.getAttachments();
      if( null != attachments ) {
        for(Attachment attachment : attachments){
          String digest = computeAttachmentDigest(attachment);
          dd.addAttachmentDigest(attachment.getName(), digest);
        }
      }
     
      return dd;
     
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.couch.app.DocumentDigest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.