Interface ICache
- All Known Implementing Classes:
MemoryCache,NullCache
public interface ICache
Interface for caches that are used to cache values to improve performance.
-
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves a value from the cache by its key.Retrieves cached value from the cache using its key.Stores value in the cache with expiration time.
-
Method Details
-
retrieve
Retrieves cached value from the cache using its key. If value is missing in the cache or expired it returns null.- Parameters:
correlationId- (optional) transaction id to trace execution through call chain.key- a unique value key.- Returns:
- a cached value or null if value wasn't found or timeout expired.
-
store
Stores value in the cache with expiration time.- Parameters:
correlationId- (optional) transaction id to trace execution through call chain.key- a unique value key.value- a value to store.timeout- expiration timeout in milliseconds.- Returns:
- a cached value stored in the cache.
-
remove
Removes a value from the cache by its key.- Parameters:
correlationId- (optional) transaction id to trace execution through call chain.key- a unique value key.
-