Esempio n. 1
0
        public override LocalQuery CreateLocalQuery(ClientContext clientContext, DateTime requestCompletionDeadline)
        {
            TraceWrapper.SearchLibraryTracer.TraceError(this.GetHashCode(), "Attempted to create local query in x-forest case.", new object[0]);
            TrackingError          trackingError = new TrackingError(ErrorCode.UnexpectedErrorPermanent, string.Empty, "Local autodiscover query for Cross-Forest disallowed", string.Empty);
            TrackingFatalException ex            = new TrackingFatalException(trackingError, null, false);

            DiagnosticWatson.SendWatsonWithoutCrash(ex, "CreateLocalQuery", TimeSpan.FromDays(1.0));
            throw ex;
        }
Esempio n. 2
0
        public override BaseQuery CreateFromGroup(RecipientData recipientData, BaseQuery[] groupMembers, bool groupCapped)
        {
            TraceWrapper.SearchLibraryTracer.TraceError(this.GetHashCode(), "Attempted to create group query in x-forest case.", new object[0]);
            TrackingError          trackingError = new TrackingError(ErrorCode.UnexpectedErrorPermanent, string.Empty, "Group autodiscover query for Cross-Forest disallowed", string.Empty);
            TrackingFatalException ex            = new TrackingFatalException(trackingError, null, false);

            DiagnosticWatson.SendWatsonWithoutCrash(ex, "CreateFromGroup", TimeSpan.FromDays(1.0));
            throw ex;
        }
Esempio n. 3
0
        // Token: 0x060000F7 RID: 247 RVA: 0x00007404 File Offset: 0x00005604
        public LogSession CreateSession(string name, Version schemaVersion)
        {
            ExTraceGlobals.ServiceTracer.TraceDebug((long)this.GetHashCode(), "MsExchangeLogSearch LogSessionManager CreateSession");
            LogSession result;

            lock (this.sessionLock)
            {
                if (this.stopping)
                {
                    throw new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_SESSION_CANCELED);
                }
                Log log;
                if (!this.logs.TryGetValue(name, out log))
                {
                    throw new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_LOG_UNKNOWN_LOG);
                }
                if (this.sessions.Count == 100)
                {
                    LogSearchException ex            = new LogSearchException(LogSearchErrorCode.LOGSEARCH_E_SERVER_TOO_BUSY);
                    StringBuilder      stringBuilder = new StringBuilder(5300);
                    foreach (KeyValuePair <Guid, LogSession> keyValuePair in this.sessions)
                    {
                        stringBuilder.Append(keyValuePair.Key.ToString("N"));
                        stringBuilder.Append(":");
                        stringBuilder.Append(keyValuePair.Value.LastActivity.ToString("y/M/d:H:m:s"));
                        stringBuilder.Append(",");
                    }
                    ExWatson.AddExtraData(stringBuilder.ToString());
                    DiagnosticWatson.SendWatsonWithoutCrash(ex, "MaxSessionExceeded", TimeSpan.FromDays(1.0));
                    throw ex;
                }
                LogSession logSession = new LogSession(Guid.NewGuid(), log, schemaVersion);
                this.sessions[logSession.Id] = logSession;
                result = logSession;
            }
            return(result);
        }
