Class RemoteCacheSupport<K,V>
- java.lang.Object
-
- org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,V>
-
- All Implemented Interfaces:
ConcurrentMap<K,V>
,Map<K,V>
,RemoteCache<K,V>
,org.infinispan.commons.api.AsyncCache<K,V>
,org.infinispan.commons.api.BasicCache<K,V>
,org.infinispan.commons.api.Lifecycle
,org.infinispan.commons.api.TransactionalCache
- Direct Known Subclasses:
RemoteCacheImpl
public abstract class RemoteCacheSupport<K,V> extends Object implements RemoteCache<K,V>
Purpose: keep all delegating and unsupported methods in one place -> readability.- Since:
- 4.1
- Author:
- Mircea.Markus@jboss.com
-
-
Field Summary
Fields Modifier and Type Field Description protected long
defaultLifespan
protected long
defaultMaxIdleTime
-
Constructor Summary
Constructors Modifier Constructor Description protected
RemoteCacheSupport()
protected
RemoteCacheSupport(long defaultLifespan, long defaultMaxIdleTime)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description V
compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
V
compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
An overloaded form ofConcurrentMap.compute(Object, BiFunction)
which takes in lifespan parameters.V
compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
An overloaded form ofConcurrentMap.compute(Object, BiFunction)
which takes in lifespan and maxIdleTime parameters.CompletableFuture<V>
computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
Asynchronous version ofConcurrentMap.compute(Object, BiFunction)
.CompletableFuture<V>
computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
Asynchronous version ofBasicCache.compute(Object, BiFunction, long, TimeUnit)
.CompletableFuture<V>
computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Asynchronous version ofBasicCache.compute(Object, BiFunction, long, TimeUnit, long, TimeUnit)
.V
computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
V
computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit)
An overloaded form ofConcurrentMap.computeIfAbsent(Object, Function)
which takes in lifespan parameters.V
computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
An overloaded form ofConcurrentMap.computeIfAbsent(Object, Function)
which takes in lifespan and maxIdleTime parameters.CompletableFuture<V>
computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction)
Asynchronous version ofConcurrentMap.computeIfAbsent(Object, Function)
.CompletableFuture<V>
computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit)
Asynchronous version ofBasicCache.computeIfAbsent(Object, Function, long, TimeUnit)
.CompletableFuture<V>
computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Asynchronous version ofBasicCache.computeIfAbsent(Object, Function, long, TimeUnit, long, TimeUnit)
.V
computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
V
computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
An overloaded form ofConcurrentMap.computeIfPresent(Object, BiFunction)
which takes in lifespan parameters.V
computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
An overloaded form ofConcurrentMap.computeIfPresent(Object, BiFunction)
which takes in lifespan and maxIdleTime parameters.CompletableFuture<V>
computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
Asynchronous version ofConcurrentMap.computeIfPresent(Object, BiFunction)
.CompletableFuture<V>
computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
Asynchronous version ofBasicCache.computeIfPresent(Object, BiFunction, long, TimeUnit)
.CompletableFuture<V>
computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Asynchronous version ofBasicCache.computeIfPresent(Object, BiFunction, long, TimeUnit, long, TimeUnit)
.V
merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
V
merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
An overloaded form ofConcurrentMap.merge(Object, Object, BiFunction)
which takes in lifespan parameters.V
merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
An overloaded form ofConcurrentMap.merge(Object, Object, BiFunction)
which takes in lifespan parameters.CompletableFuture<V>
mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
Asynchronous version ofConcurrentMap.merge(Object, Object, BiFunction)
.CompletableFuture<V>
mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
Asynchronous version ofBasicCache.merge(Object, Object, BiFunction, long, TimeUnit)
.CompletableFuture<V>
mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Asynchronous version ofBasicCache.merge(Object, Object, BiFunction, long, TimeUnit, long, TimeUnit)
.V
put(K key, V value)
If the return value of this operation will be ignored by the application, the user is strongly encouraged to use theFlag.IGNORE_RETURN_VALUES
flag when invoking this method in order to make it behave as efficiently as possible (i.e.V
put(K key, V value, long lifespan, TimeUnit unit)
An overloaded form ofBasicCache.put(Object, Object)
, which takes in lifespan parameters.V
put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
An overloaded form ofBasicCache.put(Object, Object)
, which takes in lifespan parameters.void
putAll(Map<? extends K,? extends V> map)
Synthetic operation.void
putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit unit)
Synthetic operation.CompletableFuture<Void>
putAllAsync(Map<? extends K,? extends V> data)
Synthetic operation.CompletableFuture<Void>
putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit unit)
Synthetic operation.CompletableFuture<V>
putAsync(K key, V value)
Asynchronous version ofBasicCache.put(Object, Object)
.CompletableFuture<V>
putAsync(K key, V value, long lifespan, TimeUnit unit)
Asynchronous version ofBasicCache.put(Object, Object, long, TimeUnit)
.V
putIfAbsent(K key, V value)
V
putIfAbsent(K key, V value, long lifespan, TimeUnit unit)
An overloaded form ofConcurrentMap.putIfAbsent(Object, Object)
, which takes in lifespan parameters.V
putIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
An overloaded form ofConcurrentMap.putIfAbsent(Object, Object)
, which takes in lifespan parameters.CompletableFuture<V>
putIfAbsentAsync(K key, V value)
Asynchronous version ofConcurrentMap.putIfAbsent(Object, Object)
.CompletableFuture<V>
putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit)
Asynchronous version ofBasicCache.putIfAbsent(Object, Object, long, TimeUnit)
.CompletableFuture<V>
putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Asynchronous version ofBasicCache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit)
.CompletableFuture<Boolean>
removeAsync(Object key, Object value)
Asynchronous version ofConcurrentMap.remove(Object, Object)
.V
replace(K key, V value)
V
replace(K key, V value, long lifespan, TimeUnit unit)
An overloaded form ofConcurrentMap.replace(Object, Object)
, which takes in lifespan parameters.V
replace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
An overloaded form ofConcurrentMap.replace(Object, Object)
, which takes in lifespan parameters.boolean
replace(K key, V oldValue, V newValue)
boolean
replace(K key, V oldValue, V value, long lifespan, TimeUnit unit)
An overloaded form ofConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.boolean
replace(K key, V oldValue, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
An overloaded form ofConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.void
replaceAll(BiFunction<? super K,? super V,? extends V> function)
CompletableFuture<V>
replaceAsync(K key, V value)
Asynchronous version ofConcurrentMap.replace(Object, Object)
.CompletableFuture<V>
replaceAsync(K key, V value, long lifespan, TimeUnit unit)
Asynchronous version ofBasicCache.replace(Object, Object, long, TimeUnit)
.CompletableFuture<V>
replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Asynchronous version ofBasicCache.replace(Object, Object, long, TimeUnit, long, TimeUnit)
.CompletableFuture<Boolean>
replaceAsync(K key, V oldValue, V newValue)
Asynchronous version ofConcurrentMap.replace(Object, Object, Object)
.CompletableFuture<Boolean>
replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit unit)
Asynchronous version ofBasicCache.replace(Object, Object, Object, long, TimeUnit)
.CompletableFuture<Boolean>
replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Asynchronous version ofBasicCache.replace(Object, Object, Object, long, TimeUnit, long, TimeUnit)
.boolean
replaceWithVersion(K key, V newValue, long version)
Replaces the given value only if its version matches the supplied version.boolean
replaceWithVersion(K key, V newValue, long version, int lifespanSeconds)
A overloaded form ofRemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan parameters.CompletableFuture<Boolean>
replaceWithVersionAsync(K key, V newValue, long version)
CompletableFuture<Boolean>
replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds)
protected abstract void
set(K key, V value)
This is intentionally a non-public method meant as an integration point for bytecode manipulation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.commons.api.AsyncCache
clearAsync, containsKeyAsync, getAllAsync, getAsync, putAsync, removeAsync
-
Methods inherited from interface java.util.concurrent.ConcurrentMap
forEach, getOrDefault
-
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, size
-
Methods inherited from interface org.infinispan.client.hotrod.RemoteCache
addClientListener, addClientListener, clientStatistics, entrySet, entrySet, execute, execute, getAll, getBulk, getBulk, getCacheTopologyInfo, getDataFormat, getListeners, getProtocolVersion, getRemoteCacheManager, getVersioned, getWithMetadata, getWithMetadataAsync, keySet, keySet, putAll, putAllAsync, remove, remove, removeClientListener, removeWithVersion, removeWithVersionAsync, replaceWithVersion, replaceWithVersion, replaceWithVersionAsync, retrieveEntries, retrieveEntries, retrieveEntries, retrieveEntriesByQuery, retrieveEntriesWithMetadata, serverStatistics, stats, streaming, values, values, withDataFormat, withFlags
-
-
-
-
Method Detail
-
putAll
public void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit unit)
Description copied from interface:RemoteCache
Synthetic operation. The client iterates over the set of keys and calls put for each one of them. This results in operation not being atomic (if a failure happens after few puts it is not rolled back) and costly (for each key in the parameter map a remote call is performed).- Specified by:
putAll
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Specified by:
putAll
in interfaceRemoteCache<K,V>
- Parameters:
map
- map containing mappings to enterlifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit
- unit of measurement for the lifespan
-
putAllAsync
public CompletableFuture<Void> putAllAsync(Map<? extends K,? extends V> data)
Description copied from interface:RemoteCache
Synthetic operation.- Specified by:
putAllAsync
in interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Specified by:
putAllAsync
in interfaceRemoteCache<K,V>
- Parameters:
data
- to store- Returns:
- a future containing a void return type
- See Also:
RemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
putAllAsync
public CompletableFuture<Void> putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit unit)
Description copied from interface:RemoteCache
Synthetic operation.- Specified by:
putAllAsync
in interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Specified by:
putAllAsync
in interfaceRemoteCache<K,V>
- Parameters:
data
- to storelifespan
- lifespan of entryunit
- time unit for lifespan- Returns:
- a future containing a void return type
- See Also:
RemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
putAll
public void putAll(Map<? extends K,? extends V> map)
Description copied from interface:RemoteCache
Synthetic operation.- Specified by:
putAll
in interfaceMap<K,V>
- Specified by:
putAll
in interfaceRemoteCache<K,V>
- See Also:
RemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
putIfAbsent
public V putIfAbsent(K key, V value)
- Specified by:
putIfAbsent
in interfaceConcurrentMap<K,V>
- Specified by:
putIfAbsent
in interfaceMap<K,V>
-
putIfAbsent
public V putIfAbsent(K key, V value, long lifespan, TimeUnit unit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.putIfAbsent(Object, Object)
, which takes in lifespan parameters.- Specified by:
putIfAbsent
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit
- unit of measurement for the lifespan- Returns:
- the value being replaced, or null if nothing is being replaced.
-
putIfAbsent
public V putIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.putIfAbsent(Object, Object)
, which takes in lifespan parameters.- Specified by:
putIfAbsent
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
- time unit for max idle time- Returns:
- the value being replaced, or null if nothing is being replaced.
-
replace
public boolean replace(K key, V oldValue, V newValue)
Description copied from interface:RemoteCache
This method requires 2 round trips to the server. The first to retrieve the value and version and a second to replace the key with the version if the value matches. If possible user should use
RemoteCache.getWithMetadata(Object)
andRemoteCache.replaceWithVersion(Object, Object, long)
.
-
replace
public final V replace(K key, V value, long lifespan, TimeUnit unit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.replace(Object, Object)
, which takes in lifespan parameters.- Specified by:
replace
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit
- unit of measurement for the lifespan- Returns:
- the value being replaced, or null if nothing is being replaced.
-
replace
public V replace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.replace(Object, Object)
, which takes in lifespan parameters.- Specified by:
replace
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
- time unit for max idle time- Returns:
- the value being replaced, or null if nothing is being replaced.
-
put
public V put(K key, V value)
Description copied from interface:org.infinispan.commons.api.BasicCache
If the return value of this operation will be ignored by the application, the user is strongly encouraged to use theFlag.IGNORE_RETURN_VALUES
flag when invoking this method in order to make it behave as efficiently as possible (i.e. avoiding needless remote or network calls).
-
set
protected abstract void set(K key, V value)
This is intentionally a non-public method meant as an integration point for bytecode manipulation. Don't remove or alter the signature even if it might look like unreachable code. Implementors should perform a put operation but optimizing it as return values are not required.- Since:
- 5.0
-
putAsync
public final CompletableFuture<V> putAsync(K key, V value)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.put(Object, Object)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
putAsync
public CompletableFuture<V> putAsync(K key, V value, long lifespan, TimeUnit unit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.put(Object, Object, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
replaceWithVersionAsync
public CompletableFuture<Boolean> replaceWithVersionAsync(K key, V newValue, long version)
- Specified by:
replaceWithVersionAsync
in interfaceRemoteCache<K,V>
- See Also:
RemoteCache.replaceWithVersion(Object, Object, long)
-
replaceWithVersionAsync
public CompletableFuture<Boolean> replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds)
- Specified by:
replaceWithVersionAsync
in interfaceRemoteCache<K,V>
- See Also:
RemoteCache.replaceWithVersion(Object, Object, long)
-
replaceWithVersion
public boolean replaceWithVersion(K key, V newValue, long version)
Description copied from interface:RemoteCache
Replaces the given value only if its version matches the supplied version. SeeRemoteCache.removeWithVersion(Object, long)
for a sample usage of the version-based methods.- Specified by:
replaceWithVersion
in interfaceRemoteCache<K,V>
version
- numeric version that should match the one in the server for the operation to succeed- Returns:
- true if the value has been replaced
- See Also:
RemoteCache.getVersioned(Object)
,VersionedValue
-
replaceWithVersion
public boolean replaceWithVersion(K key, V newValue, long version, int lifespanSeconds)
Description copied from interface:RemoteCache
A overloaded form ofRemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan parameters.- Specified by:
replaceWithVersion
in interfaceRemoteCache<K,V>
- Parameters:
key
- key to usenewValue
- new value to be associated with the keyversion
- numeric version that should match the one in the server for the operation to succeedlifespanSeconds
- lifespan of the entry- Returns:
- true if the value was replaced
-
replaceAsync
public CompletableFuture<V> replaceAsync(K key, V value)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofConcurrentMap.replace(Object, Object)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
put
public V put(K key, V value, long lifespan, TimeUnit unit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofBasicCache.put(Object, Object)
, which takes in lifespan parameters.- Specified by:
put
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit
- unit of measurement for the lifespan- Returns:
- the value being replaced, or null if nothing is being replaced.
-
put
public V put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofBasicCache.put(Object, Object)
, which takes in lifespan parameters.- Specified by:
put
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
- time unit for max idle time- Returns:
- the value being replaced, or null if nothing is being replaced.
-
putIfAbsentAsync
public CompletableFuture<V> putIfAbsentAsync(K key, V value)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofConcurrentMap.putIfAbsent(Object, Object)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
putIfAbsentAsync
public CompletableFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.putIfAbsent(Object, Object, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
putIfAbsentAsync
public CompletableFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.- Specified by:
putIfAbsentAsync
in interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Parameters:
key
- key to usevalue
- value to storelifespan
- lifespan of entrylifespanUnit
- time unit for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleUnit
- time unit for max idle time- Returns:
- a future containing the old value replaced
-
removeAsync
public CompletableFuture<Boolean> removeAsync(Object key, Object value)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofConcurrentMap.remove(Object, Object)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
replaceAsync
public CompletableFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit unit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.replace(Object, Object, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
replaceAsync
public CompletableFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.replace(Object, Object, long, TimeUnit, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.- Specified by:
replaceAsync
in interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Parameters:
key
- key to removevalue
- value to storelifespan
- lifespan of entrylifespanUnit
- time unit for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleUnit
- time unit for max idle time- Returns:
- a future containing the previous value overwritten
-
replaceAsync
public CompletableFuture<Boolean> replaceAsync(K key, V oldValue, V newValue)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofConcurrentMap.replace(Object, Object, Object)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
replaceAsync
public CompletableFuture<Boolean> replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit unit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.replace(Object, Object, Object, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.- Specified by:
replaceAsync
in interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Parameters:
key
- key to removeoldValue
- value to overwritenewValue
- value to storelifespan
- lifespan of entryunit
- time unit for lifespan- Returns:
- a future containing a boolean, indicating whether the entry was replaced or not
-
replaceAsync
public CompletableFuture<Boolean> replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.replace(Object, Object, Object, long, TimeUnit, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.- Specified by:
replaceAsync
in interfaceorg.infinispan.commons.api.AsyncCache<K,V>
- Parameters:
key
- key to removeoldValue
- value to overwritenewValue
- value to storelifespan
- lifespan of entrylifespanUnit
- time unit for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleUnit
- time unit for max idle time- Returns:
- a future containing a boolean, indicating whether the entry was replaced or not
-
replace
public boolean replace(K key, V oldValue, V value, long lifespan, TimeUnit unit)
Description copied from interface:RemoteCache
An overloaded form ofConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.This method requires 2 round trips to the server. The first to retrieve the value and version and a second to replace the key with the version if the value matches. If possible user should use
RemoteCache.getWithMetadata(Object)
andRemoteCache.replaceWithVersion(Object, Object, long, long, TimeUnit, long, TimeUnit)
.- Specified by:
replace
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Specified by:
replace
in interfaceRemoteCache<K,V>
- Parameters:
key
- key to useoldValue
- value to replacevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit
- unit of measurement for the lifespan- Returns:
- true if the value was replaced, false otherwise
-
replace
public boolean replace(K key, V oldValue, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:RemoteCache
An overloaded form ofConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.This method requires 2 round trips to the server. The first to retrieve the value and version and a second to replace the key with the version if the value matches. If possible user should use
RemoteCache.getWithMetadata(Object)
andRemoteCache.replaceWithVersion(Object, Object, long, long, TimeUnit, long, TimeUnit)
if possible.- Specified by:
replace
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Specified by:
replace
in interfaceRemoteCache<K,V>
- Parameters:
key
- key to useoldValue
- value to replacevalue
- value to storelifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
- time unit for max idle time- Returns:
- true if the value was replaced, false otherwise
-
merge
public V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
-
merge
public V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.merge(Object, Object, BiFunction)
which takes in lifespan parameters.- Specified by:
merge
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to usevalue
- new value to merge with existing valueremappingFunction
- function to use to merge new and existing values into a merged value to store under keylifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
- time unit for max idle time- Returns:
- the merged value that was stored under key
-
merge
public V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.merge(Object, Object, BiFunction)
which takes in lifespan parameters.- Specified by:
merge
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to usevalue
- new value to merge with existing valueremappingFunction
- function to use to merge new and existing values into a merged value to store under keylifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespan- Returns:
- the merged value that was stored under key
-
computeAsync
public CompletableFuture<V> computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofConcurrentMap.compute(Object, BiFunction)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
computeIfAbsent
public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
- Specified by:
computeIfAbsent
in interfaceConcurrentMap<K,V>
- Specified by:
computeIfAbsent
in interfaceMap<K,V>
-
computeIfAbsentAsync
public CompletableFuture<V> computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofConcurrentMap.computeIfAbsent(Object, Function)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
computeIfPresent
public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
- Specified by:
computeIfPresent
in interfaceConcurrentMap<K,V>
- Specified by:
computeIfPresent
in interfaceMap<K,V>
-
computeIfPresentAsync
public CompletableFuture<V> computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofConcurrentMap.computeIfPresent(Object, BiFunction)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
compute
public V compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.compute(Object, BiFunction)
which takes in lifespan parameters.- Specified by:
compute
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to useremappingFunction
- function to use to compute and store the value under keylifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespan- Returns:
- the computed value that was stored under key
-
compute
public V compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.compute(Object, BiFunction)
which takes in lifespan and maxIdleTime parameters.- Specified by:
compute
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to useremappingFunction
- function to use to compute and store the value under keylifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
- time unit for max idle time- Returns:
- the computed value that was stored under key
-
computeIfPresent
public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.computeIfPresent(Object, BiFunction)
which takes in lifespan parameters.- Specified by:
computeIfPresent
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to useremappingFunction
- function to use to compute and store the value under key, if such existslifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespan- Returns:
- the computed value that was stored under key
-
computeIfPresent
public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.computeIfPresent(Object, BiFunction)
which takes in lifespan and maxIdleTime parameters.- Specified by:
computeIfPresent
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to useremappingFunction
- function to use to compute and store the value under key, if such existslifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
- time unit for max idle time- Returns:
- the computed value that was stored under key
-
computeIfAbsent
public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.computeIfAbsent(Object, Function)
which takes in lifespan parameters.- Specified by:
computeIfAbsent
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to usemappingFunction
- function to use to compute and store the value under key, if the key is absentlifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespan- Returns:
- the computed value that was stored under key
-
computeIfAbsent
public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:org.infinispan.commons.api.BasicCache
An overloaded form ofConcurrentMap.computeIfAbsent(Object, Function)
which takes in lifespan and maxIdleTime parameters.- Specified by:
computeIfAbsent
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Parameters:
key
- key to usemappingFunction
- function to use to compute and store the value under key, if the key is absentlifespan
- lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
- time unit for max idle time- Returns:
- the computed value that was stored under key
-
computeAsync
public CompletableFuture<V> computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.compute(Object, BiFunction, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
computeAsync
public CompletableFuture<V> computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.compute(Object, BiFunction, long, TimeUnit, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
computeIfAbsentAsync
public CompletableFuture<V> computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.computeIfAbsent(Object, Function, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
computeIfAbsentAsync
public CompletableFuture<V> computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.computeIfAbsent(Object, Function, long, TimeUnit, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
computeIfPresentAsync
public CompletableFuture<V> computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.computeIfPresent(Object, BiFunction, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
computeIfPresentAsync
public CompletableFuture<V> computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.computeIfPresent(Object, BiFunction, long, TimeUnit, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
mergeAsync
public CompletableFuture<V> mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofConcurrentMap.merge(Object, Object, BiFunction)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
mergeAsync
public CompletableFuture<V> mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.merge(Object, Object, BiFunction, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
mergeAsync
public CompletableFuture<V> mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:org.infinispan.commons.api.AsyncCache
Asynchronous version ofBasicCache.merge(Object, Object, BiFunction, long, TimeUnit, long, TimeUnit)
. This method does not block on remote calls, even if your cache mode is synchronous.
-
replaceAll
public void replaceAll(BiFunction<? super K,? super V,? extends V> function)
- Specified by:
replaceAll
in interfaceConcurrentMap<K,V>
- Specified by:
replaceAll
in interfaceMap<K,V>
-
-