redis.clients.jedis.PipeliningBase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jedis_preview Show documentation
Show all versions of jedis_preview Show documentation
Jedis is a blazingly small and sane Redis java client.
The newest version!
package redis.clients.jedis;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.json.JSONArray;
import redis.clients.jedis.args.*;
import redis.clients.jedis.bloom.*;
import redis.clients.jedis.commands.PipelineBinaryCommands;
import redis.clients.jedis.commands.PipelineCommands;
import redis.clients.jedis.commands.ProtocolCommand;
import redis.clients.jedis.commands.RedisModulePipelineCommands;
import redis.clients.jedis.graph.GraphCommandObjects;
import redis.clients.jedis.graph.ResultSet;
import redis.clients.jedis.json.JsonSetParams;
import redis.clients.jedis.json.Path;
import redis.clients.jedis.json.Path2;
import redis.clients.jedis.json.JsonObjectMapper;
import redis.clients.jedis.params.*;
import redis.clients.jedis.resps.*;
import redis.clients.jedis.search.*;
import redis.clients.jedis.search.aggr.AggregationBuilder;
import redis.clients.jedis.search.aggr.AggregationResult;
import redis.clients.jedis.search.schemafields.SchemaField;
import redis.clients.jedis.timeseries.*;
import redis.clients.jedis.util.KeyValue;
public abstract class PipeliningBase
implements PipelineCommands, PipelineBinaryCommands, RedisModulePipelineCommands {
protected final CommandObjects commandObjects;
private GraphCommandObjects graphCommandObjects;
protected PipeliningBase(CommandObjects commandObjects) {
this.commandObjects = commandObjects;
}
/**
* Sub-classes must call this method, if graph commands are going to be used.
*/
protected final void setGraphCommands(GraphCommandObjects graphCommandObjects) {
this.graphCommandObjects = graphCommandObjects;
}
protected abstract Response appendCommand(CommandObject commandObject);
@Override
public Response exists(String key) {
return appendCommand(commandObjects.exists(key));
}
@Override
public Response exists(String... keys) {
return appendCommand(commandObjects.exists(keys));
}
@Override
public Response persist(String key) {
return appendCommand(commandObjects.persist(key));
}
@Override
public Response type(String key) {
return appendCommand(commandObjects.type(key));
}
@Override
public Response dump(String key) {
return appendCommand(commandObjects.dump(key));
}
@Override
public Response restore(String key, long ttl, byte[] serializedValue) {
return appendCommand(commandObjects.restore(key, ttl, serializedValue));
}
@Override
public Response restore(String key, long ttl, byte[] serializedValue, RestoreParams params) {
return appendCommand(commandObjects.restore(key, ttl, serializedValue, params));
}
@Override
public Response expire(String key, long seconds) {
return appendCommand(commandObjects.expire(key, seconds));
}
@Override
public Response expire(String key, long seconds, ExpiryOption expiryOption) {
return appendCommand(commandObjects.expire(key, seconds, expiryOption));
}
@Override
public Response pexpire(String key, long milliseconds) {
return appendCommand(commandObjects.pexpire(key, milliseconds));
}
@Override
public Response pexpire(String key, long milliseconds, ExpiryOption expiryOption) {
return appendCommand(commandObjects.pexpire(key, milliseconds, expiryOption));
}
@Override
public Response expireTime(String key) {
return appendCommand(commandObjects.expireTime(key));
}
@Override
public Response pexpireTime(String key) {
return appendCommand(commandObjects.pexpireTime(key));
}
@Override
public Response expireAt(String key, long unixTime) {
return appendCommand(commandObjects.expireAt(key, unixTime));
}
@Override
public Response expireAt(String key, long unixTime, ExpiryOption expiryOption) {
return appendCommand(commandObjects.expireAt(key, unixTime, expiryOption));
}
@Override
public Response pexpireAt(String key, long millisecondsTimestamp) {
return appendCommand(commandObjects.pexpireAt(key, millisecondsTimestamp));
}
@Override
public Response pexpireAt(String key, long millisecondsTimestamp, ExpiryOption expiryOption) {
return appendCommand(commandObjects.pexpireAt(key, millisecondsTimestamp, expiryOption));
}
@Override
public Response ttl(String key) {
return appendCommand(commandObjects.ttl(key));
}
@Override
public Response pttl(String key) {
return appendCommand(commandObjects.pttl(key));
}
@Override
public Response touch(String key) {
return appendCommand(commandObjects.touch(key));
}
@Override
public Response touch(String... keys) {
return appendCommand(commandObjects.touch(keys));
}
@Override
public Response> sort(String key) {
return appendCommand(commandObjects.sort(key));
}
@Override
public Response sort(String key, String dstKey) {
return appendCommand(commandObjects.sort(key, dstKey));
}
@Override
public Response> sort(String key, SortingParams sortingParams) {
return appendCommand(commandObjects.sort(key, sortingParams));
}
@Override
public Response sort(String key, SortingParams sortingParams, String dstKey) {
return appendCommand(commandObjects.sort(key, sortingParams, dstKey));
}
@Override
public Response> sortReadonly(String key, SortingParams sortingParams) {
return appendCommand(commandObjects.sortReadonly(key, sortingParams));
}
@Override
public Response del(String key) {
return appendCommand(commandObjects.del(key));
}
@Override
public Response del(String... keys) {
return appendCommand(commandObjects.del(keys));
}
@Override
public Response unlink(String key) {
return appendCommand(commandObjects.unlink(key));
}
@Override
public Response unlink(String... keys) {
return appendCommand(commandObjects.unlink(keys));
}
@Override
public Response copy(String srcKey, String dstKey, boolean replace) {
return appendCommand(commandObjects.copy(srcKey, dstKey, replace));
}
@Override
public Response rename(String oldkey, String newkey) {
return appendCommand(commandObjects.rename(oldkey, newkey));
}
@Override
public Response renamenx(String oldkey, String newkey) {
return appendCommand(commandObjects.renamenx(oldkey, newkey));
}
@Override
public Response memoryUsage(String key) {
return appendCommand(commandObjects.memoryUsage(key));
}
@Override
public Response memoryUsage(String key, int samples) {
return appendCommand(commandObjects.memoryUsage(key, samples));
}
@Override
public Response objectRefcount(String key) {
return appendCommand(commandObjects.objectRefcount(key));
}
@Override
public Response objectEncoding(String key) {
return appendCommand(commandObjects.objectEncoding(key));
}
@Override
public Response objectIdletime(String key) {
return appendCommand(commandObjects.objectIdletime(key));
}
@Override
public Response objectFreq(String key) {
return appendCommand(commandObjects.objectFreq(key));
}
@Override
public Response migrate(String host, int port, String key, int timeout) {
return appendCommand(commandObjects.migrate(host, port, key, timeout));
}
@Override
public Response migrate(String host, int port, int timeout, MigrateParams params, String... keys) {
return appendCommand(commandObjects.migrate(host, port, timeout, params, keys));
}
@Override
public Response> keys(String pattern) {
return appendCommand(commandObjects.keys(pattern));
}
@Override
public Response> scan(String cursor) {
return appendCommand(commandObjects.scan(cursor));
}
@Override
public Response> scan(String cursor, ScanParams params) {
return appendCommand(commandObjects.scan(cursor, params));
}
@Override
public Response> scan(String cursor, ScanParams params, String type) {
return appendCommand(commandObjects.scan(cursor, params, type));
}
@Override
public Response randomKey() {
return appendCommand(commandObjects.randomKey());
}
@Override
public Response get(String key) {
return appendCommand(commandObjects.get(key));
}
@Override
public Response setGet(String key, String value, SetParams params) {
return appendCommand(commandObjects.setGet(key, value, params));
}
@Override
public Response getDel(String key) {
return appendCommand(commandObjects.getDel(key));
}
@Override
public Response getEx(String key, GetExParams params) {
return appendCommand(commandObjects.getEx(key, params));
}
@Override
public Response setbit(String key, long offset, boolean value) {
return appendCommand(commandObjects.setbit(key, offset, value));
}
@Override
public Response getbit(String key, long offset) {
return appendCommand(commandObjects.getbit(key, offset));
}
@Override
public Response setrange(String key, long offset, String value) {
return appendCommand(commandObjects.setrange(key, offset, value));
}
@Override
public Response getrange(String key, long startOffset, long endOffset) {
return appendCommand(commandObjects.getrange(key, startOffset, endOffset));
}
@Override
public Response getSet(String key, String value) {
return appendCommand(commandObjects.getSet(key, value));
}
@Override
public Response setnx(String key, String value) {
return appendCommand(commandObjects.setnx(key, value));
}
@Override
public Response setex(String key, long seconds, String value) {
return appendCommand(commandObjects.setex(key, seconds, value));
}
@Override
public Response psetex(String key, long milliseconds, String value) {
return appendCommand(commandObjects.psetex(key, milliseconds, value));
}
@Override
public Response> mget(String... keys) {
return appendCommand(commandObjects.mget(keys));
}
@Override
public Response mset(String... keysvalues) {
return appendCommand(commandObjects.mset(keysvalues));
}
@Override
public Response msetnx(String... keysvalues) {
return appendCommand(commandObjects.msetnx(keysvalues));
}
@Override
public Response incr(String key) {
return appendCommand(commandObjects.incr(key));
}
@Override
public Response incrBy(String key, long increment) {
return appendCommand(commandObjects.incrBy(key, increment));
}
@Override
public Response incrByFloat(String key, double increment) {
return appendCommand(commandObjects.incrByFloat(key, increment));
}
@Override
public Response decr(String key) {
return appendCommand(commandObjects.decr(key));
}
@Override
public Response decrBy(String key, long decrement) {
return appendCommand(commandObjects.decrBy(key, decrement));
}
@Override
public Response append(String key, String value) {
return appendCommand(commandObjects.append(key, value));
}
@Override
public Response substr(String key, int start, int end) {
return appendCommand(commandObjects.substr(key, start, end));
}
@Override
public Response strlen(String key) {
return appendCommand(commandObjects.strlen(key));
}
@Override
public Response bitcount(String key) {
return appendCommand(commandObjects.bitcount(key));
}
@Override
public Response bitcount(String key, long start, long end) {
return appendCommand(commandObjects.bitcount(key, start, end));
}
@Override
public Response bitcount(String key, long start, long end, BitCountOption option) {
return appendCommand(commandObjects.bitcount(key, start, end, option));
}
@Override
public Response bitpos(String key, boolean value) {
return appendCommand(commandObjects.bitpos(key, value));
}
@Override
public Response bitpos(String key, boolean value, BitPosParams params) {
return appendCommand(commandObjects.bitpos(key, value, params));
}
@Override
public Response> bitfield(String key, String... arguments) {
return appendCommand(commandObjects.bitfield(key, arguments));
}
@Override
public Response> bitfieldReadonly(String key, String... arguments) {
return appendCommand(commandObjects.bitfieldReadonly(key, arguments));
}
@Override
public Response bitop(BitOP op, String destKey, String... srcKeys) {
return appendCommand(commandObjects.bitop(op, destKey, srcKeys));
}
@Override
public Response lcs(String keyA, String keyB, LCSParams params) {
return appendCommand(commandObjects.lcs(keyA, keyB, params));
}
@Override
public Response set(String key, String value) {
return appendCommand(commandObjects.set(key, value));
}
@Override
public Response set(String key, String value, SetParams params) {
return appendCommand(commandObjects.set(key, value, params));
}
@Override
public Response rpush(String key, String... string) {
return appendCommand(commandObjects.rpush(key, string));
}
@Override
public Response lpush(String key, String... string) {
return appendCommand(commandObjects.lpush(key, string));
}
@Override
public Response llen(String key) {
return appendCommand(commandObjects.llen(key));
}
@Override
public Response> lrange(String key, long start, long stop) {
return appendCommand(commandObjects.lrange(key, start, stop));
}
@Override
public Response ltrim(String key, long start, long stop) {
return appendCommand(commandObjects.ltrim(key, start, stop));
}
@Override
public Response lindex(String key, long index) {
return appendCommand(commandObjects.lindex(key, index));
}
@Override
public Response lset(String key, long index, String value) {
return appendCommand(commandObjects.lset(key, index, value));
}
@Override
public Response lrem(String key, long count, String value) {
return appendCommand(commandObjects.lrem(key, count, value));
}
@Override
public Response lpop(String key) {
return appendCommand(commandObjects.lpop(key));
}
@Override
public Response> lpop(String key, int count) {
return appendCommand(commandObjects.lpop(key, count));
}
@Override
public Response lpos(String key, String element) {
return appendCommand(commandObjects.lpos(key, element));
}
@Override
public Response lpos(String key, String element, LPosParams params) {
return appendCommand(commandObjects.lpos(key, element, params));
}
@Override
public Response> lpos(String key, String element, LPosParams params, long count) {
return appendCommand(commandObjects.lpos(key, element, params, count));
}
@Override
public Response rpop(String key) {
return appendCommand(commandObjects.rpop(key));
}
@Override
public Response> rpop(String key, int count) {
return appendCommand(commandObjects.rpop(key, count));
}
@Override
public Response linsert(String key, ListPosition where, String pivot, String value) {
return appendCommand(commandObjects.linsert(key, where, pivot, value));
}
@Override
public Response lpushx(String key, String... strings) {
return appendCommand(commandObjects.lpushx(key, strings));
}
@Override
public Response rpushx(String key, String... strings) {
return appendCommand(commandObjects.rpushx(key, strings));
}
@Override
public Response> blpop(int timeout, String key) {
return appendCommand(commandObjects.blpop(timeout, key));
}
@Override
public Response> blpop(double timeout, String key) {
return appendCommand(commandObjects.blpop(timeout, key));
}
@Override
public Response> brpop(int timeout, String key) {
return appendCommand(commandObjects.brpop(timeout, key));
}
@Override
public Response> brpop(double timeout, String key) {
return appendCommand(commandObjects.brpop(timeout, key));
}
@Override
public Response> blpop(int timeout, String... keys) {
return appendCommand(commandObjects.blpop(timeout, keys));
}
@Override
public Response> blpop(double timeout, String... keys) {
return appendCommand(commandObjects.blpop(timeout, keys));
}
@Override
public Response> brpop(int timeout, String... keys) {
return appendCommand(commandObjects.brpop(timeout, keys));
}
@Override
public Response> brpop(double timeout, String... keys) {
return appendCommand(commandObjects.brpop(timeout, keys));
}
@Override
public Response rpoplpush(String srcKey, String dstKey) {
return appendCommand(commandObjects.rpoplpush(srcKey, dstKey));
}
@Override
public Response brpoplpush(String source, String destination, int timeout) {
return appendCommand(commandObjects.brpoplpush(source, destination, timeout));
}
@Override
public Response lmove(String srcKey, String dstKey, ListDirection from, ListDirection to) {
return appendCommand(commandObjects.lmove(srcKey, dstKey, from, to));
}
@Override
public Response blmove(String srcKey, String dstKey, ListDirection from, ListDirection to, double timeout) {
return appendCommand(commandObjects.blmove(srcKey, dstKey, from, to, timeout));
}
@Override
public Response>> lmpop(ListDirection direction, String... keys) {
return appendCommand(commandObjects.lmpop(direction, keys));
}
@Override
public Response>> lmpop(ListDirection direction, int count, String... keys) {
return appendCommand(commandObjects.lmpop(direction, count, keys));
}
@Override
public Response>> blmpop(double timeout, ListDirection direction, String... keys) {
return appendCommand(commandObjects.blmpop(timeout, direction, keys));
}
@Override
public Response>> blmpop(double timeout, ListDirection direction, int count, String... keys) {
return appendCommand(commandObjects.blmpop(timeout, direction, count, keys));
}
@Override
public Response hset(String key, String field, String value) {
return appendCommand(commandObjects.hset(key, field, value));
}
@Override
public Response hset(String key, Map hash) {
return appendCommand(commandObjects.hset(key, hash));
}
@Override
public Response hget(String key, String field) {
return appendCommand(commandObjects.hget(key, field));
}
@Override
public Response hsetnx(String key, String field, String value) {
return appendCommand(commandObjects.hsetnx(key, field, value));
}
@Override
public Response hmset(String key, Map hash) {
return appendCommand(commandObjects.hmset(key, hash));
}
@Override
public Response> hmget(String key, String... fields) {
return appendCommand(commandObjects.hmget(key, fields));
}
@Override
public Response hincrBy(String key, String field, long value) {
return appendCommand(commandObjects.hincrBy(key, field, value));
}
@Override
public Response hincrByFloat(String key, String field, double value) {
return appendCommand(commandObjects.hincrByFloat(key, field, value));
}
@Override
public Response hexists(String key, String field) {
return appendCommand(commandObjects.hexists(key, field));
}
@Override
public Response hdel(String key, String... field) {
return appendCommand(commandObjects.hdel(key, field));
}
@Override
public Response hlen(String key) {
return appendCommand(commandObjects.hlen(key));
}
@Override
public Response> hkeys(String key) {
return appendCommand(commandObjects.hkeys(key));
}
@Override
public Response> hvals(String key) {
return appendCommand(commandObjects.hvals(key));
}
@Override
public Response