Esempio n. 4
0
        public List <MessageTrackingLogEntry> ProcessEntries()
        {
            List <MessageTrackingLogEntry> list = new List <MessageTrackingLogEntry>();

            if (this.entriesForMailItem == null || this.entriesForMailItem.Count == 0)
            {
                TraceWrapper.SearchLibraryTracer.TraceDebug(this.GetHashCode(), "No entries for tracker, finishing the tree at this node", new object[0]);
                return(list);
            }
            this.FixupFederatedDeliveryEvents();
            this.entriesForMailItem.Sort((MessageTrackingLogEntry left, MessageTrackingLogEntry right) => this.LogEntryComparer(left, right));
            foreach (MessageTrackingLogEntry messageTrackingLogEntry in this.entriesForMailItem)
            {
                if (!this.ShouldSkipEvent(messageTrackingLogEntry))
                {
                    messageTrackingLogEntry.ProcessedBy = this.tree;
                    MessageTrackingEvent eventId = messageTrackingLogEntry.EventId;
                    if (messageTrackingLogEntry.EventId == MessageTrackingEvent.SUBMIT)
                    {
                        if (messageTrackingLogEntry.RecipientAddresses == null || messageTrackingLogEntry.RecipientAddresses.Length == 0)
                        {
                            messageTrackingLogEntry.RecipientAddresses = MailItemTracker.emptyRecipientList;
                        }
                        if (this.tree.Root != null)
                        {
                            list.Add(messageTrackingLogEntry);
                            return(list);
                        }
                    }
                    bool flag;
                    if (eventId == MessageTrackingEvent.EXPAND || eventId == MessageTrackingEvent.RESOLVE)
                    {
                        string text = messageTrackingLogEntry.RelatedRecipientAddress;
                        if (messageTrackingLogEntry.RecipientAddresses == null || messageTrackingLogEntry.RecipientAddresses.Length == 0)
                        {
                            TraceWrapper.SearchLibraryTracer.TraceDebug(this.GetHashCode(), "No recipients in EXPAND event.  Removing parent from leaf node dictionary.", new object[0]);
                            this.tree.RemoveKeyFromLeafSet(text);
                            continue;
                        }
                        int    num   = messageTrackingLogEntry.RecipientAddresses.Length;
                        Node[] array = new Node[num];
                        for (int i = 0; i < num; i++)
                        {
                            string key  = messageTrackingLogEntry.RecipientAddresses[i];
                            Node   node = new Node(key, text, messageTrackingLogEntry.Clone());
                            array[i] = node;
                        }
                        flag = this.tree.InsertAllChildrenForOneNode(text, array);
                        if (flag && eventId == MessageTrackingEvent.EXPAND && string.IsNullOrEmpty(messageTrackingLogEntry.FederatedDeliveryAddress))
                        {
                            this.tree.DropRecipientDueToPotentialDuplication(text);
                        }
                    }
                    else
                    {
                        if (messageTrackingLogEntry.RecipientAddresses == null || messageTrackingLogEntry.RecipientAddresses.Length == 0)
                        {
                            TraceWrapper.SearchLibraryTracer.TraceError <MessageTrackingLogEntry>(this.GetHashCode(), "A Message Tracking Log Entry of type other than SUBMIT or EXPAND had no recipients: {0}.\n", messageTrackingLogEntry);
                            continue;
                        }
                        bool             entryIsStoreDriverReceiveEvent = eventId == MessageTrackingEvent.RECEIVE && messageTrackingLogEntry.Source == MessageTrackingSource.STOREDRIVER;
                        bool             entryIsAgentReceiveEvent       = eventId == MessageTrackingEvent.RECEIVE && messageTrackingLogEntry.Source == MessageTrackingSource.AGENT;
                        int              num2    = 0;
                        HashSet <string> hashSet = null;
                        if (eventId == MessageTrackingEvent.RECEIVE)
                        {
                            hashSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
                        }
                        for (int j = 0; j < messageTrackingLogEntry.RecipientAddresses.Length; j++)
                        {
                            if (hashSet == null || hashSet.Add(messageTrackingLogEntry.RecipientAddresses[j]))
                            {
                                string text = messageTrackingLogEntry.RecipientAddresses[j];
                                Node   node2;
                                if (eventId == MessageTrackingEvent.REDIRECT)
                                {
                                    node2 = new Node(messageTrackingLogEntry.RelatedRecipientAddress, text, messageTrackingLogEntry.Clone());
                                }
                                else
                                {
                                    node2 = new Node(messageTrackingLogEntry.RecipientAddresses[j], text, messageTrackingLogEntry.Clone());
                                }
                                MessageTrackingLogEntry messageTrackingLogEntry2 = (MessageTrackingLogEntry)node2.Value;
                                this.SetPerRecipientProperties(node2, j, entryIsStoreDriverReceiveEvent, entryIsAgentReceiveEvent);
                                if (this.tree.Insert(node2))
                                {
                                    num2++;
                                }
                            }
                        }
                        flag = (num2 == messageTrackingLogEntry.RecipientAddresses.Length);
                    }
                    if (!flag && ServerCache.Instance.ReportNonFatalBugs)
                    {
                        string extraData = string.Format(CultureInfo.InvariantCulture, "Not all entries can be inserted into the tree. total number of entries is {0}, Message id = {1}, server = {2}", new object[]
                        {
                            this.entriesForMailItem.Count,
                            this.entriesForMailItem[0].MessageId,
                            this.entriesForMailItem[0].Server
                        });
                        DiagnosticWatson.SendWatsonWithoutCrash(new InvalidOperationException(), "RecipInsertFailure", TimeSpan.FromHours(3.0), extraData);
                    }
                    if (messageTrackingLogEntry.IsTerminalEvent)
                    {
                        list.Add(messageTrackingLogEntry);
                    }
                }
            }
            return(list);
        }