public abstract class RedissonObject extends Object implements RObject
Modifier and Type | Field and Description |
---|---|
protected Codec |
codec |
protected CommandAsyncExecutor |
commandExecutor |
Constructor and Description |
---|
RedissonObject(Codec codec,
CommandAsyncExecutor commandExecutor,
String name) |
RedissonObject(CommandAsyncExecutor commandExecutor,
String name) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
await(RFuture<?> future,
long timeout,
TimeUnit timeoutUnit) |
boolean |
delete()
Deletes the object
|
RFuture<Boolean> |
deleteAsync()
Delete object in async mode
|
protected byte[] |
encode(Object value) |
protected byte[] |
encodeMapKey(Object value) |
protected byte[] |
encodeMapValue(Object value) |
protected <V> V |
get(RFuture<V> future) |
Codec |
getCodec()
Returns the underlying Codec used by this RObject
|
String |
getName()
Returns name of object
|
protected String |
getName(Object o) |
boolean |
isExists()
Check object existence
|
RFuture<Boolean> |
isExistsAsync()
Check object existence in async mode.
|
void |
migrate(String host,
int port,
int database)
Transfer an object from source Redis instance to destination Redis instance
|
RFuture<Void> |
migrateAsync(String host,
int port,
int database)
Transfer an object from source Redis instance to destination Redis instance
in async mode
|
boolean |
move(int database)
Move object to another database
|
RFuture<Boolean> |
moveAsync(int database)
Move object to another database in async mode
|
protected <V> RPromise<V> |
newPromise() |
protected <V> RFuture<V> |
newSucceededFuture(V result) |
protected String |
prefixName(String prefix,
String name) |
void |
rename(String newName)
Rename current object key to
newName |
RFuture<Void> |
renameAsync(String newName)
Rename current object key to
newName
in async mode |
boolean |
renamenx(String newName)
Rename current object key to
newName
only if new key is not exists |
RFuture<Boolean> |
renamenxAsync(String newName)
Rename current object key to
newName
in async mode only if new key is not exists |
protected String |
suffixName(String name,
String suffix) |
boolean |
touch()
Update the last access time of an object.
|
RFuture<Boolean> |
touchAsync()
Update the last access time of an object in async mode.
|
protected final CommandAsyncExecutor commandExecutor
protected final Codec codec
public RedissonObject(Codec codec, CommandAsyncExecutor commandExecutor, String name)
public RedissonObject(CommandAsyncExecutor commandExecutor, String name)
protected boolean await(RFuture<?> future, long timeout, TimeUnit timeoutUnit) throws InterruptedException
InterruptedException
protected <V> V get(RFuture<V> future)
protected <V> RPromise<V> newPromise()
protected <V> RFuture<V> newSucceededFuture(V result)
public void rename(String newName)
RObject
newName
public RFuture<Void> renameAsync(String newName)
RObjectAsync
newName
in async moderenameAsync
in interface RObjectAsync
newName
- - new name of objectpublic void migrate(String host, int port, int database)
RObject
public RFuture<Void> migrateAsync(String host, int port, int database)
RObjectAsync
migrateAsync
in interface RObjectAsync
host
- - destination hostport
- - destination portdatabase
- - destination databasepublic boolean move(int database)
RObject
public RFuture<Boolean> moveAsync(int database)
RObjectAsync
moveAsync
in interface RObjectAsync
database
- - number of Redis databasetrue
if key was moved false
if notpublic boolean renamenx(String newName)
RObject
newName
only if new key is not existspublic RFuture<Boolean> renamenxAsync(String newName)
RObjectAsync
newName
in async mode only if new key is not existsrenamenxAsync
in interface RObjectAsync
newName
- - new name of objecttrue
if object has been renamed successfully and false
otherwisepublic boolean delete()
RObject
public RFuture<Boolean> deleteAsync()
RObjectAsync
deleteAsync
in interface RObjectAsync
true
if object was deleted false
if notpublic boolean touch()
RObject
public RFuture<Boolean> touchAsync()
RObjectAsync
touchAsync
in interface RObjectAsync
true
if object was touched else false
public boolean isExists()
RObject
public RFuture<Boolean> isExistsAsync()
RObjectAsync
isExistsAsync
in interface RObjectAsync
true
if object exists and false
otherwisepublic Codec getCodec()
RObject
protected byte[] encode(Object value)
protected byte[] encodeMapKey(Object value)
protected byte[] encodeMapValue(Object value)
Copyright © 2014–2017 The Redisson Project. All rights reserved.