public interface Cache
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String key)
check if there is a entry inside the cache that match the given key
|
java.util.List<CacheEntry> |
entries()
Returns a List of entries containing in this cache Each element in the returned list is a CacheEntry.
|
java.util.List<CacheEntry> |
entries(CacheEntryFilter filter)
Returns a list of entries containing in this cache that match the given filter.
|
java.util.List<CacheEntry> |
entries(CacheKeyFilter filter)
Returns a list of entries containing in this cache that match the given filter.
|
CacheEntry |
getCacheEntry(java.lang.String key)
return cache entry that match the key, throws a CacheException when entry does not exist or is stale
|
CacheEntry |
getCacheEntry(java.lang.String key,
CacheEntry defaultValue)
return cache entry that match the key or the defaultValue when entry does not exist
|
Struct |
getCustomInfo()
get all information data available for this cache
|
java.lang.Object |
getValue(java.lang.String key)
return value that match the key, throws a CacheException when entry does not exist or is stale
|
java.lang.Object |
getValue(java.lang.String key,
java.lang.Object defaultValue)
return value that match the key or the defaultValue when entry does not exist
|
long |
hitCount()
how many time was the cache accessed?
|
void |
init(Config config,
java.lang.String cacheName,
Struct arguments)
initialize the cache
|
java.util.List<java.lang.String> |
keys()
Returns a List of the keys contained in this cache.
|
java.util.List<java.lang.String> |
keys(CacheEntryFilter filter)
Returns a List of the keys contained in this cache that match the given filter.
|
java.util.List<java.lang.String> |
keys(CacheKeyFilter filter)
Returns a List of the keys contained in this cache that match the given filter.
|
long |
missCount()
how many time was the cache accessed for a record that does not exist?
|
void |
put(java.lang.String key,
java.lang.Object value,
java.lang.Long idleTime,
java.lang.Long until)
puts a cache entry to the cache, overwrite existing entries that already exists inside the cache with the same key
|
int |
remove(CacheEntryFilter filter)
remove all entries that match the given filter
|
int |
remove(CacheKeyFilter filter)
remove all entries that match the given filter
|
boolean |
remove(java.lang.String key)
remove entry that match this key
|
java.util.List<java.lang.Object> |
values()
Returns a List of values containing in this cache.
|
java.util.List<java.lang.Object> |
values(CacheEntryFilter filter)
Returns a list of values containing in this cache that match the given filter.
|
java.util.List<java.lang.Object> |
values(CacheKeyFilter filter)
Returns a list of values containing in this cache that match the given filter.
|
void init(Config config, java.lang.String cacheName, Struct arguments) throws java.io.IOException
arguments
- configuration argumentsCacheException
java.io.IOException
CacheEntry getCacheEntry(java.lang.String key) throws java.io.IOException
key
- key of the cache entry to getCacheException
java.io.IOException
java.lang.Object getValue(java.lang.String key) throws java.io.IOException
key
- key of the value to getCacheException
java.io.IOException
CacheEntry getCacheEntry(java.lang.String key, CacheEntry defaultValue)
key
- key of the cache entry to getjava.lang.Object getValue(java.lang.String key, java.lang.Object defaultValue)
key
- key of the value to getvoid put(java.lang.String key, java.lang.Object value, java.lang.Long idleTime, java.lang.Long until)
value
- boolean contains(java.lang.String key)
key
- boolean remove(java.lang.String key) throws java.io.IOException
key
- java.io.IOException
int remove(CacheKeyFilter filter) throws java.io.IOException
filter
- java.io.IOException
int remove(CacheEntryFilter filter) throws java.io.IOException
filter
- java.io.IOException
java.util.List<java.lang.String> keys() throws java.io.IOException
java.io.IOException
java.util.List<java.lang.String> keys(CacheKeyFilter filter) throws java.io.IOException
filter
- java.io.IOException
java.util.List<java.lang.String> keys(CacheEntryFilter filter) throws java.io.IOException
filter
- java.io.IOException
java.util.List<java.lang.Object> values() throws java.io.IOException
java.io.IOException
java.util.List<java.lang.Object> values(CacheKeyFilter filter) throws java.io.IOException
java.io.IOException
java.util.List<java.lang.Object> values(CacheEntryFilter filter) throws java.io.IOException
java.io.IOException
java.util.List<CacheEntry> entries() throws java.io.IOException
java.io.IOException
java.util.List<CacheEntry> entries(CacheKeyFilter filter) throws java.io.IOException
java.io.IOException
java.util.List<CacheEntry> entries(CacheEntryFilter filter) throws java.io.IOException
java.io.IOException
long hitCount()
long missCount()
Struct getCustomInfo()