protected override int GetNodePriorities(Node node, out int secondaryPriority) { RecipientTrackingEvent recipientTrackingEvent = (RecipientTrackingEvent)node.Value; EventDescriptionInformation eventDescriptionInformation; if (!EnumAttributeInfo <EventDescription, EventDescriptionInformation> .TryGetValue((int)recipientTrackingEvent.EventDescription, out eventDescriptionInformation)) { throw new InvalidOperationException(string.Format("Value {0} was not annotated", Names <EventDescription> .Map[(int)recipientTrackingEvent.EventDescription])); } secondaryPriority = EventTree.GetSecondaryPriority(recipientTrackingEvent.BccRecipient, recipientTrackingEvent.HiddenRecipient, string.Equals(recipientTrackingEvent.RootAddress, (string)recipientTrackingEvent.RecipientAddress, StringComparison.OrdinalIgnoreCase)); return(eventDescriptionInformation.EventPriority); }
internal string ToErrorMessage(bool isMultiMessageSearch, out ErrorCodeInformationAttribute errorCodeInfo, out ErrorCode errorCode) { errorCodeInfo = null; string result; if (!EnumValidator <Microsoft.Exchange.InfoWorker.Common.MessageTracking.ErrorCode> .TryParse(this.ErrorCode, EnumParseOptions.Default, out errorCode)) { result = (isMultiMessageSearch ? Strings.TrackingTransientErrorMultiMessageSearch : Strings.TrackingTransientError); } else { if (!EnumAttributeInfo <Microsoft.Exchange.InfoWorker.Common.MessageTracking.ErrorCode, ErrorCodeInformationAttribute> .TryGetValue((int)errorCode, out errorCodeInfo)) { throw new InvalidOperationException(string.Format("{0} not annotated with ErrorCodeInformationAttribute", errorCode)); } result = errorCodeInfo.ErrorFormatter(this, isMultiMessageSearch); } return(result); }
public void GetTimeBudgetRemainingForWSCall(TrackingAuthorityKind authorityKindToConnect, out TimeSpan clientTimeout, out TimeSpan serverTimeout) { TrackingAuthorityKindInformation trackingAuthorityKindInformation; if (EnumAttributeInfo <TrackingAuthorityKind, TrackingAuthorityKindInformation> .TryGetValue((int)authorityKindToConnect, out trackingAuthorityKindInformation)) { int expectedConnectionLatencyMSec = trackingAuthorityKindInformation.ExpectedConnectionLatencyMSec; } int num = (int)Math.Min(this.timer.Elapsed.TotalMilliseconds, 2147483647.0); if (this.timeBudgetAllowed.TotalMilliseconds <= (double)num) { TraceWrapper.SearchLibraryTracer.TraceError <double, int>(this.GetHashCode(), "No time budget remaining. Total budget: {0}, Already used up: {1}", this.timeBudgetAllowed.TotalMilliseconds, num); clientTimeout = TimeSpan.Zero; serverTimeout = TimeSpan.Zero; return; } double val = this.timeBudgetAllowed.TotalMilliseconds - (double)num; int num2 = (int)Math.Min(val, 2147483647.0); if (num2 <= trackingAuthorityKindInformation.ExpectedConnectionLatencyMSec) { TraceWrapper.SearchLibraryTracer.TraceError <int, string, int>(this.GetHashCode(), "Remaining time in budget = {0} is less than connection overhead for Connection-Type: {1}. Overhead = {2}", num2, Names <TrackingAuthorityKind> .Map[(int)authorityKindToConnect], trackingAuthorityKindInformation.ExpectedConnectionLatencyMSec); clientTimeout = TimeSpan.Zero; serverTimeout = TimeSpan.Zero; return; } int num3 = num2 - trackingAuthorityKindInformation.ExpectedConnectionLatencyMSec; clientTimeout = TimeSpan.FromMilliseconds((double)num2); serverTimeout = TimeSpan.FromMilliseconds((double)num3); TraceWrapper.SearchLibraryTracer.TraceError(this.GetHashCode(), "Timeouts calculated based on budget: clientTimeout={0}, serverTimeout={1}, elapsed={2}, total={3}", new object[] { num2, num3, num, this.timeBudgetAllowed.TotalMilliseconds }); }
private MessageTrackingReport FilterReport(MessageTrackingReport report) { if (report == null) { return(report); } if (!this.Identity.IsSender) { report.RecipientAddresses = new SmtpAddress[] { this.trackedUser.SmtpAddress }; report.RecipientDisplayNames = new string[] { this.trackedUser.DisplayName }; } if (report.RecipientTrackingEvents.Length == 0) { return(report); } bool flag = false; List <RecipientTrackingEvent> list = null; RecipientTrackingEvent[] recipientTrackingEvents = report.RecipientTrackingEvents; int i = 0; while (i < recipientTrackingEvents.Length) { RecipientTrackingEvent recipientTrackingEvent = recipientTrackingEvents[i]; if (this.ReportTemplate == ReportTemplate.Summary) { if (this.EventMeetsCriteriaForSummaryReport(recipientTrackingEvent)) { report.IncrementEventTypeCount(recipientTrackingEvent.Status); goto IL_A7; } } else if (this.EventMeetsCriteriaForPathReport(recipientTrackingEvent)) { goto IL_A7; } IL_109: i++; continue; IL_A7: if (flag) { goto IL_109; } if (list != null && (long)list.Count >= (long)((ulong)this.ResultSize.Value)) { flag = true; if (this.ReportTemplate != ReportTemplate.Summary) { break; } goto IL_109; } else { if (list == null) { list = new List <RecipientTrackingEvent>(); } if (this.ResultSize.Value > 0U) { list.Add(recipientTrackingEvent); } if (this.Identity.IsSender || this.ReportTemplate != ReportTemplate.Summary) { goto IL_109; } break; } } if (flag && this.ReportTemplate != ReportTemplate.Summary) { this.WriteWarning(CoreStrings.TrackingWarningTooManyEvents); } if (list == null) { return(null); } if (0 < list.Count && !this.BypassDelegateChecking) { EventDescription eventDescription = EventDescription.Submitted; bool flag2 = false; if (!this.Identity.IsSender) { eventDescription = ((this.ReportTemplate == ReportTemplate.Summary) ? list[0].EventDescriptionEnum : list[list.Count - 1].EventDescriptionEnum); flag2 = true; } else if (ReportTemplate.RecipientPath == this.ReportTemplate) { eventDescription = list[list.Count - 1].EventDescriptionEnum; flag2 = true; } EventDescriptionInformation eventDescriptionInformation; if (!EnumAttributeInfo <EventDescription, EventDescriptionInformation> .TryGetValue((int)eventDescription, out eventDescriptionInformation)) { throw new InvalidOperationException(string.Format("Value {0} was not annotated", eventDescription)); } if (flag2 && eventDescriptionInformation.IsTerminal) { this.getMessageTrackingReport.Errors.ResetAllErrors(); } } report.RecipientTrackingEvents = list.ToArray(); return(report); }