Class RedissonMapCacheNative<K,V>
- Type Parameters:
K
- keyV
- value
- All Implemented Interfaces:
ConcurrentMap<K,
,V> Map<K,
,V> RDestroyable
,RExpirable
,RExpirableAsync
,RMap<K,
,V> RMapAsync<K,
,V> RMapCacheNative<K,
,V> RMapCacheNativeAsync<K,
,V> RObject
,RObjectAsync
- Author:
- Nikita Koksharov
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
Constructor Summary
ConstructorDescriptionRedissonMapCacheNative
(Codec codec, CommandAsyncExecutor commandExecutor, String name) RedissonMapCacheNative
(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapOptions<K, V> options, WriteBehindService writeBehindService) RedissonMapCacheNative
(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapOptions<K, V> options, WriteBehindService writeBehindService) -
Method Summary
Modifier and TypeMethodDescriptionint
addListener
(ObjectListener listener) Adds object event listeneraddListenerAsync
(ObjectListener listener) Adds object event listenerboolean
Clear an expire timeout or expire date for object.clearExpire
(Set<K> keys) Clears an expiration timeout or date of specified entries by keys.clearExpire
(K key) Clears an expiration timeout or date of specified entry by key.Clear an expire timeout or expire date for object in async mode.clearExpireAsync
(String... keys) clearExpireAsync
(Set<K> keys) Clears an expiration timeout or date of specified entries by keys.clearExpireAsync
(K key) Clears an expiration timeout or date of specified entry by key.boolean
UseRExpirable.expire(Duration)
insteadboolean
Sets a timeout for this object.boolean
Sets an expiration date for this object.expireAsync
(long timeToLive, TimeUnit timeUnit) UseRExpirableAsync.expireAsync(Duration)
insteadexpireAsync
(long timeToLive, TimeUnit timeUnit, String param, String... keys) expireAsync
(Duration duration) Set a timeout for object.expireAsync
(Instant instant) Set an expire date for object.boolean
expireAt
(long timestamp) UseRExpirable.expire(Instant)
insteadboolean
UseRExpirable.expire(Instant)
insteadexpireAtAsync
(long timestamp) UseRExpirableAsync.expireAsync(Instant)
insteadexpireAtAsync
(long timestamp, String param, String... keys) expireAtAsync
(Date timestamp) UseRExpirableAsync.expireAsync(Instant)
insteadint
expireEntries
(Set<K> keys, Duration ttl) Updates time to live of specified entries by keys.expireEntriesAsync
(Set<K> keys, Duration ttl) Updates time to live and max idle time of specified entries by keys.int
expireEntriesIfGreater
(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys only if it's greater than timeout set before.expireEntriesIfGreaterAsync
(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys only if it's greater than timeout set before.int
expireEntriesIfLess
(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys only if it's less than timeout set before.expireEntriesIfLessAsync
(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys only if it's less than timeout set before.int
expireEntriesIfNotSet
(Set<K> keys, Duration ttl) Sets time to live of specified entries by keys.expireEntriesIfNotSetAsync
(Set<K> keys, Duration ttl) Sets time to live and max idle time of specified entries by keys.boolean
expireEntry
(K key, Duration ttl) Updates time to live of specified entry by key.expireEntryAsync
(K key, Duration ttl) Updates time to live and max idle time of specified entry by key.boolean
expireEntryIfGreater
(K key, Duration ttl) Sets time to live of specified entry by key only if it's greater than timeout set before.expireEntryIfGreaterAsync
(K key, Duration ttl) Sets time to live of specified entry by key only if it's greater than timeout set before.boolean
expireEntryIfLess
(K key, Duration ttl) Sets time to live of specified entry by key only if it's less than timeout set before.expireEntryIfLessAsync
(K key, Duration ttl) Sets time to live of specified entry by key only if it's less than timeout set before.boolean
expireEntryIfNotSet
(K key, Duration ttl) Sets time to live of specified entry by key.expireEntryIfNotSetAsync
(K key, Duration ttl) Sets time to live and max idle time of specified entry by key.boolean
expireIfGreater
(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.boolean
expireIfGreater
(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.expireIfGreaterAsync
(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.expireIfGreaterAsync
(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.boolean
expireIfLess
(Duration duration) Sets a timeout for this object only if it's less than timeout set before.boolean
expireIfLess
(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.expireIfLessAsync
(Duration duration) Sets a timeout for this object only if it's less than timeout set before.expireIfLessAsync
(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.boolean
expireIfNotSet
(Duration duration) Sets a timeout for this object only if it hasn't been set before.boolean
expireIfNotSet
(Instant time) Sets an expiration date for this object only if it hasn't been set before.expireIfNotSetAsync
(Duration duration) Sets a timeout for this object only if it hasn't been set before.expireIfNotSetAsync
(Instant time) Sets an expiration date for this object only if it hasn't been set before.boolean
expireIfSet
(Duration duration) Sets a timeout for this object only if it has been already set.boolean
expireIfSet
(Instant time) Sets an expiration date for this object only if it has been already set.expireIfSetAsync
(Duration duration) Sets a timeout for this object only if it has been already set.expireIfSetAsync
(Instant time) Sets an expiration date for this object only if it has been already set.boolean
Stores value mapped by key with specified time to live.fastPutAsync
(K key, V value, Duration ttl) Stores value mapped by key with specified time to live.boolean
fastPutIfAbsent
(K key, V value, Duration ttl) If the specified key is not already associated with a value, associate it with the given value.fastPutIfAbsentAsync
(K key, V value, Duration ttl) If the specified key is not already associated with a value, associate it with the given value.fastPutIfAbsentOperationAsync
(K key, V value, Duration ttl) fastPutOperationAsync
(K key, V value, Duration ttl) long
Returns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.Returns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.Stores value mapped by key with specified time to live.void
Associates the specifiedvalue
with the specifiedkey
in batch.putAllAsync
(Map<? extends K, ? extends V> map, Duration ttl) Associates the specifiedvalue
with the specifiedkey
in batch.putAllOperationAsync
(Map<? extends K, ? extends V> map, Duration ttl) Stores value mapped by key with specified time to live.putIfAbsent
(K key, V value, Duration ttl) If the specified key is not already associated with a value, associate it with the given value.putIfAbsentAsync
(K key, V value, Duration ttl) If the specified key is not already associated with a value, associate it with the given value.putIfAbsentOperationAsync
(K key, V value, Duration ttl) putOperationAsync
(K key, V value, Duration ttl) long
Returns remaining time of the object in milliseconds.remainTimeToLive
(Set<K> keys) Remaining time to live of map entries associated withkeys
.long
remainTimeToLive
(K key) Remaining time to live of map entry associated with akey
.Returns remaining time of the object in milliseconds.remainTimeToLiveAsync
(Set<K> keys) remainTimeToLiveAsync
(K key) Remaining time to live of map entry associated with akey
.void
removeListener
(int listenerId) Removes object event listenerremoveListenerAsync
(int listenerId) Removes object event listenerMethods inherited from class org.redisson.RedissonMap
addAndGet, addAndGetAsync, addAndGetOperationAsync, checkKey, checkValue, clear, clearAsync, compute, computeAsync, computeIfAbsent, computeIfAbsentAsync, computeIfPresent, computeIfPresentAsync, containsKey, containsKeyAsync, containsKeyAsync, containsKeyOperationAsync, containsValue, containsValueAsync, destroy, encodeMapKeys, entryIterator, entrySet, entrySet, entrySet, entrySet, equals, fastPut, fastPutAsync, fastPutIfAbsent, fastPutIfAbsentAsync, fastPutIfAbsentOperationAsync, fastPutIfExists, fastPutIfExistsAsync, fastPutIfExistsOperationAsync, fastPutOperationAsync, fastRemove, fastRemoveAsync, fastRemoveOperationAsync, fastRemoveOperationBatchAsync, fastReplace, fastReplaceAsync, fastReplaceOperationAsync, get, getAll, getAllAsync, getAllOperationAsync, getAsync, getAsync, getCountDownLatch, getFairLock, getLock, getOperationAsync, getPermitExpirableSemaphore, getReadWriteLock, getSemaphore, hashCode, hasNoLoader, hasNoWriter, isEmpty, keyIterator, keySet, keySet, keySet, keySet, loadAll, loadAll, loadAllAsync, loadAllAsync, loadAllMapAsync, loadValue, loadValue, mapReduce, mapWriterFuture, mapWriterFuture, merge, mergeAsync, put, putAll, putAll, putAllAsync, putAllAsync, putAllOperationAsync, putAsync, putIfAbsent, putIfAbsentAsync, putIfAbsentOperationAsync, putIfExists, putIfExistsAsync, putIfExistsOperationAsync, putOperationAsync, randomEntries, randomEntriesAsync, randomKeys, randomKeysAsync, readAllEntrySet, readAllEntrySetAsync, readAllKeySet, readAllKeySetAsync, readAllMap, readAllMapAsync, readAllValues, readAllValuesAsync, remove, remove, removeAsync, removeAsync, removeOperationAsync, removeOperationAsync, replace, replace, replaceAsync, replaceAsync, replaceOperationAsync, replaceOperationAsync, scanIterator, scanIteratorAsync, scanKeyIterator, scanKeyIteratorAsync, size, sizeAsync, valueIterator, values, values, values, values, valueSize, valueSizeAsync
Methods inherited from class org.redisson.RedissonObject
addListener, addListener, addListenerAsync, addListenerAsync, addListenerId, addTrackingListener, addTrackingListenerAsync, checkNotBatch, copy, copy, copy, copyAndReplace, copyAndReplace, copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, copyAsync, copyAsync, delete, deleteAsync, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getListenerIdsByName, getLockByMapKey, getLockByValue, getName, getNameByListenerId, getRawName, getRawName, getServiceManager, getSubscribeService, isExists, isExistsAsync, map, mapName, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenerAsync, removeListenerId, removeListeners, removeTrackingListener, removeTrackingListenerAsync, rename, renameAsync, renameAsync, renameAsync, renamenx, renamenxAsync, renamenxAsync, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
Methods inherited from interface org.redisson.api.RDestroyable
destroy
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLive
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RMap
addAndGet, containsKey, containsValue, entrySet, entrySet, entrySet, entrySet, fastPut, fastPutIfAbsent, fastPutIfExists, fastRemove, fastReplace, get, getAll, getCountDownLatch, getFairLock, getLock, getPermitExpirableSemaphore, getReadWriteLock, getSemaphore, keySet, keySet, keySet, keySet, loadAll, loadAll, mapReduce, put, putAll, putAll, putIfAbsent, putIfExists, randomEntries, randomKeys, readAllEntrySet, readAllKeySet, readAllMap, readAllValues, remove, remove, replace, replace, values, values, values, values, valueSize
Methods inherited from interface org.redisson.api.RMapAsync
addAndGetAsync, clearAsync, computeAsync, computeIfAbsentAsync, computeIfPresentAsync, containsKeyAsync, containsValueAsync, fastPutAsync, fastPutIfAbsentAsync, fastPutIfExistsAsync, fastRemoveAsync, fastReplaceAsync, getAllAsync, getAsync, loadAllAsync, loadAllAsync, mergeAsync, putAllAsync, putAllAsync, putAsync, putIfAbsentAsync, putIfExistsAsync, randomEntriesAsync, randomKeysAsync, readAllEntrySetAsync, readAllKeySetAsync, readAllMapAsync, readAllValuesAsync, removeAsync, removeAsync, replaceAsync, replaceAsync, sizeAsync, valueSizeAsync
Methods inherited from interface org.redisson.api.RObject
copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
Methods inherited from interface org.redisson.api.RObjectAsync
copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Constructor Details
-
RedissonMapCacheNative
public RedissonMapCacheNative(CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapOptions<K, V> options, WriteBehindService writeBehindService) -
RedissonMapCacheNative
-
RedissonMapCacheNative
public RedissonMapCacheNative(Codec codec, CommandAsyncExecutor commandExecutor, String name, RedissonClient redisson, MapOptions<K, V> options, WriteBehindService writeBehindService)
-
-
Method Details
-
put
Description copied from interface:RMapCacheNative
Stores value mapped by key with specified time to live. Entry expires after specified time to live.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
- Specified by:
put
in interfaceRMapCacheNative<K,
V> - Parameters:
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry. If0
then stores infinitely.- Returns:
- previous associated value
-
putAsync
Description copied from interface:RMapCacheNativeAsync
Stores value mapped by key with specified time to live. Entry expires after specified time to live.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
- Specified by:
putAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry. If0
then stores infinitely.- Returns:
- previous associated value
-
putOperationAsync
-
fastPut
Description copied from interface:RMapCacheNative
Stores value mapped by key with specified time to live. Entry expires after specified time to live.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
Works faster than usual
RMapCacheNative.put(Object, Object, Duration)
as it not returns previous value.- Specified by:
fastPut
in interfaceRMapCacheNative<K,
V> - Parameters:
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry. If0
then stores infinitely.- Returns:
true
if key is a new key in the hash and value was set.false
if key already exists in the hash and the value was updated.
-
fastPutAsync
Description copied from interface:RMapCacheNativeAsync
Stores value mapped by key with specified time to live. Entry expires after specified time to live.If the map previously contained a mapping for the key, the old value is replaced by the specified value.
Works faster than usual
RMapCacheNativeAsync.putAsync(Object, Object, Duration)
as it not returns previous value.- Specified by:
fastPutAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry. If0
then stores infinitely.- Returns:
true
if key is a new key in the hash and value was set.false
if key already exists in the hash and the value was updated.
-
fastPutOperationAsync
-
putIfAbsent
Description copied from interface:RMapCacheNative
If the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live. Entry expires after specified time to live.
- Specified by:
putIfAbsent
in interfaceRMapCacheNative<K,
V> - Parameters:
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry. If0
then stores infinitely.- Returns:
- current associated value
-
putIfAbsentAsync
Description copied from interface:RMapCacheNativeAsync
If the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live. Entry expires after specified time to live.
- Specified by:
putIfAbsentAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry. If0
then stores infinitely.- Returns:
- current associated value
-
putIfAbsentOperationAsync
-
fastPutIfAbsent
Description copied from interface:RMapCacheNative
If the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live. Entry expires after specified time to live.
Works faster than usual
RMapCacheNative.putIfAbsent(Object, Object, Duration)
as it not returns previous value.- Specified by:
fastPutIfAbsent
in interfaceRMapCacheNative<K,
V> - Parameters:
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry. If0
then stores infinitely.- Returns:
true
if key is a new key in the hash and value was set.false
if key already exists in the hash
-
fastPutIfAbsentAsync
Description copied from interface:RMapCacheNativeAsync
If the specified key is not already associated with a value, associate it with the given value.Stores value mapped by key with specified time to live. Entry expires after specified time to live.
Works faster than usual
RMapCacheNativeAsync.putIfAbsentAsync(Object, Object, Duration)
as it not returns previous value.- Specified by:
fastPutIfAbsentAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
key
- - map keyvalue
- - map valuettl
- - time to live for key\value entry. If0
then stores infinitely.- Returns:
true
if key is a new key in the hash and value was set.false
if key already exists in the hash
-
fastPutIfAbsentOperationAsync
-
remainTimeToLive
Description copied from interface:RMapCacheNative
Remaining time to live of map entry associated with akey
.- Specified by:
remainTimeToLive
in interfaceRMapCacheNative<K,
V> - Parameters:
key
- map key- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
Description copied from interface:RMapCacheNativeAsync
Remaining time to live of map entry associated with akey
.- Specified by:
remainTimeToLiveAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
key
- - map key- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLive
Description copied from interface:RMapCacheNative
Remaining time to live of map entries associated withkeys
.- Specified by:
remainTimeToLive
in interfaceRMapCacheNative<K,
V> - Parameters:
keys
- map keys- Returns:
- Time to live mapped by key. Time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
- Specified by:
remainTimeToLiveAsync
in interfaceRMapCacheNativeAsync<K,
V>
-
putAll
Description copied from interface:RMapCacheNative
Associates the specifiedvalue
with the specifiedkey
in batch.If
MapWriter
is defined then new map entries will be stored in write-through mode.- Specified by:
putAll
in interfaceRMapCacheNative<K,
V> - Parameters:
map
- - mappings to be stored in this mapttl
- - time to live for all key\value entries. If0
then stores infinitely.
-
putAllAsync
Description copied from interface:RMapCacheNativeAsync
Associates the specifiedvalue
with the specifiedkey
in batch.If
MapWriter
is defined then new map entries will be stored in write-through mode.- Specified by:
putAllAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
map
- - mappings to be stored in this mapttl
- - time to live for all key\value entries. If0
then stores infinitely.
-
putAllOperationAsync
-
expireEntry
Description copied from interface:RMapCacheNative
Updates time to live of specified entry by key. Entry expires when specified time to live was reached.Returns
false
if entry already expired or doesn't exist, otherwise returnstrue
.- Specified by:
expireEntry
in interfaceRMapCacheNative<K,
V> - Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if entry already expired or doesn't exist, otherwise returnstrue
.
-
expireEntryAsync
Description copied from interface:RMapCacheNativeAsync
Updates time to live and max idle time of specified entry by key. Entry expires when specified time to live was reached.Returns
false
if entry already expired or doesn't exist, otherwise returnstrue
.- Specified by:
expireEntryAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
maxIdleTime
andttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if entry already expired or doesn't exist, otherwise returnstrue
.
-
expireEntryIfNotSet
Description copied from interface:RMapCacheNative
Sets time to live of specified entry by key. If these parameters weren't set before. Entry expires when specified time to live was reached.Returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.- Specified by:
expireEntryIfNotSet
in interfaceRMapCacheNative<K,
V> - Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.
-
expireEntryIfNotSetAsync
Description copied from interface:RMapCacheNativeAsync
Sets time to live and max idle time of specified entry by key. If these parameters weren't set before. Entry expires when specified time to live was reached.Returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.- Specified by:
expireEntryIfNotSetAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
maxIdleTime
andttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.
-
expireEntries
Description copied from interface:RMapCacheNative
Updates time to live of specified entries by keys. Entries expires when specified time to live was reached.Returns amount of updated entries.
- Specified by:
expireEntries
in interfaceRMapCacheNative<K,
V> - Parameters:
keys
- map keysttl
- time to live for key\value entries. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entries are stored infinitely.- Returns:
- amount of updated entries.
-
expireEntriesAsync
Description copied from interface:RMapCacheNativeAsync
Updates time to live and max idle time of specified entries by keys. Entries expires when specified time to live was reached.Returns amount of updated entries.
- Specified by:
expireEntriesAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
keys
- map keysttl
- time to live for key\value entries. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entries are stored infinitely.- Returns:
- amount of updated entries.
-
expireEntriesIfNotSet
Description copied from interface:RMapCacheNative
Sets time to live of specified entries by keys. If these parameters weren't set before. Entries expire when specified time to live was reached.Returns amount of updated entries.
- Specified by:
expireEntriesIfNotSet
in interfaceRMapCacheNative<K,
V> - Parameters:
keys
- map keysttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- amount of updated entries.
-
expireEntriesIfNotSetAsync
Description copied from interface:RMapCacheNativeAsync
Sets time to live and max idle time of specified entries by keys. If these parameters weren't set before. Entries expire when specified time to live was reached.Returns amount of updated entries.
- Specified by:
expireEntriesIfNotSetAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
keys
- map keysttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- amount of updated entries.
-
expireEntryIfGreater
Description copied from interface:RMapCacheNative
Sets time to live of specified entry by key only if it's greater than timeout set before. Entry expires when specified time to live was reached.Returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.- Specified by:
expireEntryIfGreater
in interfaceRMapCacheNative<K,
V> - Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.
-
expireEntryIfLess
Description copied from interface:RMapCacheNative
Sets time to live of specified entry by key only if it's less than timeout set before. Entry expires when specified time to live was reached.Returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.- Specified by:
expireEntryIfLess
in interfaceRMapCacheNative<K,
V> - Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.
-
expireEntriesIfGreater
Description copied from interface:RMapCacheNative
Sets time to live of specified entries by keys only if it's greater than timeout set before. Entries expire when specified time to live was reached.Returns amount of updated entries.
- Specified by:
expireEntriesIfGreater
in interfaceRMapCacheNative<K,
V> - Parameters:
keys
- map keysttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- amount of updated entries.
-
expireEntriesIfLess
Description copied from interface:RMapCacheNative
Sets time to live of specified entries by keys only if it's less than timeout set before. Entries expire when specified time to live was reached.Returns amount of updated entries.
- Specified by:
expireEntriesIfLess
in interfaceRMapCacheNative<K,
V> - Parameters:
keys
- map keysttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- amount of updated entries.
-
expireEntryIfGreaterAsync
Description copied from interface:RMapCacheNativeAsync
Sets time to live of specified entry by key only if it's greater than timeout set before. Entry expires when specified time to live was reached.Returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.- Specified by:
expireEntryIfGreaterAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.
-
expireEntryIfLessAsync
Description copied from interface:RMapCacheNativeAsync
Sets time to live of specified entry by key only if it's less than timeout set before. Entry expires when specified time to live was reached.Returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.- Specified by:
expireEntryIfLessAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
key
- map keyttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- returns
false
if entry already has expiration time or doesn't exist, otherwise returnstrue
.
-
expireEntriesIfGreaterAsync
Description copied from interface:RMapCacheNativeAsync
Sets time to live of specified entries by keys only if it's greater than timeout set before. Entries expire when specified time to live was reached.Returns amount of updated entries.
- Specified by:
expireEntriesIfGreaterAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
keys
- map keysttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- amount of updated entries.
-
expireEntriesIfLessAsync
Description copied from interface:RMapCacheNativeAsync
Sets time to live of specified entries by keys only if it's less than timeout set before. Entries expire when specified time to live was reached.Returns amount of updated entries.
- Specified by:
expireEntriesIfLessAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
keys
- map keysttl
- time to live for key\value entry. If0
then time to live doesn't affect entry expiration.if
ttl
params are equal to0
then entry stores infinitely.- Returns:
- amount of updated entries.
-
clearExpire
Description copied from interface:RMapCacheNative
Clears an expiration timeout or date of specified entry by key.- Specified by:
clearExpire
in interfaceRMapCacheNative<K,
V> - Parameters:
key
- map key- Returns:
true
if timeout was removedfalse
if entry does not have an associated timeoutnull
if entry does not exist
-
clearExpireAsync
Description copied from interface:RMapCacheNativeAsync
Clears an expiration timeout or date of specified entry by key.- Specified by:
clearExpireAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
key
- map key- Returns:
true
if timeout was removedfalse
if entry does not have an associated timeoutnull
if entry does not exist
-
clearExpire
Description copied from interface:RMapCacheNative
Clears an expiration timeout or date of specified entries by keys.- Specified by:
clearExpire
in interfaceRMapCacheNative<K,
V> - Parameters:
keys
- map keys- Returns:
- Boolean mapped by key.
true
if timeout was removedfalse
if entry does not have an associated timeoutnull
if entry does not exist
-
clearExpireAsync
Description copied from interface:RMapCacheNativeAsync
Clears an expiration timeout or date of specified entries by keys.- Specified by:
clearExpireAsync
in interfaceRMapCacheNativeAsync<K,
V> - Parameters:
keys
- map keys- Returns:
- Boolean mapped by key.
true
if timeout was removedfalse
if entry does not have an associated timeoutnull
if entry does not exist
-
addListener
Description copied from interface:RObject
Adds object event listener- Specified by:
addListener
in interfaceRMap<K,
V> - Specified by:
addListener
in interfaceRMapCacheNative<K,
V> - Specified by:
addListener
in interfaceRObject
- Overrides:
addListener
in classRedissonMap<K,
V> - Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-
addListenerAsync
Description copied from interface:RObjectAsync
Adds object event listener- Specified by:
addListenerAsync
in interfaceRMapAsync<K,
V> - Specified by:
addListenerAsync
in interfaceRMapCacheNativeAsync<K,
V> - Specified by:
addListenerAsync
in interfaceRObjectAsync
- Overrides:
addListenerAsync
in classRedissonMap<K,
V> - Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-
removeListener
public void removeListener(int listenerId) Description copied from interface:RObject
Removes object event listener- Specified by:
removeListener
in interfaceRObject
- Overrides:
removeListener
in classRedissonMap<K,
V> - Parameters:
listenerId
- - listener id
-
removeListenerAsync
Description copied from interface:RObjectAsync
Removes object event listener- Specified by:
removeListenerAsync
in interfaceRObjectAsync
- Overrides:
removeListenerAsync
in classRedissonMap<K,
V> - Parameters:
listenerId
- - listener id
-
expire
Description copied from interface:RExpirable
UseRExpirable.expire(Duration)
instead- Specified by:
expire
in interfaceRExpirable
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Duration)
instead- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(long timestamp) Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expire
Description copied from interface:RExpirable
Sets an expiration date for this object. When expire date comes the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
instant
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
Description copied from interface:RExpirable
Sets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSet
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSetAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it has been already set. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
Description copied from interface:RExpirable
Sets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSet
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it hasn't been set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
Description copied from interface:RExpirable
Sets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreater
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it's greater than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
Description copied from interface:RExpirable
Sets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLess
in interfaceRExpirable
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLessAsync
Description copied from interface:RExpirableAsync
Sets an expiration date for this object only if it's less than expiration date set before. When expire date comes the object will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsync
in interfaceRExpirableAsync
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expire
Description copied from interface:RExpirable
Sets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
Description copied from interface:RExpirableAsync
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
Description copied from interface:RExpirable
Sets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSet
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSetAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it has been already set. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfSetAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
Description copied from interface:RExpirable
Sets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSet
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it hasn't been set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfNotSetAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
Description copied from interface:RExpirable
Sets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreater
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it's greater than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfGreaterAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
Description copied from interface:RExpirable
Sets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLess
in interfaceRExpirable
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLessAsync
Description copied from interface:RExpirableAsync
Sets a timeout for this object only if it's less than timeout set before. After the timeout has expired, the key will automatically be deleted.Requires Redis 7.0.0 and higher.
- Specified by:
expireIfLessAsync
in interfaceRExpirableAsync
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
public boolean clearExpire()Description copied from interface:RExpirable
Clear an expire timeout or expire date for object.- Specified by:
clearExpire
in interfaceRExpirable
- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
clearExpireAsync
Description copied from interface:RExpirableAsync
Clear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsync
in interfaceRExpirableAsync
- Returns:
true
if the timeout was cleared andfalse
if not
-
remainTimeToLive
public long remainTimeToLive()Description copied from interface:RExpirable
Returns remaining time of the object in milliseconds.- Specified by:
remainTimeToLive
in interfaceRExpirable
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
Description copied from interface:RExpirableAsync
Returns remaining time of the object in milliseconds.- Specified by:
remainTimeToLiveAsync
in interfaceRExpirableAsync
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
getExpireTime
public long getExpireTime()Description copied from interface:RExpirable
Returns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.Requires Redis 7.0.0 and higher.
- Specified by:
getExpireTime
in interfaceRExpirable
- Returns:
- Unix time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expiration time.
-
getExpireTimeAsync
Description copied from interface:RExpirableAsync
Returns expiration time of the object as the absolute Unix expiration timestamp in milliseconds.Requires Redis 7.0.0 and higher.
- Specified by:
getExpireTimeAsync
in interfaceRExpirableAsync
- Returns:
- Unix time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expiration time.
-
expireAsync
-
expireAtAsync
-
clearExpireAsync
-