public static IPushNotificationStorage Create(IMailboxSession mailboxSession, IXSOFactory xsoFactory, IOrganizationIdConvertor organizationIdConvertor)
        {
            ArgumentValidator.ThrowIfNull("mailboxSession", mailboxSession);
            ArgumentValidator.ThrowIfNull("xsoFactory", xsoFactory);
            IPushNotificationStorage pushNotificationStorage = PushNotificationStorage.Find(mailboxSession, xsoFactory);

            if (pushNotificationStorage != null)
            {
                return(pushNotificationStorage);
            }
            ArgumentValidator.ThrowIfNull("mailboxSession.MailboxOwner", mailboxSession.MailboxOwner);
            ArgumentValidator.ThrowIfNull("organizationIdConvertor", organizationIdConvertor);
            if (ExTraceGlobals.StorageNotificationSubscriptionTracer.IsTraceEnabled(TraceType.DebugTrace))
            {
                ExTraceGlobals.StorageNotificationSubscriptionTracer.TraceDebug <string>(0L, "PushNotificationStorage.Create: Creating a new Notification Subscription folder for user {0}.", (mailboxSession.MailboxOwner.ObjectId != null) ? mailboxSession.MailboxOwner.ObjectId.ToDNString() : string.Empty);
            }
            StoreObjectId folderId = mailboxSession.CreateDefaultFolder(DefaultFolderType.PushNotificationRoot);
            IFolder       folder   = xsoFactory.BindToFolder(mailboxSession, folderId);

            return(new PushNotificationStorage(folder, PushNotificationStorage.GetTenantId(mailboxSession), xsoFactory));
        }
Exemple #2
0
 public IPushNotificationStorage FindPushNotificationStorage(IMailboxSession session)
 {
     return(PushNotificationStorage.Find(session, this));
 }
 public static IPushNotificationStorage Find(IMailboxSession mailboxSession)
 {
     return(PushNotificationStorage.Find(mailboxSession, XSOFactory.Default));
 }