IDataCachingService Interface |
Namespace: SanteDB.Core.Services
The IDataCachingService type exposes the following members.
Name | Description | |
---|---|---|
ServiceName |
Gets the service name
(Inherited from IServiceImplementation.) | |
Size |
Gets the current size of the cache in objects
|
Name | Description | |
---|---|---|
Add |
Adds data to the cache
| |
Clear |
Purges the entire cache of all entries
| |
GetCacheItem(Guid) |
Gets the cache item specified by key regardless of the type of data
| |
GetCacheItemTData(Guid) |
Gets the cache item specified by key returning it as a casted instance of TData. Returning the default of TData if the
object doesn't exist or if the object is the wrong type.
| |
Remove(Guid) |
Removes/evicts an object with identifier key from the cache
| |
Remove(IdentifiedData) |
Removes/evicts the provided object form cache if available
|
Name | Description | |
---|---|---|
Added |
Fired after an object has successfully been committed to the cache
| |
Removed |
Fired after an object has successfully been evicted from cache
| |
Updated |
Fired after an object has successfully been updated within the cache
|
The data caching service is primarily used to store fully loaded objects from the database. This loading into the cache reduces the load on the persistence layer of the SanteDB host context. The data persistence layers themselves will use implementations of this class to prevent re-loading of data to/from the disk system. The process on a read is generally:
Of course, keeping the cache service in a consistent state is tantamount to the reliable functioning of SanteDB, this means that any update, delete or create on an object that already exists in cache results in its eviction from the cache via the Remove(Guid) method.