public class RedissonKeysReactive extends Object implements RKeysReactive
Constructor and Description |
---|
RedissonKeysReactive(CommandReactiveService commandExecutor) |
Modifier and Type | Method and Description |
---|---|
org.reactivestreams.Publisher<Boolean> |
clearExpire(String name)
Clear an expire timeout or expire date for object.
|
org.reactivestreams.Publisher<Void> |
copy(String name,
String host,
int port,
int database,
long timeout)
Copy object from source Redis instance to destination Redis instance
|
org.reactivestreams.Publisher<Long> |
count()
Returns the number of keys in the currently-selected database
|
org.reactivestreams.Publisher<Long> |
countExists(String... names)
Checks if provided keys exist
|
org.reactivestreams.Publisher<Long> |
delete(String... keys)
Delete multiple objects by name.
|
org.reactivestreams.Publisher<Long> |
deleteByPattern(String pattern)
Delete multiple objects by a key pattern.
|
org.reactivestreams.Publisher<Boolean> |
expire(String name,
long timeToLive,
TimeUnit timeUnit)
Set a timeout for object.
|
org.reactivestreams.Publisher<Boolean> |
expireAt(String name,
long timestamp)
Set an expire date for object.
|
org.reactivestreams.Publisher<Collection<String>> |
findKeysByPattern(String pattern)
Find keys by key search pattern by one Redis call.
|
org.reactivestreams.Publisher<Void> |
flushall()
Delete all the keys of all the existing databases
Uses
FLUSHALL Redis command. |
org.reactivestreams.Publisher<Void> |
flushdb()
Delete all the keys of the currently selected database
Uses
FLUSHDB Redis command. |
org.reactivestreams.Publisher<String> |
getKeys()
Load keys in incrementally iterate mode.
|
org.reactivestreams.Publisher<String> |
getKeysByPattern(String pattern)
Find keys by pattern and load it in incrementally iterate mode.
|
org.reactivestreams.Publisher<Integer> |
getSlot(String key)
Get hash slot identifier for key.
|
org.reactivestreams.Publisher<RType> |
getType(String key)
Get Redis object type by key
|
org.reactivestreams.Publisher<Void> |
migrate(String name,
String host,
int port,
int database,
long timeout)
Transfer object from source Redis instance to destination Redis instance
|
org.reactivestreams.Publisher<Boolean> |
move(String name,
int database)
Move object to another database
|
org.reactivestreams.Publisher<String> |
randomKey()
Get random key
Uses
RANDOM_KEY Redis command. |
org.reactivestreams.Publisher<Long> |
remainTimeToLive(String name)
Remaining time to live of Redisson object that has a timeout
|
org.reactivestreams.Publisher<Void> |
rename(String currentName,
String newName)
Rename current object key to
newName |
org.reactivestreams.Publisher<Boolean> |
renamenx(String oldName,
String newName)
Rename object with
oldName to newName
only if new key is not exists |
org.reactivestreams.Publisher<Long> |
touch(String... names)
Update the last access time of an object.
|
org.reactivestreams.Publisher<Long> |
unlink(String... keys)
Delete multiple objects by name.
|
public RedissonKeysReactive(CommandReactiveService commandExecutor)
public org.reactivestreams.Publisher<Integer> getSlot(String key)
RKeysReactive
KEYSLOT
Redis command.getSlot
in interface RKeysReactive
key
- - name of keypublic org.reactivestreams.Publisher<String> getKeysByPattern(String pattern)
RKeysReactive
SCAN
Redis command.
Supported glob-style patterns:
h?llo subscribes to hello, hallo and hxllo
h*llo subscribes to hllo and heeeello
h[ae]llo subscribes to hello and hallo, but not hillogetKeysByPattern
in interface RKeysReactive
pattern
- - match patternpublic org.reactivestreams.Publisher<String> getKeys()
RKeysReactive
SCAN
Redis command.getKeys
in interface RKeysReactive
public org.reactivestreams.Publisher<Collection<String>> findKeysByPattern(String pattern)
RKeysReactive
KEYS
Redis command.
Supported glob-style patterns:
h?llo subscribes to hello, hallo and hxllo
h*llo subscribes to hllo and heeeello
h[ae]llo subscribes to hello and hallo, but not hillofindKeysByPattern
in interface RKeysReactive
pattern
- - match patternpublic org.reactivestreams.Publisher<String> randomKey()
RKeysReactive
RANDOM_KEY
Redis command.randomKey
in interface RKeysReactive
public org.reactivestreams.Publisher<Long> deleteByPattern(String pattern)
RKeysReactive
deleteByPattern
in interface RKeysReactive
pattern
- - match patternpublic org.reactivestreams.Publisher<Long> delete(String... keys)
RKeysReactive
DEL
Redis command.delete
in interface RKeysReactive
keys
- - object namespublic org.reactivestreams.Publisher<Void> flushdb()
RKeysReactive
FLUSHDB
Redis command.flushdb
in interface RKeysReactive
public org.reactivestreams.Publisher<Void> flushall()
RKeysReactive
FLUSHALL
Redis command.flushall
in interface RKeysReactive
public org.reactivestreams.Publisher<Boolean> move(String name, int database)
RKeysReactive
move
in interface RKeysReactive
name
- of objectdatabase
- - Redis database numbertrue
if key was moved else false
public org.reactivestreams.Publisher<Void> migrate(String name, String host, int port, int database, long timeout)
RKeysReactive
migrate
in interface RKeysReactive
name
- of objecthost
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in millisecondspublic org.reactivestreams.Publisher<Void> copy(String name, String host, int port, int database, long timeout)
RKeysReactive
copy
in interface RKeysReactive
name
- of objecthost
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in millisecondspublic org.reactivestreams.Publisher<Boolean> expire(String name, long timeToLive, TimeUnit timeUnit)
RKeysReactive
expire
in interface RKeysReactive
name
- of objecttimeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic org.reactivestreams.Publisher<Boolean> expireAt(String name, long timestamp)
RKeysReactive
expireAt
in interface RKeysReactive
name
- of objecttimestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic org.reactivestreams.Publisher<Boolean> clearExpire(String name)
RKeysReactive
clearExpire
in interface RKeysReactive
name
- of objecttrue
if timeout was removed
false
if object does not exist or does not have an associated timeoutpublic org.reactivestreams.Publisher<Boolean> renamenx(String oldName, String newName)
RKeysReactive
oldName
to newName
only if new key is not existsrenamenx
in interface RKeysReactive
oldName
- - old name of objectnewName
- - new name of objecttrue
if object has been renamed successfully and false
otherwisepublic org.reactivestreams.Publisher<Void> rename(String currentName, String newName)
RKeysReactive
newName
rename
in interface RKeysReactive
currentName
- - current name of objectnewName
- - new name of objectpublic org.reactivestreams.Publisher<Long> remainTimeToLive(String name)
RKeysReactive
remainTimeToLive
in interface RKeysReactive
name
- of keypublic org.reactivestreams.Publisher<Long> touch(String... names)
RKeysReactive
touch
in interface RKeysReactive
names
- of keyspublic org.reactivestreams.Publisher<Long> countExists(String... names)
RKeysReactive
countExists
in interface RKeysReactive
names
- of keyspublic org.reactivestreams.Publisher<RType> getType(String key)
RKeysReactive
getType
in interface RKeysReactive
key
- - name of keypublic org.reactivestreams.Publisher<Long> unlink(String... keys)
RKeysReactive
Requires Redis 4.0+
unlink
in interface RKeysReactive
keys
- of objectspublic org.reactivestreams.Publisher<Long> count()
RKeysReactive
count
in interface RKeysReactive
Copyright © 2014–2018 The Redisson Project. All rights reserved.