public class InfinispanAsyncMapImpl<K,V> extends Object implements AsyncMap<K,V>, InfinispanAsyncMap<K,V>
| Constructor and Description |
|---|
InfinispanAsyncMapImpl(Vertx vertx,
org.infinispan.Cache<Object,Object> cache) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(Handler<AsyncResult<Void>> resultHandler)
Clear all entries in the map
|
void |
entries(Handler<AsyncResult<Map<K,V>>> resultHandler)
Get the entries of the map, asynchronously.
|
ReadStream<Map.Entry<K,V>> |
entryStream()
Get the entries of the map as a
ReadStream. |
void |
get(K k,
Handler<AsyncResult<V>> resultHandler)
Get a value from the map, asynchronously.
|
void |
keys(Handler<AsyncResult<Set<K>>> resultHandler)
Get the keys of the map, asynchronously.
|
ReadStream<K> |
keyStream()
Get the keys of the map as a
ReadStream. |
void |
put(K k,
V v,
Handler<AsyncResult<Void>> completionHandler)
Put a value in the map, asynchronously.
|
void |
put(K k,
V v,
long ttl,
Handler<AsyncResult<Void>> completionHandler)
Like
AsyncMap.put(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but specifying a time to live for the entry. |
void |
putIfAbsent(K k,
V v,
Handler<AsyncResult<V>> completionHandler)
Put the entry only if there is no entry with the key already present.
|
void |
putIfAbsent(K k,
V v,
long ttl,
Handler<AsyncResult<V>> completionHandler)
Link
AsyncMap.putIfAbsent(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>>) but specifying a time to live for the entry. |
void |
remove(K k,
Handler<AsyncResult<V>> resultHandler)
Remove a value from the map, asynchronously.
|
void |
removeIfPresent(K k,
V v,
Handler<AsyncResult<Boolean>> resultHandler)
Remove a value from the map, only if entry already exists with same value.
|
void |
replace(K k,
V v,
Handler<AsyncResult<V>> resultHandler)
Replace the entry only if it is currently mapped to some value
|
void |
replaceIfPresent(K k,
V oldValue,
V newValue,
Handler<AsyncResult<Boolean>> resultHandler)
Replace the entry only if it is currently mapped to a specific value
|
void |
size(Handler<AsyncResult<Integer>> resultHandler)
Provide the number of entries in the map
|
void |
values(Handler<AsyncResult<List<V>>> resultHandler)
Get the values of the map, asynchronously.
|
ReadStream<V> |
valueStream()
Get the values of the map as a
ReadStream. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitunwrappublic void get(K k, Handler<AsyncResult<V>> resultHandler)
AsyncMappublic void put(K k, V v, Handler<AsyncResult<Void>> completionHandler)
AsyncMappublic void put(K k, V v, long ttl, Handler<AsyncResult<Void>> completionHandler)
AsyncMapAsyncMap.put(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>) but specifying a time to live for the entry. Entry will expire and get evicted after the
ttl.public void putIfAbsent(K k, V v, Handler<AsyncResult<V>> completionHandler)
AsyncMapputIfAbsent in interface AsyncMap<K,V>k - the keyv - the valuecompletionHandler - the handlerpublic void putIfAbsent(K k, V v, long ttl, Handler<AsyncResult<V>> completionHandler)
AsyncMapAsyncMap.putIfAbsent(K, V, io.vertx.core.Handler<io.vertx.core.AsyncResult<V>>) but specifying a time to live for the entry. Entry will expire and get evicted
after the ttl.putIfAbsent in interface AsyncMap<K,V>k - the keyv - the valuettl - The time to live (in ms) for the entrycompletionHandler - the handlerpublic void remove(K k, Handler<AsyncResult<V>> resultHandler)
AsyncMappublic void removeIfPresent(K k, V v, Handler<AsyncResult<Boolean>> resultHandler)
AsyncMapremoveIfPresent in interface AsyncMap<K,V>k - the keyv - the valueresultHandler - - this will be called some time later to signify the value has been removedpublic void replace(K k, V v, Handler<AsyncResult<V>> resultHandler)
AsyncMappublic void replaceIfPresent(K k, V oldValue, V newValue, Handler<AsyncResult<Boolean>> resultHandler)
AsyncMapreplaceIfPresent in interface AsyncMap<K,V>k - the keyoldValue - the existing valuenewValue - the new valueresultHandler - the result handlerpublic void clear(Handler<AsyncResult<Void>> resultHandler)
AsyncMappublic void size(Handler<AsyncResult<Integer>> resultHandler)
AsyncMappublic void keys(Handler<AsyncResult<Set<K>>> resultHandler)
AsyncMap
Use this method with care as the map may contain a large number of keys,
which may not fit entirely in memory of a single node.
In this case, the invocation will result in an OutOfMemoryError.
public void values(Handler<AsyncResult<List<V>>> resultHandler)
AsyncMap
Use this method with care as the map may contain a large number of values,
which may not fit entirely in memory of a single node.
In this case, the invocation will result in an OutOfMemoryError.
public void entries(Handler<AsyncResult<Map<K,V>>> resultHandler)
AsyncMap
Use this method with care as the map may contain a large number of entries,
which may not fit entirely in memory of a single node.
In this case, the invocation will result in an OutOfMemoryError.
public ReadStream<K> keyStream()
InfinispanAsyncMapReadStream.
The stream will be automatically closed if it fails or ends.
Otherwise you must set a null data handler after usage to avoid leaking resources.
keyStream in interface InfinispanAsyncMap<K,V>public ReadStream<V> valueStream()
InfinispanAsyncMapReadStream.
The stream will be automatically closed if it fails or ends.
Otherwise you must set a null data handler after usage to avoid leaking resources.
valueStream in interface InfinispanAsyncMap<K,V>public ReadStream<Map.Entry<K,V>> entryStream()
InfinispanAsyncMapReadStream.
The stream will be automatically closed if it fails or ends.
Otherwise you must set a null data handler after usage to avoid leaking resources.
entryStream in interface InfinispanAsyncMap<K,V>Copyright © 2020. All rights reserved.