org.infinispan.client.hotrod.impl
Class RemoteCacheSupport<K,V>

java.lang.Object
  extended by org.infinispan.CacheSupport<K,V>
      extended by org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,V>
All Implemented Interfaces:
ConcurrentMap<K,V>, Map<K,V>, Cache<K,V>, RemoteCache<K,V>, Lifecycle, Listenable
Direct Known Subclasses:
RemoteCacheImpl

public abstract class RemoteCacheSupport<K,V>
extends CacheSupport<K,V>
implements RemoteCache<K,V>

Purpose: keep all delegating and unsupported methods in one place -> readability.

Since:
4.1
Author:
Mircea.Markus@jboss.com

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
RemoteCacheSupport()
           
 
Method Summary
 void addListener(Object listener)
          This operation is not supported.
 void compact()
          This operation is not supported.
 boolean containsValue(Object value)
          This operation is not supported.
 void endBatch(boolean successful)
          This operation is not supported.
 Set<Map.Entry<K,V>> entrySet()
          This operation is not supported.
 void evict(K key)
          This operation is not supported.
 AdvancedCache<K,V> getAdvancedCache()
          This operation is not supported.
 EmbeddedCacheManager getCacheManager()
          Retrieves the cache manager responsible for creating this cache instance.
 Configuration getConfiguration()
          This operation is not supported.
 Set<Object> getListeners()
          This operation is not supported.
 ComponentStatus getStatus()
           
 Set<K> keySet()
          This operation is not supported.
 void putForExternalRead(K key, V value)
          This operation is not supported.
 boolean remove(Object key, Object value)
          This operation is not supported.
 NotifyingFuture<Boolean> removeAsync(Object key, Object value)
          This operation is not supported.
 void removeListener(Object listener)
          This operation is not supported.
 boolean replace(K key, V oldValue, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)
          This operation is not supported.
 NotifyingFuture<Boolean> replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
          This operation is not supported.
 boolean replaceWithVersion(K key, V newValue, long version)
          Removes the given value only if its version matches the supplied version.
 boolean replaceWithVersion(K key, V newValue, long version, int lifespanSeconds)
           
 NotifyingFuture<Boolean> replaceWithVersionAsync(K key, V newValue, long version)
           
 NotifyingFuture<Boolean> replaceWithVersionAsync(K key, V newValue, long version, int lifespanSeconds)
           
 boolean startBatch()
          This operation is not supported.
 Collection<V> values()
          This operation is not supported.
 
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
getBulk, getBulk, getRemoteCacheManager, getVersioned, isEmpty, putAll, putAll, putAll, putAllAsync, putAllAsync, putAllAsync, removeWithVersion, removeWithVersionAsync, replace, replace, replaceAsync, replaceAsync, replaceWithVersion, replaceWithVersionAsync, size, stats, withFlags
 
Methods inherited from interface org.infinispan.Cache
clearAsync, getName, getVersion, put, put, putAsync, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, putIfAbsentAsync, removeAsync, replace, replace, replaceAsync, replaceAsync, replaceAsync
 
Methods inherited from interface java.util.concurrent.ConcurrentMap
putIfAbsent, replace
 
Methods inherited from interface java.util.Map
clear, containsKey, equals, get, hashCode, put, remove
 
Methods inherited from interface org.infinispan.lifecycle.Lifecycle
start, stop
 

Constructor Detail

RemoteCacheSupport

public RemoteCacheSupport()
Method Detail

replaceWithVersionAsync

public NotifyingFuture<Boolean> replaceWithVersionAsync(K key,
                                                        V newValue,
                                                        long version)
Specified by:
replaceWithVersionAsync in interface RemoteCache<K,V>
See Also:
RemoteCache.replaceWithVersion(Object, Object, long)

replaceWithVersionAsync

public NotifyingFuture<Boolean> replaceWithVersionAsync(K key,
                                                        V newValue,
                                                        long version,
                                                        int lifespanSeconds)
Specified by:
replaceWithVersionAsync in interface RemoteCache<K,V>
See Also:
RemoteCache.replaceWithVersion(Object, Object, long)

replaceWithVersion

public boolean replaceWithVersion(K key,
                                  V newValue,
                                  long version)
Description copied from interface: RemoteCache
Removes the given value only if its version matches the supplied version. See RemoteCache.removeWithVersion(Object, long) for a sample usage.

Specified by:
replaceWithVersion in interface RemoteCache<K,V>
Returns:
true if the method has been replaced
See Also:
RemoteCache.getVersioned(Object), VersionedValue

getCacheManager

public EmbeddedCacheManager getCacheManager()
Description copied from interface: Cache
Retrieves the cache manager responsible for creating this cache instance.

Specified by:
getCacheManager in interface Cache<K,V>
Returns:
a cache manager

replaceWithVersion

public boolean replaceWithVersion(K key,
                                  V newValue,
                                  long version,
                                  int lifespanSeconds)
Specified by:
replaceWithVersion in interface RemoteCache<K,V>
See Also:
RemoteCache.replaceWithVersion(Object, Object, long)

putForExternalRead

public void putForExternalRead(K key,
                               V value)
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
putForExternalRead in interface Cache<K,V>
Specified by:
putForExternalRead in interface RemoteCache<K,V>
Parameters:
key - key with which the specified value is to be associated.
value - value to be associated with the specified key.

