public class CacheComplex extends Object implements Cache
Constructor and Description |
---|
CacheComplex(CacheConnection cc,
Cache cache) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String key)
check if there is a entry inside the cache that match the given key
|
List<CacheEntry> |
entries()
Returns a List of entries containing in this cache Each element in the returned list is a CacheEntry.
|
List<CacheEntry> |
entries(CacheEntryFilter filter)
Returns a list of entries containing in this cache that match the given filter.
|
List<CacheEntry> |
entries(CacheKeyFilter filter)
Returns a list of entries containing in this cache that match the given filter.
|
CacheEntry |
getCacheEntry(String key)
return cache entry that match the key, throws a CacheException when entry does not exist or is stale
|
CacheEntry |
getCacheEntry(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
|
Object |
getValue(String key)
return value that match the key, throws a CacheException when entry does not exist or is stale
|
Object |
getValue(String key,
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?
this information is optional and depends on the implementation,
when information is not available -1 is returned
|
void |
init(Config config,
String arg1,
Struct arg2)
initialize the cache
|
List<String> |
keys()
Returns a List of the keys contained in this cache.
|
List<String> |
keys(CacheEntryFilter filter)
Returns a List of the keys contained in this cache that match the given filter.
|
List<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?
this information is optional and depends on the implementation,
when information is not available -1 is returned
|
void |
put(String key,
Object value,
Long idle,
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(String key)
remove entry that match this key
|
List<Object> |
values()
Returns a List of values containing in this cache.
|
List<Object> |
values(CacheEntryFilter filter)
Returns a list of values containing in this cache that match the given filter.
|
List<Object> |
values(CacheKeyFilter filter)
Returns a list of values containing in this cache that match the given filter.
|
List<Object> |
values(List<Object> values) |
public CacheComplex(CacheConnection cc, Cache cache)
public List<CacheEntry> entries() throws IOException
Cache
entries
in interface Cache
IOException
public List<CacheEntry> entries(CacheKeyFilter filter) throws IOException
Cache
entries
in interface Cache
IOException
public List<CacheEntry> entries(CacheEntryFilter filter) throws IOException
Cache
entries
in interface Cache
IOException
public CacheEntry getCacheEntry(String key) throws IOException
Cache
getCacheEntry
in interface Cache
key
- key of the cache entry to getCacheException
IOException
public CacheEntry getCacheEntry(String key, CacheEntry defaultValue)
Cache
getCacheEntry
in interface Cache
key
- key of the cache entry to getpublic Struct getCustomInfo()
Cache
getCustomInfo
in interface Cache
public Object getValue(String key) throws IOException
Cache
getValue
in interface Cache
key
- key of the value to getCacheException
IOException
public Object getValue(String key, Object defaultValue)
Cache
public long hitCount()
Cache
public long missCount()
Cache
public void put(String key, Object value, Long idle, Long until)
Cache
public int remove(CacheEntryFilter filter) throws IOException
Cache
remove
in interface Cache
IOException
public List<String> keys(CacheEntryFilter filter) throws IOException
Cache
keys
in interface Cache
IOException
public List<Object> values() throws IOException
Cache
values
in interface Cache
IOException
public List<Object> values(CacheKeyFilter filter) throws IOException
Cache
values
in interface Cache
IOException
public List<Object> values(CacheEntryFilter filter) throws IOException
Cache
values
in interface Cache
IOException
public boolean contains(String key)
Cache
public void init(Config config, String arg1, Struct arg2) throws IOException
Cache
init
in interface Cache
arg2
- configuration argumentsCacheException
IOException
public List<String> keys() throws IOException
Cache
keys
in interface Cache
IOException
public List<String> keys(CacheKeyFilter filter) throws IOException
Cache
keys
in interface Cache
IOException
public boolean remove(String key) throws IOException
Cache
remove
in interface Cache
IOException
public int remove(CacheKeyFilter filter) throws IOException
Cache
remove
in interface Cache
IOException
Copyright © 2015 Lucee