K
- keyV
- valuepublic interface ICache<K,V>
extends javax.cache.Cache<K,V>
Modifier and Type | Method and Description |
---|---|
void |
destroy()
close the cache, clear the internal content and release any resource
|
V |
get(K key,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Get with custom expiry policy
|
Map<K,V> |
getAll(Set<? extends K> keys,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
getAll with custom expiry policy
|
V |
getAndPut(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
getAndPut with custom expiry policy
|
Future<V> |
getAndPutAsync(K key,
V value)
Asynchronously associates the specified value with the specified key in this cache,
returning an existing value if one existed.
|
Future<V> |
getAndPutAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously associates the specified value with the specified key in this cache,
returning an existing value if one existed using a custom expiry policy
|
Future<V> |
getAndRemoveAsync(K key)
Asynchronously removes the entry for a key returning the removed value if one existed.
|
V |
getAndReplace(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
getAndReplace with custom expiry policy
|
Future<V> |
getAndReplaceAsync(K key,
V value)
Asynchronously replaces the entry for a key only if currently mapped to some
|
Future<V> |
getAndReplaceAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously replaces the entry for a key only if currently mapped to some
using custom expiry policy
|
Future<V> |
getAsync(K key)
Asynchronously get an entry from cache
|
Future<V> |
getAsync(K key,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously get an entry from cache with a provided expiry policy
|
CacheStatistics |
getLocalCacheStatistics()
Directly access to local Cache Statistics
|
void |
put(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
put with custom expiry policy
|
void |
putAll(Map<? extends K,? extends V> map,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
putAll with custom expiry policy
|
Future<Void> |
putAsync(K key,
V value)
Asynchronously associates the specified value with the specified key in the cache.
|
Future<Void> |
putAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously associates the specified value with the specified key in the cache using a
custom expiry policy
|
boolean |
putIfAbsent(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
putIfAbsent with custom expiry policy
|
Future<Boolean> |
putIfAbsentAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously associates the specified value with the specified key in the cache if not already exist
using a custom expiry policy
|
Future<Boolean> |
removeAsync(K key)
Asynchronously removes the mapping for a key from this cache if it is present.
|
Future<Boolean> |
removeAsync(K key,
V oldValue)
Asynchronously removes the mapping for a key only if currently mapped to the
given value.
|
boolean |
replace(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
replace with custom expiry policy
|
boolean |
replace(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
replace with custom expiry policy
|
Future<Boolean> |
replaceAsync(K key,
V value)
Asynchronously replaces the entry for a key
|
Future<Boolean> |
replaceAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously replaces the entry for a key only if currently mapped to some
value.
|
Future<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue)
Asynchronously replaces the entry for a key only if currently mapped to a
given value.
|
Future<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously replaces the entry for a key only if currently mapped to a
given value using custom expiry policy
|
int |
size()
total entry count
|
clear, close, containsKey, deregisterCacheEntryListener, get, getAll, getAndPut, getAndRemove, getAndReplace, getCacheManager, getConfiguration, getName, invoke, invokeAll, isClosed, iterator, loadAll, put, putAll, putIfAbsent, registerCacheEntryListener, remove, remove, removeAll, removeAll, replace, replace, unwrap
Future<V> getAsync(K key)
key
- the key whose associated value is to be returnedjavax.cache.Cache#get(K)
,
Future
Future<V> getAsync(K key, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- the key whose associated value is to be returnedexpiryPolicy
- custom expiry policy for this operationjavax.cache.Cache#get(K)
,
Future
Future<Void> putAsync(K key, V value)
key
- the key whose associated value is to be returnedvalue
- value to be associated with the specified keyjavax.cache.Cache#put(K,V)
,
Future
Future<Void> putAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- the key whose associated value is to be returnedvalue
- value to be associated with the specified keyexpiryPolicy
- custom expiry Policy for this operationjavax.cache.Cache#put(K,V)
,
Future
Future<Boolean> putIfAbsentAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyexpiryPolicy
- javax.cache.Cache#putIfAbsent(K,V)
,
Future
Future<V> getAndPutAsync(K key, V value)
key
- the key whose associated value is to be returnedvalue
- value to be associated with the specified keyjavax.cache.Cache#getAndPut(K,V)
,
Future
Future<V> getAndPutAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- the key whose associated value is to be returnedvalue
- value to be associated with the specified keyexpiryPolicy
- custom expiry Policy for this operationjavax.cache.Cache#getAndPut(K,V)
,
Future
Future<Boolean> removeAsync(K key)
key
- the key whose associated value is to be returnedjavax.cache.Cache#remove(K)
,
Future
Future<Boolean> removeAsync(K key, V oldValue)
key
- the key whose associated value is to be returnedoldValue
- value expected to be associated with the specified keyjavax.cache.Cache#remove(K,V)
,
Future
Future<V> getAndRemoveAsync(K key)
key
- the key whose associated value is to be returnedjavax.cache.Cache#getAndRemove(K)
,
Future
Future<Boolean> replaceAsync(K key, V value)
key
- the key whose associated value is to be returnedvalue
- value to be associated with the specified keyjavax.cache.Cache#replace(K,V)
,
Future
Future<Boolean> replaceAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- the key with which the specified value is associatedvalue
- the value to be associated with the specified keyexpiryPolicy
- custom expiry Policy for this operationjavax.cache.Cache#replace(K,V)
,
Future
Future<Boolean> replaceAsync(K key, V oldValue, V newValue)
key
- key with which the specified value is associatedoldValue
- value expected to be associated with the specified keynewValue
- value to be associated with the specified keyjavax.cache.Cache#replace(K,V,V)
,
Future
Future<Boolean> replaceAsync(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- key with which the specified value is associatedoldValue
- value expected to be associated with the specified keynewValue
- value to be associated with the specified keyexpiryPolicy
- custom expiry Policy for this operationjavax.cache.Cache#replace(K,V,V)
,
Future
Future<V> getAndReplaceAsync(K key, V value)
key
- the key with which the specified value is associatedvalue
- the value to be associated with the specified keyjavax.cache.Cache#getAndReplace(K,V)
,
Future
Future<V> getAndReplaceAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- the key with which the specified value is associatedvalue
- the value to be associated with the specified keyexpiryPolicy
- custom expiry Policy for this operationjavax.cache.Cache#getAndReplace(K,V)
,
Future
V get(K key, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- the key whose associated value is to be returnedexpiryPolicy
- javax.cache.Cache#get(K)
,
Future
Map<K,V> getAll(Set<? extends K> keys, javax.cache.expiry.ExpiryPolicy expiryPolicy)
keys
- The keys whose associated values are to be returned.expiryPolicy
- Cache.getAll(java.util.Set)
,
Future
void put(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyexpiryPolicy
- javax.cache.Cache#put(K,V)
,
Future
V getAndPut(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyexpiryPolicy
- javax.cache.Cache#getAndPut(K,V)
,
Future
void putAll(Map<? extends K,? extends V> map, javax.cache.expiry.ExpiryPolicy expiryPolicy)
map
- mappings to be stored in this cacheexpiryPolicy
- Cache.putAll(java.util.Map)
,
Future
boolean putIfAbsent(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyexpiryPolicy
- javax.cache.Cache#putIfAbsent(K,V)
,
Future
boolean replace(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- key with which the specified value is associatedoldValue
- value expected to be associated with the specified keynewValue
- value to be associated with the specified keyexpiryPolicy
- javax.cache.Cache#replace(K,V,V)
,
Future
boolean replace(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- the key with which the specified value is associatedvalue
- the value to be associated with the specified keyexpiryPolicy
- V getAndReplace(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
key
- key with which the specified value is associatedvalue
- value to be associated with the specified keyexpiryPolicy
- javax.cache.Cache#getAndReplace(K,V)
,
Future
int size()
void destroy()
CacheManager.destroyCache(String)
CacheStatistics getLocalCacheStatistics()
Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.