|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.CacheSupport<K,V>
org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,V>
org.infinispan.client.hotrod.impl.RemoteCacheImpl<K,V>
public class RemoteCacheImpl<K,V>
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary |
---|
Fields inherited from class org.infinispan.CacheSupport |
---|
defaultLifespan, defaultMaxIdleTime |
Constructor Summary | |
---|---|
RemoteCacheImpl(RemoteCacheManager rcm,
String name)
|
Method Summary | |
---|---|
void |
clear()
|
NotifyingFuture<Void> |
clearAsync()
Asynchronous version of Map.clear() . |
boolean |
containsKey(Object key)
|
V |
get(Object key)
|
Map<K,V> |
getBulk()
Bulk get operations, returns all the entries within the remote cache. |
Map<K,V> |
getBulk(int size)
Same as RemoteCache.getBulk() , but limits the returned set of values to the specified size. |
String |
getName()
Retrieves the name of the cache |
RemoteCacheManager |
getRemoteCacheManager()
Returns the RemoteCacheManager that created this cache. |
String |
getVersion()
Retrieves the version of Infinispan |
VersionedValue<V> |
getVersioned(K key)
Returns the VersionedValue associated to the supplied key param, or null if it doesn't exist. |
void |
init(Marshaller marshaller,
ExecutorService executorService,
OperationsFactory operationsFactory,
int estimateKeySize,
int estimateValueSize)
|
boolean |
isEmpty()
This operation is not supported. |
V |
put(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
An overloaded form of Map.put(Object, Object) , which takes in lifespan parameters. |
void |
putAll(Map<? extends K,? extends V> map,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
Synthetic operation. |
NotifyingFuture<Void> |
putAllAsync(Map<? extends K,? extends V> data,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
Synthetic operation. |
NotifyingFuture<V> |
putAsync(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
Asynchronous version of Cache.put(Object, Object, long, TimeUnit, long, TimeUnit) . |
V |
putIfAbsent(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
An overloaded form of ConcurrentMap.putIfAbsent(Object, Object) , which takes in lifespan parameters. |
NotifyingFuture<V> |
putIfAbsentAsync(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
Asynchronous version of Cache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit) . |
V |
remove(Object key)
|
NotifyingFuture<V> |
removeAsync(Object key)
Asynchronous version of Map.remove(Object) . |
boolean |
removeWithVersion(K key,
long version)
Removes the given entry only if its version matches the supplied version. |
NotifyingFuture<Boolean> |
removeWithVersionAsync(K key,
long version)
|
V |
replace(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit)
An overloaded form of ConcurrentMap.replace(Object, Object) , which takes in lifespan parameters. |
NotifyingFuture<V> |
replaceAsync(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
Asynchronous version of Cache.replace(Object, Object, long, TimeUnit, long, TimeUnit) . |
boolean |
replaceWithVersion(K key,
V newValue,
long version,
int lifespanSeconds,
int maxIdleTimeSeconds)
|
NotifyingFuture<Boolean> |
replaceWithVersionAsync(K key,
V newValue,
long version,
int lifespanSeconds,
int maxIdleSeconds)
|
int |
size()
This operation is not supported. |
void |
start()
|
ServerStatistics |
stats()
|
void |
stop()
|
RemoteCache<K,V> |
withFlags(Flag... flags)
Applies one or more Flag s to the scope of a single invocation. |
Methods inherited from class org.infinispan.client.hotrod.impl.RemoteCacheSupport |
---|
addListener, compact, containsValue, endBatch, entrySet, evict, getAdvancedCache, getCacheManager, getConfiguration, getListeners, getStatus, keySet, putForExternalRead, remove, removeAsync, removeListener, replace, replaceAsync, replaceWithVersion, replaceWithVersion, replaceWithVersionAsync, replaceWithVersionAsync, startBatch, values |
Methods inherited from class org.infinispan.CacheSupport |
---|
put, put, putAll, putAll, putAllAsync, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, replace, replace, replace, replace, replaceAsync, replaceAsync, replaceAsync, replaceAsync |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.infinispan.client.hotrod.RemoteCache |
---|
putAll, putAll, putAllAsync, putAllAsync, replace, replace, replaceAsync, replaceAsync |
Methods inherited from interface org.infinispan.Cache |
---|
put, putAsync, putAsync, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, replace, replaceAsync, replaceAsync |
Methods inherited from interface java.util.concurrent.ConcurrentMap |
---|
putIfAbsent, replace |
Methods inherited from interface java.util.Map |
---|
equals, hashCode, put |
Constructor Detail |
---|
public RemoteCacheImpl(RemoteCacheManager rcm, String name)
Method Detail |
---|
public void init(Marshaller marshaller, ExecutorService executorService, OperationsFactory operationsFactory, int estimateKeySize, int estimateValueSize)
public RemoteCacheManager getRemoteCacheManager()
RemoteCache
RemoteCacheManager
that created this cache.
public boolean removeWithVersion(K key, long version)
RemoteCache
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.
VersionedValue
,
RemoteCache.getVersioned(Object)
public NotifyingFuture<Boolean> removeWithVersionAsync(K key, long version)
RemoteCache.remove(Object, Object)
public boolean replaceWithVersion(K key, V newValue, long version, int lifespanSeconds, int maxIdleTimeSeconds)
RemoteCache.replaceWithVersion(Object, Object, long)
public NotifyingFuture<Boolean> replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds, int maxIdleSeconds)
RemoteCache.replaceWithVersion(Object, Object, long)
public VersionedValue<V> getVersioned(K key)
RemoteCache
VersionedValue
associated to the supplied key param, or null if it doesn't exist.
public void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
RemoteCache
map
- map containing mappings to enterlifespan
- 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 timeRemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
public NotifyingFuture<Void> putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
RemoteCache
data
- 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
RemoteCache.putAll(java.util.Map, long, java.util.concurrent.TimeUnit)
public int size()
RemoteCache
public boolean isEmpty()
RemoteCache
public ServerStatistics stats()
public V put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Cache
Map.put(Object, Object)
, which takes in lifespan 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
public V putIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Cache
ConcurrentMap.putIfAbsent(Object, Object)
, which takes in lifespan 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
public V replace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
Cache
ConcurrentMap.replace(Object, Object)
, which takes in lifespan 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
public NotifyingFuture<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Cache
Cache.put(Object, Object, long, TimeUnit, long, TimeUnit)
. This method does not block
on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.put(Object, Object, long,
TimeUnit, long, TimeUnit)
if used in LOCAL mode.
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
public NotifyingFuture<Void> clearAsync()
Cache
Map.clear()
. This method does not block on remote calls, even if your cache mode is
synchronous. Has no benefit over Map.clear()
if used in LOCAL mode.
public NotifyingFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Cache
Cache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit)
. This method does
not block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.putIfAbsent(Object, Object, long, TimeUnit, long, TimeUnit)
if used in LOCAL mode.
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
public NotifyingFuture<V> removeAsync(Object key)
Cache
Map.remove(Object)
. This method does not block on remote calls, even if your cache
mode is synchronous. Has no benefit over Map.remove(Object)
if used in LOCAL mode.
key
- key to remove
public NotifyingFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
Cache
Cache.replace(Object, Object, long, TimeUnit, long, TimeUnit)
. This method does not
block on remote calls, even if your cache mode is synchronous. Has no benefit over Cache.replace(Object,
Object, long, TimeUnit, long, TimeUnit)
if used in LOCAL mode.
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
public boolean containsKey(Object key)
public V get(Object key)
public Map<K,V> getBulk()
RemoteCache
public Map<K,V> getBulk(int size)
RemoteCache
RemoteCache.getBulk()
, but limits the returned set of values to the specified size. No ordering is guaranteed, and there is no
guarantee that "size" elements are returned( e.g. if the number of elements in the back-end server is smaller that "size")
public V remove(Object key)
public void clear()
public void start()
public void stop()
public String getName()
Cache
public String getVersion()
Cache
public RemoteCache<K,V> withFlags(Flag... flags)
RemoteCache
Flag
s to the scope of a single invocation. See the Flag
enumeration to for
information on available flags.
Sample usage:
remoteCache.withFlags(Flag.FORCE_RETURN_VALUE).put("hello", "world");
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |