public interface AsyncCacheApi
Modifier and Type | Method and Description |
---|---|
<T> java.util.concurrent.CompletionStage<T> |
get(java.lang.String key)
Retrieves an object by key.
|
<T> java.util.concurrent.CompletionStage<T> |
getOrElseUpdate(java.lang.String key,
java.util.concurrent.Callable<java.util.concurrent.CompletionStage<T>> block)
Retrieve a value from the cache, or set it from a default Callable function.
|
<T> java.util.concurrent.CompletionStage<T> |
getOrElseUpdate(java.lang.String key,
java.util.concurrent.Callable<java.util.concurrent.CompletionStage<T>> block,
int expiration)
Retrieve a value from the cache, or set it from a default Callable function.
|
java.util.concurrent.CompletionStage<akka.Done> |
remove(java.lang.String key)
Removes a value from the cache.
|
java.util.concurrent.CompletionStage<akka.Done> |
removeAll()
Removes all values from the cache.
|
java.util.concurrent.CompletionStage<akka.Done> |
set(java.lang.String key,
java.lang.Object value)
Sets a value without expiration.
|
java.util.concurrent.CompletionStage<akka.Done> |
set(java.lang.String key,
java.lang.Object value,
int expiration)
Sets a value with expiration.
|
default SyncCacheApi |
sync() |
default SyncCacheApi sync()
<T> java.util.concurrent.CompletionStage<T> get(java.lang.String key)
T
- the type of the stored objectkey
- the key to look up<T> java.util.concurrent.CompletionStage<T> getOrElseUpdate(java.lang.String key, java.util.concurrent.Callable<java.util.concurrent.CompletionStage<T>> block, int expiration)
T
- the type of the valuekey
- Item key.block
- block returning value to set if key does not existexpiration
- expiration period in seconds.<T> java.util.concurrent.CompletionStage<T> getOrElseUpdate(java.lang.String key, java.util.concurrent.Callable<java.util.concurrent.CompletionStage<T>> block)
The value has no expiration.
T
- the type of the valuekey
- Item key.block
- block returning value to set if key does not existjava.util.concurrent.CompletionStage<akka.Done> set(java.lang.String key, java.lang.Object value, int expiration)
key
- Item key.value
- The value to set.expiration
- expiration in secondsjava.util.concurrent.CompletionStage<akka.Done> set(java.lang.String key, java.lang.Object value)
key
- Item key.value
- The value to set.java.util.concurrent.CompletionStage<akka.Done> remove(java.lang.String key)
key
- The key to remove the value for.java.util.concurrent.CompletionStage<akka.Done> removeAll()
java.lang.UnsupportedOperationException
- if this cache implementation does not support removing
all values.