public class Cache
extends java.lang.Object
Constructor and Description |
---|
Cache(java.io.File rakFile,
java.lang.String connectionid) |
Cache(java.lang.String connectionid)
Constructor with a valid connectionid
|
Modifier and Type | Method and Description |
---|---|
void |
clear(java.lang.String cacheName)
Removes ALL items from the cache - and does the same across a cluster
|
java.lang.Object |
get(java.lang.String cacheName,
java.lang.String cacheKey)
Gets an object out of the cluster
|
int |
getCacheSize(java.lang.String cacheName)
Returns the number of items in the cache.
|
java.util.Set<java.lang.String> |
keySet(java.lang.String cacheName)
Returns a list of all keys in the cache
|
void |
put(java.lang.String cacheName,
java.lang.String cacheKey,
java.lang.Object cacheItem)
Stored a value in a cache with a given key
|
void |
remove(java.lang.String cacheName,
java.lang.String cacheKey)
Removes a single item from a cache and from the same cache across a cluster
|
public Cache(java.lang.String connectionid) throws SapphireException
connectionid
- A valid connectionid. Note that this cache is not specific to this connectionid. It will be shared by all users of the user's database. However a valid connectionid is required to use the cache.SapphireException
public Cache(java.io.File rakFile, java.lang.String connectionid) throws SapphireException
rakFile
- Rak file for remote operationconnectionid
- A valid connectionid. Note that this cache is not specific to this connectionid. It will be shared by all users of the user's database. However a valid connectionid is required to use the cache.SapphireException
public void put(java.lang.String cacheName, java.lang.String cacheKey, java.lang.Object cacheItem)
cacheName
- The name of the cachecacheKey
- The key to use to retrieve the value from the cachecacheItem
- The Object to store in the cachepublic java.lang.Object get(java.lang.String cacheName, java.lang.String cacheKey)
cacheName
- The name of the cachecacheKey
- The key to the stored valuepublic java.util.Set<java.lang.String> keySet(java.lang.String cacheName)
cacheName
- The name of the cachepublic void clear(java.lang.String cacheName)
cacheName
- The name of the cachepublic void remove(java.lang.String cacheName, java.lang.String cacheKey)
cacheName
- The name of the cachecacheKey
- The key to the stored value that is to be removedpublic int getCacheSize(java.lang.String cacheName)
cacheName
- The name of the cache