Package org.redisson.api
Interface RExpirableRx
- All Superinterfaces:
RObjectRx
- All Known Subinterfaces:
RAtomicDoubleRx,RAtomicLongRx,RBinaryStreamRx,RBitSetRx,RBlockingDequeRx<V>,RBlockingQueueRx<V>,RBucketRx<V>,RCollectionRx<V>,RDequeRx<V>,RGeoRx<V>,RHyperLogLogRx<V>,RIdGeneratorRx,RJsonBucketRx<V>,RLexSortedSetRx,RListMultimapCacheRx<K,,V> RListMultimapRx<K,,V> RListRx<V>,RLocalCachedMapRx<K,,V> RMapCacheRx<K,,V> RMapRx<K,,V> RMultimapRx<K,,V> RPermitExpirableSemaphoreRx,RQueueRx<V>,RRateLimiterRx,RReliableTopicRx,RRingBufferRx<V>,RScoredSortedSetRx<V>,RSemaphoreRx,RSetCacheRx<V>,RSetMultimapCacheRx<K,,V> RSetMultimapRx<K,,V> RSetRx<V>,RStreamRx<K,,V> RTimeSeriesRx<V,,L> RTransferQueueRx<V>
Base interface for all Redisson objects
which support expiration or TTL
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<Boolean>Clear an expire timeout or expire date for object in mode.io.reactivex.rxjava3.core.Single<Boolean>Deprecated.io.reactivex.rxjava3.core.Single<Boolean>Sets a timeout for this object.io.reactivex.rxjava3.core.Single<Boolean>Set an expire date for object.io.reactivex.rxjava3.core.Single<Boolean>expireAt(long timestamp) Deprecated.io.reactivex.rxjava3.core.Single<Boolean>Deprecated.io.reactivex.rxjava3.core.Single<Boolean>expireIfGreater(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.io.reactivex.rxjava3.core.Single<Boolean>expireIfGreater(Instant time) Sets an expiration date for this object only if it's greater than expiration date set before.io.reactivex.rxjava3.core.Single<Boolean>expireIfLess(Duration duration) Sets a timeout for this object only if it's less than timeout set before.io.reactivex.rxjava3.core.Single<Boolean>expireIfLess(Instant time) Sets an expiration date for this object only if it's less than expiration date set before.io.reactivex.rxjava3.core.Single<Boolean>expireIfNotSet(Duration duration) Sets a timeout for this object only if it hasn't been set before.io.reactivex.rxjava3.core.Single<Boolean>expireIfNotSet(Instant time) Sets an expiration date for this object only if it hasn't been set before.io.reactivex.rxjava3.core.Single<Boolean>expireIfSet(Duration duration) Sets a timeout for this object only if it has been already set.io.reactivex.rxjava3.core.Single<Boolean>expireIfSet(Instant time) Sets an expiration date for this object only if it has been already set.io.reactivex.rxjava3.core.Single<Long>Expiration time of Redisson object that has a timeoutio.reactivex.rxjava3.core.Single<Long>Get remaining time to live of object in milliseconds.Methods inherited from interface org.redisson.api.RObjectRx
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Method Details
-
expire
Deprecated.Useexpire(Duration)instead- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
Deprecated.Useexpire(Instant)instead- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAt
Deprecated.Useexpire(Instant)instead- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expire
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
-
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:
trueif the timeout was set andfalseif 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:
trueif the timeout was set andfalseif 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:
trueif the timeout was set andfalseif 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:
trueif the timeout was set andfalseif 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:
trueif the timeout was set andfalseif 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:
trueif the timeout was set andfalseif 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:
trueif the timeout was set andfalseif 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:
trueif the timeout was set andfalseif 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:
trueif the timeout was set andfalseif not
-
clearExpire
io.reactivex.rxjava3.core.Single<Boolean> clearExpire()Clear an expire timeout or expire date for object in mode. Object will not be deleted.- Returns:
trueif the timeout was cleared andfalseif not
-
remainTimeToLive
io.reactivex.rxjava3.core.Single<Long> remainTimeToLive()Get remaining time to live of object in milliseconds.- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
getExpireTime
io.reactivex.rxjava3.core.Single<Long> getExpireTime()Expiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Returns:
- expiration time
-