Ejemplo n.º 1
0
 public void AddDocumentToCouch(string rDocument)
 {
     try
     {
         bool   error;
         string retMSG;
         //  this.targetCouchVO.dbName = vo.TargetCouchDBName;
         SavedDoc       = CouchArchiverAddHelper.getInstance().Document_Add(rDocument, out error, out retMSG, JobAllocationHandlerMain.getTargetCouch(), vo.StorageID, vo.TargetCouchDBName);
         this.storageID = vo.StorageID;
         if (!SavedDoc)
         {
             if (retMSG != null && retMSG.Contains("already exists"))
             {
                 SavedDoc = true;
             }
             log.Error("Add Document failed:" + retMSG);
         }
     }
     catch (Exception e)
     {
         log.Error(string.Format("Save Doc failed for {0} target db{1}", vo.StorageID, vo.TargetCouchDBName), e);
         SavedDoc  = false;
         exception = e.Message;
     }
     finally
     {
         rDocument = null;
     }
 }
Ejemplo n.º 2
0
 public void deleteDocFromSource()
 {
     try
     {
         bool   error;
         string retMSG;
         SouceDocDeleted = CouchArchiverDeleteHelper.getInstance().Document_Delete(out retMSG, out error, JobAllocationHandlerMain.getSourceCouch(), vo.StorageID);
     }
     catch (Exception e)
     {
         log.Error(string.Format("Document delete failed for {0} source db{1}", storageID, JobAllocationHandlerMain.getSourceCouch().dbName), e);
         SouceDocDeleted = false;
     }
 }
Ejemplo n.º 3
0
        public string getDocumentFromCouch()
        {
            string rDocument = null;

            try
            {
                bool   error;
                string retMSG;
                rDocument = CouchArchiverGetHelper.getInstance().GetRawDocument(out retMSG, out error, JobAllocationHandlerMain.getSourceCouch(), vo);
                if (error)
                {
                    GotDoc = false;
                }
                else
                {
                    GotDoc = true;
                }
                exception = retMSG;
            }
            catch (Exception e)
            {
                GotDoc    = false;
                exception = e.Message;
                log.Error(string.Format("Get Doc failed for {0}, archive skipped for {1}", vo.StorageID, vo.DocID), e);
            }
            return(rDocument);
        }