// Token: 0x0600015D RID: 349 RVA: 0x000096D0 File Offset: 0x000078D0
        private string GetCacheDataAsStringForTracing()
        {
            string        value         = "-------------------------------------";
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine(value);
            stringBuilder.AppendLine("DiscoveryHoldQueryCache:" + ExDateTime.UtcNow);
            lock (this.cacheLock)
            {
                foreach (OrganizationId organizationId in this.allInPlaceHoldConfiguration.Keys)
                {
                    stringBuilder.AppendLine(value);
                    stringBuilder.AppendLine("OrganizationId" + organizationId);
                    Dictionary <string, InPlaceHoldConfiguration> dictionary = this.allInPlaceHoldConfiguration[organizationId];
                    foreach (string text in dictionary.Keys)
                    {
                        stringBuilder.AppendLine("InPlaceHoldIdentity:" + text);
                        InPlaceHoldConfiguration inPlaceHoldConfiguration = dictionary[text];
                        stringBuilder.AppendLine("In-place hold configuration: " + inPlaceHoldConfiguration.Name);
                    }
                }
            }
            stringBuilder.AppendLine(value);
            return(stringBuilder.ToString());
        }
        // Token: 0x0600014D RID: 333 RVA: 0x00008A6C File Offset: 0x00006C6C
        private bool VerifyHoldPolicy(InPlaceHoldConfiguration inPlaceHoldConfiguration, IExchangePrincipal mailboxOwner, int maxQueryLengthLimit, ref int queryLength)
        {
            bool flag;

            if (!inPlaceHoldConfiguration.IsValid)
            {
                this.LogDiscoveryQueryLoadFailure(mailboxOwner, inPlaceHoldConfiguration.Name, InfoWorkerEventLogConstants.Tuple_CorruptDiscoverySearchObject);
                flag = true;
            }
            else if (inPlaceHoldConfiguration.QueryFilter == null)
            {
                flag = true;
            }
            else
            {
                queryLength += inPlaceHoldConfiguration.QueryString.Length;
                if (queryLength >= maxQueryLengthLimit)
                {
                    this.TraceInformation(string.Format("{0}: This mailbox {1} has exceeded the MaxSearchQueryLengthLimit of {2}. This mailbox will be skipped for discovery hold processing.", this, mailboxOwner, maxQueryLengthLimit));
                    Globals.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_DiscoveryHoldsSkippedForTooManyQueries, null, new object[]
                    {
                        mailboxOwner,
                        maxQueryLengthLimit
                    });
                    flag = true;
                }
                else
                {
                    flag = false;
                }
            }
            return(!flag);
        }
        // Token: 0x06000153 RID: 339 RVA: 0x00008BFC File Offset: 0x00006DFC
        private Dictionary <string, InPlaceHoldConfiguration> LoadInPlaceHoldConfigurationInOrg(OrganizationId orgId, StatisticsLogEntry logEntry)
        {
            this.TraceInformation("Load All hold policy Objects in Organization " + orgId);
            new List <InPlaceHoldConfiguration>();
            DiscoverySearchDataProvider                   discoverySearchDataProvider = new DiscoverySearchDataProvider(orgId);
            IEnumerable <MailboxDiscoverySearch>          all        = discoverySearchDataProvider.GetAll <MailboxDiscoverySearch>();
            Dictionary <string, InPlaceHoldConfiguration> dictionary = new Dictionary <string, InPlaceHoldConfiguration>();

            foreach (MailboxDiscoverySearch mailboxDiscoverySearch in all)
            {
                if (!dictionary.ContainsKey(mailboxDiscoverySearch.InPlaceHoldIdentity))
                {
                    InPlaceHoldConfiguration value = new InPlaceHoldConfiguration(mailboxDiscoverySearch);
                    dictionary.Add(mailboxDiscoverySearch.InPlaceHoldIdentity, value);
                }
            }
            bool flag = false;

            try
            {
                flag = discoverySearchDataProvider.Mailbox.GetConfiguration().MailboxAssistants.UnifiedPolicyHold.Enabled;
            }
            catch (CannotDetermineExchangeModeException)
            {
                this.TraceInformation("Failed to load unifiedHold flight information");
            }
            if (flag)
            {
                try
                {
                    PolicyConfigProvider policyConfigProvider = PolicyConfigProviderManager <ExPolicyConfigProviderManager> .Instance.CreateForProcessingEngine(orgId);

                    if (policyConfigProvider != null)
                    {
                        ExComplianceServiceProvider          exComplianceServiceProvider = new ExComplianceServiceProvider();
                        IEnumerable <PolicyDefinitionConfig> enumerable = policyConfigProvider.FindByName <PolicyDefinitionConfig>("*");
                        if (enumerable != null && exComplianceServiceProvider != null)
                        {
                            foreach (PolicyDefinitionConfig policyDefinitionConfig in enumerable)
                            {
                                string holdId = ExMailboxComplianceItemContainer.GetHoldId(policyDefinitionConfig.Identity);
                                if (policyDefinitionConfig.Mode == Mode.Enforce && policyDefinitionConfig.Scenario == PolicyScenario.Hold)
                                {
                                    IEnumerable <PolicyRuleConfig> enumerable2 = policyConfigProvider.FindByPolicyDefinitionConfigId <PolicyRuleConfig>(policyDefinitionConfig.Identity);
                                    if (enumerable2 == null)
                                    {
                                        continue;
                                    }
                                    using (IEnumerator <PolicyRuleConfig> enumerator3 = enumerable2.GetEnumerator())
                                    {
                                        while (enumerator3.MoveNext())
                                        {
                                            PolicyRuleConfig rule = enumerator3.Current;
                                            if (dictionary.ContainsKey(holdId))
                                            {
                                                this.TraceInformation(string.Format("Hold Id contained twice.  HoldId: {0}", holdId));
                                                break;
                                            }
                                            InPlaceHoldConfiguration value2 = new InPlaceHoldConfiguration(policyDefinitionConfig, rule, exComplianceServiceProvider.GetRuleParser(), DiscoveryHoldQueryCache.Tracer);
                                            dictionary.Add(holdId, value2);
                                        }
                                        continue;
                                    }
                                }
                                this.TraceInformation(string.Format("Hold not loaded. HoldId: {0} Mode: {1} Scenario: {2}", holdId, policyDefinitionConfig.Mode.ToString(), policyDefinitionConfig.Scenario.ToString()));
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    DiscoveryHoldQueryCache.Tracer.TraceDebug <Exception>((long)this.GetHashCode(), "Failed to load hold queries from PolicyConfigProvider.  Exception: {0}", ex);
                    if (logEntry != null)
                    {
                        logEntry.FailedToLoadUnifiedPolicies = ex.Message;
                    }
                }
            }
            return(dictionary);
        }