Interface ICache
This interface contians the services and methods that are used to perform operations on the cache.
Assembly: Alachisoft.NCache.Client.dll
Syntax
public interface ICache : IDisposable, IEnumerable
Properties
Name | Description |
---|---|
Client |
Displays the information related to this client. |
Connected |
Gets the information of all connected clients to the cache. |
Count | Gets the number of items stored in the cache. |
Data |
Gets an instance of IData |
Execution |
Gets an instance of IExecution |
Messaging |
Gets an instance of IMessaging |
Notification |
Gets an instance of INotification |
Search |
Gets an instance of ISearch |
Methods
Name | Description |
---|---|
Add(String, Cache |
Adds a Cache |
Add(String, Object) | Adds an item into the cache with a cache key to reference its location. |
Add |
Adds a Cache |
Add |
Adds an object into the cache asynchronously, with a cache key to reference its location. |
AddBulk(IDictionary<String, CacheItem>, WriteThruOptions) | Adds a dictionary of cache keys with Cache |
Clear() | Removes all elements from the ICache. |
Clear |
Removes all elements from the client cache. |
Contains(String) | Determines whether the cache contains a specific key. |
ContainsBulk(IEnumerable<String>) | Determines whether the cache contains specifiec keys. |
Get<T>(String, ref CacheItemVersion, ReadThruOptions) | Retrieves the specified item from the cache object, with read-through caching option available.
If the option of read-through has been set, the object will be fetched from the data source if
it does not exist in cache. It accepts the Cache 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. |
Get<T>(String, ReadThruOptions) | Retrieves the specified item from the cache object, with read-through caching option available. If the option of read-through has been set, the object will be fetched from the data source if it does not exist in cache. |
Get<T>(String, Boolean, TimeSpan, ref LockHandle) | Retrieves the specified object from the cache and locks it simulataneously, if it is not already locked. It returns null, if the object is already locked. This is different from the basic Get operation, where an object is returned ignoring the lock altogether. Use this method if you're using NCache item locking features. |
GetBulk<T>(IEnumerable<String>, ReadThruOptions) | Retrieves the objects from cache for the given keys as key-value pairs. Options regarding reading from data source (read-through) can be set. |
Get |
Retrieves the specified CacheItem from the cache object. This overload also allows specifying the ReadThruOptions. If read-through is set and the object does not exist in the cache, the object will be fetched from the data source and added to the cache.
It accepts the Cache 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. |
Get |
Retrieves the specified CacheItem from the cache object. This overload also allows specifying the ReadThruOptions. If read-through is set and the object does not exist in the cache, the object will be fetched from the data source and added to the cache. |
Get |
Retrieves the cache item from the cache and locks it if it is not already locked. If the item is already locked, it returns null. This differs from the basic GetCachItem operation, which returns an item (while ignoring the lock). If you're using the NCache item locking features, use this approach. |
GetCacheItemBulk(IEnumerable<String>, ReadThruOptions) | Retrieves the specified CacheItems from the cache object. This overload also allows specifying the ReadThruOptions. If read-through is set and the object does not exist in the cache, the object will be fetched from the data source and added to the cache. |
Get |
Gets a Cache |
GetIfNewer<T>(String, ref CacheItemVersion) | Gets an object from the cache only if a newer version of the object exists in cache. |
Get |
Retrieves a dictionary enumerator used to iterate through the key settings and their values as JSON objects contained in the cache. |
Insert(String, Cache |
Inserts a Cache |
Insert(String, Cache |
Inserts a Cache |
Insert(String, Object) | Inserts an item (object) into the cache. |
Insert |
Inserts a Cache |
Insert |
Inserts an object into the cache asynchronously, with a cache key to reference its location. |
InsertBulk(IDictionary<String, CacheItem>, WriteThruOptions) | Inserts a dictionary of cache keys with Cache |
Lock(String, Time |
Acquires a lock on an item in the cache. |
Remove(String, Lock |
Removes the specified item from the ICache. You can also specify the write option, such that the item may be removed from both cache and data source. If version is specified, then item will only be removed if the specified version is still the most recent version in the cache. |
Remove<T>(String, out T, LockHandle, CacheItemVersion, WriteThruOptions) | Removes the specified item from the ICache and returns it to the application as an out parameter. You can also specify the write option such that the item may be removed from both cache and data source. If version is specified, then item will only be removed if the specified version is still the most recent version in the cache. |
RemoveAsync<T>(String, WriteThruOptions) | Removes an item from the cache asynchronously, with a cache key to reference its location and WriteThruOptions. |
RemoveBulk(IEnumerable<String>, WriteThruOptions) | Removes the specified items from the ICache. You can also specify the write option such that the items may be removed from both cache and data source. |
RemoveBulk<T>(IEnumerable<String>, out IDictionary<String, T>, WriteThruOptions) | Removes the specified items from the Alachisoft. |
Unlock(String, Lock |
Unlocks a locked cached item, if the correct LockHandle is specified. If LockHandle is null, it forcefully unlocks a locked cached item. |
Update |
Update Cache |