Class InvalidatedNearRemoteCache<K,V>
- java.lang.Object
-
- org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,V>
-
- org.infinispan.client.hotrod.impl.RemoteCacheImpl<K,V>
-
- org.infinispan.client.hotrod.impl.InvalidatedNearRemoteCache<K,V>
-
- Type Parameters:
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
public class InvalidatedNearRemoteCache<K,V> extends RemoteCacheImpl<K,V>
NearRemoteCache
implementation enabling
-
-
Field Summary
-
Fields inherited from class org.infinispan.client.hotrod.impl.RemoteCacheImpl
operationsFactory
-
Fields inherited from class org.infinispan.client.hotrod.impl.RemoteCacheSupport
defaultLifespan, defaultMaxIdleTime
-
-
Constructor Summary
Constructors Constructor Description InvalidatedNearRemoteCache(RemoteCacheManager rcm, String name, NearCacheService<K,V> nearcache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
V
get(Object key)
VersionedValue<V>
getVersioned(K key)
Returns theVersionedValue
associated to the supplied key param, or null if it doesn't exist.V
put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
void
putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Synthetic operation.V
remove(Object key)
boolean
removeWithVersion(K key, long version)
Removes the given entry only if its version matches the supplied version.V
replace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
boolean
replaceWithVersion(K key, V newValue, long version, long lifespan, TimeUnit lifespanTimeUnit, long maxIdle, TimeUnit maxIdleTimeUnit)
A overloaded form ofRemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters.void
start()
void
stop()
-
Methods inherited from class org.infinispan.client.hotrod.impl.RemoteCacheImpl
addClientListener, addClientListener, assertRemoteCacheManagerIsStarted, clearAsync, containsKey, containsValue, entrySet, execute, execute, getAll, getAsync, getBulk, getBulk, getCacheTopologyInfo, getDataFormat, getListeners, getName, getOperationsFactory, getProtocolVersion, getRemoteCacheManager, getVersion, getWithMetadata, hasCompatibility, init, isEmpty, keySet, keyToBytes, ping, putAllAsync, putAsync, putIfAbsent, putIfAbsentAsync, remove, removeAsync, removeClientListener, removeWithVersionAsync, replace, replaceAsync, replaceWithVersion, replaceWithVersionAsync, replaceWithVersionAsync, resolveCompatibility, retrieveEntries, retrieveEntries, retrieveEntries, retrieveEntriesByQuery, retrieveEntriesWithMetadata, set, size, stats, streaming, values, valueToBytes, withDataFormat, withFlags
-
Methods inherited from class org.infinispan.client.hotrod.impl.RemoteCacheSupport
merge, merge, merge, put, put, putAll, putAll, putAllAsync, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, removeAsync, replace, replace, replace, replace, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceAsync, replaceWithVersion, replaceWithVersion, replaceWithVersionAsync, replaceWithVersionAsync
-
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
containsKeyAsync, getAllAsync
-
Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, replaceAll
-
-
-
-
Constructor Detail
-
InvalidatedNearRemoteCache
public InvalidatedNearRemoteCache(RemoteCacheManager rcm, String name, NearCacheService<K,V> nearcache)
-
-
Method Detail
-
getVersioned
public VersionedValue<V> getVersioned(K key)
Description copied from interface:RemoteCache
Returns theVersionedValue
associated to the supplied key param, or null if it doesn't exist.- Specified by:
getVersioned
in interfaceRemoteCache<K,V>
- Overrides:
getVersioned
in classRemoteCacheImpl<K,V>
-
put
public V put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
-
putAll
public void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Description copied from interface:RemoteCache
Synthetic operation.- Specified by:
putAll
in interfaceorg.infinispan.commons.api.BasicCache<K,V>
- Specified by:
putAll
in interfaceRemoteCache<K,V>
- Overrides:
putAll
in classRemoteCacheImpl<K,V>
- See Also:
RemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
-
replace
public V replace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
-
replaceWithVersion
public boolean replaceWithVersion(K key, V newValue, long version, long lifespan, TimeUnit lifespanTimeUnit, long maxIdle, TimeUnit maxIdleTimeUnit)
Description copied from interface:RemoteCache
A overloaded form ofRemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters.- Specified by:
replaceWithVersion
in interfaceRemoteCache<K,V>
- Overrides:
replaceWithVersion
in classRemoteCacheImpl<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 succeedlifespan
- lifespan of the entrylifespanTimeUnit
-TimeUnit
for lifespanmaxIdle
- the maximum amount of time this key is allowed to be idle for before it is considered as expiredmaxIdleTimeUnit
-TimeUnit
for maxIdle- Returns:
- true if the value was replaced
-
remove
public V remove(Object key)
Description copied from interface:RemoteCache
The returned value is only sent back if
Flag.FORCE_RETURN_VALUE
is enabled.
-
removeWithVersion
public boolean removeWithVersion(K key, long version)
Description copied from interface:RemoteCache
Removes the given entry only if its version matches the supplied version. A typical use case looks like this:VersionedEntry ve = remoteCache.getVersioned(key); //some processing remoteCache.removeWithVersion(key, ve.getVersion();
Lat call (removeWithVersion) will make sure that the entry will only be removed if it hasn't been changed in between.- Specified by:
removeWithVersion
in interfaceRemoteCache<K,V>
- Overrides:
removeWithVersion
in classRemoteCacheImpl<K,V>
- Returns:
- true if the entry has been removed
- See Also:
VersionedValue
,RemoteCache.getVersioned(Object)
-
clear
public void clear()
-
start
public void start()
- Specified by:
start
in interfaceorg.infinispan.commons.api.Lifecycle
- Overrides:
start
in classRemoteCacheImpl<K,V>
-
stop
public void stop()
- Specified by:
stop
in interfaceorg.infinispan.commons.api.Lifecycle
- Overrides:
stop
in classRemoteCacheImpl<K,V>
-
-