예제 #1
0
        /// <summary>
        /// Creates datalog entry from record information
        /// </summary>
        /// <param name="record">The record.</param>
        private void CreateDatalogEntry(HpcrArchiveRecord record)
        {
            TraceFactory.Logger.Debug("Send datalog entry for RowIdentifier={0}, StfLogId={1} to {2}"
                                      .FormatWith(record.RowIdentifier, record.StfLogId, GlobalSettings.WcfHosts[WcfService.DataLog]));
            if (!string.IsNullOrEmpty(record.SessionId))
            {
                DigitalSendServerJobLogger log = new DigitalSendServerJobLogger(record.StfLogId);

                log.SessionId     = record.SessionId;
                log.JobType       = record.JobType;
                log.ProcessedBy   = "HPCR";
                log.DeviceModel   = record.DeviceModel;
                log.FileSizeBytes = record.FileSizeBytes;
                log.ScannedPages  = (short)record.ScannedPages;
                log.FileType      = record.FileType;

                log.DssVersion = record.DssVersion.Equals("") ? "Unknown" : record.DssVersion;

                if (record.DateDelivered.HasValue)
                {
                    log.CompletionDateTime = record.DateDelivered.Value;
                    record.StfLogStatus    = StfLogStatus.Completed;
                }
                else
                {
                    record.StfLogStatus    = StfLogStatus.Partial;
                    log.CompletionDateTime = DateTime.Parse("01/01/1800 12:00:00 AM");
                }
                record.StfDigitalSendServerJobId = log.DigitalSendServerJobId;

                log.CompletionStatus = record.FinalStatus;
                log.FileName         = record.DocumentName;
                _dataLogger.Submit(log);
            }
        }
예제 #2
0
        /// <summary>
        /// Creates datalog entry from record information
        /// </summary>
        private void CreateDatalogEntry(DigitalSendServerJobLogger log)
        {
            TraceFactory.Logger.Debug("DSS Log Entry: SessionId={0}, JobId={1}, ProcessedBy={2}, DeviceModel={3}, FileName={4}, FileType={5}, ScannedPages={6}, FileSizeBytes={7}, CompletionDateTime={8}"
                                      .FormatWith(log.SessionId, log.DigitalSendJobId.ToString(), log.ProcessedBy, log.DeviceModel, log.FileName, log.FileType, log.ScannedPages.ToString(), log.FileSizeBytes.ToString(), log.CompletionDateTime.ToString()));

            DataLogger dataLogger = new DataLogger(GlobalSettings.WcfHosts[WcfService.DataLog]);

            if (!string.IsNullOrEmpty(log.SessionId))
            {
                log.CompletionStatus = "Success";
                dataLogger.Submit(log);
            }
        }
예제 #3
0
        /// <summary>
        /// Searches the AutoStore XML file for the DigitalSendServerJob required data
        /// </summary>
        protected virtual void ProcessFile(string filePath, DateTime?createdEventTime = null)
        {
            TraceFactory.Logger.Debug("Found file: {0}".FormatWith(filePath));

            try
            {
                XElement root = XElement.Load(filePath);
                IEnumerable <XElement> xmlData = from el in root.Elements(ParentNodes.JobData)
                                                 select el;

                string autoStoreJobId = GetAttributeValue(xmlData, ChildNodes.JobId);
                Guid   jobId          = Guid.Parse(autoStoreJobId);

                DigitalSendServerJobLogger dssLog = new DigitalSendServerJobLogger(jobId);
                dssLog.ProcessedBy = GetAttributeValue(xmlData, ParentNodes.ServerData, ChildNodes.ServerName);
                dssLog.JobType     = dssLog.ProcessedBy + "-" + GetAttributeValue(xmlData, ChildNodes.FormName);

                dssLog.FileName      = GetAttributeValue(xmlData, ParentNodes.FileData, ChildNodes.FileName);
                dssLog.FileSizeBytes = long.Parse(GetAttributeValue(xmlData, ParentNodes.FileData, ChildNodes.FileSize));
                dssLog.ScannedPages  = short.Parse(GetAttributeValue(xmlData, ParentNodes.FileData, ChildNodes.PageCount));
                dssLog.FileType      = GetAttributeValue(xmlData, ParentNodes.FileData, ChildNodes.FileExt);

                dssLog.DeviceModel = GetAttributeValue(xmlData, ParentNodes.DeviceData, ChildNodes.ModelProduct);
                string endingDT = GetAttributeValue(xmlData, ParentNodes.DeviceData, ChildNodes.DeviceTime);
                int    offset   = GetOffset(endingDT);

                string completionDateTime = GetJobTypeCompletionTime(xmlData, dssLog.JobType);


                dssLog.CompletionDateTime = ParseAutoStoreDateTime(completionDateTime).AddHours(offset);
                dssLog.SessionId          = GetSessionId(dssLog.FileName);

                dssLog.DssVersion = GetAutoStoreVersion();


                _fileNamePath = filePath;

                CreateDatalogEntry(dssLog);
                MoveAutoStoreXmlFile();
            }
            catch (IOException ex)
            {
                LogProcessFileError(filePath, ex);
            }
            catch (FormatException ex)
            {
                LogProcessFileError(filePath, ex);
            }
        }
예제 #4
0
        /// <summary>
        /// Updates a previously made datalog entry with updated completion time and completion status
        /// </summary>
        /// <param name="record">The record.</param>
        private void UpdateDatalogEntry(HpcrArchiveRecord record)
        {
            TraceFactory.Logger.Debug("Update datalog entry for RowIdentifier={0}, StfLogId={1}"
                                      .FormatWith(record.RowIdentifier, record.StfLogId));
            if (!string.IsNullOrEmpty(record.SessionId))
            {
                DigitalSendServerJobLogger log = new DigitalSendServerJobLogger(record.StfLogId);
                log.DigitalSendServerJobId = record.StfDigitalSendServerJobId;
                log.SessionId = record.SessionId;

                if (record.DateDelivered.HasValue)
                {
                    log.CompletionDateTime = record.DateDelivered.Value;
                    log.CompletionStatus   = record.FinalStatus;
                    _dataLogger.Update(log);

                    record.StfLogStatus = StfLogStatus.Completed;
                }
            }
        }