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, JobAllocationHandler5.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; } }
public void deleteDocFromSource() { try { bool error; string retMSG; SouceDocDeleted = CouchArchiverDeleteHelper.getInstance().Document_Delete(out retMSG, out error, JobAllocationHandler5.getSourceCouch(), vo.StorageID); } catch (Exception e) { log.Error(string.Format("Document delete failed for {0} source db{1}", storageID, JobAllocationHandler5.getSourceCouch().dbName), e); SouceDocDeleted = false; } }
public string getDocumentFromCouch() { string rDocument = null; try { bool error; string retMSG; rDocument = CouchArchiverGetHelper.getInstance().GetRawDocument(out retMSG, out error, JobAllocationHandler5.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); }