org.infinispan.client.hotrod.impl
public class RemoteCacheImpl<K,V> extends RemoteCacheSupport<K,V>
Constructor and Description |
---|
RemoteCacheImpl(RemoteCacheManager rcm,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
org.infinispan.util.concurrent.NotifyingFuture<Void> |
clearAsync() |
boolean |
containsKey(Object key) |
V |
get(Object key) |
org.infinispan.util.concurrent.NotifyingFuture<V> |
getAsync(K 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() |
RemoteCacheManager |
getRemoteCacheManager()
Returns the
RemoteCacheManager that created this cache. |
String |
getVersion() |
VersionedValue<V> |
getVersioned(K key)
Returns the
VersionedValue associated to the supplied key param, or null if it doesn't exist. |
MetadataValue<V> |
getWithMetadata(K key)
Returns the
MetadataValue associated to the supplied key param, or null if it doesn't exist. |
void |
init(org.infinispan.marshall.Marshaller marshaller,
ExecutorService executorService,
OperationsFactory operationsFactory,
int estimateKeySize,
int estimateValueSize) |
boolean |
isEmpty() |
Set<K> |
keySet()
Returns all keys in the remote server.
|
PingOperation.PingResult |
ping() |
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.
|
org.infinispan.util.concurrent.NotifyingFuture<Void> |
putAllAsync(Map<? extends K,? extends V> data,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
Synthetic operation.
|
org.infinispan.util.concurrent.NotifyingFuture<V> |
putAsync(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit) |
V |
putIfAbsent(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit) |
org.infinispan.util.concurrent.NotifyingFuture<V> |
putIfAbsentAsync(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit) |
V |
remove(Object key) |
org.infinispan.util.concurrent.NotifyingFuture<V> |
removeAsync(Object key) |
boolean |
removeWithVersion(K key,
long version)
Removes the given entry only if its version matches the supplied version.
|
org.infinispan.util.concurrent.NotifyingFuture<Boolean> |
removeWithVersionAsync(K key,
long version) |
V |
replace(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit) |
org.infinispan.util.concurrent.NotifyingFuture<V> |
replaceAsync(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit) |
boolean |
replaceWithVersion(K key,
V newValue,
long version,
int lifespanSeconds,
int maxIdleTimeSeconds)
A overloaded form of
RemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time parameters. |
org.infinispan.util.concurrent.NotifyingFuture<Boolean> |
replaceWithVersionAsync(K key,
V newValue,
long version,
int lifespanSeconds,
int maxIdleSeconds) |
protected void |
set(K key,
V value) |
int |
size() |
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. |
containsValue, entrySet, remove, removeAsync, replace, replaceAsync, replaceWithVersion, replaceWithVersion, replaceWithVersionAsync, replaceWithVersionAsync, values
put, put, putAll, putAll, putAllAsync, putAllAsync, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, replace, replace, replace, replace, replaceAsync, replaceAsync, replaceAsync, replaceAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
putAll, putAll, putAllAsync, putAllAsync, replace, replace, replaceAsync, replaceAsync
put, put, putAsync, putAsync, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, replace, replaceAsync, replaceAsync
putIfAbsent, replace
public RemoteCacheImpl(RemoteCacheManager rcm, String name)
public void init(org.infinispan.marshall.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 org.infinispan.util.concurrent.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
RemoteCache.replaceWithVersion(Object, Object, long)
which takes in lifespan and maximum idle time 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 entrymaxIdleTimeSeconds
- the maximum amount of time this key is allowed
to be idle for before it is considered as expiredpublic org.infinispan.util.concurrent.NotifyingFuture<Boolean> replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds, int maxIdleSeconds)
public VersionedValue<V> getVersioned(K key)
RemoteCache
VersionedValue
associated to the supplied key param, or null if it doesn't exist.public MetadataValue<V> getWithMetadata(K key)
RemoteCache
MetadataValue
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
public org.infinispan.util.concurrent.NotifyingFuture<Void> putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
RemoteCache
public int size()
public boolean isEmpty()
public ServerStatistics stats()
public V put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
public V putIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
public V replace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
public org.infinispan.util.concurrent.NotifyingFuture<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
public org.infinispan.util.concurrent.NotifyingFuture<Void> clearAsync()
public org.infinispan.util.concurrent.NotifyingFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
public org.infinispan.util.concurrent.NotifyingFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
public boolean containsKey(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 void clear()
public void start()
public void stop()
public String getName()
public String getVersion()
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");
public PingOperation.PingResult ping()
public Set<K> keySet()
RemoteCache
Copyright © 2016 JBoss, a division of Red Hat. All Rights Reserved.