Class ReactiveKeyCommandsImpl<K>
- java.lang.Object
-
- io.quarkus.redis.runtime.datasource.AbstractRedisCommands
-
- io.quarkus.redis.runtime.datasource.AbstractKeyCommands<K>
-
- io.quarkus.redis.runtime.datasource.ReactiveKeyCommandsImpl<K>
-
- All Implemented Interfaces:
ReactiveKeyCommands<K>
,ReactiveRedisCommands
public class ReactiveKeyCommandsImpl<K> extends AbstractKeyCommands<K> implements ReactiveKeyCommands<K>
-
-
Field Summary
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractKeyCommands
typeOfKey
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommands
marshaller, redis
-
-
Constructor Summary
Constructors Constructor Description ReactiveKeyCommandsImpl(ReactiveRedisDataSourceImpl redis, Type k)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Boolean>
copy(K source, K destination)
Execute the command COPY.io.smallrye.mutiny.Uni<Boolean>
copy(K source, K destination, CopyArgs copyArgs)
Execute the command COPY.io.smallrye.mutiny.Uni<Integer>
del(K... keys)
Execute the command DEL.io.smallrye.mutiny.Uni<String>
dump(K key)
Execute the command DUMP.io.smallrye.mutiny.Uni<Boolean>
exists(K key)
Execute the command EXISTS.io.smallrye.mutiny.Uni<Integer>
exists(K... keys)
Execute the command EXISTS.io.smallrye.mutiny.Uni<Boolean>
expire(K key, long seconds)
Execute the command EXPIRE.io.smallrye.mutiny.Uni<Boolean>
expire(K key, long seconds, ExpireArgs expireArgs)
Execute the command EXPIRE.io.smallrye.mutiny.Uni<Boolean>
expire(K key, Duration duration)
Execute the command EXPIRE.io.smallrye.mutiny.Uni<Boolean>
expire(K key, Duration duration, ExpireArgs expireArgs)
Execute the command EXPIRE.io.smallrye.mutiny.Uni<Boolean>
expireat(K key, long timestamp)
Execute the command EXPIREAT.io.smallrye.mutiny.Uni<Boolean>
expireat(K key, long timestamp, ExpireArgs expireArgs)
Execute the command EXPIREAT.io.smallrye.mutiny.Uni<Boolean>
expireat(K key, Instant timestamp)
Execute the command EXPIREAT.io.smallrye.mutiny.Uni<Boolean>
expireat(K key, Instant timestamp, ExpireArgs expireArgs)
Execute the command EXPIREAT.io.smallrye.mutiny.Uni<Long>
expiretime(K key)
Execute the command EXPIRETIME.ReactiveRedisDataSource
getDataSource()
io.smallrye.mutiny.Uni<List<K>>
keys(String pattern)
Execute the command KEYS.io.smallrye.mutiny.Uni<Boolean>
move(K key, long db)
Execute the command MOVE.io.smallrye.mutiny.Uni<Boolean>
persist(K key)
Execute the command PERSIST.io.smallrye.mutiny.Uni<Boolean>
pexpire(K key, long ms)
Execute the command PEXPIRE.io.smallrye.mutiny.Uni<Boolean>
pexpire(K key, long milliseconds, ExpireArgs expireArgs)
Execute the command PEXPIRE.io.smallrye.mutiny.Uni<Boolean>
pexpire(K key, Duration duration)
Execute the command PEXPIRE.io.smallrye.mutiny.Uni<Boolean>
pexpire(K key, Duration duration, ExpireArgs expireArgs)
Execute the command PEXPIRE.io.smallrye.mutiny.Uni<Boolean>
pexpireat(K key, long timestamp)
Execute the command PEXPIREAT.io.smallrye.mutiny.Uni<Boolean>
pexpireat(K key, long timestamp, ExpireArgs expireArgs)
Execute the command PEXPIREAT.io.smallrye.mutiny.Uni<Boolean>
pexpireat(K key, Instant timestamp)
Execute the command PEXPIREAT.io.smallrye.mutiny.Uni<Boolean>
pexpireat(K key, Instant timestamp, ExpireArgs expireArgs)
Execute the command PEXPIREAT.io.smallrye.mutiny.Uni<Long>
pexpiretime(K key)
Execute the command PEXPIRETIME.io.smallrye.mutiny.Uni<Long>
pttl(K key)
Execute the command PTTL.io.smallrye.mutiny.Uni<K>
randomkey()
Execute the command RANDOMKEY.io.smallrye.mutiny.Uni<Void>
rename(K key, K newKey)
Execute the command RENAME.io.smallrye.mutiny.Uni<Boolean>
renamenx(K key, K newKey)
Execute the command RENAMENX.ReactiveKeyScanCursor<K>
scan()
Execute the command SCAN.ReactiveKeyScanCursor<K>
scan(KeyScanArgs args)
Execute the command SCAN.io.smallrye.mutiny.Uni<Integer>
touch(K... keys)
Execute the command TOUCH.io.smallrye.mutiny.Uni<Long>
ttl(K key)
Execute the command TTL.io.smallrye.mutiny.Uni<RedisValueType>
type(K key)
Execute the command TYPE.io.smallrye.mutiny.Uni<Integer>
unlink(K... keys)
Execute the command UNLINK.-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractKeyCommands
_copy, _copy, _del, _dump, _exists, _exists, _expire, _expire, _expire, _expire, _expireat, _expireat, _expireat, _expireat, _expiretime, _keys, _move, _persist, _pexpire, _pexpire, _pexpire, _pexpire, _pexpireat, _pexpireat, _pexpireat, _pexpireat, _pexpiretime, _pttl, _randomkey, _rename, _renamenx, _touch, _ttl, _type, _unlink, decodeExpireResponse, decodeK, decodeKeys, decodeRedisType, decodeStringOrNull
-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommands
execute, isMap
-
-
-
-
Constructor Detail
-
ReactiveKeyCommandsImpl
public ReactiveKeyCommandsImpl(ReactiveRedisDataSourceImpl redis, Type k)
-
-
Method Detail
-
getDataSource
public ReactiveRedisDataSource getDataSource()
- Specified by:
getDataSource
in interfaceReactiveRedisCommands
- Returns:
- the data source.
-
copy
public io.smallrye.mutiny.Uni<Boolean> copy(K source, K destination)
Description copied from interface:ReactiveKeyCommands
Execute the command COPY. Summary: Copy a key Group: generic Requires Redis 6.2.0- Specified by:
copy
in interfaceReactiveKeyCommands<K>
- Parameters:
source
- the keydestination
- the key- Returns:
true
source was copied.false
source was not copied.
-
copy
public io.smallrye.mutiny.Uni<Boolean> copy(K source, K destination, CopyArgs copyArgs)
Description copied from interface:ReactiveKeyCommands
Execute the command COPY. Summary: Copy a key Group: generic Requires Redis 6.2.0- Specified by:
copy
in interfaceReactiveKeyCommands<K>
- Parameters:
source
- the keydestination
- the keycopyArgs
- the additional arguments- Returns:
true
source was copied.false
source was not copied.
-
del
public io.smallrye.mutiny.Uni<Integer> del(K... keys)
Description copied from interface:ReactiveKeyCommands
Execute the command DEL. Summary: Delete one or multiple keys Group: generic Requires Redis 1.0.0- Specified by:
del
in interfaceReactiveKeyCommands<K>
- Parameters:
keys
- the keys.- Returns:
- The number of keys that were removed.
-
dump
public io.smallrye.mutiny.Uni<String> dump(K key)
Description copied from interface:ReactiveKeyCommands
Execute the command DUMP. Summary: Return a serialized version of the value stored at the specified key. Group: generic Requires Redis 2.6.0- Specified by:
dump
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the key- Returns:
- the serialized value.
-
exists
public io.smallrye.mutiny.Uni<Boolean> exists(K key)
Description copied from interface:ReactiveKeyCommands
Execute the command EXISTS. Summary: Determine if a key exists Group: generic Requires Redis 1.0.0- Specified by:
exists
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the key to check- Returns:
true
if the key exists,false
otherwise
-
exists
public io.smallrye.mutiny.Uni<Integer> exists(K... keys)
Description copied from interface:ReactiveKeyCommands
Execute the command EXISTS. Summary: Determine if a key exists Group: generic Requires Redis 1.0.0- Specified by:
exists
in interfaceReactiveKeyCommands<K>
- Parameters:
keys
- the keys to check- Returns:
- the number of keys that exist from those specified as arguments.
-
expire
public io.smallrye.mutiny.Uni<Boolean> expire(K key, long seconds, ExpireArgs expireArgs)
Description copied from interface:ReactiveKeyCommands
Execute the command EXPIRE. Summary: Set a key's time to live in seconds Group: generic Requires Redis 1.0.0- Specified by:
expire
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keyseconds
- the new TTLexpireArgs
- theEXPIRE
command extra-arguments- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
-
expire
public io.smallrye.mutiny.Uni<Boolean> expire(K key, Duration duration, ExpireArgs expireArgs)
Description copied from interface:ReactiveKeyCommands
Execute the command EXPIRE. Summary: Set a key's time to live in seconds Group: generic Requires Redis 1.0.0- Specified by:
expire
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keyduration
- the new TTLexpireArgs
- theEXPIRE
command extra-arguments- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
-
expire
public io.smallrye.mutiny.Uni<Boolean> expire(K key, long seconds)
Description copied from interface:ReactiveKeyCommands
Execute the command EXPIRE. Summary: Set a key's time to live in seconds Group: generic Requires Redis 1.0.0- Specified by:
expire
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keyseconds
- the new TTL- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist.
-
expire
public io.smallrye.mutiny.Uni<Boolean> expire(K key, Duration duration)
Description copied from interface:ReactiveKeyCommands
Execute the command EXPIRE. Summary: Set a key's time to live in seconds Group: generic Requires Redis 1.0.0- Specified by:
expire
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keyduration
- the new TTL- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist.
-
expireat
public io.smallrye.mutiny.Uni<Boolean> expireat(K key, long timestamp)
Description copied from interface:ReactiveKeyCommands
Execute the command EXPIREAT. Summary: Set the expiration for a key as a UNIX timestamp Group: generic Requires Redis 1.2.0- Specified by:
expireat
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keytimestamp
- the timestamp- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist.
-
expireat
public io.smallrye.mutiny.Uni<Boolean> expireat(K key, Instant timestamp)
Description copied from interface:ReactiveKeyCommands
Execute the command EXPIREAT. Summary: Set the expiration for a key as a UNIX timestamp Group: generic Requires Redis 1.2.0- Specified by:
expireat
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keytimestamp
- the timestamp- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist.
-
expireat
public io.smallrye.mutiny.Uni<Boolean> expireat(K key, long timestamp, ExpireArgs expireArgs)
Description copied from interface:ReactiveKeyCommands
Execute the command EXPIREAT. Summary: Set the expiration for a key as a UNIX timestamp Group: generic Requires Redis 1.2.0- Specified by:
expireat
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keytimestamp
- the timestampexpireArgs
- theEXPIREAT
command extra-arguments- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
-
expireat
public io.smallrye.mutiny.Uni<Boolean> expireat(K key, Instant timestamp, ExpireArgs expireArgs)
Description copied from interface:ReactiveKeyCommands
Execute the command EXPIREAT. Summary: Set the expiration for a key as a UNIX timestamp Group: generic Requires Redis 1.2.0- Specified by:
expireat
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keytimestamp
- the timestampexpireArgs
- theEXPIREAT
command extra-arguments- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
-
expiretime
public io.smallrye.mutiny.Uni<Long> expiretime(K key)
Description copied from interface:ReactiveKeyCommands
Execute the command EXPIRETIME. Summary: Get the expiration Unix timestamp for a key Group: generic Requires Redis 7.0.0- Specified by:
expiretime
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the key- Returns:
- the expiration Unix timestamp in seconds,
-1
if the key exists but has no associated expire. The Uni produces aRedisKeyNotFoundException
if the key does not exist.
-
keys
public io.smallrye.mutiny.Uni<List<K>> keys(String pattern)
Description copied from interface:ReactiveKeyCommands
Execute the command KEYS. Summary: Find all keys matching the given pattern Group: generic Requires Redis 1.0.0- Specified by:
keys
in interfaceReactiveKeyCommands<K>
- Parameters:
pattern
- the glob-style pattern- Returns:
- the list of keys matching pattern.
-
move
public io.smallrye.mutiny.Uni<Boolean> move(K key, long db)
Description copied from interface:ReactiveKeyCommands
Execute the command MOVE. Summary: Move a key to another database Group: generic Requires Redis 1.0.0- Specified by:
move
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the key- Returns:
true
key was moved.false
key was not moved.
-
persist
public io.smallrye.mutiny.Uni<Boolean> persist(K key)
Description copied from interface:ReactiveKeyCommands
Execute the command PERSIST. Summary: Remove the expiration from a key Group: generic Requires Redis 2.2.0- Specified by:
persist
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the key- Returns:
true
the timeout was removed.false
key does not exist or does not have an associated timeout.
-
pexpire
public io.smallrye.mutiny.Uni<Boolean> pexpire(K key, long milliseconds, ExpireArgs expireArgs)
Description copied from interface:ReactiveKeyCommands
Execute the command PEXPIRE. Summary: Set a key's time to live in milliseconds Group: generic Requires Redis 2.6.0- Specified by:
pexpire
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keymilliseconds
- the new TTLexpireArgs
- thePEXPIRE
command extra-arguments- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist.
-
pexpire
public io.smallrye.mutiny.Uni<Boolean> pexpire(K key, Duration duration, ExpireArgs expireArgs)
Description copied from interface:ReactiveKeyCommands
Execute the command PEXPIRE. Summary: Set a key's time to live in milliseconds Group: generic Requires Redis 2.6.0- Specified by:
pexpire
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keyduration
- the new TTLexpireArgs
- thePEXPIRE
command extra-arguments- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
-
pexpire
public io.smallrye.mutiny.Uni<Boolean> pexpire(K key, long ms)
Description copied from interface:ReactiveKeyCommands
Execute the command PEXPIRE. Summary: Set a key's time to live in milliseconds Group: generic Requires Redis 2.6.0- Specified by:
pexpire
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keyms
- the new TTL- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist.
-
pexpire
public io.smallrye.mutiny.Uni<Boolean> pexpire(K key, Duration duration)
Description copied from interface:ReactiveKeyCommands
Execute the command PEXPIRE. Summary: Set a key's time to live in milliseconds Group: generic Requires Redis 2.6.0- Specified by:
pexpire
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keyduration
- the new TTL- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist.
-
pexpireat
public io.smallrye.mutiny.Uni<Boolean> pexpireat(K key, long timestamp)
Description copied from interface:ReactiveKeyCommands
Execute the command PEXPIREAT. Summary: Set the expiration for a key as a UNIX timestamp Group: generic Requires Redis 2.6.0- Specified by:
pexpireat
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keytimestamp
- the timestamp- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist.
-
pexpireat
public io.smallrye.mutiny.Uni<Boolean> pexpireat(K key, Instant timestamp)
Description copied from interface:ReactiveKeyCommands
Execute the command PEXPIREAT. Summary: Set the expiration for a key as a UNIX timestamp Group: generic Requires Redis 2.6.0- Specified by:
pexpireat
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keytimestamp
- the timestamp- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist.
-
pexpireat
public io.smallrye.mutiny.Uni<Boolean> pexpireat(K key, long timestamp, ExpireArgs expireArgs)
Description copied from interface:ReactiveKeyCommands
Execute the command PEXPIREAT. Summary: Set the expiration for a key as a UNIX timestamp Group: generic Requires Redis 2.6.0- Specified by:
pexpireat
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keytimestamp
- the timestampexpireArgs
- theEXPIREAT
command extra-arguments- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
-
pexpireat
public io.smallrye.mutiny.Uni<Boolean> pexpireat(K key, Instant timestamp, ExpireArgs expireArgs)
Description copied from interface:ReactiveKeyCommands
Execute the command PEXPIREAT. Summary: Set the expiration for a key as a UNIX timestamp Group: generic Requires Redis 2.6.0- Specified by:
pexpireat
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keytimestamp
- the timestampexpireArgs
- theEXPIREAT
command extra-arguments- Returns:
true
the timeout was set.false
the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
-
pexpiretime
public io.smallrye.mutiny.Uni<Long> pexpiretime(K key)
Description copied from interface:ReactiveKeyCommands
Execute the command PEXPIRETIME. Summary: Get the expiration Unix timestamp for a key Group: generic Requires Redis 2.6.0- Specified by:
pexpiretime
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the key- Returns:
- the expiration Unix timestamp in milliseconds,
-1
if the key exists but has no associated expire. The Uni produces aRedisKeyNotFoundException
if the key does not exist.
-
pttl
public io.smallrye.mutiny.Uni<Long> pttl(K key)
Description copied from interface:ReactiveKeyCommands
Execute the command PTTL. Summary: Get the time to live for a key in milliseconds Group: generic Requires Redis 2.6.0- Specified by:
pttl
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the key- Returns:
- TTL in milliseconds,
-1
if the key exists but has no associated expire. The Uni produces aRedisKeyNotFoundException
if the key does not exist.
-
randomkey
public io.smallrye.mutiny.Uni<K> randomkey()
Description copied from interface:ReactiveKeyCommands
Execute the command RANDOMKEY. Summary: Return a random key from the keyspace Group: generic Requires Redis 1.0.0- Specified by:
randomkey
in interfaceReactiveKeyCommands<K>
- Returns:
- the random key, or
null
when the database is empty.
-
rename
public io.smallrye.mutiny.Uni<Void> rename(K key, K newKey)
Description copied from interface:ReactiveKeyCommands
Execute the command RENAME. Summary: Rename a key Group: generic Requires Redis 1.0.0- Specified by:
rename
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keynewKey
- the new key- Returns:
- a Uni completed with
null
when the operation completes successfully. Emits a failure is something wrong happens.
-
renamenx
public io.smallrye.mutiny.Uni<Boolean> renamenx(K key, K newKey)
Description copied from interface:ReactiveKeyCommands
Execute the command RENAMENX. Summary: Rename a key, only if the new key does not exist Group: generic Requires Redis 1.0.0- Specified by:
renamenx
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the keynewKey
- the new key- Returns:
true
ifkey
was renamed tonewkey
.false
ifnewkey
already exists.
-
scan
public ReactiveKeyScanCursor<K> scan()
Description copied from interface:ReactiveKeyCommands
Execute the command SCAN. Summary: Incrementally iterate the keys space Group: generic Requires Redis 2.8.0- Specified by:
scan
in interfaceReactiveKeyCommands<K>
- Returns:
- the cursor.
-
scan
public ReactiveKeyScanCursor<K> scan(KeyScanArgs args)
Description copied from interface:ReactiveKeyCommands
Execute the command SCAN. Summary: Incrementally iterate the keys space Group: generic Requires Redis 2.8.0- Specified by:
scan
in interfaceReactiveKeyCommands<K>
- Parameters:
args
- the extra arguments- Returns:
- the cursor.
-
touch
public io.smallrye.mutiny.Uni<Integer> touch(K... keys)
Description copied from interface:ReactiveKeyCommands
Execute the command TOUCH. Summary: Alters the last access time of a key(s). Returns the number of existing keys specified. Group: generic Requires Redis 3.2.1- Specified by:
touch
in interfaceReactiveKeyCommands<K>
- Parameters:
keys
- the keys- Returns:
- The number of keys that were touched.
-
ttl
public io.smallrye.mutiny.Uni<Long> ttl(K key)
Description copied from interface:ReactiveKeyCommands
Execute the command TTL. Summary: Get the time to live for a key in seconds Group: generic Requires Redis 1.0.0- Specified by:
ttl
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the key- Returns:
- TTL in seconds,
-1
if the key exists but has no associated expire. The Uni produces aRedisKeyNotFoundException
if the key does not exist
-
type
public io.smallrye.mutiny.Uni<RedisValueType> type(K key)
Description copied from interface:ReactiveKeyCommands
Execute the command TYPE. Summary: Determine the type stored at key Group: generic Requires Redis 1.0.0- Specified by:
type
in interfaceReactiveKeyCommands<K>
- Parameters:
key
- the key- Returns:
- type of key, or
NONE
when key does not exist.
-
unlink
public io.smallrye.mutiny.Uni<Integer> unlink(K... keys)
Description copied from interface:ReactiveKeyCommands
Execute the command UNLINK. Summary: Delete a key asynchronously in another thread. Otherwise, it is just asDEL
, but non-blocking. Group: generic Requires Redis 4.0.0- Specified by:
unlink
in interfaceReactiveKeyCommands<K>
- Parameters:
keys
- the keys- Returns:
- The number of keys that were unlinked.
-
-