2021-04-23 18:41:30 +00:00
|
|
|
import { CacheEntry } from './levelcache.classes.cacheentry';
|
2021-04-23 18:40:57 +00:00
|
|
|
|
|
|
|
export abstract class AbstractCache {
|
|
|
|
public abstract ready: Promise<void>;
|
|
|
|
public abstract status: 'active' | 'inactive';
|
2021-04-23 18:41:30 +00:00
|
|
|
|
2021-05-10 14:26:32 +00:00
|
|
|
// Cache Entries
|
2021-04-23 18:40:57 +00:00
|
|
|
/**
|
|
|
|
* store a Blob
|
|
|
|
*/
|
|
|
|
public abstract storeCacheEntryByKey(keyArg: string, valueArg: CacheEntry): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* retrieve cache entry
|
|
|
|
*/
|
|
|
|
public abstract retrieveCacheEntryByKey(keyArg: string): Promise<CacheEntry>;
|
|
|
|
|
2021-05-10 14:26:32 +00:00
|
|
|
/**
|
|
|
|
* checks for the presence of a key
|
|
|
|
* @param keyArg
|
|
|
|
*/
|
2021-04-23 18:40:57 +00:00
|
|
|
public abstract checkKeyPresence(keyArg: string): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
2021-05-10 14:26:32 +00:00
|
|
|
* delete a key
|
|
|
|
*/
|
|
|
|
public abstract deleteCacheEntryByKey(keyArg: string): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clean the cache
|
|
|
|
*/
|
|
|
|
public abstract cleanOutdated(): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cleans the complete cache
|
2021-04-23 18:40:57 +00:00
|
|
|
*/
|
2021-05-10 14:26:32 +00:00
|
|
|
public abstract cleanAll(): Promise<void>;
|
2021-04-23 18:41:30 +00:00
|
|
|
}
|