Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.redisson.client.protocol.RedisCommands Maven / Gradle / Ivy
Go to download
Easy Redis Java client and Real-Time Data Platform. Valkey compatible. Sync/Async/RxJava3/Reactive API. Client side caching. Over 50 Redis based Java objects and services: JCache API, Apache Tomcat, Hibernate, Spring, Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Bloom filter, Scheduler, RPC
/**
* Copyright (c) 2013-2024 Nikita Koksharov
*
* 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 org.redisson.client.protocol;
import org.redisson.api.*;
import org.redisson.api.search.index.IndexInfo;
import org.redisson.client.codec.Codec;
import org.redisson.client.codec.DoubleCodec;
import org.redisson.client.codec.StringCodec;
import org.redisson.client.handler.State;
import org.redisson.client.protocol.convertor.*;
import org.redisson.client.protocol.decoder.*;
import org.redisson.client.protocol.pubsub.PubSubStatusDecoder;
import org.redisson.cluster.ClusterNodeInfo;
import org.redisson.codec.CompositeCodec;
import org.redisson.misc.RedisURI;
import java.time.Duration;
import java.time.Instant;
import java.util.*;
import java.util.Map.Entry;
import java.util.stream.Collectors;
/**
*
* @author Nikita Koksharov
*
*/
public interface RedisCommands {
RedisStrictCommand DEBUG = new RedisStrictCommand("DEBUG");
RedisStrictCommand GEOADD = new RedisStrictCommand("GEOADD");
RedisStrictCommand GEOADD_BOOLEAN = new RedisStrictCommand<>("GEOADD", new BooleanReplayConvertor());
RedisCommand GEODIST = new RedisCommand("GEODIST", new DoubleReplayConvertor());
RedisCommand> GEORADIUS_RO = new RedisCommand>("GEORADIUS_RO", new ObjectListReplayDecoder());
RedisCommand> GEORADIUSBYMEMBER_RO = new RedisCommand>("GEORADIUSBYMEMBER_RO", new ObjectListReplayDecoder());
RedisCommand> GEOSEARCH = new RedisCommand<>("GEOSEARCH", new ObjectListReplayDecoder<>());
RedisCommand GEORADIUS_STORE = new RedisCommand("GEORADIUS", new Long2MultiDecoder());
RedisCommand GEORADIUSBYMEMBER_STORE = new RedisCommand("GEORADIUSBYMEMBER", new Long2MultiDecoder());
RedisCommand GEOSEARCHSTORE_STORE = new RedisCommand("GEOSEARCHSTORE", new Long2MultiDecoder());
RedisStrictCommand KEYSLOT = new RedisStrictCommand("CLUSTER", "KEYSLOT", new IntegerReplayConvertor());
RedisStrictCommand TYPE = new RedisStrictCommand("TYPE", new TypeConvertor());
RedisStrictCommand BITFIELD_LONG = new RedisStrictCommand<>("BITFIELD", null,
new ListFirstObjectDecoder(), new LongReplayConvertor());
RedisStrictCommand BITFIELD_INT = new RedisStrictCommand<>("BITFIELD", null,
new ListFirstObjectDecoder(), new IntegerReplayConvertor(0));
RedisStrictCommand BITFIELD_BYTE = new RedisStrictCommand<>("BITFIELD", null,
new ListFirstObjectDecoder(), new ByteReplayConvertor());
RedisStrictCommand BITFIELD_SHORT = new RedisStrictCommand<>("BITFIELD", null,
new ListFirstObjectDecoder(), new ShortReplayConvertor());
RedisStrictCommand BITFIELD_VOID = new RedisStrictCommand<>("BITFIELD", new VoidReplayConvertor());
RedisStrictCommand GETBIT = new RedisStrictCommand("GETBIT", new BooleanReplayConvertor());
RedisStrictCommand BITS_SIZE = new RedisStrictCommand("STRLEN", new BitsSizeReplayConvertor());
RedisStrictCommand STRLEN = new RedisStrictCommand("STRLEN");
RedisStrictCommand BITCOUNT = new RedisStrictCommand("BITCOUNT");
RedisStrictCommand BITPOS = new RedisStrictCommand("BITPOS", new IntegerReplayConvertor());
RedisStrictCommand SETBIT_VOID = new RedisStrictCommand("SETBIT", new VoidReplayConvertor());
RedisStrictCommand SETBIT = new RedisStrictCommand("SETBIT", new BooleanReplayConvertor());
RedisStrictCommand BITOP = new RedisStrictCommand("BITOP", new VoidReplayConvertor());
RedisStrictCommand WAIT = new RedisStrictCommand("WAIT", new IntegerReplayConvertor());
RedisCommand> WAITAOF = new RedisCommand("WAITAOF", new ObjectListReplayDecoder(), new IntegerReplayConvertor());
RedisStrictCommand CLIENT_REPLY = new RedisStrictCommand("CLIENT", "REPLY", new VoidReplayConvertor());
RedisStrictCommand ASKING = new RedisStrictCommand("ASKING", new VoidReplayConvertor());
RedisStrictCommand READONLY = new RedisStrictCommand("READONLY", new VoidReplayConvertor());
RedisCommand> ZRANDMEMBER_ENTRIES = new RedisCommand<>("ZRANDMEMBER", new ScoredSortedSetRandomMapDecoder());
RedisCommand> ZRANDMEMBER = new RedisCommand<>("ZRANDMEMBER", new ObjectSetReplayDecoder<>());
RedisCommand ZRANDMEMBER_SINGLE = new RedisCommand<>("ZRANDMEMBER");
RedisStrictCommand> ZDIFF = new RedisStrictCommand<>("ZDIFF", new ObjectListReplayDecoder<>());
RedisCommand> ZUNION = new RedisCommand<>("ZUNION", new ObjectListReplayDecoder<>());
RedisCommand> ZINTER = new RedisCommand<>("ZINTER", new ObjectListReplayDecoder<>());
RedisStrictCommand ZINTERCARD_INT = new RedisStrictCommand<>("ZINTERCARD", new IntegerReplayConvertor());
RedisStrictCommand ZDIFFSTORE_INT = new RedisStrictCommand("ZDIFFSTORE", new IntegerReplayConvertor());
RedisStrictCommand ZUNIONSTORE_INT = new RedisStrictCommand("ZUNIONSTORE", new IntegerReplayConvertor());
RedisStrictCommand ZINTERSTORE_INT = new RedisStrictCommand("ZINTERSTORE", new IntegerReplayConvertor());
RedisCommand ZADD_BOOL = new RedisCommand("ZADD", new BooleanAmountReplayConvertor());
RedisCommand ZADD_NX_BOOL = new RedisCommand("ZADD", new BooleanAmountReplayConvertor());
RedisCommand ZADD_BOOL_RAW = new RedisCommand("ZADD", new BooleanAmountReplayConvertor());
RedisCommand ZADD_RAW = new RedisCommand("ZADD");
RedisStrictCommand ZADD_INT = new RedisStrictCommand("ZADD", new IntegerReplayConvertor());
RedisCommand ZADD = new RedisCommand("ZADD");
RedisStrictCommand ZREM_INT = new RedisStrictCommand<>("ZREM", new IntegerReplayConvertor());
RedisStrictCommand ZREM_LONG = new RedisStrictCommand("ZREM");
RedisCommand ZREM = new RedisCommand("ZREM", new BooleanAmountReplayConvertor());
RedisStrictCommand ZCARD_INT = new RedisStrictCommand("ZCARD", new IntegerReplayConvertor());
RedisStrictCommand ZCARD = new RedisStrictCommand("ZCARD");
RedisStrictCommand ZCOUNT = new RedisStrictCommand("ZCOUNT", new IntegerReplayConvertor());
RedisStrictCommand ZLEXCOUNT = new RedisStrictCommand("ZLEXCOUNT", new IntegerReplayConvertor());
RedisCommand ZSCORE_CONTAINS = new RedisCommand("ZSCORE", new BooleanNotNullReplayConvertor());
RedisStrictCommand ZSCORE = new RedisStrictCommand("ZSCORE", new DoubleReplayConvertor());
RedisStrictCommand ZRANK = new RedisStrictCommand("ZRANK");
RedisCommand ZRANK_INT = new RedisCommand("ZRANK", new IntegerReplayConvertor());
RedisCommand> ZRANK_ENTRY = new RedisCommand<>("ZRANK", new RankedEntryDecoder());
RedisStrictCommand ZREVRANK = new RedisStrictCommand("ZREVRANK");
RedisCommand ZREVRANK_INT = new RedisCommand("ZREVRANK", new IntegerReplayConvertor());
RedisCommand> ZREVRANK_ENTRY = new RedisCommand<>("ZREVRANK", new RankedEntryDecoder());
RedisCommand ZRANGE_SINGLE = new RedisCommand("ZRANGE", new ListFirstObjectDecoder());
RedisCommand ZRANGE_SINGLE_ENTRY = new RedisCommand<>("ZRANGE", new ListFirstObjectDecoder(new ScoredSortedSetReplayDecoder()));
RedisCommand ZRANGE_SINGLE_ENTRY_V2 = new RedisCommand<>("ZRANGE",
new ListMultiDecoder2<>(new ListFirstObjectDecoder(), new ScoredSortedSetReplayDecoderV2()));
RedisStrictCommand ZRANGE_SINGLE_SCORE = new RedisStrictCommand("ZRANGE", new ObjectFirstScoreReplayDecoder());
RedisCommand> ZRANGE = new RedisCommand>("ZRANGE", new ObjectListReplayDecoder());
RedisCommand ZRANGESTORE = new RedisCommand<>("ZRANGESTORE", new IntegerReplayConvertor());
RedisCommand> ZPOPMIN = new RedisCommand>("ZPOPMIN", new ObjectListReplayDecoder());
RedisCommand> ZPOPMAX = new RedisCommand>("ZPOPMAX", new ObjectListReplayDecoder());
RedisCommand> BZMPOP_ENTRIES = new RedisCommand<>("BZMPOP",
new ListMultiDecoder2(
new ObjectDecoder(StringCodec.INSTANCE.getValueDecoder()) {
@Override
public Object decode(List parts, State state) {
for (int i = 0; i < parts.size(); i+= 2) {
List> entries = (List>) parts.get(i + 1);
List map = new ArrayList<>();
for (List entry : entries) {
map.add(new ScoredEntry((Double) entry.get(1), entry.get(0)));
}
return map;
}
return Collections.emptyList();
}
},
new CodecDecoder(),
new CodecDecoder() {
@Override
public Decoder getDecoder(Codec codec, int paramNum, State state, long size) {
if ((paramNum + 1) % 2 == 0) {
return DoubleCodec.INSTANCE.getValueDecoder();
}
return codec.getValueDecoder();
}
}));
RedisCommand>> ZMPOP = new RedisCommand<>("ZMPOP",
new ListMultiDecoder2(
new ObjectDecoder(StringCodec.INSTANCE.getValueDecoder()) {
@Override
public Object decode(List parts, State state) {
Map> result = new HashMap<>();
for (int i = 0; i < parts.size(); i+= 2) {
List> entries = (List>) parts.get(i + 1);
Map map = new HashMap<>(entries.size());
for (List entry : entries) {
map.put(entry.get(0), entry.get(1));
}
result.put((String) parts.get(i), map);
}
return result;
}
},
new CodecDecoder(),
new CodecDecoder() {
@Override
public Decoder getDecoder(Codec codec, int paramNum, State state, long size) {
if ((paramNum + 1) % 2 == 0) {
return DoubleCodec.INSTANCE.getValueDecoder();
}
return codec.getValueDecoder();
}
}));
RedisCommand> ZMPOP_VALUES = new RedisCommand<>("ZMPOP", new ListMultiDecoder2(
new ObjectDecoder(StringCodec.INSTANCE.getValueDecoder()) {
@Override
public Object decode(List parts, State state) {
if (parts.isEmpty()) {
return parts;
}
return parts.get(1);
}
},
new CodecDecoder(),
new ListFirstObjectDecoder() {
@Override
public Decoder getDecoder(Codec codec, int paramNum, State state, long size) {
if ((paramNum + 1) % 2 == 0) {
return DoubleCodec.INSTANCE.getValueDecoder();
}
return codec.getValueDecoder();
}
}));
RedisStrictCommand ZREMRANGEBYRANK = new RedisStrictCommand("ZREMRANGEBYRANK", new IntegerReplayConvertor());
RedisStrictCommand ZREMRANGEBYSCORE = new RedisStrictCommand("ZREMRANGEBYSCORE", new IntegerReplayConvertor());
RedisStrictCommand ZREMRANGEBYLEX = new RedisStrictCommand("ZREMRANGEBYLEX", new IntegerReplayConvertor());
RedisCommand> ZRANGEBYLEX = new RedisCommand>("ZRANGEBYLEX", new ObjectListReplayDecoder());
RedisCommand> ZREVRANGEBYLEX = new RedisCommand>("ZREVRANGEBYLEX", new ObjectListReplayDecoder());
RedisCommand> ZRANGEBYSCORE = new RedisCommand>("ZRANGEBYSCORE", new ObjectSetReplayDecoder());
RedisCommand> ZRANGEBYSCORE_LIST = new RedisCommand>("ZRANGEBYSCORE", new ObjectListReplayDecoder());
RedisCommand> ZREVRANGE = new RedisCommand>("ZREVRANGE", new ObjectListReplayDecoder());
RedisCommand> ZREVRANGEBYSCORE = new RedisCommand>("ZREVRANGEBYSCORE", new ObjectSetReplayDecoder());
RedisCommand>> ZREVRANGE_ENTRY = new RedisCommand("ZREVRANGE", new ScoredSortedSetReplayDecoder());
RedisCommand>> ZREVRANGE_ENTRY_V2 = new RedisCommand("ZREVRANGE",
new ListMultiDecoder2(new CodecDecoder(), new ScoredSortedSetReplayDecoderV2<>()));
RedisCommand>> ZREVRANGEBYSCORE_ENTRY = new RedisCommand("ZREVRANGEBYSCORE", new ScoredSortedSetReplayDecoder());
RedisCommand>> ZREVRANGEBYSCORE_ENTRY_V2 = new RedisCommand("ZREVRANGEBYSCORE",
new ListMultiDecoder2(new CodecDecoder(), new ScoredSortedSetReplayDecoderV2<>()));
RedisCommand>> ZRANGE_ENTRY = new RedisCommand("ZRANGE", new ScoredSortedSetReplayDecoder());
RedisCommand>> ZRANGE_ENTRY_V2 = new RedisCommand("ZRANGE",
new ListMultiDecoder2(new CodecDecoder(), new ScoredSortedSetReplayDecoderV2<>()));
RedisCommand>> ZRANGEBYSCORE_ENTRY = new RedisCommand("ZRANGEBYSCORE", new ScoredSortedSetReplayDecoder());
RedisCommand>> ZRANGEBYSCORE_ENTRY_V2 = new RedisCommand("ZRANGEBYSCORE",
new ListMultiDecoder2(new CodecDecoder(), new ScoredSortedSetReplayDecoderV2<>()));
RedisCommand> ZSCAN = new RedisCommand>("ZSCAN", new ListMultiDecoder2(new ScoredSortedSetScanReplayDecoder(), new ScoredSortedSetScanDecoder()));
RedisCommand> ZSCAN_ENTRY = new RedisCommand>("ZSCAN", new ListMultiDecoder2(new ScoredEntryScanDecoder<>(), new ScoredSortedSetScanDecoder<>()));
RedisStrictCommand ZINCRBY = new RedisStrictCommand("ZINCRBY", new DoubleNullSafeReplayConvertor());
RedisCommand> SCAN = new RedisCommand>("SCAN", new ListMultiDecoder2(new ListScanResultReplayDecoder(), new ObjectListReplayDecoder()));
RedisStrictCommand RANDOM_KEY = new RedisStrictCommand("RANDOMKEY");
RedisCommand PING = new RedisCommand("PING");
RedisStrictCommand PING_BOOL = new RedisStrictCommand("PING", new BooleanNotNullReplayConvertor());
RedisStrictCommand SHUTDOWN = new RedisStrictCommand("SHUTDOWN", new VoidReplayConvertor());
RedisStrictCommand UNWATCH = new RedisStrictCommand("UNWATCH", new VoidReplayConvertor());
RedisStrictCommand WATCH = new RedisStrictCommand("WATCH", new VoidReplayConvertor());
RedisStrictCommand MULTI = new RedisStrictCommand("MULTI", new VoidReplayConvertor());
RedisStrictCommand DISCARD = new RedisStrictCommand("DISCARD", new VoidReplayConvertor());
RedisCommand> EXEC = new RedisCommand>("EXEC", new ObjectListReplayDecoder());
RedisCommand SADD_BOOL = new RedisCommand("SADD", new BooleanAmountReplayConvertor());
RedisCommand SADD = new RedisCommand("SADD", new IntegerReplayConvertor());
RedisCommand> SPOP = new RedisCommand>("SPOP", new ObjectSetReplayDecoder());
RedisCommand SPOP_SINGLE = new RedisCommand("SPOP");
RedisCommand SADD_SINGLE = new RedisCommand("SADD", new BooleanReplayConvertor());
RedisCommand SREM = new RedisCommand<>("SREM", new IntegerReplayConvertor());
RedisCommand SREM_SINGLE = new RedisCommand("SREM", new BooleanAmountReplayConvertor());
RedisCommand SMOVE = new RedisCommand("SMOVE", new BooleanReplayConvertor());
RedisCommand> SMEMBERS = new RedisCommand>("SMEMBERS", new ObjectSetReplayDecoder());
RedisCommand> SRANDMEMBER = new RedisCommand>("SRANDMEMBER", new ObjectSetReplayDecoder());
RedisCommand SRANDMEMBER_SINGLE = new RedisCommand("SRANDMEMBER");
RedisCommand> SSCAN = new RedisCommand>("SSCAN", new ListMultiDecoder2(new ListScanResultReplayDecoder(), new ObjectListReplayDecoder()));
RedisCommand> EVAL_SCAN = new RedisCommand>("EVAL", new ListMultiDecoder2(new ListScanResultReplayDecoder(), new ObjectListReplayDecoder()));
RedisCommand SISMEMBER = new RedisCommand("SISMEMBER", new BooleanReplayConvertor());
RedisStrictCommand SCARD_INT = new RedisStrictCommand("SCARD", new IntegerReplayConvertor());
RedisStrictCommand SINTERCARD_INT = new RedisStrictCommand<>("SINTERCARD", new IntegerReplayConvertor());
RedisStrictCommand SCARD = new RedisStrictCommand("SCARD");
RedisStrictCommand SUNIONSTORE_INT = new RedisStrictCommand("SUNIONSTORE", new IntegerReplayConvertor());
RedisStrictCommand SDIFFSTORE_INT = new RedisStrictCommand("SDIFFSTORE", new IntegerReplayConvertor());
RedisStrictCommand SINTERSTORE_INT = new RedisStrictCommand("SINTERSTORE", new IntegerReplayConvertor());
RedisStrictCommand SUNIONSTORE = new RedisStrictCommand("SUNIONSTORE");
RedisStrictCommand SINTERSTORE = new RedisStrictCommand("SINTERSTORE");
RedisStrictCommand SDIFFSTORE = new RedisStrictCommand