V - value typepublic class RedissonTransactionalBucket<V> extends RedissonBucket<V>
codec, commandExecutor, name| Constructor and Description |
|---|
RedissonTransactionalBucket(Codec codec,
CommandAsyncExecutor commandExecutor,
long timeout,
String name,
List<TransactionalOperation> operations,
AtomicBoolean executed,
String transactionId) |
RedissonTransactionalBucket(CommandAsyncExecutor commandExecutor,
long timeout,
String name,
List<TransactionalOperation> operations,
AtomicBoolean executed,
String transactionId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkState() |
boolean |
clearExpire()
Clear an expire timeout or expire date for object.
|
RFuture<Boolean> |
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.
|
protected RFuture<Boolean> |
clearExpireAsync(String... keys) |
RFuture<Boolean> |
compareAndSetAsync(V expect,
V update)
Atomically sets the value to the given updated value
only if serialized state of the current value equals
to serialized state of the expected value.
|
RFuture<Boolean> |
deleteAsync()
Delete object in async mode
|
protected <R> void |
executeLocked(RPromise<R> promise,
Runnable runnable) |
boolean |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object.
|
RFuture<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object in async mode.
|
protected RFuture<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit,
String... keys) |
boolean |
expireAt(Date timestamp)
Set an expire date for object.
|
boolean |
expireAt(long timestamp)
Set an expire date for object.
|
RFuture<Boolean> |
expireAtAsync(Date timestamp)
Set an expire date for object in async mode.
|
RFuture<Boolean> |
expireAtAsync(long timestamp)
Set an expire date for object in async mode.
|
protected RFuture<Boolean> |
expireAtAsync(long timestamp,
String... keys) |
RFuture<V> |
getAndDeleteAsync()
Retrieves element in the holder and removes it.
|
RFuture<V> |
getAndSetAsync(V value)
Retrieves current element in the holder and replaces it with
newValue. |
RFuture<V> |
getAndSetAsync(V value,
long timeToLive,
TimeUnit timeUnit)
Retrieves current element in the holder and replaces it with
newValue with defined timeToLive interval. |
RFuture<V> |
getAsync()
Retrieves element stored in the holder.
|
RFuture<Boolean> |
isExistsAsync()
Check object existence in async mode.
|
RFuture<Void> |
migrateAsync(String host,
int port,
int database,
long timeout)
Transfer object from source Redis instance to destination Redis instance
in async mode
|
RFuture<Boolean> |
moveAsync(int database)
Move object to another database in async mode
|
long |
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout
|
RFuture<Long> |
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeout
|
RFuture<Void> |
setAsync(V newValue)
Stores element into the holder.
|
RFuture<Void> |
setAsync(V value,
long timeToLive,
TimeUnit timeUnit)
Stores element into the holder with defined
timeToLive interval. |
RFuture<Long> |
sizeAsync()
Returns size of object in bytes
|
RFuture<Boolean> |
touchAsync()
Update the last access time of an object in async mode.
|
RFuture<Boolean> |
trySetAsync(V newValue)
Tries to set element atomically into empty holder.
|
RFuture<Boolean> |
trySetAsync(V value,
long timeToLive,
TimeUnit timeUnit)
Tries to set element atomically into empty holder with defined
timeToLive interval. |
RFuture<Boolean> |
unlinkAsync()
Delete the objects.
|
addListener, addListenerAsync, compareAndSet, get, getAndDelete, getAndSet, getAndSet, removeListener, removeListenerAsync, set, set, setIfExists, setIfExists, setIfExistsAsync, setIfExistsAsync, size, trySet, trySetaddListener, addListenerAsync, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getName, isExists, migrate, move, prefixName, removeListenersAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, unlinkclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearExpire, expire, expireAt, expireAt, remainTimeToLivecopy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkremainTimeToLiveAsynccopyAsync, dumpAsync, getIdleTimeAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsyncpublic RedissonTransactionalBucket(CommandAsyncExecutor commandExecutor, long timeout, String name, List<TransactionalOperation> operations, AtomicBoolean executed, String transactionId)
public RedissonTransactionalBucket(Codec codec, CommandAsyncExecutor commandExecutor, long timeout, String name, List<TransactionalOperation> operations, AtomicBoolean executed, String transactionId)
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsyncexpireAsync in interface RExpirableAsynctimeToLive - - timeout before object will be deletedtimeUnit - - timeout time unittrue if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire datetrue if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire date in milliseconds (Unix timestamp)true if the timeout was set and false if notpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsyncclearExpireAsync in interface RExpirableAsynctrue if the timeout was cleared and false if notpublic RFuture<Boolean> moveAsync(int database)
RObjectAsyncmoveAsync in interface RObjectAsyncmoveAsync in class RedissonObjectdatabase - - number of Redis databasetrue if key was moved false if notpublic RFuture<Void> migrateAsync(String host, int port, int database, long timeout)
RObjectAsyncmigrateAsync in interface RObjectAsyncmigrateAsync in class RedissonObjecthost - - destination hostport - - destination portdatabase - - destination databasetimeout - - maximum idle time in any moment of the communication with the destination instance in millisecondspublic RFuture<Long> sizeAsync()
RBucketAsyncsizeAsync in interface RBucketAsync<V>sizeAsync in class RedissonBucket<V>public RFuture<Boolean> isExistsAsync()
RObjectAsyncisExistsAsync in interface RObjectAsyncisExistsAsync in class RedissonObjecttrue if object exists and false otherwisepublic RFuture<Boolean> touchAsync()
RObjectAsynctouchAsync in interface RObjectAsynctouchAsync in class RedissonObjecttrue if object was touched else falsepublic RFuture<Boolean> unlinkAsync()
RObjectAsyncRequires Redis 4.0+
unlinkAsync in interface RObjectAsyncunlinkAsync in class RedissonObjecttrue if it was exist and deleted else falsepublic RFuture<Boolean> deleteAsync()
RObjectAsyncdeleteAsync in interface RObjectAsyncdeleteAsync in class RedissonObjecttrue if object was deleted false if notpublic RFuture<V> getAsync()
RBucketAsyncgetAsync in interface RBucketAsync<V>getAsync in class RedissonBucket<V>public RFuture<Boolean> compareAndSetAsync(V expect, V update)
RBucketAsynccompareAndSetAsync in interface RBucketAsync<V>compareAndSetAsync in class RedissonBucket<V>expect - the expected valueupdate - the new valuetrue if successful; or false if the actual value
was not equal to the expected value.public RFuture<V> getAndSetAsync(V value, long timeToLive, TimeUnit timeUnit)
RBucketAsyncnewValue with defined timeToLive interval.getAndSetAsync in interface RBucketAsync<V>getAndSetAsync in class RedissonBucket<V>value - - value to settimeToLive - - time to live intervaltimeUnit - - unit of time to live intervalpublic RFuture<V> getAndSetAsync(V value)
RBucketAsyncnewValue.getAndSetAsync in interface RBucketAsync<V>getAndSetAsync in class RedissonBucket<V>value - - value to setpublic RFuture<V> getAndDeleteAsync()
RBucketAsyncgetAndDeleteAsync in interface RBucketAsync<V>getAndDeleteAsync in class RedissonBucket<V>public RFuture<Void> setAsync(V newValue)
RBucketAsyncsetAsync in interface RBucketAsync<V>setAsync in class RedissonBucket<V>newValue - - value to setpublic RFuture<Void> setAsync(V value, long timeToLive, TimeUnit timeUnit)
RBucketAsynctimeToLive interval.setAsync in interface RBucketAsync<V>setAsync in class RedissonBucket<V>value - - value to settimeToLive - - time to live intervaltimeUnit - - unit of time to live intervalpublic RFuture<Boolean> trySetAsync(V newValue)
RBucketAsynctrySetAsync in interface RBucketAsync<V>trySetAsync in class RedissonBucket<V>newValue - - value to settrue if successful, or false if
element was already setpublic RFuture<Boolean> trySetAsync(V value, long timeToLive, TimeUnit timeUnit)
RBucketAsynctimeToLive interval.trySetAsync in interface RBucketAsync<V>trySetAsync in class RedissonBucket<V>value - - value to settimeToLive - - time to live intervaltimeUnit - - unit of time to live intervaltrue if successful, or false if
element was already setprotected void checkState()
public boolean expire(long timeToLive,
TimeUnit timeUnit)
RExpirableexpire in interface RExpirabletimeToLive - - timeout before object will be deletedtimeUnit - - timeout time unittrue if the timeout was set and false if notpublic boolean expireAt(long timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire date in milliseconds (Unix timestamp)true if the timeout was set and false if notpublic boolean expireAt(Date timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire datetrue if the timeout was set and false if notpublic boolean clearExpire()
RExpirableclearExpire in interface RExpirabletrue if timeout was removed
false if object does not exist or does not have an associated timeoutpublic long remainTimeToLive()
RExpirableremainTimeToLive in interface RExpirablepublic RFuture<Long> remainTimeToLiveAsync()
RExpirableAsyncremainTimeToLiveAsync in interface RExpirableAsyncprotected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
Copyright © 2014–2020 Redisson. All rights reserved.