Package com.hybris.cockpitng.util.cache
Interface AsyncWarmUpCache<K,V>
-
- All Known Implementing Classes:
WidgetAsyncWarmUpCache
public interface AsyncWarmUpCache<K,V>A cache performing asynchronous warming up.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Clears whole cache.Vget(K key)Gets cached value for specified key.Vget(K key, java.util.function.Supplier<V> defaultValue)Gets cached value for specified key.booleanhas(K key)Checks whether a value for specified key is cached.voidrevoke(K key)Removes a value cached for specified key.voidwarmUp(java.util.Iterator<java.util.Collection<K>> keys, java.util.function.Function<K,V> values)Triggers asynchronous cache warm up.
-
-
-
Method Detail
-
warmUp
void warmUp(java.util.Iterator<java.util.Collection<K>> keys, java.util.function.Function<K,V> values)
Triggers asynchronous cache warm up.- Parameters:
keys- iterator over keys to be processedvalues- value provider
-
has
boolean has(K key)
Checks whether a value for specified key is cached.- Parameters:
key- value key- Returns:
trueif value is cached
-
get
V get(K key)
Gets cached value for specified key.- Parameters:
key- value key- Returns:
- value for key
-
get
V get(K key, java.util.function.Supplier<V> defaultValue)
Gets cached value for specified key. If cache has no value for specified key, default value provider is asked for it.- Parameters:
key- value keydefaultValue- a supplier for a result in case value is not cached- Returns:
- value for key
-
revoke
void revoke(K key)
Removes a value cached for specified key.- Parameters:
key- value key
-
clear
void clear()
Clears whole cache.
-
-