java.lang.AutoCloseable
, java.util.Enumeration
public interface Cache
extends java.util.Enumeration, java.lang.AutoCloseable
Modifier and Type | Method | Description |
---|---|---|
CacheItemVersion |
add(java.lang.String key,
CacheItem item) |
Adds a
CacheItem to the cache. |
CacheItemVersion |
add(java.lang.String key,
CacheItem item,
WriteThruOptions writeThruOptions) |
Adds a
CacheItem to the cache. |
CacheItemVersion |
add(java.lang.String key,
java.lang.Object value) |
Adds an item into the Cache object with a cache key to reference its location.
|
java.util.concurrent.FutureTask<CacheItemVersion> |
addAsync(java.lang.String key,
CacheItem item) |
Adds a
CacheItem to the cache asynchronously with a cache key to reference its location. |
java.util.concurrent.FutureTask<CacheItemVersion> |
addAsync(java.lang.String key,
CacheItem item,
WriteThruOptions writeThruOptions) |
Adds a
CacheItem to the cache asynchronously with a cache key to reference its location and WriteThruOptions. |
java.util.concurrent.FutureTask<CacheItemVersion> |
addAsync(java.lang.String key,
java.lang.Object value) |
Adds an object into the cache asynchronously with a cache key to reference its location.
|
java.util.Map<java.lang.String,java.lang.Exception> |
addBulk(java.util.Map<java.lang.String,CacheItem> items) |
Adds a Map of cache keys with
CacheItem to the cache. |
java.util.Map<java.lang.String,java.lang.Exception> |
addBulk(java.util.Map<java.lang.String,CacheItem> items,
WriteThruOptions writeThruOptions) |
Adds a Map of cache keys with
CacheItem to the cache with the WriteThruOptions. |
java.util.Iterator |
asJsonIterator() |
Retrieves a Map iterator used to iterate through the key settings and their values as JSON objects contained in the cache.
|
void |
clear() |
Removes all elements from the
Cache . |
void |
clearClientCache() |
Removes all elements from the client cache.
|
boolean |
contains(java.lang.String key) |
Determines whether the cache contains a specific key.
|
java.util.Map<java.lang.String,java.lang.Boolean> |
containsBulk(java.lang.Iterable<java.lang.String> keys) |
Determines whether the cache contains specifiec keys.
|
void |
delete(java.lang.String key) |
Deletes the item with the specified key from cache.
|
void |
delete(java.lang.String key,
LockHandle lockHandle,
CacheItemVersion version,
WriteThruOptions writeThruOptions) |
Deletes the specified item from the
Cache . |
void |
delete(java.lang.String key,
WriteThruOptions writeThruOptions) |
Deletes the specified item from the
Cache . |
java.util.concurrent.FutureTask |
deleteAsync(java.lang.String key) |
Deletes an item from the cache asynchronously with a cache key to reference its location.
|
java.util.concurrent.FutureTask |
deleteAsync(java.lang.String key,
WriteThruOptions writeThruOptions) |
Deletes an item from the cache asynchronously with a cache key to reference its location.
|
void |
deleteBulk(java.lang.Iterable<java.lang.String> keys) |
Deletes the specified items from the
Cache . |
void |
deleteBulk(java.lang.Iterable<java.lang.String> keys,
WriteThruOptions writeThruOptions) |
Deletes the specified items from the
Cache . |
<T> T |
get(java.lang.String key,
boolean acquireLock,
TimeSpan lockTimeout,
LockHandle lockHandle,
java.lang.Class<?> cls) |
Retrieves the specified item from the Cache if it is not already locked.
|
<T> T |
get(java.lang.String key,
CacheItemVersion version,
ReadThruOptions readThruOptions,
java.lang.Class<?> cls) |
Retrieves the specified item from the cache, with read-through caching option available.If the option of read-through has been set, the object will be fetched from the data source if it does not exist in cache.
|
<T> T |
get(java.lang.String key,
ReadThruOptions readThruOptions,
java.lang.Class<?> cls) |
Retrieves the specified item from the Cache object, with read-through caching option available.
|
<T> T |
get(java.lang.String key,
java.lang.Class<?> cls) |
Retrieves the specified item from the Cache object.
|
<T> java.util.Map<java.lang.String,T> |
getBulk(java.lang.Iterable<java.lang.String> keys,
ReadThruOptions readThruOptions,
java.lang.Class<?> cls) |
Retrieves the objects from cache for the given keys as key-value pairs in form of a Map.
|
<T> java.util.Map<java.lang.String,T> |
getBulk(java.lang.Iterable<java.lang.String> keys,
java.lang.Class<?> cls) |
Retrieves the objects from cache for the given keys as key-value pairs in form of a Map.
|
CacheItem |
getCacheItem(java.lang.String key) |
Retrieves the specified CacheItem from the cache.
|
CacheItem |
getCacheItem(java.lang.String key,
boolean acquireLock,
TimeSpan lockTimeout,
LockHandle lockHandle) |
Get the cache item stored in cache.
|
CacheItem |
getCacheItem(java.lang.String key,
CacheItemVersion version,
ReadThruOptions readThruOptions) |
Retrieves the specified CacheItem from the cache.This method also allows specifying the read-through option.
|
CacheItem |
getCacheItem(java.lang.String key,
ReadThruOptions readThruOptions) |
Retrieves the specified CacheItem from the cache.
|
java.util.Map<java.lang.String,CacheItem> |
getCacheItemBulk(java.lang.Iterable<java.lang.String> keys) |
Retrieves the specified CacheItems from the cache object
|
java.util.Map<java.lang.String,CacheItem> |
getCacheItemBulk(java.lang.Iterable<java.lang.String> keys,
ReadThruOptions readThruOptions) |
Retrieves the specified cacheItems from the cache.
|
CacheStream |
getCacheStream(java.lang.String key,
CacheStreamAttributes cacheStreamAttributes) |
Gets an instance of
CacheStream |
ClientInfo |
getClientInfo() |
Displays the information related to this client.
|
java.util.List<ClientInfo> |
getConnectedClientList() |
Gets the information of all connected clients to the cache.
|
long |
getCount() |
Gets the number of items stored in the cache.
|
DataStructureManager |
getDataStructuresManager() |
Gets an instance of
DataStructureManager . |
<T> T |
getIfNewer(java.lang.String key,
CacheItemVersion version,
java.lang.Class<?> cls) |
Gets an object from the cache only if a newer version of the object exists in cache.
|
MessagingService |
getMessagingService() |
Gets an instance of
MessagingService |
NotificationService |
getNotificationService() |
Gets an instance of
NotificationService . |
SearchService |
getSearchService() |
Gets an instance of
SearchService . |
CacheItemVersion |
insert(java.lang.String key,
CacheItem item) |
Inserts a
CacheItem to the cache. |
CacheItemVersion |
insert(java.lang.String key,
CacheItem item,
WriteThruOptions writeThruOptions) |
Inserts a
CacheItem to the cache, allowing to specify the Write-Through options. |
CacheItemVersion |
insert(java.lang.String key,
CacheItem item,
WriteThruOptions writeThruOptions,
LockHandle lockHandle,
boolean releaseLock) |
Inserts a
CacheItem to the cache, allowing to specify the Write-Through options. |
CacheItemVersion |
insert(java.lang.String key,
java.lang.Object value) |
Inserts an item (object) into the cache.
|
java.util.concurrent.FutureTask<CacheItemVersion> |
insertAsync(java.lang.String key,
CacheItem item) |
Inserts a
CacheItem to the cache asynchronously with a cache key to reference its location. |
java.util.concurrent.FutureTask<CacheItemVersion> |
insertAsync(java.lang.String key,
CacheItem item,
WriteThruOptions writeThruOptions) |
Inserts a
CacheItem to the cache asynchronously with a cache key to reference its location and WriteThruOptions. |
java.util.concurrent.FutureTask<CacheItemVersion> |
insertAsync(java.lang.String key,
java.lang.Object value) |
Inserts an object into the cache asynchronously with a cache key to reference its location.
|
java.util.Map<java.lang.String,java.lang.Exception> |
insertBulk(java.util.Map<java.lang.String,CacheItem> items) |
Inserts a Map of cache keys with
CacheItem to the cache. |
java.util.Map<java.lang.String,java.lang.Exception> |
insertBulk(java.util.Map<java.lang.String,CacheItem> items,
WriteThruOptions writeThruOptions) |
Inserts a Map of cache keys with
CacheItem to the cache with the WriteThruOptions. |
boolean |
lock(java.lang.String key,
TimeSpan lockTimeout,
LockHandle lockHandle) |
Acquires a lock on an item in the cache.
|
<T> T |
remove(java.lang.String key,
LockHandle lockHandle,
CacheItemVersion version,
WriteThruOptions writeThruOptions,
java.lang.Class<?> cls) |
Removes and retrieves the specified item from the
Cache . |
<T> T |
remove(java.lang.String key,
WriteThruOptions writeThruOptions,
java.lang.Class<?> cls) |
Removes and retrieves the specified item from the
Cache . |
<T> T |
remove(java.lang.String key,
java.lang.Class<?> cls) |
Removes and retrieves the item with the specified key from cache.
|
<T> java.util.concurrent.FutureTask<T> |
removeAsync(java.lang.String key,
WriteThruOptions writeThruOptions,
java.lang.Class<?> cls) |
Removes an item from the cache asynchronously with a cache key to reference its location.
|
<T> java.util.concurrent.FutureTask<T> |
removeAsync(java.lang.String key,
java.lang.Class<?> cls) |
Removes an item from the cache asynchronously with a cache key to reference its location.
|
<T> java.util.Map<java.lang.String,T> |
removeBulk(java.lang.Iterable<java.lang.String> keys,
WriteThruOptions writeThruOptions,
java.lang.Class<?> cls) |
Removes the specified items from the
Cache and returns them to the application in the form of a Map. |
<T> java.util.Map<java.lang.String,T> |
removeBulk(java.lang.Iterable<java.lang.String> keys,
java.lang.Class<?> cls) |
Removes the specified items from the
Cache and returns them to the application in the form of a Map. |
void |
unlock(java.lang.String key) |
Forcefully unlocks a locked cached item.
|
void |
unlock(java.lang.String key,
LockHandle lockHandle) |
Unlocks a locked cached item if the correct LockHandle is specified.
|
boolean |
updateAttributes(java.lang.String key,
CacheItemAttributes attributes) |
Update
CacheItemAttributes of an existing item in cache. |
long getCount() throws CacheException
CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.ClientInfo getClientInfo() throws CacheException
CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.util.List<ClientInfo> getConnectedClientList() throws CacheException
CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.MessagingService getMessagingService() throws CacheException
MessagingService
MessagingService
CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.SearchService getSearchService() throws CacheException
SearchService
.SearchService
CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.NotificationService getNotificationService() throws CacheException
NotificationService
.NotificationService
CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.DataStructureManager getDataStructuresManager() throws CacheException
DataStructureManager
.DataStructureManager
CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.CacheItemVersion add(java.lang.String key, java.lang.Object value) throws CacheException, java.lang.IllegalArgumentException
key
- Unique key to identify the cache item.value
- The item (object) to be stored in the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
CacheItemVersion add(java.lang.String key, CacheItem item) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache.
Using CacheItem, you can also specify properties for the cache items, for e.g., expiration and priority.key
- Unique key to identify the cache item.item
- CacheItem
that is to be stored in the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
CacheItemVersion add(java.lang.String key, CacheItem item, WriteThruOptions writeThruOptions) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache. It also lets you specify the WriteThruOptions.
Using CacheItem, you can also specify properties for the cache items, for e.g., expiration and priority.key
- Unique key to identify the cache item.item
- CacheItem
that is to be stored in the cache.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.Map<java.lang.String,java.lang.Exception> addBulk(java.util.Map<java.lang.String,CacheItem> items) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache.
The CacheItem contains properties to associate with the item, like expiration, dependencies and eviction information.items
- Map
of keys and CacheItem
. Keys must be unique.Map
of Keys along with Exception that were unable to store in cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.Map<java.lang.String,java.lang.Exception> addBulk(java.util.Map<java.lang.String,CacheItem> items, WriteThruOptions writeThruOptions) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache with the WriteThruOptions.
The CacheItem contains properties to associate with the item, like expiration, dependencies and eviction information.items
- Map
of keys and CacheItem
. Keys must be unique.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.Map
of Keys along with Exception that were unable to store in cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.concurrent.FutureTask<CacheItemVersion> addAsync(java.lang.String key, java.lang.Object value) throws CacheException, java.lang.IllegalArgumentException
key
- Unique key to identify the cache item.value
- The item (object) to be stored in the cache.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.concurrent.FutureTask<CacheItemVersion> addAsync(java.lang.String key, CacheItem item) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache asynchronously with a cache key to reference its location.key
- Unique key to identify the cache item.item
- CacheItem
that is to be stored in the cache.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.concurrent.FutureTask<CacheItemVersion> addAsync(java.lang.String key, CacheItem item, WriteThruOptions writeThruOptions) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache asynchronously with a cache key to reference its location and WriteThruOptions.key
- Unique key to identify the cache item.item
- CacheItem
that is to be stored in the cache.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
CacheItemVersion insert(java.lang.String key, java.lang.Object value) throws CacheException, java.lang.IllegalArgumentException
key
- Unique key to identify the cache item.value
- The item (object) that is to be inserted into the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
CacheItemVersion insert(java.lang.String key, CacheItem item) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache.key
- Unique key to identify the cache item.item
- The CacheItem that is to be inserted into the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
CacheItemVersion insert(java.lang.String key, CacheItem item, WriteThruOptions writeThruOptions) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache, allowing to specify the Write-Through options.key
- Unique key to identify the cache item.item
- The CacheItem that is to be inserted into the cache.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
CacheItemVersion insert(java.lang.String key, CacheItem item, WriteThruOptions writeThruOptions, LockHandle lockHandle, boolean releaseLock) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache, allowing to specify the Write-Through options.key
- Unique key to identify the cache item.item
- The CacheItem that is to be inserted into the cache.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.lockHandle
- An instance of LockHandle
that holds the lock information. If the item is locked, then it can only be updated if the correct lockHandle is specified.releaseLock
- A flag to determine whether or not the lock should be released after operation is performed.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.Map<java.lang.String,java.lang.Exception> insertBulk(java.util.Map<java.lang.String,CacheItem> items) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache.
The CacheItem contains properties to associate with the item, like expiration, dependencies and eviction information.items
- Map
of keys and CacheItem
. Keys must be unique.Map
of Keys along with Exception that were unable to store in cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.Map<java.lang.String,java.lang.Exception> insertBulk(java.util.Map<java.lang.String,CacheItem> items, WriteThruOptions writeThruOptions) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache with the WriteThruOptions.
The CacheItem contains properties to associate with the item, like expiration, dependencies and eviction information.items
- Map
of keys and CacheItem
. Keys must be unique.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.Map
of Keys along with Exception that were unable to store in cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.concurrent.FutureTask<CacheItemVersion> insertAsync(java.lang.String key, java.lang.Object value) throws CacheException, java.lang.IllegalArgumentException
key
- Unique key to identify the cache item.value
- The item (object) to be stored in the cache.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.concurrent.FutureTask<CacheItemVersion> insertAsync(java.lang.String key, CacheItem item) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache asynchronously with a cache key to reference its location.key
- Unique key to identify the cache item.item
- CacheItem
that is to be stored in the cache.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.concurrent.FutureTask<CacheItemVersion> insertAsync(java.lang.String key, CacheItem item, WriteThruOptions writeThruOptions) throws CacheException, java.lang.IllegalArgumentException
CacheItem
to the cache asynchronously with a cache key to reference its location and WriteThruOptions.key
- Unique key to identify the cache item.item
- CacheItem
that is to be stored in the cache.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
boolean updateAttributes(java.lang.String key, CacheItemAttributes attributes) throws CacheException, java.lang.IllegalArgumentException
CacheItemAttributes
of an existing item in cache.key
- Unique key to identify the cache item.attributes
- An instance of CacheItemAttributes
to update item in the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
<T> T get(java.lang.String key, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
T
- Specifies the type of value obtained from the cache.key
- The unique identifier for the cache item to be retrieved.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> T get(java.lang.String key, ReadThruOptions readThruOptions, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
T
- Specifies the type of value obtained from the cache.key
- The unique identifier for the cache item to be retrieved.readThruOptions
- ReadThruOptions
to read from data source. These can be either ReadThru, ReadThruForced or None.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> T get(java.lang.String key, boolean acquireLock, TimeSpan lockTimeout, LockHandle lockHandle, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
T
- Specifies the type of value obtained from the cache.key
- Unique identifier for the cache item to be retrieved.acquireLock
- A flag to determine whether to acquire a lock or not.lockTimeout
- The TimeSpan after which the lock is automatically released.lockHandle
- An instance of LockHandle
to hold the lock information.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> T get(java.lang.String key, CacheItemVersion version, ReadThruOptions readThruOptions, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
T
- Specifies the type of value obtained from the cache.key
- Unique identifier for the cache item to be retrieved.version
- The version of the object.readThruOptions
- ReadThruOptions
to read from data source. These can be either ReadThru, ReadThruForced or None.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> java.util.Map<java.lang.String,T> getBulk(java.lang.Iterable<java.lang.String> keys, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
T
- Specifies the type of value obtained from the cache.keys
- The keys against which items are to be fetched from cache.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> java.util.Map<java.lang.String,T> getBulk(java.lang.Iterable<java.lang.String> keys, ReadThruOptions readThruOptions, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
T
- Specifies the type of value obtained from the cache.keys
- The keys against which items are to be fetched from cache.readThruOptions
- ReadThruOptions
to read from data source. These can be either ReadThru, ReadThruForced or None.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.CacheItem getCacheItem(java.lang.String key) throws CacheException, java.lang.IllegalArgumentException
key
- Unique identifier for the cache item to be retrieved.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
CacheItem getCacheItem(java.lang.String key, ReadThruOptions readThruOptions) throws CacheException, java.lang.IllegalArgumentException
key
- Unique identifier for the cache item to be retrieved.readThruOptions
- ReadThruOptions
regarding reading from data source. It can be either ReadThru, ReadThruForced or None.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
CacheItem getCacheItem(java.lang.String key, CacheItemVersion version, ReadThruOptions readThruOptions) throws CacheException, java.lang.IllegalArgumentException
key
- Unique identifier for the cache item to be retrieved.version
- The CacheItemVersion
of the object.readThruOptions
- ReadThruOptions
regarding reading from data source. It can be either ReadThru, ReadThruForced or None.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
CacheItem getCacheItem(java.lang.String key, boolean acquireLock, TimeSpan lockTimeout, LockHandle lockHandle) throws CacheException, java.lang.IllegalArgumentException
key
- Key used to reference the desired object.acquireLock
- A flag to determine whether to acquire a lock or not.lockTimeout
- The TimeSpan after which the lock is automatically released.lockHandle
- An instance of LockHandle
to hold the lock information.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.Map<java.lang.String,CacheItem> getCacheItemBulk(java.lang.Iterable<java.lang.String> keys) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
keys
- Iterable
list of unique identifiers for the cache items to be retrieved.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.java.util.Map<java.lang.String,CacheItem> getCacheItemBulk(java.lang.Iterable<java.lang.String> keys, ReadThruOptions readThruOptions) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
keys
- Iterable
list of unique identifiers for the cache items to be retrieved.readThruOptions
- ReadThruOptions
regarding reading from data source. It can be either ReadThru, ReadThruForced or None.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> T getIfNewer(java.lang.String key, CacheItemVersion version, java.lang.Class<?> cls) throws CacheException
T
- Specifies the type of value obtained from the cache.key
- Unique key used to reference the desired object.version
- The CacheItemVersion
of the object.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.void delete(java.lang.String key) throws CacheException, java.lang.IllegalArgumentException
key
- Unique key of the item to be deleted.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
void delete(java.lang.String key, WriteThruOptions writeThruOptions) throws CacheException, java.lang.IllegalArgumentException
Cache
. You can also specify the write option such that the item may be removed from both cache and data source.key
- Unique key of the item to be deleted.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
void delete(java.lang.String key, LockHandle lockHandle, CacheItemVersion version, WriteThruOptions writeThruOptions) throws CacheException, java.lang.IllegalArgumentException
Cache
. You can also specify the write option such that the item may be removed from both cache and data source.key
- Unique key of the item to be deleted.lockHandle
- If the item is locked, it can be removed only if the correct lockHandle is specified. lockHandle should be the same which was used initially to lock the item, otherwise you will get the 'OperationFailedException'.version
- The version of the item to be removed. The item is removed from the cache only if this is still the most recent version in the cache.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.concurrent.FutureTask deleteAsync(java.lang.String key) throws CacheException, java.lang.IllegalArgumentException
key
- Unique key of the item to be deleted.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.concurrent.FutureTask deleteAsync(java.lang.String key, WriteThruOptions writeThruOptions) throws CacheException, java.lang.IllegalArgumentException
key
- key Unique key of the item to be deleted.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
void deleteBulk(java.lang.Iterable<java.lang.String> keys) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
Cache
.keys
- Iterable
list of unique keys to reference the items.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
void deleteBulk(java.lang.Iterable<java.lang.String> keys, WriteThruOptions writeThruOptions) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
Cache
. You can also specify the write option such that the items may be removed from both cache and data source.keys
- Iterable
list of unique keys to reference the items.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
<T> T remove(java.lang.String key, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
T
- Specifies the type of value obtained from the cache.key
- Unique key of the item to be removed.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> T remove(java.lang.String key, WriteThruOptions writeThruOptions, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
Cache
. You can also specify the write option such that the item may be removed from both cache and data source.T
- Specifies the type of value obtained from the cache.key
- Unique key of the item to be removed.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> T remove(java.lang.String key, LockHandle lockHandle, CacheItemVersion version, WriteThruOptions writeThruOptions, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
Cache
. You can also specify the write option such that the item may be removed from both cache and data source.T
- Specifies the type of value obtained from the cache.key
- Unique key of the item to be removed.lockHandle
- If the item is locked, it can be removed only if the correct lockHandle is specified. lockHandle should be the same which was used initially to lock the item, otherwise you will get the 'OperationFailedException'.version
- The version of the item to be removed. The item is removed from the cache only if this is still the most recent version in the cache.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> java.util.Map<java.lang.String,T> removeBulk(java.lang.Iterable<java.lang.String> keys, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
Cache
and returns them to the application in the form of a Map.T
- Specifies the type of value obtained from the cache.keys
- Iterable
list of unique keys to reference the items.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> java.util.Map<java.lang.String,T> removeBulk(java.lang.Iterable<java.lang.String> keys, WriteThruOptions writeThruOptions, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
Cache
and returns them to the application in the form of a Map.T
- Specifies the type of value obtained from the cache.keys
- Iterable
list of unique keys to reference the items.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.cls
- Specifies the class of value obtained from the cache.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> java.util.concurrent.FutureTask<T> removeAsync(java.lang.String key, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
T
- Specifies the type of value obtained from the cache.key
- Unique key of the item to be removed.cls
- Specifies the class of value obtained from the cache.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.<T> java.util.concurrent.FutureTask<T> removeAsync(java.lang.String key, WriteThruOptions writeThruOptions, java.lang.Class<?> cls) throws CacheException, java.lang.IllegalArgumentException, java.lang.ClassCastException
T
- Specifies the type of value obtained from the cache.key
- Unique key of the item to be removed.writeThruOptions
- WriteThruOptions
regarding updating the data source. This can be either WriteThru, WriteBehind or None.cls
- Specifies the class of value obtained from the cache.FutureTask
can be used to determine status
of the task i.e. isDone(), isCancelled().CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.lang.ClassCastException
- If the object returned form cache is not an instance of the specified class or any of its subclass/subclasses.boolean contains(java.lang.String key) throws CacheException, java.lang.IllegalArgumentException
key
- The key to locate in the cache.Cache
contains an element with the specified key; otherwise, false.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.Map<java.lang.String,java.lang.Boolean> containsBulk(java.lang.Iterable<java.lang.String> keys) throws CacheException
keys
- Iterable
collection of keys.Cache
contains an elementwith the specified key; otherwise, false.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.void clear() throws CacheException
Cache
.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.void clearClientCache() throws CacheException
CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.void unlock(java.lang.String key) throws CacheException, java.lang.IllegalArgumentException
key
- Key of the cached item to be unlocked.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
void unlock(java.lang.String key, LockHandle lockHandle) throws CacheException, java.lang.IllegalArgumentException
key
- Key of the cached item to be unlocked.lockHandle
- An instance of LockHandle
that is generated when the lock is acquired.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
boolean lock(java.lang.String key, TimeSpan lockTimeout, LockHandle lockHandle) throws CacheException, java.lang.IllegalArgumentException
key
- key of cached item to be locked.lockTimeout
- An instance of TimeSpan
after which the lock is automatically released.lockHandle
- An instance of LockHandle
that will be filled in with the lock information if lock is acquired successfully.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
CacheStream getCacheStream(java.lang.String key, CacheStreamAttributes cacheStreamAttributes) throws CacheException, java.lang.IllegalArgumentException
CacheStream
key
- The key used to reference the stream.cacheStreamAttributes
- Instance of CacheStreamAttributes
to set attributes of the stream.CacheException
- So you can catch this exception for all the exceptions thrown from within the NCache.java.lang.IllegalArgumentException
java.util.Iterator asJsonIterator()
Cache
as JSON objects.