Interface IClientPersistentState
- Namespace
- Sportradar.LiveData.Sdk.Common.Interfaces
- Assembly
- Sportradar.LiveData.Sdk.dll
Persistent state store interface that should be implemented by the client.
public interface IClientPersistentState
Remarks
If this interface is not implemented, XML feed error recovery will not be possible
Methods
Clear()
Clears persistent state store contents.
void Clear()
Read(string)
Retrieves value for the given key from the persistent store.
ClientPersistentStateItem Read(string key)
Parameters
keystringKey
Returns
- ClientPersistentStateItem
Retrieved item
Remarks
Returns null if key is not found. Used at error recovery and for double-checking whether persistent state store contents are consistent with buffered values.
ReadAll()
Returns all persistent state items from the store.
IEnumerable<ClientPersistentStateItem> ReadAll()
Returns
- IEnumerable<ClientPersistentStateItem>
All persistent state items from the store
Remove(string)
Removes an item by key
void Remove(string key)
Parameters
keystringKey
RemoveOld(DateTime)
Removes stale persistent state items that haven't been updated in a while.
void RemoveOld(DateTime max_age)
Parameters
max_ageDateTimeAll items older than max_age will be removed from the store
Write(IList<ClientPersistentStateItem>)
Write batch of key-value pairs into client provided persistent store (DB, file system).
void Write(IList<ClientPersistentStateItem> items)
Parameters
itemsIList<ClientPersistentStateItem>Batch of items
Remarks
Overwrites existing values so that stale items can be removed.