private List <PushNotificationServerSubscription> GetPushNotificationSubscriptions(IMailboxSession mailboxSession, SubscriptionItemEnumeratorBase enumerable)
        {
            ArgumentValidator.ThrowIfNull("enumerable", enumerable);
            List <PushNotificationServerSubscription> list = new List <PushNotificationServerSubscription>();

            foreach (IStorePropertyBag propertyBag in enumerable)
            {
                string serializedNotificationSubscription = PushNotificationStorage.GetSerializedNotificationSubscription(mailboxSession, propertyBag, this.xsoFactory);
                list.Add(PushNotificationServerSubscription.FromJson(serializedNotificationSubscription));
            }
            ExTraceGlobals.StorageNotificationSubscriptionTracer.TraceDebug <int>((long)this.GetHashCode(), "PushNotificationStorage.GetPushNotificationSubscriptions: A total {0} subscription items found.", list.Count);
            return(list);
        }
        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));
        }
Пример #3
0
 public IPushNotificationStorage FindPushNotificationStorage(IMailboxSession session)
 {
     return(PushNotificationStorage.Find(session, this));
 }
Пример #4
0
 public IPushNotificationStorage CreatePushNotificationStorage(IMailboxSession session)
 {
     return(PushNotificationStorage.Create(session, this));
 }
        public static IPushNotificationStorage Find(IMailboxSession mailboxSession, IXSOFactory xsoFactory)
        {
            ArgumentValidator.ThrowIfNull("mailboxSession", mailboxSession);
            ArgumentValidator.ThrowIfNull("xsoFactory", xsoFactory);
            StoreObjectId defaultFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.PushNotificationRoot);

            if (defaultFolderId != null)
            {
                return(new PushNotificationStorage(xsoFactory.BindToFolder(mailboxSession, defaultFolderId), PushNotificationStorage.GetTenantId(mailboxSession)));
            }
            return(null);
        }
 public static IPushNotificationStorage Find(IMailboxSession mailboxSession)
 {
     return(PushNotificationStorage.Find(mailboxSession, XSOFactory.Default));
 }
 public static IPushNotificationStorage Create(IMailboxSession mailboxSession, IXSOFactory xsoFactory)
 {
     return(PushNotificationStorage.Create(mailboxSession, xsoFactory, OrganizationIdConvertor.Default));
 }
 internal static PushNotificationStorage GetNotificationFolderRoot(Folder folder)
 {
     return(new PushNotificationStorage(folder, PushNotificationStorage.GetTenantId(folder.Session)));
 }