public class InMemoryCacheManager extends Object implements FeatureCacheManager
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CACHENAME
cache name if several caches within memory.
|
static long |
DEFAULT_TTL
Default TTL is one hour.
|
static long |
TO_MILLIS
externalized as constant.
|
| Constructor and Description |
|---|
InMemoryCacheManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove everything present within cache.
|
void |
evict(String featureId)
Remove a feature from cache by its identifier.
|
Feature |
get(String featureId)
Return feature stored in cache.
|
String |
getCacheProviderName()
Get name of expected cache.
|
Object |
getNativeCache()
Access to embedded implementation of cache.
|
long |
getTtl()
Getter accessor for attribute 'ttl'.
|
Set<String> |
listCachedFeatureNames()
List feature names in cache.
|
void |
put(Feature feat)
Add feature to cache.
|
void |
setTtl(long ttl)
Setter accessor for attribute 'ttl'.
|
public static final long DEFAULT_TTL
public static final long TO_MILLIS
public static final String DEFAULT_CACHENAME
public void clear()
clear in interface FeatureCacheManagerpublic void evict(String featureId)
evict in interface FeatureCacheManagerfeatureId - feature identifierpublic void put(Feature feat)
put in interface FeatureCacheManagerfeat - target feature to be cachedpublic Feature get(String featureId)
get in interface FeatureCacheManagerfeatureId - target feature identifierFeatureNotFoundException as FeatureStore).public String getCacheProviderName()
getCacheProviderName in interface FeatureCacheManagerpublic Set<String> listCachedFeatureNames()
listCachedFeatureNames in interface FeatureCacheManagerpublic Object getNativeCache()
getNativeCache in interface FeatureCacheManagerpublic long getTtl()
public void setTtl(long ttl)
ttl - new value for 'ttl 'Copyright © 2013–2015 FF4J. All rights reserved.