Package org.redisson.api
Interface RExpirable
- All Superinterfaces:
RExpirableAsync
,RObject
,RObjectAsync
- All Known Subinterfaces:
RAtomicDouble
,RAtomicLong
,RBinaryStream
,RBitSet
,RBlockingDeque<V>
,RBlockingQueue<V>
,RBloomFilter<T>
,RBoundedBlockingQueue<V>
,RBucket<V>
,RDelayedQueue<V>
,RDeque<V>
,RDoubleAdder
,RGeo<V>
,RHyperLogLog<V>
,RIdGenerator
,RJsonBucket<V>
,RLexSortedSet
,RList<V>
,RListMultimap<K,
,V> RListMultimapCache<K,
,V> RLiveObject
,RLocalCachedMap<K,
,V> RLongAdder
,RMap<K,
,V> RMapCache<K,
,V> RMultimap<K,
,V> RMultimapCache<K,
,V> RPermitExpirableSemaphore
,RPriorityBlockingDeque<V>
,RPriorityBlockingQueue<V>
,RPriorityDeque<V>
,RPriorityQueue<V>
,RQueue<V>
,RRateLimiter
,RReliableTopic
,RRingBuffer<V>
,RScoredSortedSet<V>
,RSemaphore
,RSet<V>
,RSetCache<V>
,RSetMultimap<K,
,V> RSetMultimapCache<K,
,V> RStream<K,
,V> RTimeSeries<V,
,L> RTransferQueue<V>
- All Known Implementing Classes:
ExpireAtOperation.RedissonBucketExtended
,ExpireOperation.RedissonBucketExtended
,RedissonAtomicDouble
,RedissonAtomicLong
,RedissonBaseAdder
,RedissonBaseLock
,RedissonBinaryStream
,RedissonBitSet
,RedissonBlockingDeque
,RedissonBlockingQueue
,RedissonBloomFilter
,RedissonBoundedBlockingQueue
,RedissonBucket
,RedissonDelayedQueue
,RedissonDeque
,RedissonDoubleAdder
,RedissonFairLock
,RedissonFencedLock
,RedissonGeo
,RedissonHyperLogLog
,RedissonIdGenerator
,RedissonJsonBucket
,RedissonLexSortedSet
,RedissonList
,RedissonListMultimap
,RedissonListMultimapCache
,RedissonListMultimapValues
,RedissonLocalCachedMap
,RedissonLock
,RedissonLongAdder
,RedissonMap
,RedissonMapCache
,RedissonMultimap
,RedissonPermitExpirableSemaphore
,RedissonPriorityBlockingDeque
,RedissonPriorityBlockingQueue
,RedissonPriorityDeque
,RedissonPriorityQueue
,RedissonQueue
,RedissonQueueSemaphore
,RedissonRateLimiter
,RedissonReadLock
,RedissonReadWriteLock
,RedissonReliableTopic
,RedissonRingBuffer
,RedissonScoredSortedSet
,RedissonSemaphore
,RedissonSet
,RedissonSetCache
,RedissonSetMultimap
,RedissonSetMultimapCache
,RedissonSetMultimapValues
,RedissonSpinLock
,RedissonStream
,RedissonSubList
,RedissonTimeSeries
,RedissonTransactionalBucket
,RedissonTransactionalLocalCachedMap
,RedissonTransactionalLock
,RedissonTransactionalMap
,RedissonTransactionalMapCache
,RedissonTransactionalReadLock
,RedissonTransactionalSet
,RedissonTransactionalSetCache
,RedissonTransactionalWriteLock
,RedissonTransferQueue
,RedissonWriteLock
Base interface for all Redisson objects
which support expiration or TTL
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Clear an expire timeout or expire date for object.boolean
Deprecated.boolean
Sets a timeout for this object.boolean
Sets an expiration date for this object.boolean
expireAt
(long timestamp) Deprecated.boolean
Deprecated.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.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.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.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.long
Expiration time of Redisson object that has a timeoutlong
Remaining time to live of Redisson object that has a timeoutMethods 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.RObject
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
expire
Deprecated.Useexpire(Duration)
instead- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
Deprecated.Useexpire(Instant)
instead- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
Deprecated.Useexpire(Instant)
instead- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expire
Sets an expiration date for this object. When expire date comes the key will automatically be deleted.- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
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.
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
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.
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
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.
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
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.
- Parameters:
time
- expire date- Returns:
true
if the timeout was set andfalse
if not
-
expire
Sets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfSet
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.
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfNotSet
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.
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfGreater
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.
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
expireIfLess
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.
- Parameters:
duration
- timeout before object will be deleted- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
boolean clearExpire()Clear an expire timeout or expire date for object.- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
remainTimeToLive
long remainTimeToLive()Remaining time to live of Redisson object that has a timeout- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
getExpireTime
long getExpireTime()Expiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Returns:
- expiration time
-