/** * Get CacheManager instance * * @param name The name of the Cache * @return CacheManager */ protected CacheManager getCacheManager(String name) { return Caching.getCacheManager(name); }
protected CacheManager getCacheManager() { return Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER); } }
protected Cache getKeyCache() { return Caching.getCacheManager(AppMConstants.API_MANAGER_CACHE_MANAGER). getCache(AppMConstants.KEY_CACHE_NAME); }
/** * get the cache manager * @return */ private static Cache getAppContextVersionConfigCache() { return Caching.getCacheManager(AppMConstants.APP_CONTEXT_VERSION_CACHE_MANAGER) .getCache(AppMConstants.APP_CONTEXT_VERSION_CONFIG_CACHE); }
private Cache getUsageCache() { return Caching.getCacheManager(AppMConstants.USAGE_CACHE_MANAGER) .getCache(AppMConstants.USAGE_CACHE); }
protected Cache getCacheFromCacheManager(String cacheName) { return Caching.getCacheManager( APIConstants.API_MANAGER_CACHE_MANAGER).getCache(cacheName); }
private Cache getUsageConfigCache() { return Caching.getCacheManager(AppMConstants.USAGE_CONFIG_CACHE_MANAGER) .getCache(AppMConstants.USAGE_CONFIG_CACHE); }
protected static Cache getGatewayTokenCache() { Cache cache = null; try { javax.cache.CacheManager manager = Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER); cache = manager.getCache(APIConstants.GATEWAY_TOKEN_CACHE_NAME); } catch (NullPointerException e) { log.error( "Did not found valid API Validation Information cache configuration. " + e.getMessage(), e); } return cache; }
public JCache(URL url) { String type = url.getParameter("jcache"); CacheManager cacheManager = type == null || type.length() == 0 ? Caching.getCacheManager() : Caching.getCacheManager(type); CacheBuilder<Object, Object> cacheBuilder = cacheManager.createCacheBuilder(url.getServiceKey()); this.store = cacheBuilder.build(); }
public JCache(URL url) { String type = url.getParameter("jcache"); CacheManager cacheManager = type == null || type.length() == 0 ? Caching.getCacheManager() : Caching.getCacheManager(type); CacheBuilder<Object, Object> cacheBuilder = cacheManager.createCacheBuilder(url.getServiceKey()); this.store = cacheBuilder.build(); }
public void invalidateOAuthKeys(String consumerKey, String authorizedUser) { Cache cache = Caching.getCacheManager(AppMConstants.API_MANAGER_CACHE_MANAGER).getCache(AppMConstants.KEY_CACHE_NAME); String cacheKey = consumerKey + ":" + authorizedUser; cache.remove(cacheKey); }
public Cache.Entry getValueFromCache(ClaimCacheKey key) { return (Cache.Entry)Caching.getCacheManager(AppMConstants.APP_MANAGER_CACHE_MANAGER).getCache(CLAIM_CACHE_NAME).get(key); }
public void clearCacheEntry(ClaimCacheKey key) { Caching.getCacheManager(AppMConstants.APP_MANAGER_CACHE_MANAGER).getCache(CLAIM_CACHE_NAME).removeAll(); } }
protected String getCachedTenantDomain(String token) { return (String) Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER) .getCache(APIConstants.GATEWAY_TOKEN_CACHE_NAME).get(token); }
protected void removeCacheEntryFromGatewayCache(String key) { Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER).getCache(APIConstants.GATEWAY_TOKEN_CACHE_NAME) .remove(key); }
protected void putInvalidTokenEntryIntoInvalidTokenCache(String cachedToken, String tenantDomain) { Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER).getCache(APIConstants .GATEWAY_INVALID_TOKEN_CACHE_NAME).put(cachedToken, tenantDomain); }
public static Cache<Integer, Policy> getPolicyCache(String name) { CacheManager manager = getCacheManager(); return (manager != null) ? manager.<Integer, Policy>getCache(name) : Caching.getCacheManager().<Integer, Policy>getCache(name); }
public static Cache<Integer, List<Policy>> getPolicyListCache(String name) { CacheManager manager = getCacheManager(); return (manager != null) ? manager.<Integer, List<Policy>>getCache(name) : Caching.getCacheManager().<Integer, List<Policy>>getCache(name); }
public Cache<String, Session> getSessionCache(){ try { CacheBuilder cacheBuilder = Caching.getCacheManager(AppMConstants.GATEWAY_CACHE_MANAGER). createCacheBuilder(AppMConstants.GATEWAY_SESSION_CACHE); return cacheBuilder.setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new CacheConfiguration.Duration(TimeUnit.SECONDS, sessionCacheTimeout)). setExpiry(CacheConfiguration.ExpiryType.ACCESSED, new CacheConfiguration.Duration(TimeUnit.SECONDS, sessionCacheTimeout)). setStoreByValue(false).build(); } catch (CacheException e) { //Cache already exists return Caching.getCacheManager(AppMConstants.GATEWAY_CACHE_MANAGER).getCache(AppMConstants.GATEWAY_SESSION_CACHE); } } }
public Cache<String, String> getSessionIndexMappingCache(){ try { CacheBuilder cacheBuilder = Caching.getCacheManager(AppMConstants.GATEWAY_CACHE_MANAGER). createCacheBuilder(AppMConstants.GATEWAY_SESSION_INDEX_MAPPING_CACHE); return cacheBuilder.setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new CacheConfiguration.Duration(TimeUnit.SECONDS, sessionCacheTimeout)). setExpiry(CacheConfiguration.ExpiryType.ACCESSED, new CacheConfiguration.Duration(TimeUnit.SECONDS, sessionCacheTimeout)). setStoreByValue(false).build(); } catch (CacheException e) { //Cache already exists return Caching.getCacheManager(AppMConstants.GATEWAY_CACHE_MANAGER).getCache(AppMConstants.GATEWAY_SESSION_INDEX_MAPPING_CACHE); } }