public interface CacheCodecTemplate
Modifier and Type | Method and Description |
---|---|
Object |
addEntryListener(String name,
boolean localOnly) |
Object |
addInvalidationListener(String name,
boolean localOnly) |
Object |
addPartitionLostListener(String name,
boolean localOnly)
Adds a CachePartitionLostListener.
|
void |
clear(String name)
Clears the contents of the cache, without notifying listeners or CacheWriters.
|
Object |
containsKey(String name,
Data key)
Determines if the Cache contains an entry for the specified key.
|
Object |
createConfig(Data cacheConfig,
boolean createAlsoOnOthers) |
void |
destroy(String name)
Closes the cache.
|
Object |
entryProcessor(String name,
Data key,
Data entryProcessor,
List<Data> arguments,
int completionId) |
Object |
get(String name,
Data key,
Data expiryPolicy)
Retrieves the mapped value of the given key using a custom javax.cache.expiry.ExpiryPolicy.
|
Object |
getAll(String name,
List<Data> keys,
Data expiryPolicy)
Gets a collection of entries from the cache with custom expiry policy, returning them as Map of the values
associated with the set of keys requested.
|
Object |
getAndRemove(String name,
Data key,
int completionId)
Atomically removes the entry for a key only if currently mapped to some value.
|
Object |
getAndReplace(String name,
Data key,
Data value,
Data expiryPolicy,
int completionId)
Atomically replaces the assigned value of the given key by the specified value using a custom
javax.cache.expiry.ExpiryPolicy and returns the previously assigned value.
|
Object |
getConfig(String name,
String simpleName) |
Object |
iterate(String name,
int partitionId,
int tableIndex,
int batch)
The ordering of iteration over entries is undefined.
|
void |
listenerRegistration(String name,
Data listenerConfig,
boolean shouldRegister,
Address address) |
void |
loadAll(String name,
List<Data> keys,
boolean replaceExistingValues) |
void |
managementConfig(String name,
boolean isStat,
boolean enabled,
Address address) |
Object |
put(String name,
Data key,
Data value,
Data expiryPolicy,
boolean get,
int completionId) |
void |
putAll(String name,
List<Map.Entry<Data,Data>> entries,
Data expiryPolicy,
int completionId) |
Object |
putIfAbsent(String name,
Data key,
Data value,
Data expiryPolicy,
int completionId)
Associates the specified key with the given value if and only if there is not yet a mapping defined for the
specified key.
|
Object |
remove(String name,
Data key,
Data currentValue,
int completionId)
Atomically removes the mapping for a key only if currently mapped to the given value.
|
void |
removeAll(String name,
int completionId)
Removes all of the mappings from this cache.
|
void |
removeAllKeys(String name,
List<Data> keys,
int completionId)
Removes entries for the specified keys.
|
Object |
removeEntryListener(String name,
String registrationId) |
Object |
removeInvalidationListener(String name,
String registrationId) |
Object |
removePartitionLostListener(String name,
String registrationId)
Removes the specified cache partition lost listener.
|
Object |
replace(String name,
Data key,
Data oldValue,
Data newValue,
Data expiryPolicy,
int completionId)
Atomically replaces the currently assigned value for the given key with the specified newValue if and only if the
currently assigned value equals the value of oldValue using a custom javax.cache.expiry.ExpiryPolicy
If the cache is configured for write-through operation mode, the underlying configured
javax.cache.integration.CacheWriter might be called to store the value of the key to any kind of external resource.
|
Object |
size(String name)
Total entry count
|
Object addEntryListener(String name, boolean localOnly)
name
- Name of the cache.localOnly
- if true fires events that originated from this node only, otherwise fires all eventsObject addInvalidationListener(String name, boolean localOnly)
name
- Name of the cache.localOnly
- if true fires events that originated from this node only, otherwise fires all eventsvoid clear(String name)
name
- Name of the cache.void removeAllKeys(String name, List<Data> keys, int completionId)
name
- Name of the cache.keys
- The keys to remove.completionId
- User generated id which shall be received as a field of the cache event upon completion of
the request in the cluster.void removeAll(String name, int completionId)
name
- Name of the cache.completionId
- User generated id which shall be received as a field of the cache event upon completion of
the request in the cluster.Object containsKey(String name, Data key)
name
- Name of the cache.key
- The key whose presence in this cache is to be tested.Object createConfig(Data cacheConfig, boolean createAlsoOnOthers)
cacheConfig
- The cache configuration. Byte-array which is serialized from an object implementing
javax.cache.configuration.Configuration interface.createAlsoOnOthers
- True if the configuration shall be created on all members, false otherwise.void destroy(String name)
name
- Name of the cache.Object entryProcessor(String name, Data key, Data entryProcessor, List<Data> arguments, int completionId)
name
- Name of the cache.key
- the key to the entryentryProcessor
- Entry processor to invoke. Byte-array which is serialized from an object implementing
javax.cache.processor.EntryProcessor.arguments
- additional arguments to pass to the EntryProcessorcompletionId
- User generated id which shall be received as a field of the cache event upon completion of
the request in the cluster.Object getAll(String name, List<Data> keys, @Nullable Data expiryPolicy)
name
- Name of the cache.keys
- The keys whose associated values are to be returned.expiryPolicy
- Expiry policy for the entry. Byte-array which is serialized from an object implementing
javax.cache.expiry.ExpiryPolicy interface.Object getAndRemove(String name, Data key, int completionId)
name
- Name of the cache.key
- key with which the specified value is associatedcompletionId
- User generated id which shall be received as a field of the cache event upon completion of
the request in the cluster.Object getAndReplace(String name, Data key, Data value, @Nullable Data expiryPolicy, int completionId)
name
- Name of the cache.key
- The key whose value is replaced.value
- The new value to be associated with the specified key.expiryPolicy
- Expiry policy for the entry. Byte-array which is serialized from an object implementing
javax.cache.expiry.ExpiryPolicy interface.completionId
- User generated id which shall be received as a field of the cache event upon completion of
the request in the cluster.Object getConfig(String name, String simpleName)
name
- Name of the cache with prefix.simpleName
- Name of the cache without prefix.Object get(String name, Data key, @Nullable Data expiryPolicy)
name
- Name of the cache.key
- The key whose mapped value is to be returned.expiryPolicy
- Expiry policy for the entry. Byte-array which is serialized from an object implementing
javax.cache.expiry.ExpiryPolicy interface.Object iterate(String name, int partitionId, int tableIndex, int batch)
name
- Name of the cache.partitionId
- The partition id which owns this cache store.tableIndex
- The slot number (or index) to start the iteratorbatch
- The number of items to be batchedvoid listenerRegistration(String name, Data listenerConfig, boolean shouldRegister, Address address)
name
- Name of the cache.listenerConfig
- The listener configuration. Byte-array which is serialized from an object implementing
javax.cache.configuration.CacheEntryListenerConfigurationshouldRegister
- true if the listener is being registered, false if the listener is being unregistered.address
- The address of the member server for which the listener is being registered for.void loadAll(String name, List<Data> keys, boolean replaceExistingValues)
name
- Name of the cache.keys
- the keys to loadreplaceExistingValues
- when true existing values in the Cache will
be replaced by those loaded from a CacheLoadervoid managementConfig(String name, boolean isStat, boolean enabled, Address address)
name
- Name of the cache.isStat
- true if enabling statistics, false if enabling management.enabled
- true if enabled, false to disable.address
- the address of the host to enable.Object putIfAbsent(String name, Data key, Data value, @Nullable Data expiryPolicy, int completionId)
name
- Name of the cache.key
- The key that is associated with the specified value.value
- The value that has the specified key associated with it.expiryPolicy
- The custom expiry policy for this operation.
A null value is equivalent to put(Object, Object).completionId
- User generated id which shall be received as a field of the cache event upon completion of
the request in the cluster.Object put(String name, Data key, Data value, @Nullable Data expiryPolicy, boolean get, int completionId)
name
- Name of the cache.key
- The key that has the specified value associated with it.value
- The value to be associated with the key.expiryPolicy
- Expiry policy for the entry. Byte-array which is serialized from an object implementing
javax.cache.expiry.ExpiryPolicy interface.get
- boolean flag indicating if the previous value should be retrieved.completionId
- User generated id which shall be received as a field of the cache event upon completion of
the request in the cluster.Object removeEntryListener(String name, String registrationId)
name
- Name of the cache.registrationId
- The id assigned during the registration for the listener which shall be removed.Object removeInvalidationListener(String name, String registrationId)
name
- Name of the cache.registrationId
- The id assigned during the registration for the listener which shall be removed.Object remove(String name, Data key, @Nullable Data currentValue, int completionId)
name
- Name of the cache.key
- key whose mapping is to be removed from the cachecurrentValue
- value expected to be associated with the specified key.completionId
- User generated id which shall be received as a field of the cache event upon completion of
the request in the cluster.Object replace(String name, Data key, @Nullable Data oldValue, Data newValue, @Nullable Data expiryPolicy, int completionId)
name
- Name of the cache.key
- The key whose value is replaced.oldValue
- Old value to match if exists before removing. Null means "don't try to remove"newValue
- The new value to be associated with the specified key.expiryPolicy
- Expiry policy for the entry. Byte-array which is serialized from an object implementing
javax.cache.expiry.ExpiryPolicy interface.completionId
- User generated id which shall be received as a field of the cache event upon completion of
the request in the cluster.Object size(String name)
name
- Name of the cache.Object addPartitionLostListener(String name, boolean localOnly)
name
- Name of the cachelocalOnly
- if true only node that has the partition sends the request, if false
sends all partition lost events.Object removePartitionLostListener(String name, String registrationId)
name
- Name of the CacheregistrationId
- ID of registered listener.void putAll(String name, List<Map.Entry<Data,Data>> entries, @Nullable Data expiryPolicy, int completionId)
name
- name of the cacheentries
- entries to be put as batchexpiryPolicy
- expiry policy for the entry. Byte-array which is serialized from an object implementing
ExpiryPolicy
interface.completionId
- user generated id which shall be received as a field of the cache event upon completion of
the request in the cluster.Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.