public interface Cache
In UltraESB there are 6 main types of caches, they are namely;
CacheEntry
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears out the cache completely, this will cause all the cache keys to be removed from the cache
|
CacheEntry |
delete(java.lang.Object key)
Deletes the entry with the given key from the cache.
|
java.lang.Object |
get(java.lang.Object key)
Gets the value stored with the given key, the key itself has to be serializable if the cache
is distributed, so does the value returned
|
CacheEntry |
getEntry(java.lang.Object key)
The entry representing the given key in the cache, the returned entry contains the value
associated with the key as well as the meta information about the entry
|
java.util.List |
getKeys()
Gives the unmodifiable list of keys registered in this cache
|
java.lang.String |
getName()
Gets the name of this cache, it is not expected that the user changes this name, but the name
is exposed as an identifier of the cache.
|
CacheType |
getType()
Gets the type of the cache, it has to be one of the;
LOCAL_TEMP
LOCAL_PERMANENT
LOCAL_PERSISTENT
DISTRIBUTED_TEMP
DISTRIBUTED_PERMANENT
DISTRIBUTED_PERSISTENT
|
boolean |
isDistributed()
Whether this cache is of distributed cache type, if the cache type is one of the following it
is a distributed cache;
DISTRIBUTED_TEMP
DISTRIBUTED_PERMANENT
DISTRIBUTED_PERSISTENT
|
boolean |
isPermanent()
Whether the cache keeps its content permanently (i.e.
|
boolean |
isPersistent()
Whether the cache persists its contents to the disk.
|
void |
put(java.lang.Object key,
java.lang.Object value)
Puts an entry into the cache with the given key and value pair.
|
CacheType getType()
java.lang.Object get(java.lang.Object key)
key
- of which the cache entry value is requiredvoid put(java.lang.Object key, java.lang.Object value)
Serializable
. This method is used
to create a new entry as well as to update an existing entry.key
- the cache key to index the cache entryvalue
- the value associated with the above key in the cacheCacheEntry delete(java.lang.Object key)
Serializable
even if the resource is persisted, this call will
permanently remove this entry.key
- entry key which needs to be removedCacheEntry getEntry(java.lang.Object key)
key
- the key of which the entry is requiredjava.util.List getKeys()
void clear()
java.lang.String getName()
boolean isDistributed()
boolean isPermanent()
Cache.isPersistent()
should return true for this method too. In concrete terms all of the following types will
belong to the permanent category.;
boolean isPersistent()