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: 8.2.23
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
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
Extension Methods
  NameDescription
Public Extension MethodAsValue
Converts object to a query value which can be used as a query parameter
(Defined by QueryExtensions.)
Public Extension MethodGetAPIString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodGetString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodToBoolean
Returns the boolean representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDateTime
Returns the DateTime representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDouble
Returns the double representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToGuid
Returns the Guid representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToInteger
Returns the integer representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToString
Returns the string representation of an object or default value if not.
(Defined by CoreExtensions.)
Top
Properties
  NameDescription
Public propertyCurrentState
Current state of items. It is not older than 'maxDelay'
Top
See Also