Package org.redisson.api
Interface RObjectReactive
- All Known Subinterfaces:
RAtomicDoubleReactive,RAtomicLongReactive,RBinaryStreamReactive,RBitSetReactive,RBlockingDequeReactive<V>,RBlockingQueueReactive<V>,RBloomFilterReactive<T>,RBucketReactive<V>,RCollectionReactive<V>,RDequeReactive<V>,RExpirableReactive,RGeoReactive<V>,RHyperLogLogReactive<V>,RIdGeneratorReactive,RJsonBucketReactive<V>,RJsonStoreReactive<K,,V> RLexSortedSetReactive,RListMultimapCacheNativeReactive<K,,V> RListMultimapCacheReactive<K,,V> RListMultimapReactive<K,,V> RListReactive<V>,RLocalCachedMapReactive<K,,V> RMapCacheNativeReactive<K,,V> RMapCacheReactive<K,,V> RMapReactive<K,,V> RMultimapReactive<K,,V> RPermitExpirableSemaphoreReactive,RQueueReactive<V>,RRateLimiterReactive,RReliableTopicReactive,RRingBufferReactive<V>,RScoredSortedSetReactive<V>,RSemaphoreReactive,RSetCacheReactive<V>,RSetMultimapCacheNativeReactive<K,,V> RSetMultimapCacheReactive<K,,V> RSetMultimapReactive<K,,V> RSetReactive<V>,RStreamReactive<K,,V> RTimeSeriesReactive<V,,L> RTransferQueueReactive<V>
public interface RObjectReactive
Base Reactive interface for all Redisson objects
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Integer> addListener(ObjectListener listener) Adds object event listenerreactor.core.publisher.Mono<Boolean> Copy this object instance to the new instance with a defined name.reactor.core.publisher.Mono<Boolean> Copy this object instance to the new instance with a defined name and database.reactor.core.publisher.Mono<Void> Copy object from source Redis instance to destination Redis instancereactor.core.publisher.Mono<Boolean> copyAndReplace(String destination) Copy this object instance to the new instance with a defined name, and replace it if it already exists.reactor.core.publisher.Mono<Boolean> copyAndReplace(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.reactor.core.publisher.Mono<Boolean> delete()Delete object in modereactor.core.publisher.Mono<byte[]> dump()Returns dump of objectgetCodec()reactor.core.publisher.Mono<Long> Returns number of seconds spent since last write or read operation over this object.getName()reactor.core.publisher.Mono<Boolean> isExists()Check object existencereactor.core.publisher.Mono<Void> Transfer a object from a source Redis instance to a destination Redis instance in modereactor.core.publisher.Mono<Boolean> move(int database) Move object to another database in modereactor.core.publisher.Mono<Void> removeListener(int listenerId) Removes object event listenerreactor.core.publisher.Mono<Void> Rename current object key tonewNamein modereactor.core.publisher.Mono<Boolean> Rename current object key tonewNamein mode only if new key is not existsreactor.core.publisher.Mono<Void> restore(byte[] state) Restores object using its state returned bydump()method.reactor.core.publisher.Mono<Void> Restores object using its state returned bydump()method and set time to live for it.reactor.core.publisher.Mono<Void> restoreAndReplace(byte[] state) Restores and replaces object if it already exists.reactor.core.publisher.Mono<Void> restoreAndReplace(byte[] state, long timeToLive, TimeUnit timeUnit) Restores and replaces object if it already exists and set time to live for it.reactor.core.publisher.Mono<Long> Returns bytes amount used by object in Redis memory.reactor.core.publisher.Mono<Boolean> touch()Update the last access time of an object.reactor.core.publisher.Mono<Boolean> unlink()Delete the objects.
-
Method Details
-
getIdleTime
reactor.core.publisher.Mono<Long> getIdleTime()Returns number of seconds spent since last write or read operation over this object.- Returns:
- number of seconds
-
getName
String getName() -
getCodec
Codec getCodec() -
sizeInMemory
reactor.core.publisher.Mono<Long> sizeInMemory()Returns bytes amount used by object in Redis memory.- Returns:
- size in bytes
-
restore
Restores object using its state returned bydump()method.- Parameters:
state- - state of object- Returns:
- void
-
restore
Restores object using its state returned bydump()method and set time to live for it.- Parameters:
state- - state of objecttimeToLive- - time to live of the objecttimeUnit- - time unit- Returns:
- void
-
restoreAndReplace
Restores and replaces object if it already exists.- Parameters:
state- - state of the object- Returns:
- void
-
restoreAndReplace
reactor.core.publisher.Mono<Void> restoreAndReplace(byte[] state, long timeToLive, TimeUnit timeUnit) 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
-
dump
reactor.core.publisher.Mono<byte[]> dump()Returns dump of object- Returns:
- dump
-
touch
reactor.core.publisher.Mono<Boolean> touch()Update the last access time of an object.- Returns:
trueif object was touched elsefalse
-
unlink
reactor.core.publisher.Mono<Boolean> unlink()Delete the objects. Actual removal will happen later asynchronously.Requires Redis 4.0+
- Returns:
trueif it was exist and deleted elsefalse
-
copy
Copy object from source Redis instance to destination Redis instance- 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
-
copy
Copy this object instance to the new instance with a defined name.- Parameters:
destination- name of the destination instance- Returns:
trueif this object instance was copied elsefalse
-
copy
Copy this object instance to the new instance with a defined name and database.- Parameters:
destination- name of the destination instancedatabase- database number- Returns:
trueif this object instance was copied elsefalse
-
copyAndReplace
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:
trueif this object instance was copied elsefalse
-
copyAndReplace
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:
trueif this object instance was copied elsefalse
-
migrate
Transfer a object from a source Redis instance to a destination Redis instance in 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
-
move
Move object to another database in mode- Parameters:
database- - number of Redis database- Returns:
trueif key was movedfalseif not
-
delete
reactor.core.publisher.Mono<Boolean> delete()Delete object in mode- Returns:
trueif object was deletedfalseif not
-
rename
Rename current object key tonewNamein mode- Parameters:
newName- - new name of object- Returns:
- void
-
renamenx
Rename current object key tonewNamein mode only if new key is not exists- Parameters:
newName- - new name of object- Returns:
trueif object has been renamed successfully andfalseotherwise
-
isExists
reactor.core.publisher.Mono<Boolean> isExists()Check object existence- Returns:
trueif object exists andfalseotherwise
-
addListener
Adds object event listener- Parameters:
listener- - object event listener- Returns:
- listener id
- See Also:
-
removeListener
Removes object event listener- Parameters:
listenerId- - listener id- Returns:
- void
-