Esempio n. 1
0
        public IConfigurable Read <T>(ObjectId identity) where T : IConfigurable, new()
        {
            AggregationSubscriptionIdentity aggregationSubscriptionIdentity = (AggregationSubscriptionIdentity)identity;

            try
            {
                using (MailboxSession mailboxSession = this.OpenMailboxSession(aggregationSubscriptionIdentity))
                {
                    bool upgradeIfRequired = this.ShouldUpgradeIfRequired();
                    PimAggregationSubscription pimAggregationSubscription = (PimAggregationSubscription)SubscriptionManager.GetSubscription(mailboxSession, aggregationSubscriptionIdentity.SubscriptionId, upgradeIfRequired);
                    PimSubscriptionProxy       pimSubscriptionProxy       = pimAggregationSubscription.CreateSubscriptionProxy();
                    if (this.loadReport)
                    {
                        ReportData reportData = SkippedItemUtilities.GetReportData(aggregationSubscriptionIdentity.SubscriptionId);
                        reportData.Load(mailboxSession.Mailbox.MapiStore);
                        pimSubscriptionProxy.Report = reportData.ToReport();
                    }
                    return(pimSubscriptionProxy);
                }
            }
            catch (LocalizedException ex)
            {
                CommonLoggingHelper.SyncLogSession.LogError((TSLID)1365UL, AggregationTaskUtils.Tracer, "Read: {0} hit exception: {1}.", new object[]
                {
                    aggregationSubscriptionIdentity,
                    ex
                });
            }
            return(null);
        }
Esempio n. 2
0
        private PimSubscriptionProxy[] GetSubscriptions(AggregationSubscriptionQueryFilter queryFilter)
        {
            List <PimSubscriptionProxy>     list             = new List <PimSubscriptionProxy>(3);
            IList <AggregationSubscription> allSubscriptions = this.GetAllSubscriptions();

            if (allSubscriptions != null)
            {
                foreach (AggregationSubscription aggregationSubscription in allSubscriptions)
                {
                    PimAggregationSubscription pimAggregationSubscription = (PimAggregationSubscription)aggregationSubscription;
                    if (queryFilter == null || queryFilter.Match(pimAggregationSubscription))
                    {
                        PimSubscriptionProxy pimSubscriptionProxy = pimAggregationSubscription.CreateSubscriptionProxy();
                        if (this.loadReport && this.reports.ContainsKey(aggregationSubscription.SubscriptionGuid))
                        {
                            pimSubscriptionProxy.Report = this.reports[aggregationSubscription.SubscriptionGuid];
                        }
                        list.Add(pimSubscriptionProxy);
                    }
                }
            }
            return(list.ToArray());
        }