addListener

public void addListener(Object listener)
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
addListener in interface RemoteCache<K,V>
Specified by:
addListener in interface Listenable
Parameters:
listener - must not be null.

removeListener

public void removeListener(Object listener)
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
removeListener in interface RemoteCache<K,V>
Specified by:
removeListener in interface Listenable
Parameters:
listener - listener to remove. Must not be null.

getListeners

public Set<Object> getListeners()
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
getListeners in interface RemoteCache<K,V>
Specified by:
getListeners in interface Listenable
Returns:
a set of all listeners registered on this component.

containsValue

public boolean containsValue(Object value)
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
containsValue in interface Map<K,V>
Specified by:
containsValue in interface RemoteCache<K,V>

keySet

public Set<K> keySet()
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
keySet in interface Map<K,V>
Specified by:
keySet in interface Cache<K,V>
Specified by:
keySet in interface RemoteCache<K,V>
Returns:
a set view of the keys contained in this cache.

values

public Collection<V> values()
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
values in interface Map<K,V>
Specified by:
values in interface Cache<K,V>
Specified by:
values in interface RemoteCache<K,V>
Returns:
a collection view of the values contained in this map.

entrySet

public Set<Map.Entry<K,V>> entrySet()
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
entrySet in interface Map<K,V>
Specified by:
entrySet in interface Cache<K,V>
Specified by:
entrySet in interface RemoteCache<K,V>
Returns:
a set view of the mappings contained in this cache.

evict

public void evict(K key)
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
evict in interface Cache<K,V>
Specified by:
evict in interface RemoteCache<K,V>
Parameters:
key - key to evict

getConfiguration

public Configuration getConfiguration()
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
getConfiguration in interface Cache<K,V>
Specified by:
getConfiguration in interface RemoteCache<K,V>

startBatch

public boolean startBatch()
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
startBatch in interface Cache<K,V>
Specified by:
startBatch in interface RemoteCache<K,V>
Returns:
true if a batch was successfully started; false if one was available and already running.

endBatch

public void endBatch(boolean successful)
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
endBatch in interface Cache<K,V>
Specified by:
endBatch in interface RemoteCache<K,V>
Parameters:
successful - if true, the batch completes, otherwise the batch is aborted and changes are not committed.

remove

public boolean remove(Object key,
                      Object value)
Description copied from interface: RemoteCache
This operation is not supported. Consider using RemoteCache.removeWithVersion(Object, long) instead.

Specified by:
remove in interface ConcurrentMap<K,V>
Specified by:
remove in interface RemoteCache<K,V>

removeAsync

public NotifyingFuture<Boolean> removeAsync(Object key,
                                            Object value)
Description copied from interface: RemoteCache
This operation is not supported. Consider using RemoteCache.removeWithVersionAsync(Object, long) instead.

Specified by:
removeAsync in interface Cache<K,V>
Specified by:
removeAsync in interface RemoteCache<K,V>
Parameters:
key - key to remove
value - value to match on
Returns:
a future containing a boolean, indicating whether the entry was removed or not

replace

public boolean replace(K key,
                       V oldValue,
                       V value,
                       long lifespan,
                       TimeUnit lifespanUnit,
                       long maxIdleTime,
                       TimeUnit maxIdleTimeUnit)
Description copied from interface: RemoteCache
This operation is not supported. Consider using RemoteCache.replaceWithVersion(Object, Object, long, int, int) instead.

Specified by:
replace in interface Cache<K,V>
Specified by:
replace in interface RemoteCache<K,V>
Parameters:
key - key to use
oldValue - value to replace
value - value to store
lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
lifespanUnit - time unit for lifespan
maxIdleTime - the maximum amount of time this key is allowed to be idle for before it is considered as expired
maxIdleTimeUnit - time unit for max idle time
Returns:
true if the value was replaced, false otherwise

replaceAsync

public NotifyingFuture<Boolean> replaceAsync(K key,
                                             V oldValue,
                                             V newValue,
                                             long lifespan,
                                             TimeUnit lifespanUnit,
                                             long maxIdle,
                                             TimeUnit maxIdleUnit)
Description copied from interface: RemoteCache
This operation is not supported. Consider using RemoteCache.replaceWithVersion(Object, Object, long, int, int) instead.

Specified by:
replaceAsync in interface Cache<K,V>
Specified by:
replaceAsync in interface RemoteCache<K,V>
Parameters:
key - key to remove
oldValue - value to overwrite
newValue - value to store
lifespan - lifespan of entry
lifespanUnit - time unit for lifespan
maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
maxIdleUnit - time unit for max idle time
Returns:
a future containing a boolean, indicating whether the entry was replaced or not

getAdvancedCache

public AdvancedCache<K,V> getAdvancedCache()
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
getAdvancedCache in interface Cache<K,V>
Specified by:
getAdvancedCache in interface RemoteCache<K,V>

compact

public void compact()
Description copied from interface: RemoteCache
This operation is not supported.

Specified by:
compact in interface Cache<K,V>
Specified by:
compact in interface RemoteCache<K,V>

getStatus

public ComponentStatus getStatus()
Specified by:
getStatus in interface Cache<K,V>


Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.