Beispiel #1
0
 public static MrsConnectedAccountsNotificationManager Create(MailboxSession mailboxSession, UserContext userContext)
 {
     if (ConnectedAccountsNotificationManagerBase.ShouldSetupNotificationManagerForUser(mailboxSession, userContext) && MrsConnectedAccountsNotificationManager.ShouldSetupNotificationManagerForUser(mailboxSession))
     {
         IExchangePrincipal mailboxOwner = mailboxSession.MailboxOwner;
         ExTraceGlobals.ConnectedAccountsTracer.TraceDebug <Guid, Guid, string>((long)userContext.GetHashCode(), "MrsConnectedAccountsNotificationManager.Create::Setting up ConnectedAccountsNotificationManager for User (MailboxGuid:{0}, MdbGuid:{1}, ServerFullyQualifiedDomainName:{2}).", mailboxOwner.MailboxInfo.MailboxGuid, mailboxOwner.MailboxInfo.GetDatabaseGuid(), mailboxOwner.MailboxInfo.Location.ServerFqdn);
         ISyncNowNotificationClient notificationClient = new MrsSyncNowNotificationClient();
         return(new MrsConnectedAccountsNotificationManager(mailboxOwner.MailboxInfo.MailboxGuid, mailboxOwner.MailboxInfo.GetDatabaseGuid(), mailboxOwner.MailboxInfo.Location.ServerFqdn, notificationClient));
     }
     return(null);
 }
Beispiel #2
0
        internal void SetupMrsNotificationManager(MailboxSession mailboxSession)
        {
            if (!VariantConfiguration.InvariantNoFlightingSnapshot.OwaDeployment.MrsConnectedAccountsSync.Enabled || !ConnectedAccountsConfiguration.Instance.NotificationsEnabled)
            {
                ExTraceGlobals.ConnectedAccountsTracer.TraceDebug((long)this.GetHashCode(), "UserContext.SetupMrsNotificationManager - ConnectedAccountsNotificationManager was not set because no DC or Notifications not enabled.");
                return;
            }
            IConnectedAccountsNotificationManager connectedAccountsNotificationManager = MrsConnectedAccountsNotificationManager.Create(mailboxSession, this);

            if (connectedAccountsNotificationManager != null)
            {
                this.connectedAccountNotificationManagers.Add(connectedAccountsNotificationManager);
            }
        }