com.alachisoft.ncache.web.caching
Class Cache<K,V>

java.lang.Object
  extended by com.alachisoft.ncache.web.caching.Cache<K,V>
Type Parameters:
K -
V -

public final class Cache<K,V>
extends java.lang.Object

Implements the clustered cache for an application. This class cannot be inherited.


Nested Class Summary
 class Cache.Entry<K,V>
           
 
Field Summary
static java.util.Date NoAbsoluteExpiration
          specify no absulute expiration.
static TimeSpan NoLockingExpiration
          Disable lock expiration
static TimeSpan NoSlidingExpiration
          specify no siliding expiration.
 
Method Summary
 CacheItemVersion add(java.lang.String key, CacheItem item)
          Add a CacheItem to the cache
 CacheItemVersion add(java.lang.String key, CacheItem item, DSWriteOption dsWriteOption, DataSourceItemsAddedCallback onDataSourceItemAdded)
          Adds the specified item to the Cache, and a delegate you can use to notify your application when the item is added into cache.
 CacheItemVersion add(java.lang.String key, CacheItem item, DSWriteOption dsWriteOption, java.lang.String providerName, DataSourceItemsAddedCallback onDataSourceItemAdded)
          Adds the specified item to the Cache, and a delegate you can use to notify your application when the item is added into 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.
 CacheItemVersion add(java.lang.String key, java.lang.Object value, CacheDependency dependency, java.util.Date absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority)
          Adds the specified item to the Cache object with dependencies, expiration and priority policies, and a delegate you can use to notify your application when the inserted item is removed from the Cache.
 CacheItemVersion add(java.lang.String key, java.lang.Object value, NamedTagsDictionary namedTags)
          Adds an item into the Cache object with a cache key to reference its location and using default values provided by the CacheItemPriority enumeration.
 CacheItemVersion add(java.lang.String key, java.lang.Object value, java.lang.String group, java.lang.String subGroup)
          Adds an item in the cache.
 CacheItemVersion add(java.lang.String key, java.lang.Object value, Tag[] tags)
          Adds an item into the Cache object with a cache key to reference its location and using default values provided by the CacheItemPriority enumeration.
 java.lang.Object addAsync(java.lang.String key, CacheItem item)
          Adds a key and CacheItem in the cache Asynchronously.
 java.lang.Object addAsync(java.lang.String key, CacheItem item, DSWriteOption dsWriteOption, DataSourceItemsAddedCallback onSourceItemAdded)
          Adds a key and CacheItem in the cache Asynchronously.
 java.lang.Object addAsync(java.lang.String key, CacheItem item, DSWriteOption dsWriteOption, java.lang.String providerName, DataSourceItemsAddedCallback onSourceItemAdded)
          Adds a key and CacheItem in the cache Asynchronously.
 java.lang.Object addAsync(java.lang.String key, java.lang.Object value, AsyncItemAddedCallback onAsyncItemAddCallback, java.lang.String group, java.lang.String subGroup)
          Add a key value pair to the cache asynchronously.
 java.util.HashMap addBulk(java.lang.String[] keys, CacheItem[] items, DSWriteOption dsWriteOption, DataSourceItemsAddedCallback onDataSourceItemAddedCallback)
          Add array of CacheItem to the cache.
 java.util.HashMap addBulk(java.lang.String[] keys, CacheItem[] items, DSWriteOption dsWriteOption, java.lang.String providerName, DataSourceItemsAddedCallback onDataSourceItemAddedCallback)
          Add array of CacheItem to the cache.
 void addCacheEventListener(com.alachisoft.ncache.event.CacheListener l)
          Adds the specified cache listener to receive cache events from this cache.
 void addClusterEventListener(com.alachisoft.ncache.event.ClusterListener l)
          Adds the specified cluster listener to receive custom cache events from this cache.
 void addCustomEventListener(com.alachisoft.ncache.event.CustomListener l)
          Adds the specified custom listener to receive custom cache events from this cache.
 boolean addDependency(java.lang.String key, CacheDependency dep, boolean isResyncRequired)
          Add dependency to the cache item.
 boolean addDependency(java.lang.String key, CacheSyncDependency dep)
          Add CacheSyncDependency to the cache item.
 void clear()
          Removes all elements from the Cache.
 void clear(DSWriteOption dsWriteOption, DataSourceClearedCallback onDataSourceCleared)
          Removes all elements from the Cache.
 void clearAsync(DSWriteOption dsWriteOption, AsyncCacheClearedCallback onAsyncCacheCleared, DataSourceClearedCallback onDataSourceCleared)
          Removes all elements from the Cache asynchronously.
 void clearClientCache()
          Clears Client Cache if initialized
 boolean contains(java.lang.String key)
          Determines whether the cache contains a specific key.
 void delete(java.lang.String key)
          Removes the object from the Cache.
 void delete(java.lang.String key, CacheItemVersion version)
          Removes an item from cache if the specified version is still the most recent version in the cache.
 void delete(java.lang.String key, DSWriteOption dsWriteOption, DataSourceItemsRemovedCallback onDataSourceItemRemoved)
          Removes the object from the Cache.
 void delete(java.lang.String key, DSWriteOption dsWriteOption, java.lang.String providerName, DataSourceItemsRemovedCallback onDataSourceItemRemoved)
          Removes the object from the Cache.
 void delete(java.lang.String key, LockHandle lockHandle)
          Removes an item from cache if it is not already locked or if the correct lock-id is specified.
 void deleteBulk(java.lang.String[] keys, DSWriteOption dsWriteOption, DataSourceItemsRemovedCallback onDataSourceItemRemoved)
          Removes the objects from the Cache.
 void deleteBulk(java.lang.String[] keys, DSWriteOption dsWriteOption, java.lang.String providerName, DataSourceItemsRemovedCallback onDataSourceItemRemoved)
          Removes the objects from the Cache.
 void dispose()
          Disposes this cache instance.
 java.lang.Object get(java.lang.String key)
          Retrieves the specified item from the Cache object.
 java.lang.Object get(java.lang.String key, CacheItemVersion version)
          Retrieves the specified item from the Cache object.
 java.lang.Object get(java.lang.String key, DSReadOption dsReadOption)
          Retrieves the specified item from the Cache object.
 java.lang.Object get(java.lang.String key, DSReadOption dsReadOption, CacheItemVersion version)
          Retrieves the specified item from the Cache object.
 java.lang.Object get(java.lang.String key, java.lang.String providerName, DSReadOption dsReadOption)
          Retrieves the specified item from the Cache object.
 java.lang.Object get(java.lang.String key, java.lang.String providerName, DSReadOption dsReadOption, CacheItemVersion version)
          Retrieves the specified item from the Cache object.
 java.lang.Object get(java.lang.String key, java.lang.String group, java.lang.String subGroup, DSReadOption dsReadOption)
          Retrieves the specified item from the Cache object.
 java.lang.Object get(java.lang.String key, TimeSpan lockTimeout, LockHandle lockHandle, boolean acquireLock)
          Retrieves the specified item from the Cache object if it is not already locked.
 java.util.HashMap getBulk(java.lang.String[] keys, DSReadOption dsReadOption)
          Retrieves the object from the cache for the given keys as key value pairs
 java.util.HashMap getBulk(java.lang.String[] keys, java.lang.String provideName, DSReadOption dsReadOption)
          Retrieves the object from the cache for the given keys as key value pairs
 java.util.HashMap getByAllTags(Tag[] tags)
          Returns the cached objects that have all the same tags in common.
 java.util.HashMap getByAnyTag(Tag[] tags)
          Returns the cached objects that have any of the same tags in common.
 java.util.HashMap getByTag(Tag tag)
          Gets all the cached objects with the specified tag.
 CacheItem getCacheItem(java.lang.String key)
          Get the cache item stored in cache.
 CacheItem getCacheItem(java.lang.String key, CacheItemVersion version)
          Retrieves the specified item from the Cache object.
 CacheItem getCacheItem(java.lang.String key, DSReadOption dsReadOption)
          Retrieves the specified item from the Cache object.
 CacheItem getCacheItem(java.lang.String key, DSReadOption dsReadOption, CacheItemVersion version)
           
 CacheItem getCacheItem(java.lang.String key, java.lang.String providerName, DSReadOption dsReadOption)
          Retrieves the specified item from the Cache object.
 CacheItem getCacheItem(java.lang.String key, java.lang.String providerName, DSReadOption dsReadOption, CacheItemVersion version)
          Retrieves the specified item from the Cache object.
 CacheItem getCacheItem(java.lang.String key, java.lang.String group, java.lang.String subGroup)
          Get the cache item stored in cache.
 CacheItem getCacheItem(java.lang.String key, java.lang.String group, java.lang.String subGroup, DSReadOption dsReadOption)
          Retrieves the specified item from the Cache object.
 CacheItem getCacheItem(java.lang.String key, TimeSpan lockTimeout, LockHandle lockHandle, boolean acquireLock)
          Get the cache item stored in cache.
 CacheStream getCacheStream(java.lang.String key, StreamMode streamMode)
          Get Cache Stream based on mode.
 CacheStream getCacheStream(java.lang.String key, StreamMode streamMode, CacheItemPriority priority)
          Gets an instance of the CacheStream class.
 CacheStream getCacheStream(java.lang.String key, StreamMode streamMode, java.util.Date absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority)
          Get Cache Stream based on mode.
 CacheStream getCacheStream(java.lang.String key, java.lang.String group, java.lang.String subGroup, StreamMode streamMode, CacheDependency dependency, java.util.Date absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority)
          Get Cache Stream based on mode.
 CacheStream getCacheStream(java.lang.String key, java.lang.String group, java.lang.String subgroup, StreamMode streamMode, CacheItemPriority priority)
          Gets an instance of the CacheStream class.
 CacheStream getCacheStream(java.lang.String key, java.lang.String group, java.lang.String subgroup, StreamMode streamMode, java.util.Date absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority)
          Gets an instance of the CacheStream class.
 boolean getClientCacheStatus()
           
 long getCount()
          Returns the cache count.
 java.util.Enumeration getEnumerator()
           
 java.util.HashMap getGroupData(java.lang.String group, java.lang.String subGroup)
          Retrieves the key and value pairs in a group or sub group.
 java.util.Collection getGroupKeys(java.lang.String group, java.lang.String subGroup)
          Retrieves the key and value pairs in a group or sub group.
 java.lang.Object getIfNewer(java.lang.String key, CacheItemVersion version)
          Gets an object from the cache only if a newer version of the object exists in cache.
 java.lang.Object getIfNewer(java.lang.String key, java.lang.String group, java.lang.String subGroup, CacheItemVersion version)
          Gets an object from the cache only if a newer version of the object exists in cache.
 java.util.Collection getKeysByAllTags(Tag[] tags)
          Returns the cached objects that have all the same tags in common.
 java.util.Collection getKeysByAnyTag(Tag[] tags)
          Returns the cached objects that have any of the same tags in common.
 java.util.Collection getKeysByTag(Tag tag)
          Gets all the cached objects with the specified tag.
 CacheItemVersion insert(java.lang.String key, CacheItem item)
          Add a CacheItem to the cache
 CacheItemVersion insert(java.lang.String key, CacheItem item, DSWriteOption dsWriteOption, DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
          Add a CacheItem to the cache
 CacheItemVersion insert(java.lang.String key, CacheItem item, DSWriteOption dsWriteOption, java.lang.String providerName, DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
          Add a CacheItem to the cache
 CacheItemVersion insert(java.lang.String key, CacheItem item, LockHandle lockHandle, boolean releaseLock)
           
 CacheItemVersion insert(java.lang.String key, java.lang.Object value)
          Inserts an item into the Cache object with a cache key to reference its location and using default values provided by the CacheItemPriority enumeration.
 CacheItemVersion insert(java.lang.String key, java.lang.Object value, CacheDependency dependency, java.util.Date absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority)
          Inserts an object into the Cache with dependencies and expiration policies.
 CacheItemVersion insert(java.lang.String key, java.lang.Object value, NamedTagsDictionary namedTags)
          Inserts an item into the Cache with a cache key to reference its location and using default values provided by the CacheItemPriority enumeration.
 CacheItemVersion insert(java.lang.String key, java.lang.Object value, java.lang.String group, java.lang.String subGroup)
          Inserts an Object into the Cache.
 CacheItemVersion insert(java.lang.String key, java.lang.Object value, Tag[] tags)
          Inserts an item into the Cache with a cache key to reference its location and using default values provided by the CacheItemPriority enumeration.
 void insertAsync(java.lang.String key, CacheItem item, DSWriteOption dsWriteOption, DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
          Inserts a key and CacheItem in the cache.
 void insertAsync(java.lang.String key, CacheItem item, java.lang.String providerName, DSWriteOption dsWriteOption, DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
          Inserts a key and CacheItem in the cache.
 void insertAsync(java.lang.String key, java.lang.Object value, AsyncItemUpdatedCallback asyncItemUpdatedCallback, java.lang.String group, java.lang.String subGroup)
          Insert a CacheItem to the cache asynchoronously
 java.util.HashMap insertBulk(java.lang.String[] keys, CacheItem[] items, DSWriteOption dsWriteOption, DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
          Insert list of CacheItem to the cache
 java.util.HashMap insertBulk(java.lang.String[] keys, CacheItem[] items, DSWriteOption dsWriteOption, java.lang.String providerName, DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
          Insert list of CacheItem to the cache
 boolean isExceptionsEnabled()
          If this property is set the Cache object throws exceptions from public operations.
 boolean lock(java.lang.String key, TimeSpan lockTimeout, LockHandle lockHandle)
          Acquire a lock on an item in cache.
 void raiseCustomEvent(java.lang.Object key, java.lang.Object value)
          Raises a custom event.
 void registerAddNotification()
          Registers the Add operation notification with the server.
 void registerCacheStoppedNotification()
          Register the cache stopped event with the server.
 void registerClearNotification()
          Registers the Clear operation notification with the server.
 void registerCQ(ContinuousQuery query)
          Registers the notifications based on the specified ContinuousQuery.
 void registerCustomNotification()
          Registers the Clear operation notification with the server.
 void registerInsertNotification()
          Registers the Insert operation notification with the server.
 void registerKeyNotificationCallback(java.lang.String[] keys, CacheItemUpdatedCallback updateCallback, CacheItemRemovedCallback removeCallback)
          Registers the CacheItemUpdatedCallback and/or CacheItemRemovedCallback for the list of specified keys.
 void registerKeyNotificationCallback(java.lang.String key, CacheItemUpdatedCallback updateCallback, CacheItemRemovedCallback removeCallback)
          Registers the CacheItemUpdatedCallback and/or CacheItemRemovedCallback for the specified key.
 void registerMemberJoinedNotification()
          Registers the Member Joined notification with the server.
 void registerMemberLeftNotification()
          Registers the Member Left notification with the server.
 void registerRemoveNotification()
          Registers the Remove operation notification with the server.
 java.lang.Object remove(java.lang.String key)
          Removes the object from the Cache.
 java.lang.Object remove(java.lang.String key, CacheItemVersion version)
          Removes an item from cache if the specified version is still the most recent version in the cache.
 java.lang.Object remove(java.lang.String key, DSWriteOption dsWriteOption, DataSourceItemsRemovedCallback onDataSourceItemRemoved)
          Removes the object from the Cache.
 java.lang.Object remove(java.lang.String key, DSWriteOption dsWriteOption, java.lang.String providerName, DataSourceItemsRemovedCallback onDataSourceItemRemoved)
          Removes the object from the Cache.
 java.lang.Object remove(java.lang.String key, LockHandle lockHandle)
          Removes an item from cache if it is not already locked or if the correct lock-id is specified.
 void removeAsync(java.lang.String key, AsyncItemRemovedCallback asyncItemRemovedCallback, DSWriteOption dsWriteOption, DataSourceItemsRemovedCallback onDataSourceItemRemoved)
          Removes the object from the Cache.
 void removeAsync(java.lang.String key, AsyncItemRemovedCallback asyncItemRemovedCallback, DSWriteOption dsWriteOption, java.lang.String providerName, DataSourceItemsRemovedCallback onDataSourceItemRemoved)
          Removes the object from the Cache.
 java.util.HashMap removeBulk(java.lang.String[] keys, DSWriteOption dsWriteOption, DataSourceItemsRemovedCallback onDataSourceItemRemoved)
          Removes the objects from the Cache.
 java.util.HashMap removeBulk(java.lang.String[] keys, DSWriteOption dsWriteOption, java.lang.String providerName, DataSourceItemsRemovedCallback onDataSourceItemRemoved)
          Removes the objects from the Cache.
 void removeByAllTags(Tag[] tags)
          Removes the cached objects that have all of the same tags in common.
 void removeByAnyTag(Tag[] tags)
          Removes the cached objects that have any of the same tags in common.
 void removeByTag(Tag tag)
          Removes the cached objects that have the specified tag.
 void removeCacheEventListener(com.alachisoft.ncache.event.CacheListener l)
          Removes the specified Cache listener so that it no longer receives cache events from this cache.
 void removeClusterEventListener(com.alachisoft.ncache.event.CustomListener l)
          Removes the specified cluster listener so that it no longer receives cache events from this cache.
 void removeCustomEventListener(com.alachisoft.ncache.event.CustomListener l)
          Removes the specified custom listener so that it no longer receives cache events from this cache.
 void removeGroupData(java.lang.String group, java.lang.String subGroup)
          Remove the group from cache.
 java.util.Collection search(java.lang.String query, java.util.HashMap values)
          Retrieves the keys for the specified query.
 java.util.Collection searchCQ(ContinuousQuery query)
          Performs search on the Cache based on the specified ContinuousQuery and registers the notifications.
 java.util.HashMap searchEntries(java.lang.String query, java.util.HashMap values)
          Retrieves the key and value pairs for the specified query.
 java.util.HashMap searchEntriesCQ(ContinuousQuery query)
          Performs search on the Cache based on the specified ContinuousQuery and registers the notifications.
 void setExceptionsEnabled(boolean exceptionsEnabled)
          If this property is set the Cache object throws exceptions from public operations.
 java.lang.String toString()
           
 void unlock(java.lang.String key)
          Forcefully unlocks a locked cached item.
 void unlock(java.lang.String key, java.lang.String lockId)
          Unlocks a locked cached item if the correct lock-id is specified.
 void unRegisterAddNotification()
          Unregisters the Add operation notification with the server.
 void unRegisterCacheStoppedNotification()
          Unregisters the cache stopped even notification with the server.
 void unRegisterClearNotification()
          Unregisters the Clear operation notification with the server.
 void unRegisterCQ(ContinuousQuery query)
          Unregisters notifications for the specified ContinuousQuery.
 void unRegisterCustomNotification()
          Registers the Clear operation notification with the server.
 void unRegisterInsertNotification()
          Unregisters the Insert operation notification with the server.
 void unRegisterKeyNotificationCallback(java.lang.String[] keys, CacheItemUpdatedCallback updateCallback, CacheItemRemovedCallback removeCallback)
          Unregisters the CacheItemUpdatedCallback and/or CacheItemRemovedCallback already registered for the specified list of keys.
 void unRegisterKeyNotificationCallback(java.lang.String key, CacheItemUpdatedCallback updateCallback, CacheItemRemovedCallback removeCallback)
          Unregisters the CacheItemUpdatedCallback and/or CacheItemRemovedCallback already registered for the specified key.
 void unRegisterMemberLeftNotification()
          Unregisters the Memeber Left Event notification with the server.
 void unRegisterMemeberJoinedNotification()
          Unregisters the Member Joined Event notification with the server.
 void unRegisterRemoveNotification()
          Unregisters the Remove operation notification with the server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NoAbsoluteExpiration

public static java.util.Date NoAbsoluteExpiration
specify no absulute expiration.


NoLockingExpiration

public static final TimeSpan NoLockingExpiration
Disable lock expiration


NoSlidingExpiration

public static TimeSpan NoSlidingExpiration
specify no siliding expiration.

Method Detail

add

public CacheItemVersion add(java.lang.String key,
                            CacheItem item)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException,
                            ArgumentException
Add a CacheItem to the cache

Parameters:
key - The cache key used to reference the item.
item - CacheItem to add in the cache
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

add

public CacheItemVersion add(java.lang.String key,
                            CacheItem item,
                            DSWriteOption dsWriteOption,
                            DataSourceItemsAddedCallback onDataSourceItemAdded)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException,
                            ArgumentException
Adds the specified item to the Cache, and a delegate you can use to notify your application when the item is added into cache.

Parameters:
key - The cache key used to reference the item.
item - The item to be added to the cache.
dsWriteOption - option regarding updating data source.
onDataSourceItemAdded - callback, if provided, is called when item is added to data source.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

add

public CacheItemVersion add(java.lang.String key,
                            CacheItem item,
                            DSWriteOption dsWriteOption,
                            java.lang.String providerName,
                            DataSourceItemsAddedCallback onDataSourceItemAdded)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException,
                            ArgumentException
Adds the specified item to the Cache, and a delegate you can use to notify your application when the item is added into cache.

Parameters:
key - The cache key used to reference the item.
item - The item to be added to the cache.
dsWriteOption - option regarding updating data source.
providerName - unique identifier for the data source.
onDataSourceItemAdded - callback, if provided, is called when item is added to data source.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

add

public CacheItemVersion add(java.lang.String key,
                            java.lang.Object value)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException,
                            ArgumentException
Adds an item into the Cache object with a cache key to reference its location.

Parameters:
key - The cache key used to reference the item.
value - The item to be added to the cache.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

add

public CacheItemVersion add(java.lang.String key,
                            java.lang.Object value,
                            CacheDependency dependency,
                            java.util.Date absoluteExpiration,
                            TimeSpan slidingExpiration,
                            CacheItemPriority priority)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException,
                            ArgumentException
Adds the specified item to the Cache object with dependencies, expiration and priority policies, and a delegate you can use to notify your application when the inserted item is removed from the Cache.

Parameters:
key - The cache key used to reference the item.
value - The item to be added to the cache.
dependency - The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.
absoluteExpiration - The time at which the added object expires and is removed from the cache.
slidingExpiration - The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.
priority - The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

add

public CacheItemVersion add(java.lang.String key,
                            java.lang.Object value,
                            NamedTagsDictionary namedTags)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException,
                            ArgumentException
Adds an item into the Cache object with a cache key to reference its location and using default values provided by the CacheItemPriority enumeration. It also enables the associating tags with the object.

Parameters:
key - The cache key used to reference the item.
value - Value to add in the cache
namedTags - to associate with object.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
NamedTagsDictionary

add

public CacheItemVersion add(java.lang.String key,
                            java.lang.Object value,
                            java.lang.String group,
                            java.lang.String subGroup)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException,
                            ArgumentException
Adds an item in the cache.

Parameters:
key - The cache key used to reference the item.
group - The data group of the item
subGroup - The data group of the item
value - The value to be added in the cache.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
ArgumentException - Thrown when Operation was failed due to an invalid argument.

add

public CacheItemVersion add(java.lang.String key,
                            java.lang.Object value,
                            Tag[] tags)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException,
                            ArgumentException
Adds an item into the Cache object with a cache key to reference its location and using default values provided by the CacheItemPriority enumeration. It also enables the associating tags with the object.

Parameters:
key - The cache key used to reference the item.
value - Value to add in the cache
tags - An array of Tags to associate with the object.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
See Also:
Tag

addAsync

public java.lang.Object addAsync(java.lang.String key,
                                 CacheItem item)
                          throws GeneralFailureException,
                                 OperationFailedException,
                                 AggregateException,
                                 SecurityException,
                                 ConfigurationException,
                                 ArgumentException
Adds a key and CacheItem in the cache Asynchronously.

Parameters:
key - The cache key used to reference the item.
item - CacheItem to be added in the cache.
Returns:
Success or Failure
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

addAsync

public java.lang.Object addAsync(java.lang.String key,
                                 CacheItem item,
                                 DSWriteOption dsWriteOption,
                                 DataSourceItemsAddedCallback onSourceItemAdded)
                          throws GeneralFailureException,
                                 OperationFailedException,
                                 AggregateException,
                                 SecurityException,
                                 ConfigurationException,
                                 ArgumentException
Adds a key and CacheItem in the cache Asynchronously.

Parameters:
key - The cache key used to reference the item.
item - CacheItem to be added in the cache.
dsWriteOption - option regarding updating data source.
onSourceItemAdded - callback, if provided, is called when item is added to data source.
Returns:
Success or Failure
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

addAsync

public java.lang.Object addAsync(java.lang.String key,
                                 CacheItem item,
                                 DSWriteOption dsWriteOption,
                                 java.lang.String providerName,
                                 DataSourceItemsAddedCallback onSourceItemAdded)
                          throws GeneralFailureException,
                                 OperationFailedException,
                                 AggregateException,
                                 SecurityException,
                                 ConfigurationException,
                                 ArgumentException
Adds a key and CacheItem in the cache Asynchronously.

Parameters:
key - The cache key used to reference the item.
item - CacheItem to be added in the cache.
dsWriteOption - option regarding updating data source.
providerName - unique identifier for the data source.
onSourceItemAdded - callback, if provided, is called when item is added to data source.
Returns:
Success or Failure
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

addAsync

public java.lang.Object addAsync(java.lang.String key,
                                 java.lang.Object value,
                                 AsyncItemAddedCallback onAsyncItemAddCallback,
                                 java.lang.String group,
                                 java.lang.String subGroup)
                          throws GeneralFailureException,
                                 OperationFailedException,
                                 AggregateException,
                                 SecurityException,
                                 ConfigurationException,
                                 ArgumentException
Add a key value pair to the cache asynchronously.

Parameters:
key - The cache key used to reference the item.
value - The value to be added.
onAsyncItemAddCallback - Callback that returns the result of the operation
group - The data group of the item
subGroup - The data group of the item
Returns:
Success of Failure
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings. This excpetion is thrown when cache is unable to read or parse configuration file

addBulk

public java.util.HashMap addBulk(java.lang.String[] keys,
                                 CacheItem[] items,
                                 DSWriteOption dsWriteOption,
                                 DataSourceItemsAddedCallback onDataSourceItemAddedCallback)
                          throws GeneralFailureException,
                                 OperationFailedException,
                                 AggregateException,
                                 SecurityException,
                                 ConfigurationException,
                                 ArgumentException
Add array of CacheItem to the cache.

Parameters:
keys - The cache keys used to reference the items.
items - The items that are to be stored
dsWriteOption - option regarding updating data source.
onDataSourceItemAddedCallback - callback, if provided, is called when item is added to data source.
Returns:
keys that are added or that already exists in the cache and their status.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

addBulk

public java.util.HashMap addBulk(java.lang.String[] keys,
                                 CacheItem[] items,
                                 DSWriteOption dsWriteOption,
                                 java.lang.String providerName,
                                 DataSourceItemsAddedCallback onDataSourceItemAddedCallback)
                          throws GeneralFailureException,
                                 OperationFailedException,
                                 AggregateException,
                                 SecurityException,
                                 ConfigurationException,
                                 ArgumentException
Add array of CacheItem to the cache.

Parameters:
keys - The cache keys used to reference the items.
items - The items that are to be stored
dsWriteOption - option regarding updating data source.
providerName - unique identifier for the data source.
onDataSourceItemAddedCallback - callback, if provided, is called when item is added to data source.
Returns:
keys that are added or that already exists in the cache and their status.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

addCacheEventListener

public void addCacheEventListener(com.alachisoft.ncache.event.CacheListener l)
Adds the specified cache listener to receive cache events from this cache. If Cachelistener l is null, no exception is thrown and no action is performed.

Parameters:
l - the CacheListener

addClusterEventListener

public void addClusterEventListener(com.alachisoft.ncache.event.ClusterListener l)
Adds the specified cluster listener to receive custom cache events from this cache. If ClusterListener l is null, no exception is thrown and no action is performed.

Parameters:
l - the ClusterListener

addCustomEventListener

public void addCustomEventListener(com.alachisoft.ncache.event.CustomListener l)
Adds the specified custom listener to receive custom cache events from this cache. If CustomListener l is null, no exception is thrown and no action is performed.

Parameters:
l - the CustomListener

addDependency

public boolean addDependency(java.lang.String key,
                             CacheDependency dep,
                             boolean isResyncRequired)
                      throws GeneralFailureException,
                             OperationFailedException,
                             AggregateException,
                             SecurityException,
                             ConfigurationException
Add dependency to the cache item.

Parameters:
isResyncRequired - If true cache autmatically synchronizes this item with the database on expiration.
key - The cache key used to reference the item.
dep - CacheDependency to be added
Returns:
True if the operation was successfull.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

addDependency

public boolean addDependency(java.lang.String key,
                             CacheSyncDependency dep)
                      throws GeneralFailureException,
                             OperationFailedException,
                             AggregateException,
                             SecurityException,
                             ConfigurationException
Add CacheSyncDependency to the cache item.

Parameters:
key - The cache key used to reference the item.
dep - CacheSyncDependency to be added
Returns:
True if the operation was successfull.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

clear

public void clear()
           throws GeneralFailureException,
                  OperationFailedException,
                  AggregateException,
                  SecurityException,
                  ConfigurationException
Removes all elements from the Cache.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

clear

public void clear(DSWriteOption dsWriteOption,
                  DataSourceClearedCallback onDataSourceCleared)
           throws GeneralFailureException,
                  OperationFailedException,
                  AggregateException,
                  SecurityException,
                  ConfigurationException
Removes all elements from the Cache.

Parameters:
dsWriteOption - option regarding updating data source.
onDataSourceCleared - callback; if provided, is called when data source is cleared.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

clearAsync

public void clearAsync(DSWriteOption dsWriteOption,
                       AsyncCacheClearedCallback onAsyncCacheCleared,
                       DataSourceClearedCallback onDataSourceCleared)
                throws GeneralFailureException,
                       OperationFailedException,
                       AggregateException,
                       SecurityException,
                       ConfigurationException
Removes all elements from the Cache asynchronously.

Parameters:
dsWriteOption - option regarding updating data source.
onAsyncCacheCleared - Callback that returns the result of the operation
onDataSourceCleared - callback; if provided, is called when data source is cleared.
Throws:
GeneralFailureException
OperationFailedException
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

clearClientCache

public void clearClientCache()
Clears Client Cache if initialized


contains

public boolean contains(java.lang.String key)
                 throws GeneralFailureException,
                        OperationFailedException,
                        AggregateException,
                        SecurityException,
                        ConfigurationException
Determines whether the cache contains a specific key.

Parameters:
key - The key to locate in the Cache.
Returns:
true if the Cache contains an element with the specified key; otherwise, false.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

delete

public void delete(java.lang.String key)
            throws GeneralFailureException,
                   OperationFailedException,
                   AggregateException,
                   SecurityException,
                   ConfigurationException
Removes the object from the Cache.

Parameters:
key - The cache key used to reference the item. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

delete

public void delete(java.lang.String key,
                   CacheItemVersion version)
            throws GeneralFailureException,
                   OperationFailedException,
                   AggregateException,
                   SecurityException,
                   ConfigurationException
Removes an item from cache if the specified version is still the most recent version in the cache.

Parameters:
key - The cache key used to reference the item.
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. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

delete

public void delete(java.lang.String key,
                   DSWriteOption dsWriteOption,
                   DataSourceItemsRemovedCallback onDataSourceItemRemoved)
            throws GeneralFailureException,
                   OperationFailedException,
                   AggregateException,
                   SecurityException,
                   ConfigurationException
Removes the object from the Cache.

Parameters:
key - The cache key used to reference the item.
dsWriteOption - option regarding updating data source.
onDataSourceItemRemoved - callback; if provided, is called when item is removed from data source. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

delete

public void delete(java.lang.String key,
                   DSWriteOption dsWriteOption,
                   java.lang.String providerName,
                   DataSourceItemsRemovedCallback onDataSourceItemRemoved)
            throws GeneralFailureException,
                   OperationFailedException,
                   AggregateException,
                   SecurityException,
                   ConfigurationException
Removes the object from the Cache.

Parameters:
key - The cache key used to reference the item.
dsWriteOption - option regarding updating data source.
providerName - unique identifier for the data source.
onDataSourceItemRemoved - callback; if provided, is called when item is removed from data source. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

delete

public void delete(java.lang.String key,
                   LockHandle lockHandle)
            throws GeneralFailureException,
                   OperationFailedException,
                   AggregateException,
                   SecurityException,
                   ConfigurationException
Removes an item from cache if it is not already locked or if the correct lock-id is specified.

Parameters:
key - The cache key used to reference the item.
lockHandle - If the item is locked then, it can be removed only if the correct lockHandle is specified. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

deleteBulk

public void deleteBulk(java.lang.String[] keys,
                       DSWriteOption dsWriteOption,
                       DataSourceItemsRemovedCallback onDataSourceItemRemoved)
                throws GeneralFailureException,
                       OperationFailedException,
                       AggregateException,
                       SecurityException,
                       ConfigurationException
Removes the objects from the Cache.

Parameters:
keys - The cache keys used to reference the item.
dsWriteOption - option regarding updating data source.
onDataSourceItemRemoved - callback; if provided, is called when item is removed from data source. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

deleteBulk

public void deleteBulk(java.lang.String[] keys,
                       DSWriteOption dsWriteOption,
                       java.lang.String providerName,
                       DataSourceItemsRemovedCallback onDataSourceItemRemoved)
                throws GeneralFailureException,
                       OperationFailedException,
                       AggregateException,
                       SecurityException,
                       ConfigurationException
Removes the objects from the Cache.

Parameters:
keys - The cache keys used to reference the item.
dsWriteOption - option regarding updating data source.
providerName - unique identifier for the data source.
onDataSourceItemRemoved - callback; if provided, is called when item is removed from data source.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

dispose

public void dispose()
             throws GeneralFailureException,
                    OperationFailedException,
                    ConfigurationException
Disposes this cache instance.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

get

public java.lang.Object get(java.lang.String key)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException
Retrieves the specified item from the Cache object.

Parameters:
key - The identifier for the cache item to retrieve.
Returns:
The retrieved cache item, or a null reference (Nothing in Visual Basic) if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

get

public java.lang.Object get(java.lang.String key,
                            CacheItemVersion version)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException
Retrieves the specified item from the Cache object. It accepts the CacheItemVersion. It item version is 0, object would be retrieved from cache with version. If any value greater the 0 is specified,then object is returned from the cache only if that is the current version of the object in the cache.

Parameters:
key - The identifier for the cache item to retrieve.
version - the version of the object.
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

get

public java.lang.Object get(java.lang.String key,
                            DSReadOption dsReadOption)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException
Retrieves the specified item from the Cache object.

Parameters:
key - The identifier for the cache item to retrieve.
dsReadOption - Options regarding reading from data source
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

get

public java.lang.Object get(java.lang.String key,
                            DSReadOption dsReadOption,
                            CacheItemVersion version)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException
Retrieves the specified item from the Cache object.

Parameters:
key - The identifier for the cache item to retrieve.
dsReadOption - Options regarding reading from data source
version - he version of the object.
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

get

public java.lang.Object get(java.lang.String key,
                            java.lang.String providerName,
                            DSReadOption dsReadOption)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException
Retrieves the specified item from the Cache object.

Parameters:
key - The identifier for the cache item to retrieve.
providerName - unique identifier for the data source.
dsReadOption - Options regarding reading from data source
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

get

public java.lang.Object get(java.lang.String key,
                            java.lang.String providerName,
                            DSReadOption dsReadOption,
                            CacheItemVersion version)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException
Retrieves the specified item from the Cache object.

Parameters:
key - The identifier for the cache item to retrieve.
providerName - unique identifier for the data source.
dsReadOption - Options regarding reading from data source
version - he version of the object.
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

get

public java.lang.Object get(java.lang.String key,
                            java.lang.String group,
                            java.lang.String subGroup,
                            DSReadOption dsReadOption)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException
Retrieves the specified item from the Cache object.

Parameters:
key - The identifier for the cache item to retrieve.
group - Group of the object.
subGroup - SubGroup of the object.
dsReadOption - Options regarding reading from data source
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

get

public java.lang.Object get(java.lang.String key,
                            TimeSpan lockTimeout,
                            LockHandle lockHandle,
                            boolean acquireLock)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException
Retrieves the specified item from the Cache object if it is not already locked. Otherwise returns null. This is different from the normal Get operation where an item is returned ignoring the lock altogether.

Parameters:
key - The identifier for the cache item to retrieve
lockTimeout - The time span after which the lock is automatically released
lockHandle - An instance of LockHandle to hold the lock information. lockHandle will be populated by cache.
acquireLock - A flag to determine whether to acquire a lock or not
Returns:
The retrieved cache item, or a null reference if the key is not found
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache. {@codeThe following example demonstrates how to retrieve the cached value and acquire a lock at the same time Cache theCache = NCache.initializeCache("myreplicatedcache"); theCache.Add("cachedItemKey", "cachedItemValue"); LockHandle lockHandle = new LockHandle(); object cachedItem = theCache.get("cachedItemKey", Cache.NoLockingExpiration, lockHandle, true);
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings. }

getBulk

public java.util.HashMap getBulk(java.lang.String[] keys,
                                 DSReadOption dsReadOption)
                          throws GeneralFailureException,
                                 OperationFailedException,
                                 AggregateException,
                                 SecurityException,
                                 ConfigurationException
Retrieves the object from the cache for the given keys as key value pairs

Parameters:
keys - The keys against which items are to be fetched.
dsReadOption - Options regarding reading from data source
Returns:
The retrieved cache items.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getBulk

public java.util.HashMap getBulk(java.lang.String[] keys,
                                 java.lang.String provideName,
                                 DSReadOption dsReadOption)
                          throws GeneralFailureException,
                                 OperationFailedException,
                                 AggregateException,
                                 SecurityException,
                                 ConfigurationException
Retrieves the object from the cache for the given keys as key value pairs

Parameters:
keys - The keys against which items are to be fetched.
provideName - unique identifier for the data source.
dsReadOption - Options regarding reading from data source
Returns:
The retrieved cache items.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getByAllTags

public java.util.HashMap getByAllTags(Tag[] tags)
                               throws GeneralFailureException,
                                      OperationFailedException,
                                      AggregateException,
                                      SecurityException,
                                      java.lang.Exception
Returns the cached objects that have all the same tags in common. (Returns the Intersection set.)

Parameters:
tags - An array of Tag to search with.
Returns:
A HashMap containing cache keys and associated objects.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
java.lang.Exception

getByAnyTag

public java.util.HashMap getByAnyTag(Tag[] tags)
                              throws GeneralFailureException,
                                     OperationFailedException,
                                     AggregateException,
                                     SecurityException,
                                     java.lang.Exception
Returns the cached objects that have any of the same tags in common. (Returns the Union set.)

Parameters:
tags - An array of Tag to search with.
Returns:
A HashMap containing cache keys and associated objects.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
java.lang.Exception
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.

getByTag

public java.util.HashMap getByTag(Tag tag)
                           throws GeneralFailureException,
                                  OperationFailedException,
                                  AggregateException,
                                  SecurityException,
                                  java.lang.Exception
Gets all the cached objects with the specified tag.

Parameters:
tag - The tag to search with.
Returns:
A HashMap containing cache keys and associated objects.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
java.lang.Exception
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.

getCacheItem

public CacheItem getCacheItem(java.lang.String key)
                       throws GeneralFailureException,
                              OperationFailedException,
                              AggregateException,
                              SecurityException,
                              ConfigurationException
Get the cache item stored in cache.

Parameters:
key - The cache key used to reference the item.
Returns:
The Cache item in the cache against the specified key.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

getCacheItem

public CacheItem getCacheItem(java.lang.String key,
                              CacheItemVersion version)
                       throws GeneralFailureException,
                              OperationFailedException,
                              AggregateException,
                              SecurityException,
                              ConfigurationException
Retrieves the specified item from the Cache object. It accepts the by reference. See @link CacheItemVersion by reference If null is passed for CacheItemVersion, then the version of the object from the cache is returned. If non-null CacheItemVersion is passed, then object is returned from the cache only if that is the current version of the object in the cache.

Parameters:
key - The identifier for the cache item to retrieve.
version - The version of the object.
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getCacheItem

public CacheItem getCacheItem(java.lang.String key,
                              DSReadOption dsReadOption)
                       throws GeneralFailureException,
                              OperationFailedException,
                              AggregateException,
                              SecurityException,
                              ConfigurationException
Retrieves the specified item from the Cache object.

Parameters:
key - The identifier for the cache item to retrieve.
dsReadOption - Options regarding reading from data source
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getCacheItem

public CacheItem getCacheItem(java.lang.String key,
                              DSReadOption dsReadOption,
                              CacheItemVersion version)
                       throws GeneralFailureException,
                              OperationFailedException,
                              AggregateException,
                              SecurityException,
                              ConfigurationException
Parameters:
key - key The identifier for the cache item to retrieve.
dsReadOption - Options regarding reading from data source
version -
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getCacheItem

public CacheItem getCacheItem(java.lang.String key,
                              java.lang.String providerName,
                              DSReadOption dsReadOption)
                       throws GeneralFailureException,
                              OperationFailedException,
                              AggregateException,
                              SecurityException,
                              ConfigurationException
Retrieves the specified item from the Cache object.

Parameters:
key - The identifier for the cache item to retrieve.
providerName - A specific name for the data source
dsReadOption - Options regarding reading from data source
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getCacheItem

public CacheItem getCacheItem(java.lang.String key,
                              java.lang.String providerName,
                              DSReadOption dsReadOption,
                              CacheItemVersion version)
                       throws GeneralFailureException,
                              OperationFailedException,
                              AggregateException,
                              SecurityException,
                              ConfigurationException
Retrieves the specified item from the Cache object. If the object is read through the data source, put it in the cache. It accepts the @link CacheItemVersion by reference. If null is passed for CacheItemVersion, then the version of the object from the cache is returned. If non-null CacheItemVersion is passed, then object is returned from the cache only if that is the current version of the object in the cache.

Parameters:
key - The identifier for the cache item to retrieve.
providerName - A specific name for the data source
dsReadOption - Options regarding reading from data source.
version - The version of the object.
Returns:
The retrieved cache item, or a null reference if the key is not found
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getCacheItem

public CacheItem getCacheItem(java.lang.String key,
                              java.lang.String group,
                              java.lang.String subGroup)
                       throws GeneralFailureException,
                              OperationFailedException,
                              AggregateException,
                              SecurityException,
                              ConfigurationException
Get the cache item stored in cache.

Parameters:
key - The cache key used to reference the item.
group - The group whose keys are to be returned.
subGroup - The sub group of the group foe which keys are to be returned.
Returns:
The Cache item in the cache against the specified key.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

getCacheItem

public CacheItem getCacheItem(java.lang.String key,
                              java.lang.String group,
                              java.lang.String subGroup,
                              DSReadOption dsReadOption)
                       throws GeneralFailureException,
                              OperationFailedException,
                              AggregateException,
                              SecurityException,
                              ConfigurationException
Retrieves the specified item from the Cache object. If the object is read through the data source, put it against the given group and sub group.

Parameters:
key - The identifier for the cache item to retrieve.
group - The name of the group which the item belongs to.
subGroup - The name of the subGroup within a group.
dsReadOption - Options regarding reading from data source.
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getCacheItem

public CacheItem getCacheItem(java.lang.String key,
                              TimeSpan lockTimeout,
                              LockHandle lockHandle,
                              boolean acquireLock)
                       throws GeneralFailureException,
                              OperationFailedException,
                              AggregateException,
                              SecurityException,
                              ConfigurationException
Get the cache item stored in cache.

Parameters:
key - The cache key used to reference the item.
lockTimeout - The TimeSpan after which the lock is automatically released.
lockHandle - An instance of "LockHandle" to hold the lock information.
acquireLock - A flag to determine whether to acquire a lock or not.
Returns:
The retrieved cache item, or a null reference if the key is not found.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

getCacheStream

public CacheStream getCacheStream(java.lang.String key,
                                  StreamMode streamMode)
                           throws java.lang.Exception
Get Cache Stream based on mode.

Parameters:
key - The identifier for the cache item.
streamMode - Specified the mode in which stream will be opened e.g; Read, Write and ReadWithoutLock
Returns:
CacheStream object
Throws:
java.lang.Exception - Thrown when an exception occurs while performing operation.

getCacheStream

public CacheStream getCacheStream(java.lang.String key,
                                  StreamMode streamMode,
                                  CacheItemPriority priority)
                           throws java.lang.Exception
Gets an instance of the CacheStream class.

Parameters:
key - The key used to reference the stream.
streamMode - Enumeration to specify the desired mode to open the stream.
priority - The relative cost of the object, as expressed by enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost. returns An instance of CacheStream
Returns:
CacheStream An instance of CacheStream
Throws:
java.lang.Exception

getCacheStream

public CacheStream getCacheStream(java.lang.String key,
                                  StreamMode streamMode,
                                  java.util.Date absoluteExpiration,
                                  TimeSpan slidingExpiration,
                                  CacheItemPriority priority)
                           throws java.lang.Exception
Get Cache Stream based on mode.

Parameters:
key - The identifier for the cache item.
streamMode - Specified the mode in which stream will be opened e.g; Read, Write and ReadWithoutLock
absoluteExpiration - The time at which the added object expires and is removed from the cache.
slidingExpiration - The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.
priority - The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.
Returns:
CacheStream object
Throws:
java.lang.Exception - Thrown when an exception occurs while performing operation.

getCacheStream

public CacheStream getCacheStream(java.lang.String key,
                                  java.lang.String group,
                                  java.lang.String subGroup,
                                  StreamMode streamMode,
                                  CacheDependency dependency,
                                  java.util.Date absoluteExpiration,
                                  TimeSpan slidingExpiration,
                                  CacheItemPriority priority)
                           throws java.lang.Exception
Get Cache Stream based on mode.

Parameters:
key - The identifier for the cache item.
group - The data group of the item
subGroup - The data group of the item
streamMode - Specified the mode in which stream will be opened e.g; Read, Write and ReadWithoutLock
dependency - The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.
absoluteExpiration - The time at which the added object expires and is removed from the cache.
slidingExpiration - The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.
priority - The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.
Returns:
CacheStream object
Throws:
java.lang.Exception - Thrown when an exception occurs while performing operation.

getCacheStream

public CacheStream getCacheStream(java.lang.String key,
                                  java.lang.String group,
                                  java.lang.String subgroup,
                                  StreamMode streamMode,
                                  CacheItemPriority priority)
                           throws java.lang.Exception
Gets an instance of the CacheStream class.

Parameters:
key - The identifier for the cache item.
group - whose keys are to be returned.
subgroup - of the group foe which keys are to be returned.
streamMode - Specified the mode in which stream will be opened e.g; Read, Write and ReadWithoutLock
priority - The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.
Returns:
CacheStream object
Throws:
java.lang.Exception - Thrown when an exception occurs while performing operation.

getCacheStream

public CacheStream getCacheStream(java.lang.String key,
                                  java.lang.String group,
                                  java.lang.String subgroup,
                                  StreamMode streamMode,
                                  java.util.Date absoluteExpiration,
                                  TimeSpan slidingExpiration,
                                  CacheItemPriority priority)
                           throws java.lang.Exception
Gets an instance of the CacheStream class.

Parameters:
key - The identifier for the cache item.
group - whose keys are to be returned.
subgroup - of the group foe which keys are to be returned.
streamMode - Specified the mode in which stream will be opened e.g; Read, Write and ReadWithoutLock
absoluteExpiration - The time at which the added object expires and is removed from the cache.
slidingExpiration - The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.
priority - The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.
Returns:
CacheStream object
Throws:
java.lang.Exception - Thrown when an exception occurs while performing operation.

getClientCacheStatus

public boolean getClientCacheStatus()
Returns:

getCount

public long getCount()
              throws GeneralFailureException,
                     OperationFailedException,
                     AggregateException,
                     SecurityException,
                     ConfigurationException
Returns the cache count. Note that this count is the total item count in the whole cluster.

Returns:
The count of the cache elements.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getEnumerator

public java.util.Enumeration getEnumerator()
Returns:

getGroupData

public java.util.HashMap getGroupData(java.lang.String group,
                                      java.lang.String subGroup)
                               throws GeneralFailureException,
                                      OperationFailedException,
                                      AggregateException,
                                      SecurityException,
                                      ConfigurationException
Retrieves the key and value pairs in a group or sub group. If only group is specified, data for the group and all the sub groups of the group are returned. If both the group and sub group are specified. Only the data related to the sub group are returned.

Parameters:
group - The group whose keys are to be returned.
subGroup - The sub group of the group foe which keys are to be returned.
Returns:
The list of key and value pairs of a group or a sub group.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
OperationFailedException - Thrown whenever an API fails.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getGroupKeys

public java.util.Collection getGroupKeys(java.lang.String group,
                                         java.lang.String subGroup)
                                  throws GeneralFailureException,
                                         OperationFailedException,
                                         AggregateException,
                                         SecurityException,
                                         ConfigurationException
Retrieves the key and value pairs in a group or sub group. If only group is specified, data for the group and all the sub groups of the group are returned. If both the group and sub group are specified. Only the data related to the sub group are returned.

Parameters:
group - The group whose keys are to be returned.
subGroup - The sub group of the group foe which keys are to be returned.
Returns:
The list of keys of a group or a sub group.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getIfNewer

public java.lang.Object getIfNewer(java.lang.String key,
                                   CacheItemVersion version)
                            throws GeneralFailureException,
                                   OperationFailedException,
                                   AggregateException,
                                   SecurityException,
                                   ConfigurationException
Gets an object from the cache only if a newer version of the object exists in cache.

Parameters:
key - key used to reference the desired object
version - The version of the desired object passed by reference.
Returns:
The version of the desired object passed by reference.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getIfNewer

public java.lang.Object getIfNewer(java.lang.String key,
                                   java.lang.String group,
                                   java.lang.String subGroup,
                                   CacheItemVersion version)
                            throws GeneralFailureException,
                                   OperationFailedException,
                                   AggregateException,
                                   SecurityException,
                                   ConfigurationException
Gets an object from the cache only if a newer version of the object exists in cache.

Parameters:
key - key used to reference the desired object
group - key used to reference the desired object
subGroup - The group of the cached object
version - The subGroup of the cached object
Returns:
The version of the desired object passed by reference.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
OperationFailedException - Thrown whenever an API fails.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

getKeysByAllTags

public java.util.Collection getKeysByAllTags(Tag[] tags)
                                      throws GeneralFailureException,
                                             OperationFailedException,
                                             AggregateException,
                                             SecurityException,
                                             java.lang.Exception
Returns the cached objects that have all the same tags in common. (Returns the Intersection set.)

Parameters:
tags - An array of Tag to search with.
Returns:
A Collection containing cache keys.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
java.lang.Exception

getKeysByAnyTag

public java.util.Collection getKeysByAnyTag(Tag[] tags)
                                     throws GeneralFailureException,
                                            OperationFailedException,
                                            AggregateException,
                                            SecurityException,
                                            java.lang.Exception
Returns the cached objects that have any of the same tags in common. (Returns the Union set.)

Parameters:
tags - An array of Tag to search with.
Returns:
A Collection containing cache keys.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
java.lang.Exception

getKeysByTag

public java.util.Collection getKeysByTag(Tag tag)
                                  throws GeneralFailureException,
                                         OperationFailedException,
                                         AggregateException,
                                         SecurityException,
                                         java.lang.Exception
Gets all the cached objects with the specified tag.

Parameters:
tag - The tag to search with.
Returns:
A Collection containing cache keys.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
java.lang.Exception

insert

public CacheItemVersion insert(java.lang.String key,
                               CacheItem item)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException,
                               ArgumentException
Add a CacheItem to the cache

Parameters:
key - The cache key used to reference the item.
item - The item to be added to the cache.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
OperationFailedException - Thrown whenever an API fails.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

insert

public CacheItemVersion insert(java.lang.String key,
                               CacheItem item,
                               DSWriteOption dsWriteOption,
                               DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException,
                               ArgumentException
Add a CacheItem to the cache

Parameters:
key - The cache key used to reference the item.
item - The item to be added to the cache.
dsWriteOption - option regarding updating data source.
onDataSourceItemUpdated - callback; if provided, is called when item is updated in data source.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

insert

public CacheItemVersion insert(java.lang.String key,
                               CacheItem item,
                               DSWriteOption dsWriteOption,
                               java.lang.String providerName,
                               DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException,
                               ArgumentException
Add a CacheItem to the cache

Parameters:
key - The cache key used to reference the item.
item - The item to be added to the cache.
dsWriteOption - option regarding updating data source.
providerName - unique identifier for the data source.
onDataSourceItemUpdated - callback; if provided, is called when item is updated in data source.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
OperationFailedException - Thrown whenever an API fails.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

insert

public CacheItemVersion insert(java.lang.String key,
                               CacheItem item,
                               LockHandle lockHandle,
                               boolean releaseLock)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException,
                               ArgumentException
Parameters:
key - The cache key used to reference the item.
item - The item to be added to the cache.
lockHandle - An instance of LockHandle. If the item is locked, then it can be updated only if the correct lockHandle is specified.
releaseLock - A flag to determine whether or not release lock after operation is performed.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

insert

public CacheItemVersion insert(java.lang.String key,
                               java.lang.Object value)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException,
                               ArgumentException
Inserts an item into the Cache object with a cache key to reference its location and using default values provided by the CacheItemPriority enumeration.

Parameters:
key - The cache key used to reference the item.
value - the item to be added.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

insert

public CacheItemVersion insert(java.lang.String key,
                               java.lang.Object value,
                               CacheDependency dependency,
                               java.util.Date absoluteExpiration,
                               TimeSpan slidingExpiration,
                               CacheItemPriority priority)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException,
                               ArgumentException
Inserts an object into the Cache with dependencies and expiration policies.

Parameters:
key - The cache key used to reference the item.
value - The item to be added to the cache.
dependency - The file or cache key dependencies for the inserted object. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this parameter contains a null reference
absoluteExpiration - The time at which the added object expires and is removed from the cache.
slidingExpiration - The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.
priority -
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

insert

public CacheItemVersion insert(java.lang.String key,
                               java.lang.Object value,
                               NamedTagsDictionary namedTags)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException,
                               ArgumentException
Inserts an item into the Cache with a cache key to reference its location and using default values provided by the CacheItemPriority enumeration. It also enables the associating tags with the object.

Parameters:
key - The cache key used to reference the item.
value - The item to be added to the cache.
namedTags - to associate with object.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
NamedTagsDictionary

insert

public CacheItemVersion insert(java.lang.String key,
                               java.lang.Object value,
                               java.lang.String group,
                               java.lang.String subGroup)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException,
                               ArgumentException
Inserts an Object into the Cache.

Parameters:
key - The cache key used to reference the item.
value - the value to be added in the cache.
group - the data group of the item.
subGroup - the data group of the item.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

insert

public CacheItemVersion insert(java.lang.String key,
                               java.lang.Object value,
                               Tag[] tags)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException,
                               ArgumentException
Inserts an item into the Cache with a cache key to reference its location and using default values provided by the CacheItemPriority enumeration. It also enables the associating tags with the object.

Parameters:
key - The cache key used to reference the item.
value - The item to be added to the cache.
tags - An array of Tag to associate with the object.
Returns:
The item version in cache
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
Tag

insertAsync

public void insertAsync(java.lang.String key,
                        CacheItem item,
                        DSWriteOption dsWriteOption,
                        DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
                 throws GeneralFailureException,
                        OperationFailedException,
                        AggregateException,
                        SecurityException,
                        ConfigurationException,
                        ArgumentException
Inserts a key and CacheItem in the cache.

Parameters:
key - The cache key used to reference the item.
item - The item that is to be stored
dsWriteOption - option regarding updating data source.
onDataSourceItemUpdated - callback; if provided, is called when item is updated in data source.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItem

insertAsync

public void insertAsync(java.lang.String key,
                        CacheItem item,
                        java.lang.String providerName,
                        DSWriteOption dsWriteOption,
                        DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
                 throws GeneralFailureException,
                        OperationFailedException,
                        AggregateException,
                        SecurityException,
                        ConfigurationException,
                        ArgumentException
Inserts a key and CacheItem in the cache.

Parameters:
key - The cache key used to reference the item.
item - The item that is to be stored.
providerName - unique identifier for the data source.
dsWriteOption - option regarding updating data source.
onDataSourceItemUpdated - callback; if provided, is called when item is updated in data source.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
GeneralFailureException Thrown when an exception occurs during a clustered operation.

insertAsync

public void insertAsync(java.lang.String key,
                        java.lang.Object value,
                        AsyncItemUpdatedCallback asyncItemUpdatedCallback,
                        java.lang.String group,
                        java.lang.String subGroup)
                 throws GeneralFailureException,
                        OperationFailedException,
                        AggregateException,
                        SecurityException,
                        ConfigurationException,
                        ArgumentException
Insert a CacheItem to the cache asynchoronously

Parameters:
key - The cache key used to reference the item.
value - The value to be added in teh cache.
asyncItemUpdatedCallback -
group -
subGroup -
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
ArgumentException - Thrown when Operation was failed due to an invalid argument.

insertBulk

public java.util.HashMap insertBulk(java.lang.String[] keys,
                                    CacheItem[] items,
                                    DSWriteOption dsWriteOption,
                                    DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
                             throws GeneralFailureException,
                                    OperationFailedException,
                                    AggregateException,
                                    SecurityException,
                                    ConfigurationException,
                                    ArgumentException
Insert list of CacheItem to the cache

Parameters:
keys - The cache keys used to reference the items.
items -
dsWriteOption - option regarding updating data source.
onDataSourceItemUpdated - callback; if provided, is called when item is updated in data source.
Returns:
The list of items could not be added in the cache.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
GeneralFailureException Thrown when an exception occurs during a clustered operation.

insertBulk

public java.util.HashMap insertBulk(java.lang.String[] keys,
                                    CacheItem[] items,
                                    DSWriteOption dsWriteOption,
                                    java.lang.String providerName,
                                    DataSourceItemsUpdatedCallback onDataSourceItemUpdated)
                             throws GeneralFailureException,
                                    OperationFailedException,
                                    AggregateException,
                                    SecurityException,
                                    ConfigurationException,
                                    ArgumentException
Insert list of CacheItem to the cache

Parameters:
keys - The cache keys used to reference the items.
items -
providerName - unique identifier for the data source.
dsWriteOption - option regarding updating data source.
onDataSourceItemUpdated - callback; if provided, is called when item is updated in data source.
Returns:
The list of items could not be added in the cache.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ArgumentException - Thrown when Operation was failed due to an invalid argument.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
GeneralFailureException Thrown when an exception occurs during a clustered operation.

isExceptionsEnabled

public boolean isExceptionsEnabled()
If this property is set the Cache object throws exceptions from public operations. If not set no exception is thrown and the operation fails silently. Setting this flag is especially helpful during development phase of application since exceptions provide more information about the specific causes of failure.

Returns:
true if exceptions are enabled, otherwise false.

lock

public boolean lock(java.lang.String key,
                    TimeSpan lockTimeout,
                    LockHandle lockHandle)
             throws OperationFailedException,
                    SecurityException,
                    GeneralFailureException,
                    AggregateException,
                    ConfigurationException
Acquire a lock on an item in cache.

Parameters:
key - key of cached item to be locked.
lockTimeout - 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.
Returns:
True if the lock was acquired successfully, false otherwise
Throws:
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

raiseCustomEvent

public void raiseCustomEvent(java.lang.Object key,
                             java.lang.Object value)
                      throws GeneralFailureException,
                             OperationFailedException,
                             AggregateException,
                             SecurityException,
                             ConfigurationException
Raises a custom event.

Parameters:
key - The key of the event.
value - The value.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

registerAddNotification

public void registerAddNotification()
                             throws GeneralFailureException,
                                    OperationFailedException,
                                    AggregateException,
                                    SecurityException,
                                    ConfigurationException
Registers the Add operation notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

registerCacheStoppedNotification

public void registerCacheStoppedNotification()
                                      throws GeneralFailureException,
                                             OperationFailedException,
                                             AggregateException,
                                             SecurityException,
                                             ConfigurationException
Register the cache stopped event with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

registerClearNotification

public void registerClearNotification()
                               throws GeneralFailureException,
                                      OperationFailedException,
                                      AggregateException,
                                      SecurityException,
                                      ConfigurationException
Registers the Clear operation notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

registerCQ

public void registerCQ(ContinuousQuery query)
                throws GeneralFailureException,
                       OperationFailedException,
                       AggregateException,
                       SecurityException,
                       ConfigurationException
Registers the notifications based on the specified ContinuousQuery.

Parameters:
query - ContinuousQuery to register notifications for.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

registerCustomNotification

public void registerCustomNotification()
                                throws GeneralFailureException,
                                       OperationFailedException,
                                       AggregateException,
                                       SecurityException,
                                       ConfigurationException
Registers the Clear operation notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

registerInsertNotification

public void registerInsertNotification()
                                throws GeneralFailureException,
                                       OperationFailedException,
                                       AggregateException,
                                       SecurityException,
                                       ConfigurationException
Registers the Insert operation notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

registerKeyNotificationCallback

public void registerKeyNotificationCallback(java.lang.String[] keys,
                                            CacheItemUpdatedCallback updateCallback,
                                            CacheItemRemovedCallback removeCallback)
                                     throws GeneralFailureException,
                                            OperationFailedException,
                                            AggregateException,
                                            SecurityException,
                                            ConfigurationException
Registers the CacheItemUpdatedCallback and/or CacheItemRemovedCallback for the list of specified keys. CacheItemUpdatedCallback and/or CacheItemRemovedCallback provided this way are very useful because a client application can show interest in any item already present in the cache. As soon as the item is updated or removed from the cache, the client application is notified and actions can be taken accordingly.

Parameters:
keys - The list of the cache keys used to reference the cache items.
updateCallback - The CacheItemUpdatedCallback that is invoked if the item with the specified key is updated in the cache.
removeCallback - The CacheItemRemovedCallback is invoked when the item with the specified key is removed from the cache.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItemUpdatedCallback, CacheItemRemovedCallback

registerKeyNotificationCallback

public void registerKeyNotificationCallback(java.lang.String key,
                                            CacheItemUpdatedCallback updateCallback,
                                            CacheItemRemovedCallback removeCallback)
                                     throws GeneralFailureException,
                                            OperationFailedException,
                                            AggregateException,
                                            SecurityException,
                                            ConfigurationException
Registers the CacheItemUpdatedCallback and/or CacheItemRemovedCallback for the specified key. CacheItemUpdatedCallback and/or CacheItemRemovedCallback provided this way are very useful because a client application can show interest in any item already present in the cache. As soon as the item is updated or removed from the cache, the client application is notified and actions can be taken accordingly.

Parameters:
key - The cache key used to reference the cache item.
updateCallback - The CacheItemUpdatedCallback that is invoked if the item with the specified key is updated in the cache.
removeCallback - The CacheItemRemovedCallback is invoked when the item with the specified key is removed from the cache.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItemUpdatedCallback, CacheItemRemovedCallback

registerMemberJoinedNotification

public void registerMemberJoinedNotification()
                                      throws GeneralFailureException,
                                             OperationFailedException,
                                             AggregateException,
                                             SecurityException,
                                             ConfigurationException
Registers the Member Joined notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

registerMemberLeftNotification

public void registerMemberLeftNotification()
                                    throws GeneralFailureException,
                                           OperationFailedException,
                                           AggregateException,
                                           SecurityException,
                                           ConfigurationException
Registers the Member Left notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

registerRemoveNotification

public void registerRemoveNotification()
                                throws GeneralFailureException,
                                       OperationFailedException,
                                       AggregateException,
                                       SecurityException,
                                       ConfigurationException
Registers the Remove operation notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

remove

public java.lang.Object remove(java.lang.String key)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException
Removes the object from the Cache.

Parameters:
key - The cache key used to reference the item.
Returns:
The item removed from the Cache. If the value in the key parameter is not found, returns a null reference.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

remove

public java.lang.Object remove(java.lang.String key,
                               CacheItemVersion version)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException
Removes an item from cache if the specified version is still the most recent version in the cache.

Parameters:
key - The cache key used to reference the item.
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.
Returns:
The item removed from the Cache. If the value in the key parameter is not found, returns a null reference GeneralFailureException Thrown when an exception occurs during a clustered operation.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

remove

public java.lang.Object remove(java.lang.String key,
                               DSWriteOption dsWriteOption,
                               DataSourceItemsRemovedCallback onDataSourceItemRemoved)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException
Removes the object from the Cache.

Parameters:
key - The cache key used to reference the item.
dsWriteOption - option regarding updating data source.
onDataSourceItemRemoved - callback; if provided, is called when item is removed from data source. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Returns:
The item removed from the Cache. If the value in the key parameter is not found, returns a null reference.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

remove

public java.lang.Object remove(java.lang.String key,
                               DSWriteOption dsWriteOption,
                               java.lang.String providerName,
                               DataSourceItemsRemovedCallback onDataSourceItemRemoved)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException
Removes the object from the Cache.

Parameters:
key - The cache key used to reference the item.
dsWriteOption - option regarding updating data source.
providerName - unique identifier for the data source.
onDataSourceItemRemoved - callback; if provided, is called when item is removed from data source. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Returns:
The item removed from the Cache. If the value in the key parameter is not found, returns a null reference.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

remove

public java.lang.Object remove(java.lang.String key,
                               LockHandle lockHandle)
                        throws GeneralFailureException,
                               OperationFailedException,
                               AggregateException,
                               SecurityException,
                               ConfigurationException
Removes an item from cache if it is not already locked or if the correct lock-id is specified.

Parameters:
key - The cache key used to reference the item.
lockHandle - If the item is locked then, it can be removed only if the correct lockHandle is specified.
Returns:
The item removed from the Cache. If the value in the key parameter is not found, returns a null reference GeneralFailureException Thrown when an exception occurs during a clustered operation.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

removeAsync

public void removeAsync(java.lang.String key,
                        AsyncItemRemovedCallback asyncItemRemovedCallback,
                        DSWriteOption dsWriteOption,
                        DataSourceItemsRemovedCallback onDataSourceItemRemoved)
                 throws GeneralFailureException,
                        OperationFailedException,
                        AggregateException,
                        SecurityException,
                        ConfigurationException
Removes the object from the Cache. This is similar to Remove except that the operation is performed asynchronously. A ItemRemoved event is fired upon successful completion of this method.It is not possible to determine if the actual operation has failed, therefore use this operation for the cases when it does not matter much.

Parameters:
key - The cache key used to reference the item.
asyncItemRemovedCallback - callback can be used by the client application to get the result of the Asynchronous Remove operation
dsWriteOption - option regarding updating data source.
onDataSourceItemRemoved - callback; if provided, is called when item is removed from data source. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
OperationFailedException - Thrown whenever an API fails.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

removeAsync

public void removeAsync(java.lang.String key,
                        AsyncItemRemovedCallback asyncItemRemovedCallback,
                        DSWriteOption dsWriteOption,
                        java.lang.String providerName,
                        DataSourceItemsRemovedCallback onDataSourceItemRemoved)
                 throws GeneralFailureException,
                        OperationFailedException,
                        AggregateException,
                        SecurityException,
                        ConfigurationException
Removes the object from the Cache. This is similar to Remove except that the operation is performed asynchronously. A ItemRemoved event is fired upon successful completion of this method.It is not possible to determine if the actual operation has failed, therefore use this operation for the cases when it does not matter much.

Parameters:
key - The cache key used to reference the item.
asyncItemRemovedCallback - callback can be used by the client application to get the result of the Asynchronous Remove operation
dsWriteOption - option regarding updating data source.
providerName - unique identifier for the data source.
onDataSourceItemRemoved - callback; if provided, is called when item is removed from data source. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

removeBulk

public java.util.HashMap removeBulk(java.lang.String[] keys,
                                    DSWriteOption dsWriteOption,
                                    DataSourceItemsRemovedCallback onDataSourceItemRemoved)
                             throws GeneralFailureException,
                                    OperationFailedException,
                                    AggregateException,
                                    SecurityException,
                                    ConfigurationException
Removes the objects from the Cache.

Parameters:
keys - The cache keys used to reference the item.
dsWriteOption - option regarding updating data source.
onDataSourceItemRemoved - callback; if provided, is called when item is removed from data source. GeneralFailureException Thrown when an exception occurs during a clustered operation.
Returns:
The items removed from the Cache. If the value in the keys parameter is not found, returns a null reference
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown if the user is not authorized to access cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

removeBulk

public java.util.HashMap removeBulk(java.lang.String[] keys,
                                    DSWriteOption dsWriteOption,
                                    java.lang.String providerName,
                                    DataSourceItemsRemovedCallback onDataSourceItemRemoved)
                             throws GeneralFailureException,
                                    OperationFailedException,
                                    AggregateException,
                                    SecurityException,
                                    ConfigurationException
Removes the objects from the Cache.

Parameters:
keys - The cache keys used to reference the item.
dsWriteOption - option regarding updating data source.
providerName - unique identifier for the data source.
onDataSourceItemRemoved - callback; if provided, is called when item is removed from data source.
Returns:
The items removed from the Cache. If the value in the keys parameter is not found, returns a null reference
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

removeByAllTags

public void removeByAllTags(Tag[] tags)
                     throws GeneralFailureException,
                            OperationFailedException,
                            ArgumentNullException,
                            AggregateException,
                            SecurityException
Removes the cached objects that have all of the same tags in common. (Returns the Intersection set.)

Parameters:
tags - - An array of Tag to search with.
Throws:
GeneralFailureException
OperationFailedException - Thrown whenever an API fails.
ArgumentNullException
SecurityException
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.

removeByAnyTag

public void removeByAnyTag(Tag[] tags)
                    throws GeneralFailureException,
                           OperationFailedException,
                           ArgumentNullException,
                           AggregateException,
                           SecurityException
Removes the cached objects that have any of the same tags in common. (Returns the Union set.)

Parameters:
tags - - An array of Tag to search with.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException
ArgumentNullException
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.

removeByTag

public void removeByTag(Tag tag)
                 throws GeneralFailureException,
                        OperationFailedException,
                        ArgumentNullException,
                        AggregateException,
                        SecurityException
Removes the cached objects that have the specified tag.

Parameters:
tag - - A Tag to search with.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException
OperationFailedException - Thrown whenever an API fails.
SecurityException
ArgumentNullException

removeCacheEventListener

public void removeCacheEventListener(com.alachisoft.ncache.event.CacheListener l)
Removes the specified Cache listener so that it no longer receives cache events from this cache. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this cache. If listener l is null, no exception is thrown and no action is performed.

Parameters:
l - the CacheListener

removeClusterEventListener

public void removeClusterEventListener(com.alachisoft.ncache.event.CustomListener l)
Removes the specified cluster listener so that it no longer receives cache events from this cache. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this cache. If listener l is null, no exception is thrown and no action is performed.

Parameters:
l - the ClusterListener

removeCustomEventListener

public void removeCustomEventListener(com.alachisoft.ncache.event.CustomListener l)
Removes the specified custom listener so that it no longer receives cache events from this cache. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this cache. If listener l is null, no exception is thrown and no action is performed.

Parameters:
l - the CustomCacheListener

removeGroupData

public void removeGroupData(java.lang.String group,
                            java.lang.String subGroup)
                     throws GeneralFailureException,
                            OperationFailedException,
                            AggregateException,
                            SecurityException,
                            ConfigurationException
Remove the group from cache.

Parameters:
group - group to be removed.
subGroup - subGroup to be removed.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

search

public java.util.Collection search(java.lang.String query,
                                   java.util.HashMap values)
                            throws GeneralFailureException,
                                   OperationFailedException,
                                   AggregateException,
                                   SecurityException,
                                   ConfigurationException
Retrieves the keys for the specified query.

Parameters:
query - The query to execute on the cache.
values - The HashMap of attribute names and values.
Returns:
The list of keys.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

searchCQ

public java.util.Collection searchCQ(ContinuousQuery query)
                              throws GeneralFailureException,
                                     OperationFailedException,
                                     AggregateException,
                                     SecurityException,
                                     ConfigurationException
Performs search on the Cache based on the specified ContinuousQuery and registers the notifications.

Parameters:
query - ContinuousQuery to perform the search and register notifications for.
Returns:
The list of keys.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

searchEntries

public java.util.HashMap searchEntries(java.lang.String query,
                                       java.util.HashMap values)
                                throws GeneralFailureException,
                                       OperationFailedException,
                                       AggregateException,
                                       SecurityException,
                                       ConfigurationException
Retrieves the key and value pairs for the specified query.

Parameters:
query - The query to execute on the cache.
values - The HashMap of attribute names and values.
Returns:
The list of key and value pairs for the specified query.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

searchEntriesCQ

public java.util.HashMap searchEntriesCQ(ContinuousQuery query)
                                  throws GeneralFailureException,
                                         OperationFailedException,
                                         AggregateException,
                                         SecurityException,
                                         ConfigurationException
Performs search on the Cache based on the specified ContinuousQuery and registers the notifications.

Parameters:
query - ContinuousQuery to perform the search and register notifications for.
Returns:
The list of key and value pairs for the specified query.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

setExceptionsEnabled

public void setExceptionsEnabled(boolean exceptionsEnabled)
If this property is set the Cache object throws exceptions from public operations. If not set no exception is thrown and the operation fails silently. Setting this flag is especially helpful during development phase of application since exceptions provide more information about the specific causes of failure.

Parameters:
exceptionsEnabled - boolean value to enable/disable the exceptions.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

unlock

public void unlock(java.lang.String key)
            throws OperationFailedException,
                   SecurityException,
                   GeneralFailureException,
                   AggregateException,
                   ConfigurationException
Forcefully unlocks a locked cached item.

Parameters:
key - key of a cached item to be unlocked
Throws:
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

unlock

public void unlock(java.lang.String key,
                   java.lang.String lockId)
            throws OperationFailedException,
                   SecurityException,
                   GeneralFailureException,
                   AggregateException,
                   ConfigurationException
Unlocks a locked cached item if the correct lock-id is specified.

Parameters:
key - key of a cached item to be unlocked
lockId - An instance of LockHandle that was generated when lock was acquired
Throws:
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

unRegisterAddNotification

public void unRegisterAddNotification()
                               throws GeneralFailureException,
                                      OperationFailedException,
                                      AggregateException,
                                      SecurityException,
                                      ConfigurationException
Unregisters the Add operation notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

unRegisterCacheStoppedNotification

public void unRegisterCacheStoppedNotification()
                                        throws GeneralFailureException,
                                               OperationFailedException,
                                               AggregateException,
                                               SecurityException,
                                               ConfigurationException
Unregisters the cache stopped even notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

unRegisterClearNotification

public void unRegisterClearNotification()
                                 throws GeneralFailureException,
                                        OperationFailedException,
                                        AggregateException,
                                        SecurityException,
                                        ConfigurationException
Unregisters the Clear operation notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

unRegisterCQ

public void unRegisterCQ(ContinuousQuery query)
                  throws GeneralFailureException,
                         OperationFailedException,
                         AggregateException,
                         SecurityException,
                         ConfigurationException
Unregisters notifications for the specified ContinuousQuery.

Parameters:
query - ContinuousQuery to unregister notifications for.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

unRegisterCustomNotification

public void unRegisterCustomNotification()
                                  throws GeneralFailureException,
                                         OperationFailedException,
                                         AggregateException,
                                         SecurityException,
                                         ConfigurationException
Registers the Clear operation notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

unRegisterInsertNotification

public void unRegisterInsertNotification()
                                  throws GeneralFailureException,
                                         OperationFailedException,
                                         AggregateException,
                                         SecurityException,
                                         ConfigurationException
Unregisters the Insert operation notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

unRegisterKeyNotificationCallback

public void unRegisterKeyNotificationCallback(java.lang.String[] keys,
                                              CacheItemUpdatedCallback updateCallback,
                                              CacheItemRemovedCallback removeCallback)
                                       throws GeneralFailureException,
                                              OperationFailedException,
                                              AggregateException,
                                              SecurityException,
                                              ConfigurationException
Unregisters the CacheItemUpdatedCallback and/or CacheItemRemovedCallback already registered for the specified list of keys.

Parameters:
keys - Keys to unregister.
updateCallback - CacheItemUpdatedCallback that is invoked when the item with the specified key is updated in the cache.
removeCallback - acheItemRemovedCallback that is invoked when the item with the key is removed from the cache.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItemUpdatedCallback, CacheItemRemovedCallback

unRegisterKeyNotificationCallback

public void unRegisterKeyNotificationCallback(java.lang.String key,
                                              CacheItemUpdatedCallback updateCallback,
                                              CacheItemRemovedCallback removeCallback)
                                       throws GeneralFailureException,
                                              OperationFailedException,
                                              AggregateException,
                                              SecurityException,
                                              ConfigurationException
Unregisters the CacheItemUpdatedCallback and/or CacheItemRemovedCallback already registered for the specified key.

Parameters:
key - The cache key used to reference the cache item.
updateCallback - CacheItemUpdatedCallback that is invoked when the item with the specified key is updated in the cache.
removeCallback - CacheItemRemovedCallback that is invoked when the item with the key is removed from the cache.
Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
See Also:
CacheItemUpdatedCallback, CacheItemRemovedCallback

unRegisterMemberLeftNotification

public void unRegisterMemberLeftNotification()
                                      throws GeneralFailureException,
                                             OperationFailedException,
                                             AggregateException,
                                             SecurityException,
                                             ConfigurationException
Unregisters the Memeber Left Event notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

unRegisterMemeberJoinedNotification

public void unRegisterMemeberJoinedNotification()
                                         throws GeneralFailureException,
                                                OperationFailedException,
                                                AggregateException,
                                                SecurityException,
                                                ConfigurationException
Unregisters the Member Joined Event notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.

unRegisterRemoveNotification

public void unRegisterRemoveNotification()
                                  throws GeneralFailureException,
                                         OperationFailedException,
                                         AggregateException,
                                         SecurityException,
                                         ConfigurationException
Unregisters the Remove operation notification with the server.

Throws:
GeneralFailureException - Thrown when an exception occurs during a clustered operation.
OperationFailedException - Thrown whenever an API fails.
AggregateException - This exception is thrown when multiple exceptions occur from multiple nodes. It combines all the exceptions as inner exceptions and throw it to the client application.
SecurityException - Thrown when current user is not allowed to perform this operation on this cache.
ConfigurationException - Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.