//List<InputOutputThreadObjectHandler<PSTMsgParser>> outputobjects, InputOutputMessageQueue<PSTMsgParser> inqueue, InputOutputMessageQueue<PSTMsgParser> outqueue) protected override PSTProcessingResult ProcessQueueObjectImplementation() { IPst rdopststore = null; try { Logger.NLogger.Info("PSTFile: {0} EntryID: {1}", this.PSTFile, this.EntryID); #if USE_PSTSTORE rdopststore = this.PstStore; #else rdopststore = new Pst(this.PSTFile); #endif Message rdomail = null; try { rdomail = (Message)rdopststore.OpenMessage(this.EntryID); rdomail.Pst = (Pst)rdopststore; Logger.NLogger.Info("EntryID: {0}", rdomail.EntryID.ToString()); } catch (Exception ex) { Logger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex); } if (rdomail != null) { try { HandleMessage(rdomail, this.ExportDirectory); //, outputobjects, inqueue, outqueue); } catch (Exception ex) { Logger.NLogger.ErrorException("ERROR: HandleMessage", ex); } rdomail.Dispose(); rdomail = null; } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } finally { #if !USE_PSTSTORE if (rdopststore != null) { rdopststore.Dispose(); rdopststore = null; } #endif } foreach (string file in this.OutputFiles) Console.WriteLine(file); PSTProcessingResult result = new PSTProcessingResult() { IsSuccessful = true, Filename = string.Empty}; result.SetProcessingObject<PSTMsgParser>(this); return result; }
protected override PSTProcessingResult ProcessQueueObjectImplementation() { IPst rdopststore = null; try { Logger.NLogger.Info("PSTFile: {0} EntryID: {1}", this.PSTFile, this.EntryID); #if USE_PSTSTORE rdopststore = this.PstStore; #else rdopststore = new Pst(this.PSTFile); #endif Message rdomail = null; try { rdomail = (Message)rdopststore.OpenMessage(this.EntryID); rdomail.Pst = (Pst)rdopststore; Logger.NLogger.Info("EntryID: {0}", rdomail.EntryID.ToString()); } catch (Exception ex) { Logger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex); } if (rdomail != null) { try { } catch (Exception ex) { Logger.NLogger.ErrorException("ERROR: HandleMessage", ex); } rdomail.Dispose(); rdomail = null; } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } finally { #if !USE_PSTSTORE if (rdopststore != null) { rdopststore.Dispose(); rdopststore = null; } #endif } PSTProcessingResult result = new PSTProcessingResult() { IsSuccessful = true, Filename = string.Empty }; result.SetProcessingObject <PSTFolderParser>(this); return(result); }
public void DisposeTest() { string path = string.Empty; // TODO: Initialize to an appropriate value Pst target = new Pst(path); // TODO: Initialize to an appropriate value target.Dispose(); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public override void Process(PSTFileParserData data) { data.WFState.Value = WFState.WFStateFail; try { IPst rdopststore = new Pst(data.DocumentToProcess); foreach (IMessage msg in rdopststore.Messages) { data.OutputDocuments.Add(msg.Node.Value.ToString()); } rdopststore.Dispose(); data.PSTFile = data.DocumentToProcess; } catch (Exception ex) { WFLogger.NLogger.ErrorException(String.Format("Message extraction for PST file: {0} failed.", data.DocumentToProcess), ex); } data.WFState.Value = WFState.WFStateSuccess; }
public override WFState Run() { WFState retval = new WFState(); IPst rdopststore = null; try { retval.Value = WFState.WFStateFail; WFLogger.NLogger.Info("PSTFile={0} NodeID={1}", this.PSTFile, this.FileToProcess); rdopststore = new Pst(this.PSTFile); Message rdomail = null; try { NodeID msgid = Convert.ToUInt32(this.FileToProcess); if (this.ParentMsg != "0") { msgid = Convert.ToUInt32(this.ParentMsg); } rdomail = (Message)rdopststore.OpenMessage(msgid); //this.EntryID); rdomail.Pst = (Pst)rdopststore; rdomail.FolderPath = this.FolderPath; WFLogger.NLogger.Info("EntryID={0}", rdomail.EntryID.ToString()); } catch (Exception ex) { WFLogger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex); } if (rdomail != null) { try { HandleMessage(rdomail, this.ExportDirectory); this.ExportDirectory = this.ExportDirectory + @"\" + this.FileToProcess; retval.Value = WFState.WFStateSuccess; } catch (Exception ex) { WFLogger.NLogger.ErrorException("ERROR: HandleMessage", ex); } rdomail.Dispose(); } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } finally { if (rdopststore != null) { rdopststore.Dispose(); } } return(retval); }
protected override PSTProcessingResult ProcessQueueObjectImplementation() //List<InputOutputThreadObjectHandler<PSTMsgParser>> outputobjects, InputOutputMessageQueue<PSTMsgParser> inqueue, InputOutputMessageQueue<PSTMsgParser> outqueue) { IPst rdopststore = null; try { Logger.NLogger.Info("PSTFile: {0} EntryID: {1}", this.PSTFile, this.EntryID); #if USE_PSTSTORE rdopststore = this.PstStore; #else rdopststore = new Pst(this.PSTFile); #endif Message rdomail = null; try { rdomail = (Message)rdopststore.OpenMessage(this.EntryID); rdomail.Pst = (Pst)rdopststore; Logger.NLogger.Info("EntryID: {0}", rdomail.EntryID.ToString()); } catch (Exception ex) { Logger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex); } if (rdomail != null) { try { HandleMessage(rdomail, this.ExportDirectory); //, outputobjects, inqueue, outqueue); } catch (Exception ex) { Logger.NLogger.ErrorException("ERROR: HandleMessage", ex); } rdomail.Dispose(); rdomail = null; } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } finally { #if !USE_PSTSTORE if (rdopststore != null) { rdopststore.Dispose(); rdopststore = null; } #endif } foreach (string file in this.OutputFiles) { Console.WriteLine(file); } PSTProcessingResult result = new PSTProcessingResult() { IsSuccessful = true, Filename = string.Empty }; result.SetProcessingObject <PSTMsgParser>(this); return(result); }
public override void Process(PSTMsgParserData data) { this.PSTFile = data.PSTFile; // GetProperty<string>("PSTFile", "PSTFileParserData"); this.PSTFile = data.PSTFile; // GetProperty<string>("PSTFile", "PSTFileParserData"); this.ProcessedMsgs.Clear(); this.ParentMsg = "0"; this.SaveAsTypes = data.SaveAsTypes; this.SaveAttachments = data.SaveAttachments; this.SaveEmbeddedMsgs = data.SaveEmbeddedMsgs; this.Pst2MsgCompatible = data.Pst2MsgCompatible; this.OutputFiles = data.OutputDocuments; this.FileToProcess = data.DocumentToProcess; data.WFState.Value = "Fail"; IPst rdopststore = null; try { WFLogger.NLogger.Info("PSTFile={0} NodeID={1}", PSTFile, this.FileToProcess); rdopststore = new Pst(PSTFile); Message rdomail = null; try { NodeID msgid = Convert.ToUInt32(this.FileToProcess); if (this.ParentMsg != "0") { msgid = Convert.ToUInt32(this.ParentMsg); } rdomail = (Message)rdopststore.OpenMessage(msgid); //this.EntryID); rdomail.Pst = (Pst)rdopststore; rdomail.FolderPath = data.FolderPath; WFLogger.NLogger.Info("EntryID={0}", rdomail.EntryID.ToString()); } catch (Exception ex) { WFLogger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex); } if (rdomail != null) { try { HandleMessage(rdomail, data.ExportDirectory); data.ExportDirectory = data.ExportDirectory + @"\" + this.FileToProcess; } catch (Exception ex) { WFLogger.NLogger.ErrorException("ERROR: HandleMessage", ex); } rdomail.Dispose(); } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } finally { if (rdopststore != null) { rdopststore.Dispose(); } } data.WFState.Value = "Succcess"; }
public override WFState Run() { WFState retval = new WFState(); IPst rdopststore = null; try { retval.Value = WFState.WFStateFail; WFLogger.NLogger.Info("PSTFile={0} NodeID={1}", this.PSTFile, this.FileToProcess); rdopststore = new Pst(this.PSTFile); Message rdomail = null; try { NodeID msgid = Convert.ToUInt32(this.FileToProcess); if (this.ParentMsg != "0") msgid = Convert.ToUInt32(this.ParentMsg); rdomail = (Message)rdopststore.OpenMessage(msgid); //this.EntryID); rdomail.Pst = (Pst)rdopststore; rdomail.FolderPath = this.FolderPath; WFLogger.NLogger.Info("EntryID={0}", rdomail.EntryID.ToString()); } catch (Exception ex) { WFLogger.NLogger.ErrorException("ERROR: ProcessQueueObjectImplementation", ex); } if (rdomail != null) { try { HandleMessage(rdomail, this.ExportDirectory); this.ExportDirectory = this.ExportDirectory + @"\" + this.FileToProcess; retval.Value = WFState.WFStateSuccess; } catch (Exception ex) { WFLogger.NLogger.ErrorException("ERROR: HandleMessage", ex); } rdomail.Dispose(); } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } finally { if (rdopststore != null) rdopststore.Dispose(); } return retval; }