Package org.redisson.api
Interface RObject
-
- All Superinterfaces:
RObjectAsync
- All Known Subinterfaces:
RAtomicDouble
,RAtomicLong
,RBinaryStream
,RBitSet
,RBlockingDeque<V>
,RBlockingQueue<V>
,RBloomFilter<T>
,RBoundedBlockingQueue<V>
,RBucket<V>
,RCountDownLatch
,RDelayedQueue<V>
,RDeque<V>
,RDoubleAdder
,RExpirable
,RGeo<V>
,RHyperLogLog<V>
,RLexSortedSet
,RList<V>
,RListMultimap<K,V>
,RListMultimapCache<K,V>
,RLocalCachedMap<K,V>
,RLock
,RLongAdder
,RMap<K,V>
,RMapCache<K,V>
,RMultimap<K,V>
,RMultimapCache<K,V>
,RPermitExpirableSemaphore
,RPriorityBlockingDeque<V>
,RPriorityBlockingQueue<V>
,RPriorityDeque<V>
,RPriorityQueue<V>
,RQueue<V>
,RRateLimiter
,RScoredSortedSet<V>
,RSemaphore
,RSet<V>
,RSetCache<V>
,RSetMultimap<K,V>
,RSetMultimapCache<K,V>
,RSortedSet<V>
,RStream<K,V>
- All Known Implementing Classes:
JCache
,RedissonAtomicDouble
,RedissonAtomicLong
,RedissonBaseAdder
,RedissonBinaryStream
,RedissonBitSet
,RedissonBlockingDeque
,RedissonBlockingQueue
,RedissonBloomFilter
,RedissonBoundedBlockingQueue
,RedissonBucket
,RedissonCountDownLatch
,RedissonDelayedQueue
,RedissonDeque
,RedissonDoubleAdder
,RedissonFairLock
,RedissonGeo
,RedissonHyperLogLog
,RedissonLexSortedSet
,RedissonList
,RedissonListMultimap
,RedissonListMultimapCache
,RedissonListMultimapValues
,RedissonLocalCachedMap
,RedissonLock
,RedissonLongAdder
,RedissonMap
,RedissonMapCache
,RedissonMultimap
,RedissonObject
,RedissonPermitExpirableSemaphore
,RedissonPriorityBlockingDeque
,RedissonPriorityBlockingQueue
,RedissonPriorityDeque
,RedissonPriorityQueue
,RedissonQueue
,RedissonQueueSemaphore
,RedissonRateLimiter
,RedissonReadLock
,RedissonReadWriteLock
,RedissonScoredSortedSet
,RedissonSemaphore
,RedissonSet
,RedissonSetCache
,RedissonSetMultimap
,RedissonSetMultimapCache
,RedissonSetMultimapValues
,RedissonSortedSet
,RedissonStream
,RedissonSubList
,RedissonTransactionalBucket
,RedissonTransactionalLocalCachedMap
,RedissonTransactionalLock
,RedissonTransactionalMap
,RedissonTransactionalMapCache
,RedissonTransactionalSet
,RedissonTransactionalSetCache
,RedissonWriteLock
public interface RObject extends RObjectAsync
Base interface for all Redisson objects- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
copy(String host, int port, int database, long timeout)
Copy object from source Redis instance to destination Redis instanceboolean
delete()
Deletes the objectbyte[]
dump()
Returns dump of objectCodec
getCodec()
Returns the underlying Codec used by this RObjectString
getName()
Returns name of objectboolean
isExists()
Check object existencevoid
migrate(String host, int port, int database, long timeout)
Copy object from source Redis instance to destination Redis instanceboolean
move(int database)
Move object to another databasevoid
rename(String newName)
Rename current object key tonewName
boolean
renamenx(String newName)
Rename current object key tonewName
only if new key is not existsvoid
restore(byte[] state)
Restores object using its state returned bydump()
method.void
restore(byte[] state, long timeToLive, TimeUnit timeUnit)
Restores object using its state returned bydump()
method and set time to live for it.void
restoreAndReplace(byte[] state)
Restores and replaces object if it already exists.void
restoreAndReplace(byte[] state, long timeToLive, TimeUnit timeUnit)
Restores and replaces object if it already exists and set time to live for it.long
sizeInMemory()
Returns size of object in Redis memoryboolean
touch()
Update the last access time of an object.boolean
unlink()
Delete the objects.-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
-
-
-
Method Detail
-
sizeInMemory
long sizeInMemory()
Returns size of object in Redis memory- Returns:
- size of object
-
restore
void restore(byte[] state)
Restores object using its state returned bydump()
method.- Parameters:
state
- - state of object
-
restore
void restore(byte[] state, long timeToLive, TimeUnit timeUnit)
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
-
restoreAndReplace
void restoreAndReplace(byte[] state)
Restores and replaces object if it already exists.- Parameters:
state
- - state of the object
-
restoreAndReplace
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
-
dump
byte[] dump()
Returns dump of object- Returns:
- dump
-
touch
boolean touch()
Update the last access time of an object.- Returns:
true
if object was touched elsefalse
-
migrate
void migrate(String host, int port, int database, long timeout)
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
-
copy
void copy(String host, int port, int database, long timeout)
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
-
move
boolean move(int database)
Move object to another database- Parameters:
database
- - Redis database number- Returns:
true
if key was moved elsefalse
-
getName
String getName()
Returns name of object- Returns:
- name - name of object
-
delete
boolean delete()
Deletes the object- Returns:
true
if it was exist and deleted elsefalse
-
unlink
boolean unlink()
Delete the objects. Actual removal will happen later asynchronously.Requires Redis 4.0+
- Returns:
true
if it was exist and deleted elsefalse
-
rename
void rename(String newName)
Rename current object key tonewName
- Parameters:
newName
- - new name of object
-
renamenx
boolean renamenx(String newName)
Rename current object key tonewName
only if new key is not exists- Parameters:
newName
- - new name of object- Returns:
true
if object has been renamed successfully andfalse
otherwise
-
isExists
boolean isExists()
Check object existence- Returns:
true
if object exists andfalse
otherwise
-
getCodec
Codec getCodec()
Returns the underlying Codec used by this RObject- Returns:
- Codec of object
-
-