Click or drag to resize
ChatCurrentStateCacheWrapperTData, TKey Class
This cache wrapper holds Dictionary of items called 'current state', which is bascically an key-value collection of items. Items in this collections can be modified by FetchChangedDataFunc. It takes two functions: FetchAllDataFunc - this function is used to load initial current state FetchChangedDataFunc - this function is used to load changes to current state in time
Inheritance Hierarchy
SystemObject
  CMS.ChatChatCurrentStateCacheWrapperTData, TKey

Namespace: CMS.Chat
Assembly: CMS.Chat (in CMS.Chat.dll) Version: 12.0.0
Syntax
C#
public class ChatCurrentStateCacheWrapper<TData, TKey>
where TData : Object, IChatCacheableWithCurrentState<TKey>

Type Parameters

TData
Type of cached items
TKey
Type of primary key of items

The ChatCurrentStateCacheWrapperTData, TKey type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyCurrentState
Current state of items. It is not older than 'maxDelay'
Top
Methods
  NameDescription
Public methodForceTryGetItem
Tries to get item from CurrentState. If item wasn't found, current state is reloaded and then it tries again.
Public methodGetCurrentStateWithLastChange
Gets current state together with time of last change.
Protected methodGetDataFromCache
Gets data (CurrentStateCacheWrapperData) from classic CMS Cache. If data are not present, the new empty object is created and immediately inserted into cache. Only this method should be used to get data from Cache, because it is thread safe.
Public methodInvalidate
Invalidates data - this means, that before next getting of data (get CurrentState) data will be updated. Across web farms.
Public methodInvalidateLocally
Invalidates data - this means, that before next getting of data (get CurrentState) data will be updated. Only on this machine.
Protected methodLoadCurrentState
Perform the first load of data and fills passed structure with results. fetchAllDataFunc function is used.
Public methodUpdateAndTryGetItem
Invalidates cache and then tries to get item.
Protected methodUpdateCurrentState
Updates data in current state data structure. Update means that only data changed since currentState.LastChange are loaded using fetchChangedDataFunc.
Protected methodUpdateIfOutdated
This method checks cache beacon and if it is needed (timeout or invalidation) it reloads data.
Top
See Also