Exemple #1
0
        public bool AddOrUpdate(ReplayCacheEntry request)
        {
            var rqst     = GetRequest(request);
            var response = new HttpClientHelperAsync(_httpClient).AddOrUpdate(rqst);

            return(response.Payload);
        }
Exemple #2
0
        public bool Remove(string request)
        {
            var rqst     = GetRequest(request);
            var response = new HttpClientHelperAsync(_httpClient).Remove(rqst);

            return(response.Payload);
        }
Exemple #3
0
        public ReplayCacheEntry Get(string request)
        {
            var rqst     = GetRequest(request);
            var response = new HttpClientHelperAsync(_httpClient).Get(rqst);

            return(response.Payload);
        }
Exemple #4
0
        public bool RemoveAllByEndpointId(Endpoint request)
        {
            var rqst     = GetRequest(request);
            var response = new HttpClientHelperAsync(_httpClient).RemoveAllByEndpointId(rqst);

            return(response.Payload);
        }
Exemple #5
0
        public SessionSecurityToken Get(SessionCacheKey request)
        {
            var rqst     = GetRequest(request);
            var response = new HttpClientHelperAsync(_httpClient).Get(rqst);

            return(response.Payload);
        }
Exemple #6
0
        public SessionSecurityToken[] GetAll(Context request)
        {
            var rqst     = GetRequest(request);
            var response = new HttpClientHelperAsync(_httpClient).GetAll(rqst);

            return(response.Payload);
        }
Exemple #7
0
        private static void Initialize(string cacheServiceAddress, int maxCacheSize, string applicationId, int servicePointConnectionLimit, int httpClientTimeoutMsecs)
        {
            _apiBaseUrl    = cacheServiceAddress;
            _internalCache = new RecentlyUsedSessionSecurityTokenCache(maxCacheSize);
            ApplicationId  = applicationId;

            _httpClient = HttpClientHelperAsync.CreateHttpClient(cacheServiceAddress, servicePointConnectionLimit, httpClientTimeoutMsecs);
            _httpClient.DefaultRequestHeaders.Clear();
            _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
        }
Exemple #8
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"));
        }
Exemple #9
0
        internal bool Purge()
        {
            var response = new HttpClientHelperAsync(_httpClient).Purge();

            return(response.Payload);
        }