Package org.redisson.api
Interface RObjectAsync
- All Known Subinterfaces:
RAtomicDouble
,RAtomicDoubleAsync
,RAtomicLong
,RAtomicLongAsync
,RBinaryStream
,RBitSet
,RBitSetAsync
,RBlockingDeque<V>
,RBlockingDequeAsync<V>
,RBlockingQueue<V>
,RBlockingQueueAsync<V>
,RBloomFilter<T>
,RBloomFilterAsync<T>
,RBoundedBlockingQueue<V>
,RBoundedBlockingQueueAsync<V>
,RBucket<V>
,RBucketAsync<V>
,RCollectionAsync<V>
,RCountDownLatch
,RCountDownLatchAsync
,RDelayedQueue<V>
,RDeque<V>
,RDequeAsync<V>
,RDoubleAdder
,RExpirable
,RExpirableAsync
,RGeo<V>
,RGeoAsync<V>
,RHyperLogLog<V>
,RHyperLogLogAsync<V>
,RIdGenerator
,RIdGeneratorAsync
,RJsonBucket<V>
,RJsonBucketAsync<V>
,RJsonStore<K,
,V> RJsonStoreAsync<K,
,V> RLexSortedSet
,RLexSortedSetAsync
,RList<V>
,RListAsync<V>
,RListMultimap<K,
,V> RListMultimapCache<K,
,V> RListMultimapCacheNative<K,
,V> RLiveObject
,RLocalCachedMap<K,
,V> RLongAdder
,RMap<K,
,V> RMapAsync<K,
,V> RMapCache<K,
,V> RMapCacheAsync<K,
,V> RMapCacheNative<K,
,V> RMapCacheNativeAsync<K,
,V> RMultimap<K,
,V> RMultimapAsync<K,
,V> RMultimapCache<K,
,V> RMultimapCacheAsync<K,
,V> RObject
,RPermitExpirableSemaphore
,RPermitExpirableSemaphoreAsync
,RPriorityBlockingDeque<V>
,RPriorityBlockingQueue<V>
,RPriorityDeque<V>
,RPriorityQueue<V>
,RQueue<V>
,RQueueAsync<V>
,RRateLimiter
,RRateLimiterAsync
,RReliableTopic
,RReliableTopicAsync
,RRingBuffer<V>
,RRingBufferAsync<V>
,RScoredSortedSet<V>
,RScoredSortedSetAsync<V>
,RSemaphore
,RSemaphoreAsync
,RSet<V>
,RSetAsync<V>
,RSetCache<V>
,RSetCacheAsync<V>
,RSetMultimap<K,
,V> RSetMultimapCache<K,
,V> RSetMultimapCacheNative<K,
,V> RSortedSet<V>
,RStream<K,
,V> RStreamAsync<K,
,V> RTimeSeries<V,
,L> RTimeSeriesAsync<V,
,L> RTransferQueue<V>
,RTransferQueueAsync<V>
- All Known Implementing Classes:
BaseRedissonList
,ExpireAtOperation.RedissonBucketExtended
,ExpireOperation.RedissonBucketExtended
,JCache
,MapCacheNativeWrapper
,RedissonAtomicDouble
,RedissonAtomicLong
,RedissonBaseAdder
,RedissonBaseLock
,RedissonBinaryStream
,RedissonBitSet
,RedissonBlockingDeque
,RedissonBlockingQueue
,RedissonBloomFilter
,RedissonBoundedBlockingQueue
,RedissonBucket
,RedissonCountDownLatch
,RedissonDelayedQueue
,RedissonDeque
,RedissonDoubleAdder
,RedissonFairLock
,RedissonFasterMultiLock
,RedissonFencedLock
,RedissonGeo
,RedissonHyperLogLog
,RedissonIdGenerator
,RedissonJsonBucket
,RedissonLexSortedSet
,RedissonList
,RedissonListMultimap
,RedissonListMultimapCache
,RedissonListMultimapCacheNative
,RedissonListMultimapValues
,RedissonLocalCachedMap
,RedissonLock
,RedissonLongAdder
,RedissonMap
,RedissonMapCache
,RedissonMapCacheNative
,RedissonMultimap
,RedissonObject
,RedissonPermitExpirableSemaphore
,RedissonPriorityBlockingDeque
,RedissonPriorityBlockingQueue
,RedissonPriorityDeque
,RedissonPriorityQueue
,RedissonQueue
,RedissonQueueSemaphore
,RedissonRateLimiter
,RedissonReadLock
,RedissonReadWriteLock
,RedissonReliableTopic
,RedissonRingBuffer
,RedissonScoredSortedSet
,RedissonSemaphore
,RedissonSet
,RedissonSetCache
,RedissonSetMultimap
,RedissonSetMultimapCache
,RedissonSetMultimapCacheNative
,RedissonSetMultimapValues
,RedissonSortedSet
,RedissonSpinLock
,RedissonStream
,RedissonSubList
,RedissonTimeSeries
,RedissonTransactionalBucket
,RedissonTransactionalLocalCachedMap
,RedissonTransactionalLock
,RedissonTransactionalMap
,RedissonTransactionalMapCache
,RedissonTransactionalReadLock
,RedissonTransactionalSet
,RedissonTransactionalSetCache
,RedissonTransactionalWriteLock
,RedissonTransferQueue
,RedissonWriteLock
public interface RObjectAsync
Base asynchronous interface for all Redisson objects
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddListenerAsync
(ObjectListener listener) Adds object event listenercopyAndReplaceAsync
(String destination) Copy this object instance to the new instance with a defined name, and replace it if it already exists.copyAndReplaceAsync
(String destination, int database) Copy this object instance to the new instance with a defined name and database, and replace it if it already exists.Copy this object instance to the new instance with a defined name.Copy this object instance to the new instance with a defined name and database.Copy object from source Redis instance to destination Redis instance in async modeDelete object in async modeRFuture
<byte[]> Returns dump of objectReturns number of seconds spent since last write or read operation over this object.Check object existence in async mode.migrateAsync
(String host, int port, int database, long timeout) Transfer object from source Redis instance to destination Redis instance in async modemoveAsync
(int database) Move object to another database in async moderemoveListenerAsync
(int listenerId) Removes object event listenerrenameAsync
(String newName) Rename current object key tonewName
in async moderenamenxAsync
(String newName) Rename current object key tonewName
in async mode only if new key is not existsrestoreAndReplaceAsync
(byte[] state) Restores and replaces object if it already exists.restoreAndReplaceAsync
(byte[] state, long timeToLive, TimeUnit timeUnit) Restores and replaces object if it already exists and set time to live for it.restoreAsync
(byte[] state) Restores object using its state returned bydumpAsync()
method.restoreAsync
(byte[] state, long timeToLive, TimeUnit timeUnit) Restores object using its state returned bydumpAsync()
method and set time to live for it.Returns bytes amount used by object in Redis memory.Update the last access time of an object in async mode.Delete the objects.
-
Method Details
-
getIdleTimeAsync
Returns number of seconds spent since last write or read operation over this object.- Returns:
- number of seconds
-
sizeInMemoryAsync
Returns bytes amount used by object in Redis memory.- Returns:
- size in bytes
-
restoreAsync
Restores object using its state returned bydumpAsync()
method.- Parameters:
state
- - state of object- Returns:
- void
-
restoreAsync
Restores object using its state returned bydumpAsync()
method and set time to live for it.- Parameters:
state
- - state of objecttimeToLive
- - time to live of the objecttimeUnit
- - time unit- Returns:
- void
-
restoreAndReplaceAsync
Restores and replaces object if it already exists.- Parameters:
state
- - state of the object- Returns:
- void
-
restoreAndReplaceAsync
Restores and replaces object if it already exists and set time to live for it.- Parameters:
state
- - state of the objecttimeToLive
- - time to live of the objecttimeUnit
- - time unit- Returns:
- void
-
dumpAsync
RFuture<byte[]> dumpAsync()Returns dump of object- Returns:
- dump
-
touchAsync
Update the last access time of an object in async mode.- Returns:
true
if object was touched elsefalse
-
migrateAsync
Transfer object from source Redis instance to destination Redis instance in async mode- Parameters:
host
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in milliseconds- Returns:
- void
-
copyAsync
Copy object from source Redis instance to destination Redis instance in async mode- Parameters:
host
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in milliseconds- Returns:
- void
-
copyAsync
Copy this object instance to the new instance with a defined name.- Parameters:
destination
- name of the destination instance- Returns:
true
if this object instance was copied elsefalse
-
copyAsync
Copy this object instance to the new instance with a defined name and database.- Parameters:
destination
- name of the destination instancedatabase
- database number- Returns:
true
if this object instance was copied elsefalse
-
copyAndReplaceAsync
Copy this object instance to the new instance with a defined name, and replace it if it already exists.- Parameters:
destination
- name of the destination instance- Returns:
true
if this object instance was copied elsefalse
-
copyAndReplaceAsync
Copy this object instance to the new instance with a defined name and database, and replace it if it already exists.- Parameters:
destination
- name of the destination instancedatabase
- database number- Returns:
true
if this object instance was copied elsefalse
-
moveAsync
Move object to another database in async mode- Parameters:
database
- - number of Redis database- Returns:
true
if key was movedfalse
if not
-
deleteAsync
Delete object in async mode- Returns:
true
if object was deletedfalse
if not
-
unlinkAsync
Delete the objects. Actual removal will happen later asynchronously.Requires Redis 4.0+
- Returns:
true
if it was exist and deleted elsefalse
-
renameAsync
Rename current object key tonewName
in async mode- Parameters:
newName
- - new name of object- Returns:
- void
-
renamenxAsync
Rename current object key tonewName
in async mode only if new key is not exists- Parameters:
newName
- - new name of object- Returns:
true
if object has been renamed successfully andfalse
otherwise
-
isExistsAsync
Check object existence in async mode.- Returns:
true
if object exists andfalse
otherwise
-
addListenerAsync
Adds object event listener- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
-
removeListenerAsync
Removes object event listener- Parameters:
listenerId
- - listener id
-