public static void Register(string key, string role, OrganizationCache.LoadHandler loader, bool skuMatch = true, OrganizationCacheExpirationType expiration = OrganizationCacheExpirationType.Default, TimeSpan?customExpireTime = null)
 {
     lock (OrganizationCache.definitionStore)
     {
         OrganizationCache.RegisterImpl(key, role, loader, skuMatch, expiration, customExpireTime);
     }
 }
        public static T GetValue <T>(string key)
        {
            T result;

            OrganizationCache.TryGetValue <T>(key, out result);
            return(result);
        }
        static OrganizationCache()
        {
            int num = 0;

            if (!int.TryParse(ConfigurationManager.AppSettings["OrgCacheLifetimeInMinute"], out num))
            {
                num = 30;
            }
            else if (num < 15)
            {
                num = 15;
            }
            OrganizationCache.orgCacheLifeTime = new TimeSpan(0, num, 0);
            OrganizationCache.RegisterImpl("EntHasTargetDeliveryDomain", "Get-RemoteDomain", new OrganizationCache.LoadHandler(OrganizationCache.LoadTargetDeliveryDomain), !Util.IsDataCenter, OrganizationCacheExpirationType.Default, null);
            OrganizationCache.RegisterImpl("EntTargetDeliveryDomain", "Get-RemoteDomain", new OrganizationCache.LoadHandler(OrganizationCache.LoadTargetDeliveryDomain), !Util.IsDataCenter, OrganizationCacheExpirationType.Default, null);
            OrganizationCache.RegisterImpl("CrossPremiseUrlFormat", "ControlPanelAdmin", new OrganizationCache.LoadHandler(OrganizationCache.LoadCrossPremiseUrl), !Util.IsDataCenter, OrganizationCacheExpirationType.Never, null);
            OrganizationCache.RegisterImpl("CrossPremiseServer", "ControlPanelAdmin", new OrganizationCache.LoadHandler(OrganizationCache.LoadCrossPremiseUrl), !Util.IsDataCenter, OrganizationCacheExpirationType.Never, null);
            OrganizationCache.RegisterImpl("CrossPremiseUrlFormatWorldWide", "ControlPanelAdmin", new OrganizationCache.LoadHandler(OrganizationCache.LoadCrossPremiseUrl), !Util.IsDataCenter, OrganizationCacheExpirationType.Never, null);
            OrganizationCache.RegisterImpl("CrossPremiseServerWorldWide", "ControlPanelAdmin", new OrganizationCache.LoadHandler(OrganizationCache.LoadCrossPremiseUrl), !Util.IsDataCenter, OrganizationCacheExpirationType.Never, null);
            OrganizationCache.RegisterImpl("CrossPremiseUrlFormatGallatin", "ControlPanelAdmin", new OrganizationCache.LoadHandler(OrganizationCache.LoadCrossPremiseUrl), !Util.IsDataCenter, OrganizationCacheExpirationType.Never, null);
            OrganizationCache.RegisterImpl("CrossPremiseServerGallatin", "ControlPanelAdmin", new OrganizationCache.LoadHandler(OrganizationCache.LoadCrossPremiseUrl), !Util.IsDataCenter, OrganizationCacheExpirationType.Never, null);
            OrganizationCache.RegisterImpl("ServiceInstance", "ControlPanelAdmin", new OrganizationCache.LoadHandler(OrganizationCache.LoadCrossPremiseServiceInstance), !Util.IsDataCenter, OrganizationCacheExpirationType.Never, null);
            OrganizationCache.RegisterImpl("RestrictIOCToSP1OrGreaterWorldWide", "ControlPanelAdmin", new OrganizationCache.LoadHandler(OrganizationCache.LoadRestrictIOCToSP1OrGreater), !Util.IsDataCenter, OrganizationCacheExpirationType.Never, null);
            OrganizationCache.RegisterImpl("RestrictIOCToSP1OrGreaterGallatin", "ControlPanelAdmin", new OrganizationCache.LoadHandler(OrganizationCache.LoadRestrictIOCToSP1OrGreater), !Util.IsDataCenter, OrganizationCacheExpirationType.Never, null);
            OrganizationCache.RegisterImpl("DCIsDirSyncRunning", "HybridAdmin", new OrganizationCache.LoadHandler(OrganizationCache.LoadDCIsDirSyncRunning), Util.IsMicrosoftHostedOnly, OrganizationCacheExpirationType.Default, null);
        }
Example #4
0
        public sealed override bool?TryIsInRole(ExchangeRunspaceConfiguration rbacConfiguration)
        {
            T    t;
            bool flag  = OrganizationCache.TryGetValue <T>(this.key, out t);
            bool value = flag && ((this.predicate != null) ? this.predicate(t) : ((bool)((object)t)));

            return(new bool?(value));
        }