// Token: 0x06000D56 RID: 3414 RVA: 0x000322A4 File Offset: 0x000304A4 internal override void HandlePendingGetTimerCallback(MapiNotificationsLogEvent logEvent) { bool flag = false; ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "ConnectionDroppedEventHandler.HandlePendingGetTimerCallback Begin."); lock (base.SyncRoot) { flag = base.NeedToReinitSubscriptions; } if (flag) { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "ConnectionDroppedEventHandler.HandlePendingGetTimerCallback Need to reinit true."); try { lock (base.SyncRoot) { if (base.NeedToReinitSubscriptions) { base.InitSubscription(); ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "ConnectionDroppedEventHandler.HandlePendingGetTimerCallback Successful reinit ."); } } } catch (Exception) { base.NeedToReinitSubscriptions = true; throw; } } }
internal override void HandleNotificationInternal(Notification notif, MapiNotificationsLogEvent logEvent, object context) { NewMailNotification newMailNotification = notif as NewMailNotification; if (newMailNotification == null) { return; } if (newMailNotification.NewMailItemId == null || newMailNotification.ParentFolderId == null) { ExTraceGlobals.CoreCallTracer.TraceDebug((long)this.GetHashCode(), "notification has a null notifying item id"); return; } StoreObjectId parentFolderId = newMailNotification.ParentFolderId; if (parentFolderId == null || newMailNotification.NewMailItemId == null) { ExTraceGlobals.CoreCallTracer.TraceDebug((long)this.GetHashCode(), "notification has a null notifying item id"); return; } if (!parentFolderId.Equals(this.InboxFolderId)) { return; } NewMailNotificationPayload newMailNotificationPayload = this.BindToItemAndCreatePayload(newMailNotification); if (newMailNotificationPayload != null) { this.newMailNotifier.Payload = newMailNotificationPayload; this.newMailNotifier.PickupData(); } }
// Token: 0x06000D27 RID: 3367 RVA: 0x0003156C File Offset: 0x0002F76C internal override void HandleNotificationInternal(Notification notification, MapiNotificationsLogEvent logEvent, object context) { lock (base.SyncRoot) { if (notification == null) { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "Received NULL notification"); logEvent.NullNotification = true; } else { QueryNotification queryNotification = (QueryNotification)notification; ExTraceGlobals.NotificationsCallTracer.TraceDebug <QueryNotificationType, int>((long)this.GetHashCode(), "CalendarItemNotificationHandler received a notification. Type: {0}. Row length: {1}.", queryNotification.EventType, queryNotification.Row.Length); string itemProperty = RowNotificationHandler.GetItemProperty <string>(queryNotification, 38); if (ObjectClass.IsCalendarItemSeries(itemProperty)) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "CalendarItemNotificationHandler ignored notification for item of class: {0}.", itemProperty); } else if (base.ProcessErrorNotification(queryNotification)) { logEvent.InvalidNotification = true; } else { base.Notifier.AddFolderContentChangePayload(base.FolderId, this.GetPayloadFromNotification(base.FolderId, queryNotification)); base.Notifier.PickupData(); } } } }
private void ProcessKeepAlive(MapiNotificationsLogEvent logEvent) { try { if (!base.IsDisposed) { OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate() { this.HandlePendingGetTimerCallback(logEvent); }); } } catch (GrayException ex) { ExTraceGlobals.NotificationsCallTracer.TraceError <string, string>((long)this.GetHashCode(), "MapiNotificationHandlerBase.KeepAlive for {0} encountered an exception: {1}", base.GetType().Name, ex.ToString()); logEvent.HandledException = ex; } finally { if (this.ShouldLog(logEvent)) { OwaServerTraceLogger.AppendToLog(logEvent); } } }
internal override void HandlePendingGetTimerCallback(MapiNotificationsLogEvent logEvent) { lock (base.SyncRoot) { base.InitSubscription(); } this.newMailNotifier.PickupData(); }
private void KeepAlive(object sender, EventArgs e) { int num = Interlocked.Increment(ref this.connectionAliveTimerCount); if (num % 5 == 0) { MapiNotificationsLogEvent logEvent = new MapiNotificationsLogEvent(this.UserContext.ExchangePrincipal, this.UserContext.Key.ToString(), this, this.EventPrefix + "KeepAlive"); this.ProcessKeepAlive(logEvent); } }
internal override void HandleNotificationInternal(Notification notif, MapiNotificationsLogEvent logEvent, object context) { if (notif == null) { return; } ReminderNotificationPayload reminderNotificationPayload = new ReminderNotificationPayload(true); reminderNotificationPayload.SubscriptionId = base.SubscriptionId; reminderNotificationPayload.Source = MailboxLocation.FromMailboxContext(base.UserContext); this.reminderNotifier.AddGetRemindersPayload(reminderNotificationPayload); this.reminderNotifier.PickupData(); }
// Token: 0x06000D55 RID: 3413 RVA: 0x00032220 File Offset: 0x00030420 internal override void HandleNotificationInternal(Notification notification, MapiNotificationsLogEvent logEvent, object context) { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "ConnectionDroppedEventHandler.HandleNotification Begin."); lock (base.SyncRoot) { base.NeedToReinitSubscriptions = true; } if (this.OnConnectionDropped != null) { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "ConnectionDroppedEventHandler.HandleNotification Call OnConnectionDropped."); this.OnConnectionDropped(notification); } }
// Token: 0x06000DAE RID: 3502 RVA: 0x00033684 File Offset: 0x00031884 internal override void HandlePendingGetTimerCallback(MapiNotificationsLogEvent logEvent) { lock (base.SyncRoot) { base.InitSubscription(); if (base.MissedNotifications) { this.notifier.AddRefreshPayload(); this.notifier.PickupData(); base.MissedNotifications = false; } } }
// Token: 0x06000D11 RID: 3345 RVA: 0x00030838 File Offset: 0x0002EA38 internal override void HandleNotificationInternal(Notification notification, MapiNotificationsLogEvent logEvent, object context) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification row notification received. User: {0}. SubscriptionId: {1}", base.UserContext.PrimarySmtpAddress, base.SubscriptionId); lock (base.SyncRoot) { if (base.IsDisposed_Reentrant) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "RowNotificationHandlerBase.HandleNotificationInternal for {0}: Ignoring notification because we're disposed (reentrant).", base.GetType().Name); } else if (notification == null) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: Received a null Row Notification object for user {0} SubscriptionId: {1}", base.UserContext.PrimarySmtpAddress, base.SubscriptionId); logEvent.NullNotification = true; } else { QueryNotification queryNotification = (QueryNotification)notification; if (this.ProcessErrorNotification(queryNotification)) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: Received a invalid Row Notification object for user {0} SubscriptionId: {1}", base.UserContext.PrimarySmtpAddress, base.SubscriptionId); logEvent.InvalidNotification = true; } else { QueryNotificationType eventType = queryNotification.EventType; switch (eventType) { case QueryNotificationType.QueryResultChanged: ExTraceGlobals.NotificationsCallTracer.TraceDebug <QueryNotificationType, SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: EventType {0}. Calling ProcessQueryResultChangedNotification. user {1} SubscriptionId: {2}", eventType, base.UserContext.PrimarySmtpAddress, base.SubscriptionId); this.ProcessQueryResultChangedNotification(); goto IL_1EE; case QueryNotificationType.RowAdded: case QueryNotificationType.RowDeleted: case QueryNotificationType.RowModified: ExTraceGlobals.NotificationsCallTracer.TraceDebug <QueryNotificationType, SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: EventType {0} for user {1} SubscriptionId: {2}", eventType, base.UserContext.PrimarySmtpAddress, base.SubscriptionId); this.notifier.AddFolderContentChangePayload(this.folderId, this.GetPayloadFromNotification(this.folderId, queryNotification)); goto IL_1EE; case QueryNotificationType.Reload: ExTraceGlobals.NotificationsCallTracer.TraceDebug <QueryNotificationType, SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: EventType {0}. Calling ProcessReloadNotification. user {1} SubscriptionId: {2}", eventType, base.UserContext.PrimarySmtpAddress, base.SubscriptionId); this.ProcessReloadNotification(); goto IL_1EE; } ExTraceGlobals.NotificationsCallTracer.TraceDebug <QueryNotificationType, SmtpAddress, string>((long)this.GetHashCode(), "RowNotificationHandler.HandleNotification: EventType {0}. Ignoring. user {1} SubscriptionId: {2}", eventType, base.UserContext.PrimarySmtpAddress, base.SubscriptionId); IL_1EE: this.notifier.PickupData(); } } } }
internal virtual void HandleConnectionDroppedNotification(Notification notification) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "MapiNotificationHandlerBase.HandleConnectionDroppedNotification. Type: {0}", base.GetType().Name); lock (this.syncRoot) { MapiNotificationsLogEvent logEvent = new MapiNotificationsLogEvent(this.UserContext.ExchangePrincipal, this.UserContext.Key.ToString(), this, this.EventPrefix + "HandleConnectionDroppedNotification"); if (!this.IsDisposed_Reentrant) { this.needReinitSubscriptions = true; } if (this.ShouldLog(logEvent)) { OwaServerTraceLogger.AppendToLog(logEvent); } } }
internal override void HandleNotificationInternal(Notification notification, MapiNotificationsLogEvent logEvent, object context) { if (!(notification is QueryNotification)) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress>((long)this.GetHashCode(), "UnseenItemNotificationHandler.HandleNotificationInternal: Received a null QueryNotification object for group {0}", base.UserContext.PrimarySmtpAddress); logEvent.NullNotification = true; return; } lock (base.SyncRoot) { if (!base.IsDisposed) { this.GenerateAndAddGroupNotificationPayload(); } } }
// Token: 0x06000DAD RID: 3501 RVA: 0x000335F0 File Offset: 0x000317F0 internal override void HandleNotificationInternal(Notification notification, MapiNotificationsLogEvent logEvent, object context) { QueryNotification queryNotification = notification as QueryNotification; if (queryNotification == null) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress, string>((long)this.GetHashCode(), "GroupAssociationNotificationHandler.HandleNotificationInternal: Received a null QueryNotification object for user {0} SubscriptionId: {1}", base.UserContext.PrimarySmtpAddress, base.SubscriptionId); logEvent.NullNotification = true; return; } GroupAssociationNotificationPayload payloadFromNotification = this.GetPayloadFromNotification(queryNotification); lock (base.SyncRoot) { this.notifier.AddGroupAssociationNotificationPayload(payloadFromNotification); this.notifier.PickupData(); } }
internal override void HandleNotificationInternal(Notification notif, MapiNotificationsLogEvent logEvent, object context) { if (notif == null) { return; } if ((notif.Type & NotificationType.SearchComplete) != NotificationType.SearchComplete) { ExTraceGlobals.CoreCallTracer.TraceDebug((long)this.GetHashCode(), "notification is not for search complete"); return; } OwaSearchContext localSearchContext = context as OwaSearchContext; if (localSearchContext == null) { ExTraceGlobals.CoreCallTracer.TraceDebug((long)this.GetHashCode(), "notification has not passed in context data"); throw new ArgumentNullException("context"); } ThreadPool.QueueUserWorkItem(delegate(object o) { lock (this.SyncRoot) { if (localSearchContext != this.currentSearchContext) { ExTraceGlobals.CoreCallTracer.TraceDebug((long)this.GetHashCode(), "Not sending search completed notification because the currentSearchContext and the localSearchContext are different"); return; } } SearchNotificationPayload payload = SearchNotificationHandler.SearchPayloadCreator.CreatePayLoad(this.UserContext, localSearchContext); lock (this.SyncRoot) { if (localSearchContext != this.currentSearchContext) { ExTraceGlobals.CoreCallTracer.TraceDebug((long)this.GetHashCode(), "Payload data calculated. Not sending the notification to the client because another search has been triggered"); } else { this.searchNotifier.Payload = payload; this.searchNotifier.PickupData(); } } }, null); }
protected void InitSubscription() { MapiNotificationsLogEvent logEvent = new MapiNotificationsLogEvent(this.UserContext.ExchangePrincipal, this.UserContext.Key.ToString(), this, this.EventPrefix + "InitSubscription"); if (this.IsDisposed_Reentrant) { return; } try { this.userContext.LockAndReconnectMailboxSession(3000); this.NeedRefreshPayload = false; if (this.NeedToReinitSubscriptions) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <Type>((long)this.GetHashCode(), "MapiNotificationHandlerBase.InitSubscription need to cleanup subscription before reinit for type: {0}", base.GetType()); this.CleanupSubscriptions(); this.NeedRefreshPayload = true; } if (this.Subscription == null) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <Type, SmtpAddress>((long)this.GetHashCode(), "Notification Handler type: {0} needs to init subscriptions. User: {1}", base.GetType(), this.UserContext.PrimarySmtpAddress); if (this.QueryResult != null) { MapiNotificationHandlerBase.DisposeXSOObjects(this.QueryResult, this.UserContext); } this.QueryResult = null; this.InitSubscriptionInternal(); ExTraceGlobals.NotificationsCallTracer.TraceDebug <Type>((long)this.GetHashCode(), "MapiNotificationHandlerBase.InitSubscription subscription successfully initialized for type: {0}", base.GetType()); } this.NeedToReinitSubscriptions = false; } finally { if (this.userContext.MailboxSessionLockedByCurrentThread()) { this.userContext.UnlockAndDisconnectMailboxSession(); } if (this.ShouldLog(logEvent)) { OwaServerTraceLogger.AppendToLog(logEvent); } } }
internal override void HandlePendingGetTimerCallback(MapiNotificationsLogEvent logEvent) { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "HierarchyNotificationHandler.HandlePendingGetTimerCallback Start"); lock (base.SyncRoot) { base.InitSubscription(); if (base.MissedNotifications) { base.NeedRefreshPayload = true; } base.MissedNotifications = false; } if (base.NeedRefreshPayload) { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "HierarchyNotificationHandler.HandlePendingGetTimerCallback NeedRefreshPayload"); this.hierarchyNotifier.AddRefreshPayload(base.SubscriptionId); base.NeedRefreshPayload = false; } this.hierarchyNotifier.PickupData(); }
internal override void HandlePendingGetTimerCallback(MapiNotificationsLogEvent logEvent) { lock (base.SyncRoot) { base.InitSubscription(); if (base.MissedNotifications) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "UnseenItemNotificationHandler.HandlePendingGetTimerCallback this.MissedNotifications == true. SubscriptionId: {0}", base.SubscriptionId); base.NeedRefreshPayload = true; } if (base.NeedRefreshPayload) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "UnseenItemNotificationHandler.HandlePendingGetTimerCallback NeedRefreshPayload. SubscriptionId: {0}", base.SubscriptionId); this.GenerateAndAddGroupNotificationPayload(); base.NeedRefreshPayload = false; } ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "UnseenItemNotificationHandler.HandlePendingGetTimerCallback setting this.MissedNotifications = false. SubscriptionId: {0}", base.SubscriptionId); base.MissedNotifications = false; } }
internal override void HandleNotificationInternal(Notification notif, MapiNotificationsLogEvent logEvent, object context) { ExTraceGlobals.CoreCallTracer.TraceDebug <SmtpAddress>((long)this.GetHashCode(), "HierarchyNotificationHandler.HandleNotification Hierarchy notification received. User: {0}", base.UserContext.PrimarySmtpAddress); lock (base.SyncRoot) { QueryNotification queryNotification = notif as QueryNotification; if (queryNotification == null) { ExTraceGlobals.CoreCallTracer.TraceDebug <SmtpAddress>((long)this.GetHashCode(), "HierarchyNotificationHandler.HandleNotification: Received a null Hierarchy Notification object for user {0}", base.UserContext.PrimarySmtpAddress); logEvent.NullNotification = true; } else if (queryNotification.Row.Length < this.querySubscriptionProperties.Length) { ExTraceGlobals.CoreCallTracer.TraceDebug <SmtpAddress>((long)this.GetHashCode(), "HierarchyNotificationHandler.HandleNotification: Received an incomplete Hierarchy Notification object for user {0}", base.UserContext.PrimarySmtpAddress); logEvent.InvalidNotification = true; } else { switch (queryNotification.EventType) { case QueryNotificationType.QueryResultChanged: case QueryNotificationType.Reload: this.hierarchyNotifier.AddRefreshPayload(base.SubscriptionId); ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress>((long)this.GetHashCode(), "HierarchyNotificationHandler.HandleNotification: Hierarchy notification refresh payload for user: {0}", base.UserContext.PrimarySmtpAddress); break; case QueryNotificationType.Error: this.hierarchyNotifier.AddRefreshPayload(base.SubscriptionId); ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress>((long)this.GetHashCode(), "HierarchyNotificationHandler.HandleNotification: Error in Hierarchy Notification, Type is QueryNotificationType.Error, user: {0}", base.UserContext.PrimarySmtpAddress); break; case QueryNotificationType.RowAdded: case QueryNotificationType.RowDeleted: case QueryNotificationType.RowModified: this.ProcessHierarchyNotification(queryNotification); break; } this.hierarchyNotifier.PickupData(); } } }
internal override void HandlePendingGetTimerCallback(MapiNotificationsLogEvent logEvent) { lock (base.SyncRoot) { base.InitSubscription(); if (base.MissedNotifications) { base.NeedRefreshPayload = true; } base.MissedNotifications = false; } if (base.NeedRefreshPayload) { ReminderNotificationPayload reminderNotificationPayload = new ReminderNotificationPayload(true); reminderNotificationPayload.SubscriptionId = base.SubscriptionId; reminderNotificationPayload.Source = MailboxLocation.FromMailboxContext(base.UserContext); this.reminderNotifier.AddGetRemindersPayload(reminderNotificationPayload); base.NeedRefreshPayload = false; } this.reminderNotifier.PickupData(); }
internal void HandleNotification(Notification notification, object context) { MapiNotificationsLogEvent logEvent = new MapiNotificationsLogEvent(this.UserContext.ExchangePrincipal, this.UserContext.Key.ToString(), this, this.EventPrefix + "HandleNotification"); try { if (base.IsDisposed) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "MapiNotificationHandlerBase.HandleNotification for {0}: Ignoring notification because we're disposed.", base.GetType().Name); } else if (this.MissedNotifications) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "MapiNotificationHandlerBase.HandleNotification for {0}: Ignoring notification because we've missed notifications.", base.GetType().Name); } else if (this.NeedToReinitSubscriptions) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "MapiNotificationHandlerBase.HandleNotification for {0}: Ignoring notification because we need to re-init subscription.", base.GetType().Name); } else { OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate() { this.HandleNotificationInternal(notification, logEvent, context); }); } } catch (GrayException ex) { ExTraceGlobals.NotificationsCallTracer.TraceError <string, string>((long)this.GetHashCode(), "MapiNotificationHandlerBase.HandleNotification for {0} encountered an exception: {1}", base.GetType().Name, ex.ToString()); logEvent.HandledException = ex; this.MissedNotifications = true; } finally { if (this.ShouldLog(logEvent)) { OwaServerTraceLogger.AppendToLog(logEvent); } } }
// Token: 0x06000D12 RID: 3346 RVA: 0x00030A68 File Offset: 0x0002EC68 internal override void HandlePendingGetTimerCallback(MapiNotificationsLogEvent logEvent) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "RowNotificationHandler.HandlePendingGetTimerCallback Start. SubscriptionId: {0}", base.SubscriptionId); lock (base.SyncRoot) { base.InitSubscription(); if (base.MissedNotifications) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "RowNotificationHandler.HandlePendingGetTimerCallback this.MissedNotifications == true. SubscriptionId: {0}", base.SubscriptionId); base.NeedRefreshPayload = true; } ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "RowNotificationHandler.HandlePendingGetTimerCallback setting this.MissedNotifications = false. SubscriptionId: {0}", base.SubscriptionId); base.MissedNotifications = false; } if (base.NeedRefreshPayload) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "RowNotificationHandler.HandlePendingGetTimerCallback NeedRefreshPayload. SubscriptionId: {0}", base.SubscriptionId); this.AddFolderRefreshPayload(); logEvent.RefreshPayloadSent = true; ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "RowNotificationHandler.HandlePendingGetTimerCallback setting this.NeedRefreshPayload = false, since we have called AddFolderRefresshPayload. SubscriptionId: {0}", base.SubscriptionId); base.NeedRefreshPayload = false; } this.notifier.PickupData(); }
internal abstract void HandleNotificationInternal(Notification notif, MapiNotificationsLogEvent logEvent, object context);
internal abstract void HandlePendingGetTimerCallback(MapiNotificationsLogEvent logEvent);
internal override void HandlePendingGetTimerCallback(MapiNotificationsLogEvent logEvent) { }
private bool ShouldLog(MapiNotificationsLogEvent logEvent) { return(this.verboseLoggingEnabled || logEvent.HandledException != null || base.IsDisposed); }
private void RemoteKeepAlive(object sender, EventArgs e) { MapiNotificationsLogEvent logEvent = new MapiNotificationsLogEvent(this.UserContext.ExchangePrincipal, this.UserContext.Key.ToString(), this, this.EventPrefix + "RemoteKeepAlive"); this.ProcessKeepAlive(logEvent); }