Package org.forgerock.openig.tools.cache
Class CaffeineAsyncCache<K,V,E extends Exception>  
java.lang.Object
org.forgerock.openig.tools.cache.CaffeineAsyncCache<K,V,E>  
- Type Parameters:
 K- type of the keyV- type of the cached valueE- type of the promise exception
- All Implemented Interfaces:
 AsyncCache<K,V, E> 
public final class CaffeineAsyncCache<K,V,E extends Exception>  
extends Object
implements AsyncCache<K,V,E>  
Provides a Caffeine-based implementation of the 
AsyncCache.- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classCaffeineAsyncCache.Builder<K,V, E extends Exception> A builder for aCaffeineAsyncCache. - 
Method Summary
Modifier and TypeMethodDescriptionReturns a promise that will be completed with the value associated with the key in this cache, or with an exception if the case of any errors.getIfPresent(K key) Return anOptionalpromise of the value which will be empty if the key is not present in the cache.voidSynchronously clean up the entire cache.voidsynchronousInvalidate(K key) Synchronously invalidates the cache entry for the given key.voidSynchronously invalidates all the cache entries.voidsynchronousInvalidateAll(Iterable<? extends K> keys) Synchronously invalidates all the cache entries for the given keys. 
- 
Method Details
- 
get
Description copied from interface:AsyncCacheReturns a promise that will be completed with the value associated with the key in this cache, or with an exception if the case of any errors. If the key is not present in the cache then the value will first be obtained by invoking the supplied mapping function.- Specified by:
 getin interfaceAsyncCache<K,V, E extends Exception> - Parameters:
 key- the key to look upasyncValueSupplier- the asynchronous supplier to obtain the value from if it is not already present in the cache.- Returns:
 - a promise that will be completed with the value associated with the key in this cache, or with an exception if the case of any errors.
 
 - 
getIfPresent
Description copied from interface:AsyncCacheReturn anOptionalpromise of the value which will be empty if the key is not present in the cache.- Specified by:
 getIfPresentin interfaceAsyncCache<K,V, E extends Exception> - Parameters:
 key- the key to look up in the cache- Returns:
 - an 
Optionalpromise of the value which will be empty if the key is not present in the cache 
 - 
synchronousCleanUp
public void synchronousCleanUp()Description copied from interface:AsyncCacheSynchronously clean up the entire cache.- Specified by:
 synchronousCleanUpin interfaceAsyncCache<K,V, E extends Exception> 
 - 
synchronousInvalidate
Description copied from interface:AsyncCacheSynchronously invalidates the cache entry for the given key.- Specified by:
 synchronousInvalidatein interfaceAsyncCache<K,V, E extends Exception> - Parameters:
 key- the key to invalidate
 - 
synchronousInvalidateAll
Description copied from interface:AsyncCacheSynchronously invalidates all the cache entries for the given keys.- Specified by:
 synchronousInvalidateAllin interfaceAsyncCache<K,V, E extends Exception> - Parameters:
 keys- the keys to invalidate
 - 
synchronousInvalidateAll
public void synchronousInvalidateAll()Description copied from interface:AsyncCacheSynchronously invalidates all the cache entries.- Specified by:
 synchronousInvalidateAllin interfaceAsyncCache<K,V, E extends Exception> 
 
 -