Top level cache implementing ICascadeCache. This class manages an array of IModelClassCache, one per model class. The IModelClassCache implementations passed to the constructor can use any storage mechanism, and Cascade provides a few file and memory options. A IBlobCache can also be included to manage the storing, fetching, and clearing of binary blob data.
More...
|
| string? | GetBlobAbsoluteFilePath (string blobPath) |
| | Given a blob path (always relative) return an absolute local file system path for that blob.
|
| async Task | ClearAll (bool exceptHeld=true, DateTime? olderThan=null) |
| async Task | ClearByType (Type type, bool exceptHeld=true, DateTime? olderThan=null) |
| async Task | ClearBlobs (bool exceptHeld=true, DateTime? olderThan=null) |
| async Task | ClearBlob (string path) |
| Task | NotifyBlobIsFresh (string blobPath, long arrivedAtMs) |
| | Set the ArrivedAtMs value for the given blobPath to the given value. This is not absolutely necessary but for maximum efficiency should be implemented. It is only used when eTags indicate that a local blob is still fresh.
|
| | ModelCache (IDictionary< Type, IModelClassCache > aClassCache, IBlobCache? blobCache=null) |
| async Task< OpResponse > | Fetch (RequestOp requestOp) |
| | Fetches data based on the specified request operation from the enclosed caches.
|
| Task | Store (Type type, object id, object model, long arrivedAt) |
| | Stores a model in the cache under the specified type, id, and arrival time.
|
| Task | StoreCollection (Type type, string key, IEnumerable ids, long arrivedAt) |
| | Stores a collection of model IDs in the cache under the given type and key.
|
| async Task< OpResponse > | Store (OpResponse opResponse) |
| | Stores an operation response in the appropriate cache Manages storage differently depending on whether it's a Blob operation, single model, or a query collection.
|
| Task | StoreCollection (Type type, string key, IEnumerable? ids, long arrivedAt) |
| | Stores a collection of model ids in the cache.
|
Top level cache implementing ICascadeCache. This class manages an array of IModelClassCache, one per model class. The IModelClassCache implementations passed to the constructor can use any storage mechanism, and Cascade provides a few file and memory options. A IBlobCache can also be included to manage the storing, fetching, and clearing of binary blob data.
◆ ModelCache()
ModelCache Constructor
- Parameters
-
| aClassCache | Dictionary that provides the model class caches to be managed. |
| blobCache | Optional instance of a blob cache to be managed alongside the class caches. |
◆ ClearAll()
| async Task Buzzware.Cascade.ModelCache.ClearAll |
( |
bool | exceptHeld = true, |
|
|
DateTime? | olderThan = null ) |
|
inline |
Clears all cached data from class caches and the blob cache if specified. Can optionally protect held data and clear only data older than a certain date.
- Parameters
-
| exceptHeld | Flag indicating whether to exclude held items from being cleared. |
| olderThan | If specified, only clear items older than this date/time. |
Implements Buzzware.Cascade.ICascadeCache.
◆ ClearBlob()
| async Task Buzzware.Cascade.ModelCache.ClearBlob |
( |
string | path | ) |
|
|
inline |
◆ ClearBlobs()
| async Task Buzzware.Cascade.ModelCache.ClearBlobs |
( |
bool | exceptHeld = true, |
|
|
DateTime? | olderThan = null ) |
|
inline |
◆ ClearByType()
| async Task Buzzware.Cascade.ModelCache.ClearByType |
( |
Type | type, |
|
|
bool | exceptHeld = true, |
|
|
DateTime? | olderThan = null ) |
|
inline |
◆ Fetch()
Fetches data based on the specified request operation from the enclosed caches.
- Parameters
-
| requestOp | The operation request that specifies what data to fetch and how to do it. |
- Returns
- OpResponse containing the result of the fetch operation and its metadata.
Implements Buzzware.Cascade.ICascadeCache.
◆ GetBlobAbsoluteFilePath()
| string? Buzzware.Cascade.ModelCache.GetBlobAbsoluteFilePath |
( |
string | blobPath | ) |
|
|
inline |
Given a blob path (always relative) return an absolute local file system path for that blob.
- Parameters
-
- Returns
Implements Buzzware.Cascade.ICascadeCache.
◆ NotifyBlobIsFresh()
| Task Buzzware.Cascade.ModelCache.NotifyBlobIsFresh |
( |
string | blobPath, |
|
|
long | arrivedAtMs ) |
|
inline |
Set the ArrivedAtMs value for the given blobPath to the given value. This is not absolutely necessary but for maximum efficiency should be implemented. It is only used when eTags indicate that a local blob is still fresh.
- Parameters
-
- Returns
Implements Buzzware.Cascade.ICascadeCache.
◆ Store() [1/2]
Stores an operation response in the appropriate cache Manages storage differently depending on whether it's a Blob operation, single model, or a query collection.
- Parameters
-
| opResponse | The response of an operation that provides details about what to store. |
Implements Buzzware.Cascade.ICascadeCache.
◆ Store() [2/2]
| Task Buzzware.Cascade.ModelCache.Store |
( |
Type | type, |
|
|
object | id, |
|
|
object | model, |
|
|
long | arrivedAt ) |
|
inline |
Stores a model in the cache under the specified type, id, and arrival time.
- Parameters
-
| type | The type of the model being stored. |
| id | The id of the model. |
| model | The model instance to store. |
| arrivedAt | Timestamp representing when the data arrived from the origin |
Implements Buzzware.Cascade.ICascadeCache.
◆ StoreCollection()
| Task Buzzware.Cascade.ModelCache.StoreCollection |
( |
Type | type, |
|
|
string | key, |
|
|
IEnumerable | ids, |
|
|
long | arrivedAt ) |
|
inline |
Stores a collection of model IDs in the cache under the given type and key.
- Parameters
-
| type | The type of the models being stored. |
| key | The key to associate with the collection of model IDs. |
| ids | The collection of model IDs to store. |
| arrivedAt | Timestamp indicating when the collection was captured, in ms since 1970 |
◆ Cascade
CascadeDataLayer instance used by the ModelCache. When set, updates the Cascade instance for all class caches and the blob cache if available.
Implements Buzzware.Cascade.ICascadeCache.
◆ SupportsBlobs
| bool Buzzware.Cascade.ModelCache.SupportsBlobs |
|
get |
◆ SupportsGetBlobAbsoluteFilePath
| bool Buzzware.Cascade.ModelCache.SupportsGetBlobAbsoluteFilePath |
|
get |
The documentation for this class was generated from the following file:
- Buzzware.Cascade/ModelCache.cs