Package org.redisson
Class RedissonPermitExpirableSemaphore
java.lang.Object
org.redisson.RedissonObject
org.redisson.RedissonPermitExpirableSemaphore
- All Implemented Interfaces:
RExpirable,RExpirableAsync,RObject,RObjectAsync,RPermitExpirableSemaphore,RPermitExpirableSemaphoreAsync
public class RedissonPermitExpirableSemaphore
extends RedissonObject
implements RPermitExpirableSemaphore
- Author:
- Nikita Koksharov
-
Field Summary
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name -
Constructor Summary
ConstructorsConstructorDescriptionRedissonPermitExpirableSemaphore(CommandAsyncExecutor commandExecutor, String name) -
Method Summary
Modifier and TypeMethodDescriptionacquire()Acquires a permit and returns its id.acquire(int permits) Acquires defined amount ofpermits.Acquires defined amount ofpermitswith definedleaseTimeand returns ids.Acquires a permit with definedleaseTimeand return its id.Acquires a permit and returns its id.acquireAsync(int permits) Acquires defined amount ofpermitsand returns their ids.acquireAsync(int permits, long leaseTime, TimeUnit timeUnit) Acquires defined amount ofpermitsand return their ids.acquireAsync(long leaseTime, TimeUnit timeUnit) Acquires a permit with definedleaseTimeand return its id.intReturns the number of acquired permits.Returns the number of acquired permits.voidaddPermits(int permits) Increases or decreases the number of available permits by defined value.addPermitsAsync(int permits) Increases or decreases the number of available permits by defined value.intReturns number of available permits.Returns number of available permits.booleanClear an expire timeout or expire date for object.Clear an expire timeout or expire date for object in async mode.clearExpireAsync(String... keys) Delete object in async modebooleanUseRExpirable.expire(Duration)insteadbooleanSets a timeout for this object.booleanSets 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.booleanexpireAt(long timestamp) UseRExpirable.expire(Instant)insteadbooleanUseRExpirable.expire(Instant)insteadexpireAtAsync(long timestamp) UseRExpirableAsync.expireAsync(Instant)insteadexpireAtAsync(long timestamp, String param, String... keys) expireAtAsync(Date timestamp) UseRExpirableAsync.expireAsync(Instant)insteadbooleanexpireIfGreater(Duration duration) Sets a timeout for this object only if it's greater than timeout set before.booleanexpireIfGreater(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.booleanexpireIfLess(Duration duration) Sets a timeout for this object only if it's less than timeout set before.booleanexpireIfLess(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.booleanexpireIfNotSet(Duration duration) Sets a timeout for this object only if it hasn't been set before.booleanexpireIfNotSet(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.booleanexpireIfSet(Duration duration) Sets a timeout for this object only if it has been already set.booleanexpireIfSet(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.longExpiration time of Redisson object that has a timeoutExpiration time of Redisson object that has a timeoutintReturns the number of permits.Returns the number of permits.voidReleases a permit by its id.voidReleases permits by their ids.releaseAsync(String permitId) Releases a permit by its id.releaseAsync(List<String> permitsIds) Releases permits by their ids.longRemaining time to live of Redisson object that has a timeoutRemaining time to live of Redisson object that has a timeoutvoidsetPermits(int permits) Sets the number of permits to the provided value.setPermitsAsync(int permits) Sets the number of permits to the provided value.Returns bytes amount used by object in Redis memory.Tries to acquire currently available permit and return its id.tryAcquire(int permits) Tries to acquire defined amount of currently availablepermitsand returns ids.tryAcquire(int permits, long waitTime, long leaseTime, TimeUnit unit) Tries to acquire defined amount of currently availablepermitswith definedleaseTimeand return ids.tryAcquire(long waitTime, long leaseTime, TimeUnit unit) Tries to acquire currently available permit with definedleaseTimeand return its id.tryAcquire(long waitTime, TimeUnit unit) Tries to acquire currently available permit and return its id.Tries to acquire currently available permit and return its id.tryAcquireAsync(int permits) Tries to acquire defined amount of currently availablepermitsand returns their ids.tryAcquireAsync(int permits, long waitTime, long leaseTime, TimeUnit timeUnit) Tries to acquire defined amount of currently availablepermitswith definedleaseTimeand returns their ids.tryAcquireAsync(long waitTime, long leaseTime, TimeUnit unit) Tries to acquire currently available permit with definedleaseTimeand return its id.tryAcquireAsync(long waitTime, TimeUnit unit) Tries to acquire currently available permit and return its id.booleantryRelease(String permitId) Tries to release permit by its id.inttryRelease(List<String> permitsIds) Tries to release permits by their ids.tryReleaseAsync(String permitId) Tries to release permit by its id.tryReleaseAsync(List<String> permitsIds) Tries to release defined permits by their ids.booleantrySetPermits(int permits) Tries to set the initial number of available permits.trySetPermitsAsync(int permits) Tries to set number of available permits.booleanupdateLeaseTime(String permitId, long leaseTime, TimeUnit unit) Overrides and updates lease time for defined permit id.updateLeaseTimeAsync(String permitId, long leaseTime, TimeUnit unit) Overrides and updates lease time for defined permit id.Methods inherited from class org.redisson.RedissonObject
addListener, addListener, addListenerAsync, addListenerAsync, addTrackingListener, addTrackingListenerAsync, checkNotBatch, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, getServiceManager, getSubscribeService, isExists, isExistsAsync, map, mapName, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListener, removeListenerAsync, removeListenerAsync, removeListenerAsync, removeTrackingListener, removeTrackingListenerAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RExpirableAsync
expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods 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, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
Constructor Details
-
RedissonPermitExpirableSemaphore
-
-
Method Details
-
acquire
Description copied from interface:RPermitExpirableSemaphoreAcquires a permit and returns its id. Waits if necessary until a permit became available.- Specified by:
acquirein interfaceRPermitExpirableSemaphore- Returns:
- permit id
- Throws:
InterruptedException- if the current thread is interrupted
-
acquire
Description copied from interface:RPermitExpirableSemaphoreAcquires defined amount ofpermits. Waits if necessary until enough permits became available.- Specified by:
acquirein interfaceRPermitExpirableSemaphore- Parameters:
permits- the number of permits to acquire- Returns:
- permits ids
- Throws:
InterruptedException- if the current thread is interrupted
-
acquire
Description copied from interface:RPermitExpirableSemaphoreAcquires a permit with definedleaseTimeand return its id. Waits if necessary until a permit became available.- Specified by:
acquirein interfaceRPermitExpirableSemaphore- Parameters:
leaseTime- permit lease timetimeUnit- time unit- Returns:
- permit id
- Throws:
InterruptedException- if the current thread is interrupted
-
acquire
public List<String> acquire(int permits, long leaseTime, TimeUnit timeUnit) throws InterruptedException Description copied from interface:RPermitExpirableSemaphoreAcquires defined amount ofpermitswith definedleaseTimeand returns ids. Waits if necessary until enough permits became available.- Specified by:
acquirein interfaceRPermitExpirableSemaphore- Parameters:
permits- the number of permits to acquireleaseTime- permit lease timetimeUnit- time unit- Returns:
- permits ids
- Throws:
InterruptedException- if the current thread is interrupted
-
acquireAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncAcquires a permit and returns its id. Waits if necessary until a permit became available.- Specified by:
acquireAsyncin interfaceRPermitExpirableSemaphoreAsync- Returns:
- permit id
-
acquireAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncAcquires defined amount ofpermitsand returns their ids. Waits if necessary until all permits became available.- Specified by:
acquireAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permits- the number of permits to acquire- Returns:
- permits ids
-
acquireAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncAcquires a permit with definedleaseTimeand return its id. Waits if necessary until a permit became available.- Specified by:
acquireAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
leaseTime- permit lease timetimeUnit- time unit- Returns:
- permit id
-
acquireAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncAcquires defined amount ofpermitsand return their ids. Waits if necessary until all permits became available.- Specified by:
acquireAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permits- the number of permits to acquireleaseTime- permit lease timetimeUnit- time unit- Returns:
- permits ids
-
tryAcquire
Description copied from interface:RPermitExpirableSemaphoreTries to acquire currently available permit and return its id.- Specified by:
tryAcquirein interfaceRPermitExpirableSemaphore- Returns:
- permit id if a permit was acquired and
nullotherwise
-
tryAcquire
Description copied from interface:RPermitExpirableSemaphoreTries to acquire defined amount of currently availablepermitsand returns ids.- Specified by:
tryAcquirein interfaceRPermitExpirableSemaphore- Parameters:
permits- the number of permits to acquire- Returns:
- permits ids if permits were acquired and empty collection otherwise
-
tryAcquireAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncTries to acquire currently available permit and return its id.- Specified by:
tryAcquireAsyncin interfaceRPermitExpirableSemaphoreAsync- Returns:
- permit id if a permit was acquired and
nullotherwise
-
tryAcquireAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncTries to acquire defined amount of currently availablepermitsand returns their ids.- Specified by:
tryAcquireAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permits- the number of permits to acquire- Returns:
- permits ids if permits were acquired and empty list otherwise
-
tryAcquireAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncTries to acquire currently available permit and return its id. Waits up to definedwaitTimeif necessary until a permit became available.- Specified by:
tryAcquireAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
waitTime- the maximum time to waitunit- the time unit- Returns:
- permit id if a permit was acquired and
nullif the waiting time elapsed before a permit was acquired
-
tryAcquire
Description copied from interface:RPermitExpirableSemaphoreTries to acquire currently available permit with definedleaseTimeand return its id. Waits up to definedwaitTimeif necessary until a permit became available.- Specified by:
tryAcquirein interfaceRPermitExpirableSemaphore- Parameters:
waitTime- the maximum time to waitleaseTime- permit lease time, use -1 to make it permanentunit- the time unit- Returns:
- permit id if a permit was acquired and
nullif the waiting time elapsed before a permit was acquired - Throws:
InterruptedException- if the current thread is interrupted
-
tryAcquireAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncTries to acquire currently available permit with definedleaseTimeand return its id. Waits up to definedwaitTimeif necessary until a permit became available.- Specified by:
tryAcquireAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
waitTime- the maximum time to waitleaseTime- permit lease time, use -1 to make it permanentunit- the time unit- Returns:
- permit id if a permit was acquired and
nullif the waiting time elapsed before a permit was acquired
-
tryAcquire
public List<String> tryAcquire(int permits, long waitTime, long leaseTime, TimeUnit unit) throws InterruptedException Description copied from interface:RPermitExpirableSemaphoreTries to acquire defined amount of currently availablepermitswith definedleaseTimeand return ids. Waits up to definedwaitTimeif necessary until enough permits became available.- Specified by:
tryAcquirein interfaceRPermitExpirableSemaphore- Parameters:
permits- the number of permits to acquirewaitTime- the maximum time to waitleaseTime- permit lease time, use -1 to make it permanentunit- the time unit- Returns:
- permits ids if permits were acquired and empty collection if the waiting time elapsed before permits were acquired
- Throws:
InterruptedException- if the current thread is interrupted
-
tryAcquireAsync
public RFuture<List<String>> tryAcquireAsync(int permits, long waitTime, long leaseTime, TimeUnit timeUnit) Description copied from interface:RPermitExpirableSemaphoreAsyncTries to acquire defined amount of currently availablepermitswith definedleaseTimeand returns their ids. Waits up to definedwaitTimeif necessary until permits became available.- Specified by:
tryAcquireAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permits- the number of permits to acquirewaitTime- the maximum time to waitleaseTime- permit lease time, use -1 to make it permanenttimeUnit- the time unit- Returns:
- permits ids if permits were acquired and empty list if the waiting time elapsed before permit were acquired
-
tryAcquire
Description copied from interface:RPermitExpirableSemaphoreTries to acquire currently available permit and return its id. Waits up to definedwaitTimeif necessary until a permit became available.- Specified by:
tryAcquirein interfaceRPermitExpirableSemaphore- Parameters:
waitTime- the maximum time to waitunit- the time unit- Returns:
- permit id if a permit was acquired and
nullif the waiting time elapsed before a permit was acquired - Throws:
InterruptedException- if the current thread is interrupted
-
release
Description copied from interface:RPermitExpirableSemaphoreReleases a permit by its id. Increases the number of available permits. Throws an exception if permit id doesn't exist or has already been released.- Specified by:
releasein interfaceRPermitExpirableSemaphore- Parameters:
permitId- - permit id
-
release
Description copied from interface:RPermitExpirableSemaphoreReleases permits by their ids. Increases the number of available permits. Throws an exception if permit id doesn't exist or has already been released.- Specified by:
releasein interfaceRPermitExpirableSemaphore- Parameters:
permitsIds- - permits ids
-
tryRelease
Description copied from interface:RPermitExpirableSemaphoreTries to release permit by its id.- Specified by:
tryReleasein interfaceRPermitExpirableSemaphore- Parameters:
permitId- permit id- Returns:
trueif a permit has been released andfalseotherwise
-
tryRelease
Description copied from interface:RPermitExpirableSemaphoreTries to release permits by their ids.- Specified by:
tryReleasein interfaceRPermitExpirableSemaphore- Parameters:
permitsIds- - permits ids- Returns:
- amount of released permits
-
tryReleaseAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncTries to release permit by its id.- Specified by:
tryReleaseAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permitId- permit id- Returns:
trueif a permit has been released andfalseotherwise
-
tryReleaseAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncTries to release defined permits by their ids.- Specified by:
tryReleaseAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permitsIds- - permits ids- Returns:
- amount of released permits
-
sizeInMemoryAsync
Description copied from interface:RObjectAsyncReturns bytes amount used by object in Redis memory.- Specified by:
sizeInMemoryAsyncin interfaceRObjectAsync- Overrides:
sizeInMemoryAsyncin classRedissonObject- Returns:
- size in bytes
-
deleteAsync
Description copied from interface:RObjectAsyncDelete object in async mode- Specified by:
deleteAsyncin interfaceRObjectAsync- Overrides:
deleteAsyncin classRedissonObject- Returns:
trueif object was deletedfalseif not
-
expireAsync
-
expireAtAsync
-
clearExpireAsync
Description copied from interface:RExpirableAsyncClear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsyncin interfaceRExpirableAsync- Returns:
trueif the timeout was cleared andfalseif not
-
releaseAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncReleases a permit by its id. Increases the number of available permits. Throws an exception if permit id doesn't exist or has already been released.- Specified by:
releaseAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permitId- - permit id- Returns:
- void
-
releaseAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncReleases permits by their ids. Increases the number of available permits. Throws an exception if permits ids don't exist or have already been released.- Specified by:
releaseAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permitsIds- - permit id
-
availablePermits
public int availablePermits()Description copied from interface:RPermitExpirableSemaphoreReturns number of available permits.- Specified by:
availablePermitsin interfaceRPermitExpirableSemaphore- Returns:
- number of available permits
-
getPermits
public int getPermits()Description copied from interface:RPermitExpirableSemaphoreReturns the number of permits.- Specified by:
getPermitsin interfaceRPermitExpirableSemaphore- Returns:
- number of permits
-
acquiredPermits
public int acquiredPermits()Description copied from interface:RPermitExpirableSemaphoreReturns the number of acquired permits.- Specified by:
acquiredPermitsin interfaceRPermitExpirableSemaphore- Returns:
- number of acquired permits
-
availablePermitsAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncReturns number of available permits.- Specified by:
availablePermitsAsyncin interfaceRPermitExpirableSemaphoreAsync- Returns:
- number of permits
-
getPermitsAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncReturns the number of permits.- Specified by:
getPermitsAsyncin interfaceRPermitExpirableSemaphoreAsync- Returns:
- number of permits
-
acquiredPermitsAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncReturns the number of acquired permits.- Specified by:
acquiredPermitsAsyncin interfaceRPermitExpirableSemaphoreAsync- Returns:
- number of acquired permits
-
trySetPermits
public boolean trySetPermits(int permits) Description copied from interface:RPermitExpirableSemaphoreTries to set the initial number of available permits.- Specified by:
trySetPermitsin interfaceRPermitExpirableSemaphore- Parameters:
permits- - number of permits- Returns:
trueif permits has been set successfully, otherwisefalse.
-
setPermits
public void setPermits(int permits) Description copied from interface:RPermitExpirableSemaphoreSets the number of permits to the provided value. Calculates thedeltabetween the givenpermitsvalue and the current number of permits, then increases the number of available permits bydelta.- Specified by:
setPermitsin interfaceRPermitExpirableSemaphore- Parameters:
permits- - number of permits
-
setPermitsAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncSets the number of permits to the provided value. Calculates thedeltabetween the givenpermitsvalue and the current number of permits, then increases the number of available permits bydelta.- Specified by:
setPermitsAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permits- - number of permits
-
trySetPermitsAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncTries to set number of available permits.- Specified by:
trySetPermitsAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permits- - number of permits- Returns:
trueif permits has been set successfully, otherwisefalse.
-
addPermits
public void addPermits(int permits) Description copied from interface:RPermitExpirableSemaphoreIncreases or decreases the number of available permits by defined value.- Specified by:
addPermitsin interfaceRPermitExpirableSemaphore- Parameters:
permits- amount of permits to add/remove
-
addPermitsAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncIncreases or decreases the number of available permits by defined value.- Specified by:
addPermitsAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permits- amount of permits to add/remove- Returns:
- void
-
updateLeaseTimeAsync
Description copied from interface:RPermitExpirableSemaphoreAsyncOverrides and updates lease time for defined permit id.- Specified by:
updateLeaseTimeAsyncin interfaceRPermitExpirableSemaphoreAsync- Parameters:
permitId- permit idleaseTime- permit lease time, use -1 to make it permanentunit- the time unit- Returns:
trueif permits has been updated successfully, otherwisefalse.
-
updateLeaseTime
Description copied from interface:RPermitExpirableSemaphoreOverrides and updates lease time for defined permit id.- Specified by:
updateLeaseTimein interfaceRPermitExpirableSemaphore- Parameters:
permitId- permit idleaseTime- permit lease time, use -1 to make it permanentunit- the time unit- Returns:
trueif permits has been updated successfully, otherwisefalse.
-
expire
Description copied from interface:RExpirableUseRExpirable.expire(Duration)instead- Specified by:
expirein interfaceRExpirable- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Duration)instead- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
timeToLive- - timeout before object will be deletedtimeUnit- - timeout time unit- Returns:
trueif the timeout was set andfalseif not
-
expireAt
public boolean expireAt(long timestamp) Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date in milliseconds (Unix timestamp)- Returns:
trueif the timeout was set andfalseif not
-
expire
Description copied from interface:RExpirableSets an expiration date for this object. When expire date comes the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
instant- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSet
Description copied from interface:RExpirableSets 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:
expireIfSetin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSetAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfSetAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSet
Description copied from interface:RExpirableSets 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:
expireIfNotSetin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfNotSetAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreater
Description copied from interface:RExpirableSets 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:
expireIfGreaterin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfGreaterAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfLess
Description copied from interface:RExpirableSets 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:
expireIfLessin interfaceRExpirable- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfLessAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfLessAsyncin interfaceRExpirableAsync- Parameters:
time- expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncSet an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
instant- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expire
Description copied from interface:RExpirableSets a timeout for this object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expirein interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireAsync
Description copied from interface:RExpirableAsyncSet a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireAt
Description copied from interface:RExpirableUseRExpirable.expire(Instant)instead- Specified by:
expireAtin interfaceRExpirable- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireAtAsync
Description copied from interface:RExpirableAsyncUseRExpirableAsync.expireAsync(Instant)instead- Specified by:
expireAtAsyncin interfaceRExpirableAsync- Parameters:
timestamp- - expire date- Returns:
trueif the timeout was set andfalseif not
-
expireIfSet
Description copied from interface:RExpirableSets 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:
expireIfSetin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfSetAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfSetAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSet
Description copied from interface:RExpirableSets 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:
expireIfNotSetin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfNotSetAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfNotSetAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreater
Description copied from interface:RExpirableSets 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:
expireIfGreaterin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfGreaterAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfGreaterAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfLess
Description copied from interface:RExpirableSets 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:
expireIfLessin interfaceRExpirable- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
expireIfLessAsync
Description copied from interface:RExpirableAsyncSets 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:
expireIfLessAsyncin interfaceRExpirableAsync- Parameters:
duration- timeout before object will be deleted- Returns:
trueif the timeout was set andfalseif not
-
clearExpire
public boolean clearExpire()Description copied from interface:RExpirableClear an expire timeout or expire date for object.- Specified by:
clearExpirein interfaceRExpirable- Returns:
trueif timeout was removedfalseif object does not exist or does not have an associated timeout
-
remainTimeToLive
public long remainTimeToLive()Description copied from interface:RExpirableRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLivein 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:RExpirableAsyncRemaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsyncin 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:RExpirableExpiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTimein interfaceRExpirable- Returns:
- expiration time
-
getExpireTimeAsync
Description copied from interface:RExpirableAsyncExpiration time of Redisson object that has a timeoutRequires Redis 7.0.0 and higher.
- Specified by:
getExpireTimeAsyncin interfaceRExpirableAsync- Returns:
- expiration time
-
clearExpireAsync
-