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,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>,RTransferQueue<V>
- All Known Implementing Classes:
RedissonAtomicDouble,RedissonAtomicLong,RedissonBaseAdder,RedissonBaseLock,RedissonBinaryStream,RedissonBitSet,RedissonBlockingDeque,RedissonBlockingQueue,RedissonBloomFilter,RedissonBoundedBlockingQueue,RedissonBucket,RedissonDelayedQueue,RedissonDeque,RedissonDoubleAdder,RedissonFairLock,RedissonGeo,RedissonHyperLogLog,RedissonIdGenerator,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,RedissonTransactionalSet,RedissonTransactionalSetCache,RedissonTransferQueue,RedissonWriteLock
public interface RExpirable extends RObject, RExpirableAsync
Base interface for all Redisson objects which support expiration or TTL- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanclearExpire()Clear an expire timeout or expire date for object.booleanexpire(long timeToLive, TimeUnit timeUnit)Set a timeout for object.booleanexpire(Instant instant)Set an expire date for object.booleanexpireAt(long timestamp)Deprecated.booleanexpireAt(Date timestamp)Deprecated.longremainTimeToLive()Remaining time to live of Redisson object that has a timeout-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, 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 Detail
-
expire
boolean expire(long timeToLive, TimeUnit timeUnit)Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
@Deprecated boolean expireAt(long timestamp)
Deprecated.Useexpire(Instant)instead- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAt
@Deprecated boolean expireAt(Date timestamp)
Deprecated.Useexpire(Instant)instead- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expire
boolean expire(Instant instant)
Set an expire date for object. When expire date comes the key will automatically be deleted.- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
boolean clearExpire()
Clear an expire timeout or expire date for object.- Returns:
trueif timeout was removedfalseif 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.
-
-