Interface IStorage
Represents a storage object used from the reporting engine to store internal state and cache rendered reports.
Namespace: Telerik.Reporting.Cache.Interfaces
Assembly: Telerik.Reporting.dll
Syntax
public interface IStorage
Remarks
Implement this interface using a storage technology of your favor
in order to have your reporting engine instance storing its state and cached reports in it.
The storage may store single values - string or byte array, and a set of unordered string values.
The storage also enables serialized access to the stored resources by implementing a lock mechanism.
Methods
AcquireLock(String)
Acquires a lock on a named resource.
Declaration
IDisposable AcquireLock(string key)
Parameters
System.String
key
The name of the lock. When a lock with particular key is acquired, a subsequent call on AcuireLock with the same key should wait until the original lock is released (disposed). |
Returns
System.IDisposable
A disposable lock object. When disposed from the lock object owner, the lock of the used key is released. |
Remarks
Acquires a lock on a named resource and returns a disposable lock object. When the lock object owner disposes it, the lock is released.
AcquireReadLock(String)
Acquires a lock on a named resource for reading, using less-restrictive locking mechanism.
Declaration
IDisposable AcquireReadLock(string key)
Parameters
System.String
key
|
Returns
System.IDisposable
|
Remarks
Acquires a lock on a named resource and returns a disposable lock object. When the lock object owner disposes it, the lock is released.
AddInSet(String, String)
Adds a single string value to a set of values denoted from the given key.
Declaration
void AddInSet(string key, string value)
Parameters
System.String
key
The key that denotes the stored set value. |
System.String
value
The value that is added to the set. |
Remarks
If a set with the given key does not exist in the storage, such set is created and the value is added as its member.
Delete(String)
Deletes a key with its value (string or byte array) from the storage.
Declaration
void Delete(string key)
Parameters
System.String
key
The key that denotes the stored value that should be removed. |
DeleteInSet(String, String)
Deletes a single string value from a set of values denoted from the given key.
Declaration
bool DeleteInSet(string key, string value)
Parameters
System.String
key
The key that denotes the stored set value. |
System.String
value
The value that should be deleted from the given set. |
Returns
System.Boolean
True if set with the given key is found and it contained the given value before deleted. Otherwise false. |
DeleteSet(String)
Deletes set of values denoted by the given key.
Declaration
void DeleteSet(string key)
Parameters
System.String
key
The key that denotes the stored set. |
Exists(String)
Retrieves a value indicating if a single value (string or byte array) exists in the storage.
Declaration
bool Exists(string key)
Parameters
System.String
key
The key that denotes the stored value. |
Returns
System.Boolean
True if the key with its value exists in the storage, otherwise false. |
ExistsInSet(String, String)
Retrieves a value indicating if a set of values exists in the storage.
Declaration
bool ExistsInSet(string key, string value)
Parameters
System.String
key
The key that denotes the stored set value. |
System.String
value
|
Returns
System.Boolean
True if the key with its value exists in the storage, otherwise false. |
GetAllMembersInSet(String)
Retrieves all members in a set of string values.
Declaration
IEnumerable<string> GetAllMembersInSet(string key)
Parameters
System.String
key
The key that denotes the stored set value. |
Returns
System.Collections.Generic.IEnumerable<System.String>
An enumerable retrieving each value of the set denoted from the given key. |
GetBytes(String)
Retrieves a byte array value stored under particular key.
Declaration
byte[] GetBytes(string key)
Parameters
System.String
key
The key that denotes the stored byte array value. |
Returns
System.Byte[]
The byte array value stored under the given key. If no such key is found, null (Nothing). |
GetCountInSet(String)
Retrieves the count of the values in a set value stored in the storage.
Declaration
long GetCountInSet(string key)
Parameters
System.String
key
The key that denotes the stored set value. |
Returns
System.Int64
The count of the values in the set. If no such set exists, zero. |
GetString(String)
Retrieves a string value stored under particular key.
Declaration
string GetString(string key)
Parameters
System.String
key
The key that denotes the stored string value. |
Returns
System.String
The string value stored under the given key. If no such key is found, null (Nothing). |
SetBytes(String, Byte[])
Stores a byte array value under particular key.
Declaration
void SetBytes(string key, byte[] value)
Parameters
System.String
key
The key that denotes the stored byte array value. |
System.Byte[]
value
The value that is stored. |
SetString(String, String)
Stores a string value under particular key.
Declaration
void SetString(string key, string value)
Parameters
System.String
key
The key that denotes the stored string value. |
System.String
value
The value that is stored. |