
com.lambdaworks.redis.api.reactive.RedisKeyReactiveCommands Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lettuce Show documentation
Show all versions of lettuce Show documentation
Advanced and thread-safe Java Redis client for synchronous, asynchronous, and
reactive usage. Supports Cluster, Sentinel, Pipelining, Auto-Reconnect, Codecs
and much more.
The newest version!
/*
* Copyright 2011-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.lambdaworks.redis.api.reactive;
import java.util.Date;
import java.util.List;
import com.lambdaworks.redis.Value;
import com.lambdaworks.redis.KeyScanCursor;
import com.lambdaworks.redis.MigrateArgs;
import com.lambdaworks.redis.ScanArgs;
import com.lambdaworks.redis.ScanCursor;
import com.lambdaworks.redis.SortArgs;
import com.lambdaworks.redis.StreamScanCursor;
import com.lambdaworks.redis.output.KeyStreamingChannel;
import com.lambdaworks.redis.output.ValueStreamingChannel;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* Reactive executed commands for Keys (Key manipulation/querying).
*
* @param Key type.
* @param Value type.
* @author Mark Paluch
* @since 4.0
* @generated by com.lambdaworks.apigenerator.CreateReactiveApi
*/
public interface RedisKeyReactiveCommands {
/**
* Delete one or more keys.
*
* @param keys the keys
* @return Long integer-reply The number of keys that were removed.
*/
Mono del(K... keys);
/**
* Unlink one or more keys (non blocking DEL).
*
* @param keys the keys
* @return Long integer-reply The number of keys that were removed.
*/
Mono unlink(K... keys);
/**
* Return a serialized version of the value stored at the specified key.
*
* @param key the key
* @return byte[] bulk-string-reply the serialized value.
*/
Mono dump(K key);
/**
* Determine how many keys exist.
*
* @param keys the keys
* @return Long integer-reply specifically: Number of existing keys
*/
Mono exists(K... keys);
/**
* Set a key's time to live in seconds.
*
* @param key the key
* @param seconds the seconds type: long
* @return Boolean integer-reply specifically:
*
* {@literal true} if the timeout was set. {@literal false} if {@code key} does not exist or the timeout could not
* be set.
*/
Mono expire(K key, long seconds);
/**
* Set the expiration for a key as a UNIX timestamp.
*
* @param key the key
* @param timestamp the timestamp type: posix time
* @return Boolean integer-reply specifically:
*
* {@literal true} if the timeout was set. {@literal false} if {@code key} does not exist or the timeout could not
* be set (see: {@code EXPIRE}).
*/
Mono expireat(K key, Date timestamp);
/**
* Set the expiration for a key as a UNIX timestamp.
*
* @param key the key
* @param timestamp the timestamp type: posix time
* @return Boolean integer-reply specifically:
*
* {@literal true} if the timeout was set. {@literal false} if {@code key} does not exist or the timeout could not
* be set (see: {@code EXPIRE}).
*/
Mono expireat(K key, long timestamp);
/**
* Find all keys matching the given pattern.
*
* @param pattern the pattern type: patternkey (pattern)
* @return K array-reply list of keys matching {@code pattern}.
*/
Flux keys(K pattern);
/**
* Find all keys matching the given pattern.
*
* @param channel the channel
* @param pattern the pattern
* @return Long array-reply list of keys matching {@code pattern}.
*/
Mono keys(KeyStreamingChannel channel, K pattern);
/**
* Atomically transfer a key from a Redis instance to another one.
*
* @param host the host
* @param port the port
* @param key the key
* @param db the database
* @param timeout the timeout in milliseconds
* @return String simple-string-reply The command returns OK on success.
*/
Mono migrate(String host, int port, K key, int db, long timeout);
/**
* Atomically transfer one or more keys from a Redis instance to another one.
*
* @param host the host
* @param port the port
* @param db the database
* @param timeout the timeout in milliseconds
* @param migrateArgs migrate args that allow to configure further options
* @return String simple-string-reply The command returns OK on success.
*/
Mono migrate(String host, int port, int db, long timeout, MigrateArgs migrateArgs);
/**
* Move a key to another database.
*
* @param key the key
* @param db the db type: long
* @return Boolean integer-reply specifically:
*/
Mono move(K key, int db);
/**
* returns the kind of internal representation used in order to store the value associated with a key.
*
* @param key the key
* @return String
*/
Mono objectEncoding(K key);
/**
* returns the number of seconds since the object stored at the specified key is idle (not requested by read or write
* operations).
*
* @param key the key
* @return number of seconds since the object stored at the specified key is idle.
*/
Mono objectIdletime(K key);
/**
* returns the number of references of the value associated with the specified key.
*
* @param key the key
* @return Long
*/
Mono objectRefcount(K key);
/**
* Remove the expiration from a key.
*
* @param key the key
* @return Boolean integer-reply specifically:
*
* {@literal true} if the timeout was removed. {@literal false} if {@code key} does not exist or does not have an
* associated timeout.
*/
Mono persist(K key);
/**
* Set a key's time to live in milliseconds.
*
* @param key the key
* @param milliseconds the milliseconds type: long
* @return integer-reply, specifically:
*
* {@literal true} if the timeout was set. {@literal false} if {@code key} does not exist or the timeout could not
* be set.
*/
Mono pexpire(K key, long milliseconds);
/**
* Set the expiration for a key as a UNIX timestamp specified in milliseconds.
*
* @param key the key
* @param timestamp the milliseconds-timestamp type: posix time
* @return Boolean integer-reply specifically:
*
* {@literal true} if the timeout was set. {@literal false} if {@code key} does not exist or the timeout could not
* be set (see: {@code EXPIRE}).
*/
Mono pexpireat(K key, Date timestamp);
/**
* Set the expiration for a key as a UNIX timestamp specified in milliseconds.
*
* @param key the key
* @param timestamp the milliseconds-timestamp type: posix time
* @return Boolean integer-reply specifically:
*
* {@literal true} if the timeout was set. {@literal false} if {@code key} does not exist or the timeout could not
* be set (see: {@code EXPIRE}).
*/
Mono pexpireat(K key, long timestamp);
/**
* Get the time to live for a key in milliseconds.
*
* @param key the key
* @return Long integer-reply TTL in milliseconds, or a negative value in order to signal an error (see the description
* above).
*/
Mono pttl(K key);
/**
* Return a random key from the keyspace.
*
* @return V bulk-string-reply the random key, or {@literal null} when the database is empty.
*/
Mono randomkey();
/**
* Rename a key.
*
* @param key the key
* @param newKey the newkey type: key
* @return String simple-string-reply
*/
Mono rename(K key, K newKey);
/**
* Rename a key, only if the new key does not exist.
*
* @param key the key
* @param newKey the newkey type: key
* @return Boolean integer-reply specifically:
*
* {@literal true} if {@code key} was renamed to {@code newkey}. {@literal false} if {@code newkey} already exists.
*/
Mono renamenx(K key, K newKey);
/**
* Create a key using the provided serialized value, previously obtained using DUMP.
*
* @param key the key
* @param ttl the ttl type: long
* @param value the serialized-value type: string
* @return String simple-string-reply The command returns OK on success.
*/
Mono restore(K key, long ttl, byte[] value);
/**
* Sort the elements in a list, set or sorted set.
*
* @param key the key
* @return V array-reply list of sorted elements.
*/
Flux sort(K key);
/**
* Sort the elements in a list, set or sorted set.
*
* @param channel streaming channel that receives a call for every value
* @param key the key
* @return Long number of values.
*/
Mono sort(ValueStreamingChannel channel, K key);
/**
* Sort the elements in a list, set or sorted set.
*
* @param key the key
* @param sortArgs sort arguments
* @return V array-reply list of sorted elements.
*/
Flux sort(K key, SortArgs sortArgs);
/**
* Sort the elements in a list, set or sorted set.
*
* @param channel streaming channel that receives a call for every value
* @param key the key
* @param sortArgs sort arguments
* @return Long number of values.
*/
Mono sort(ValueStreamingChannel channel, K key, SortArgs sortArgs);
/**
* Sort the elements in a list, set or sorted set.
*
* @param key the key
* @param sortArgs sort arguments
* @param destination the destination key to store sort results
* @return Long number of values.
*/
Mono sortStore(K key, SortArgs sortArgs, K destination);
/**
* Touch one or more keys. Touch sets the last accessed time for a key. Non-exsitent keys wont get created.
*
* @param keys the keys
* @return Long integer-reply the number of found keys.
*/
Mono touch(K... keys);
/**
* Get the time to live for a key.
*
* @param key the key
* @return Long integer-reply TTL in seconds, or a negative value in order to signal an error (see the description above).
*/
Mono ttl(K key);
/**
* Determine the type stored at key.
*
* @param key the key
* @return String simple-string-reply type of {@code key}, or {@code none} when {@code key} does not exist.
*/
Mono type(K key);
/**
* Incrementally iterate the keys space.
*
* @return KeyScanCursor<K> scan cursor.
*/
Mono> scan();
/**
* Incrementally iterate the keys space.
*
* @param scanArgs scan arguments
* @return KeyScanCursor<K> scan cursor.
*/
Mono> scan(ScanArgs scanArgs);
/**
* Incrementally iterate the keys space.
*
* @param scanCursor cursor to resume from a previous scan, must not be {@literal null}
* @param scanArgs scan arguments
* @return KeyScanCursor<K> scan cursor.
*/
Mono> scan(ScanCursor scanCursor, ScanArgs scanArgs);
/**
* Incrementally iterate the keys space.
*
* @param scanCursor cursor to resume from a previous scan, must not be {@literal null}
* @return KeyScanCursor<K> scan cursor.
*/
Mono> scan(ScanCursor scanCursor);
/**
* Incrementally iterate the keys space.
*
* @param channel streaming channel that receives a call for every key
* @return StreamScanCursor scan cursor.
*/
Mono scan(KeyStreamingChannel channel);
/**
* Incrementally iterate the keys space.
*
* @param channel streaming channel that receives a call for every key
* @param scanArgs scan arguments
* @return StreamScanCursor scan cursor.
*/
Mono scan(KeyStreamingChannel channel, ScanArgs scanArgs);
/**
* Incrementally iterate the keys space.
*
* @param channel streaming channel that receives a call for every key
* @param scanCursor cursor to resume from a previous scan, must not be {@literal null}
* @param scanArgs scan arguments
* @return StreamScanCursor scan cursor.
*/
Mono scan(KeyStreamingChannel channel, ScanCursor scanCursor, ScanArgs scanArgs);
/**
* Incrementally iterate the keys space.
*
* @param channel streaming channel that receives a call for every key
* @param scanCursor cursor to resume from a previous scan, must not be {@literal null}
* @return StreamScanCursor scan cursor.
*/
Mono scan(KeyStreamingChannel channel, ScanCursor scanCursor);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy