Exemplo n.º 1
0
        private void Initialize(string cacheServiceAddress, int maxCacheSize, int purgeIntervalMinutes)
        {
            _apiBaseUrl = cacheServiceAddress;

            _purgeInterval = TimeSpan.FromMinutes(purgeIntervalMinutes);

            _internalCache = new DefaultTokenReplayCache(maxCacheSize, _purgeInterval != TimeSpan.Zero ? _purgeInterval : DefaultTokenReplayCache.DefaultTokenReplayCachePurgeInterval);
        }
Exemplo n.º 2
0
        private void Initialize(string cacheServiceAddress, int maxCacheSize, int purgeIntervalMinutes)
        {
            cache = new bUtility.TokenCache.Implementation.DistributedTokenReplayCache(
                () => { return(new PersistentLib.SqlServerFactory(cacheServiceAddress)); });

            _purgeInterval = TimeSpan.FromMinutes(purgeIntervalMinutes);

            _internalCache = new DefaultTokenReplayCache(maxCacheSize, _purgeInterval != TimeSpan.Zero ? _purgeInterval : DefaultTokenReplayCache.DefaultTokenReplayCachePurgeInterval);
        }
Exemplo n.º 3
0
        private void Initialize(string cacheServiceAddress, int maxCacheSize, int purgeIntervalMinutes, int servicePointConnectionLimit, int httpClientTimeoutMsecs)
        {
            _apiBaseUrl = cacheServiceAddress;

            _purgeInterval = TimeSpan.FromMinutes(purgeIntervalMinutes);

            _internalCache = new DefaultTokenReplayCache(maxCacheSize, _purgeInterval != TimeSpan.Zero ? _purgeInterval : DefaultTokenReplayCache.DefaultTokenReplayCachePurgeInterval);

            _httpClient = HttpClientHelperAsync.CreateHttpClient(cacheServiceAddress, servicePointConnectionLimit, httpClientTimeoutMsecs);
            _httpClient.DefaultRequestHeaders.Clear();
            _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
        }
 public TokenReplayCacheService()
 {
     // these parameters specify 100,000 entries in cache AND a purge interval of 5 minutes.
     // 100,000 is reasonable since only a Hash is stored.
     _internalCache = new DefaultTokenReplayCache(100000, TimeSpan.FromMinutes(5));
 }