protected override IEnumerable <OutlookProtectionRule> Read(IConfigurationSession session) { ADPagedReader <TransportRule> adpagedReader = session.FindPaged <TransportRule>(PerTenantProtectionRulesCollection.GetProtectionRuleContainerId(session), QueryScope.SubTree, null, PerTenantProtectionRulesCollection.PriorityOrder, 0); TransportRule[] array = adpagedReader.ReadAllPages(); List <OutlookProtectionRule> list = new List <OutlookProtectionRule>(array.Length); OutlookProtectionRuleParser instance = OutlookProtectionRuleParser.Instance; foreach (TransportRule transportRule in array) { try { list.Add((OutlookProtectionRule)instance.GetRule(transportRule.Xml)); } catch (ParserException ex) { PerTenantProtectionRulesCollection.Tracer.TraceError <ADObjectId, Exception>((long)this.GetHashCode(), "Rule with identity {0} is corrupted and will not be returned to clients. Details: {1}", transportRule.Id, ex); CachedOrganizationConfiguration.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_CorruptOutlookProtectionRule, transportRule.Id.ToString(), new object[] { transportRule.Id, ex }); } } return(list); }
protected override ADNotificationRequestCookie Register(IConfigurationSession session) { return(ADNotificationAdapter.RegisterChangeNotification <TransportRule>(PerTenantProtectionRulesCollection.GetProtectionRuleContainerId(session), new ADNotificationCallback(base.ChangeCallback), session)); }