ICacheScheme

interface ICacheScheme

Interface with common persistent methods

Client can implement ICacheScheme and pass it to library to have it's own implementation

However it is suggested to extend InMemoryCacheManager instead to have your own implementation

And keep the caching logic in a way it is synced with memory all the time

Inheritors

Functions

Link copied to clipboard
abstract fun add(event: Event): Boolean

Add Single event to the memory

Link copied to clipboard
abstract fun addAll(eventList: List<Event>): Boolean

Add List of events to the memory

Link copied to clipboard
abstract fun getEvents(status: List<EventStatus> = Const.allStatusList): List<Event>

Get List of events from the memory based on the status

Link copied to clipboard
abstract fun getEventSize(status: List<EventStatus> = Const.allStatusList): Int

Get count of events in memory based on the status

Link copied to clipboard
abstract fun getEventSizeInBytes(status: List<EventStatus> = Const.allStatusList): Int

Get size of events in memory in bytes based on the status

Link copied to clipboard
abstract fun remove(event: Event): Boolean

Remove single event from the memory

Link copied to clipboard
abstract fun removeAll(status: List<EventStatus> = Const.allStatusList): Boolean

Remove list of events from the memory based on the status

Link copied to clipboard
abstract fun syncDataFromCache(success: (Boolean, List<Event>) -> Unit = { _, _ -> })

Fetch events from the disk

Link copied to clipboard
abstract fun syncDataToCache(success: (Boolean) -> Unit = {})

Fetch in memory events and push all the events to disk

Link copied to clipboard
abstract fun updateEventStatus(event: Event, status: EventStatus): Boolean

Update status for the event to the memory

Link copied to clipboard
abstract fun updateEventStatusAll(eventList: List<Event>, status: EventStatus): Boolean

Update status for the list of events to the memory