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.
com.lordofthejars.nosqlunit.redis.embedded.EmbeddedPipeline Maven / Gradle / Ivy
package com.lordofthejars.nosqlunit.redis.embedded;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import redis.clients.jedis.BinaryClient;
import redis.clients.jedis.Builder;
import redis.clients.jedis.BuilderFactory;
import redis.clients.jedis.Pipeline;
import redis.clients.jedis.Response;
import redis.clients.jedis.SortingParams;
import redis.clients.jedis.Tuple;
import redis.clients.jedis.ZParams;
import redis.clients.jedis.exceptions.JedisDataException;
public class EmbeddedPipeline extends Pipeline {
private EmbeddedJedis jedis;
private MultiResponseBuilder currentMulti;
public EmbeddedPipeline(EmbeddedJedis jedis) {
this.jedis = jedis;
}
@Override
public Response append(String key, String value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.append(key, value));
return response;
}
@Override
public Response append(byte[] key, byte[] value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.append(key, value));
return response;
}
@Override
public Response> blpop(String... args) {
throw new UnsupportedOperationException();
}
@Override
public Response> blpop(byte[] ... args) {
throw new UnsupportedOperationException();
}
@Override
public Response> brpop(String... args) {
throw new UnsupportedOperationException();
}
@Override
public Response> brpop(byte[] ... args) {
throw new UnsupportedOperationException();
}
@Override
public Response decr(String key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.decr(key));
return response;
}
@Override
public Response decr(byte[] key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.decr(key));
return response;
}
@Override
public Response decrBy(String key, long integer) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.decrBy(key, integer));
return response;
}
@Override
public Response decrBy(byte[] key, long integer) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.decrBy(key, integer));
return response;
}
@Override
public Response del(String... keys) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.del(keys));
return response;
}
@Override
public Response del(byte[] ... keys) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.del(keys));
return response;
}
@Override
public Response echo(String string) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.echo(string));
return response;
}
@Override
public Response echo(byte[] string) {
Response response = getResponse(BuilderFactory.BYTE_ARRAY);
response.set(jedis.echo(string));
return response;
}
@Override
public Response exists(String key) {
Response response = getResponse(BuilderFactory.BOOLEAN);
response.set(jedis.exists(key));
return response;
}
@Override
public Response exists(byte[] key) {
Response response = getResponse(BuilderFactory.BOOLEAN);
response.set(jedis.exists(key));
return response;
}
@Override
public Response expire(String key, int seconds) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.expire(key, seconds));
return response;
}
@Override
public Response expire(byte[] key, int seconds) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.expire(key, seconds));
return response;
}
@Override
public Response expireAt(String key, long unixTime) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.expireAt(key, unixTime));
return response;
}
@Override
public Response expireAt(byte[] key, long unixTime) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.expireAt(key, unixTime));
return response;
}
@Override
public Response get(String key) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.get(key));
return response;
}
@Override
public Response get(byte[] key) {
Response response = getResponse(BuilderFactory.BYTE_ARRAY);
response.set(jedis.get(key));
return response;
}
@Override
public Response getbit(String key, long offset) {
Response response = getResponse(BuilderFactory.BOOLEAN);
response.set(jedis.getbit(key, offset));
return response;
}
@Override
public Response getrange(String key, long startOffset, long endOffset) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.getrange(key, startOffset, endOffset));
return response;
}
@Override
public Response getSet(String key, String value) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.getSet(key, value));
return response;
}
@Override
public Response getSet(byte[] key, byte[] value) {
Response response = getResponse(BuilderFactory.BYTE_ARRAY);
response.set(jedis.getSet(key, value));
return response;
}
public Response hdel(String key, String field) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.hdel(key, field));
return response;
}
public Response hdel(byte[] key, byte[] field) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.hdel(key, field));
return response;
}
@Override
public Response hexists(String key, String field) {
Response response = getResponse(BuilderFactory.BOOLEAN);
response.set(jedis.hexists(key, field));
return response;
}
@Override
public Response hexists(byte[] key, byte[] field) {
Response response = getResponse(BuilderFactory.BOOLEAN);
response.set(jedis.hexists(key, field));
return response;
}
@Override
public Response hget(String key, String field) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.hget(key, field));
return response;
}
@Override
public Response hget(byte[] key, byte[] field) {
Response response = getResponse(BuilderFactory.BYTE_ARRAY);
response.set(jedis.hget(key, field));
return response;
}
@Override
public Response> hgetAll(String key) {
Response> response = getResponse(BuilderFactory.STRING_MAP);
response.set(jedis.hgetAll(key));
return response;
}
@Override
public Response> hgetAll(byte[] key) {
Response> response = getResponse(BuilderFactory.BYTE_ARRAY_MAP);
response.set(jedis.hgetAll(key));
return response;
}
@Override
public Response hincrBy(String key, String field, long value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.hincrBy(key, field, value));
return response;
}
@Override
public Response hincrBy(byte[] key, byte[] field, long value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.hincrBy(key, field, value));
return response;
}
@Override
public Response> hkeys(String key) {
Response> response = getResponse(BuilderFactory.STRING_SET);
response.set(jedis.hkeys(key));
return response;
}
@Override
public Response> hkeys(byte[] key) {
Response> response = getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
response.set(jedis.hkeys(key));
return response;
}
@Override
public Response hlen(String key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.hlen(key));
return response;
}
@Override
public Response hlen(byte[] key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.hlen(key));
return response;
}
@Override
public Response> hmget(String key, String... fields) {
Response> response = getResponse(BuilderFactory.STRING_LIST);
response.set(jedis.hmget(key, fields));
return response;
}
@Override
public Response> hmget(byte[] key, byte[] ... fields) {
Response> response = getResponse(BuilderFactory.BYTE_ARRAY_LIST);
response.set(jedis.hmget(key, fields));
return response;
}
@Override
public Response hmset(String key, Map hash) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.hmset(key, hash));
return response;
}
@Override
public Response hmset(byte[] key, Map hash) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.hmset(key, hash));
return response;
}
@Override
public Response hset(String key, String field, String value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.hset(key, field, value));
return response;
}
@Override
public Response hset(byte[] key, byte[] field, byte[] value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.hset(key, field, value));
return response;
}
@Override
public Response hsetnx(String key, String field, String value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.hsetnx(key, field, value));
return response;
}
@Override
public Response hsetnx(byte[] key, byte[] field, byte[] value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.hsetnx(key, field, value));
return response;
}
@Override
public Response> hvals(String key) {
Response> response = getResponse(BuilderFactory.STRING_LIST);
response.set(jedis.hvals(key));
return response;
}
@Override
public Response> hvals(byte[] key) {
Response> response = getResponse(BuilderFactory.BYTE_ARRAY_LIST);
response.set(jedis.hvals(key));
return response;
}
@Override
public Response incr(String key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.incr(key));
return response;
}
@Override
public Response incr(byte[] key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.incr(key));
return response;
}
@Override
public Response incrBy(String key, long integer) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.incrBy(key, integer));
return response;
}
@Override
public Response incrBy(byte[] key, long integer) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.incrBy(key, integer));
return response;
}
@Override
public Response> keys(String pattern) {
Response> response = getResponse(BuilderFactory.STRING_SET);
response.set(jedis.keys(pattern));
return response;
}
@Override
public Response> keys(byte[] pattern) {
Response> response = getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
response.set(jedis.keys(pattern));
return response;
}
public Response lindex(String key, int index) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.lindex(key, index));
return response;
}
public Response lindex(byte[] key, int index) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.lindex(key, index));
return response;
}
@Override
public Response linsert(String key, BinaryClient.LIST_POSITION where, String pivot, String value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.linsert(key, where, pivot, value));
return response;
}
@Override
public Response linsert(byte[] key, BinaryClient.LIST_POSITION where, byte[] pivot, byte[] value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.linsert(key, where, pivot, value));
return response;
}
@Override
public Response llen(String key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.llen(key));
return response;
}
@Override
public Response llen(byte[] key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.llen(key));
return response;
}
@Override
public Response lpop(String key) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.lpop(key));
return response;
}
@Override
public Response lpop(byte[] key) {
Response response = getResponse(BuilderFactory.BYTE_ARRAY);
response.set(jedis.lpop(key));
return response;
}
public Response lpush(String key, String string) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.lpush(key, string));
return response;
}
public Response lpush(byte[] key, byte[] string) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.lpush(key, string));
return response;
}
public Response lpushx(String key, String string) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.lpushx(key, string));
return response;
}
public Response lpushx(byte[] key, byte[] bytes) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.lpushx(key, bytes));
return response;
}
@Override
public Response> lrange(String key, long start, long end) {
Response> response = getResponse(BuilderFactory.STRING_LIST);
response.set(jedis.lrange(key, start, end));
return response;
}
@Override
public Response> lrange(byte[] key, long start, long end) {
Response> response = getResponse(BuilderFactory.BYTE_ARRAY_LIST);
response.set(jedis.lrange(key, (int) start, (int) end));
return response;
}
@Override
public Response lrem(String key, long count, String value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.lrem(key, count, value));
return response;
}
@Override
public Response lrem(byte[] key, long count, byte[] value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.lrem(key, (int) count, value));
return response;
}
@Override
public Response lset(String key, long index, String value) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.lset(key, index, value));
return response;
}
@Override
public Response lset(byte[] key, long index, byte[] value) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.lset(key, (int) index, value));
return response;
}
@Override
public Response ltrim(String key, long start, long end) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.ltrim(key, start, end));
return response;
}
@Override
public Response ltrim(byte[] key, long start, long end) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.ltrim(key, (int) start, (int) end));
return response;
}
@Override
public Response> mget(String... keys) {
throw new UnsupportedOperationException();
}
@Override
public Response> mget(byte[] ... keys) {
throw new UnsupportedOperationException();
}
@Override
public Response move(String key, int dbIndex) {
throw new UnsupportedOperationException();
}
@Override
public Response move(byte[] key, int dbIndex) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.move(key, dbIndex));
return response;
}
@Override
public Response mset(String... keysvalues) {
throw new UnsupportedOperationException();
}
@Override
public Response mset(byte[] ... keysvalues) {
throw new UnsupportedOperationException();
}
@Override
public Response msetnx(String... keysvalues) {
throw new UnsupportedOperationException();
}
@Override
public Response msetnx(byte[] ... keysvalues) {
throw new UnsupportedOperationException();
}
@Override
public Response persist(String key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.persist(key));
return response;
}
@Override
public Response persist(byte[] key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.persist(key));
return response;
}
@Override
public Response rename(String oldkey, String newkey) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.rename(oldkey, newkey));
return response;
}
@Override
public Response rename(byte[] oldkey, byte[] newkey) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.rename(oldkey, newkey));
return response;
}
@Override
public Response renamenx(String oldkey, String newkey) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.renamenx(oldkey, newkey));
return response;
}
@Override
public Response renamenx(byte[] oldkey, byte[] newkey) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.renamenx(oldkey, newkey));
return response;
}
@Override
public Response rpop(String key) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.rpop(key));
return response;
}
@Override
public Response rpop(byte[] key) {
Response response = getResponse(BuilderFactory.BYTE_ARRAY);
response.set(jedis.rpop(key));
return response;
}
@Override
public Response rpoplpush(String srckey, String dstkey) {
throw new UnsupportedOperationException();
}
@Override
public Response rpoplpush(byte[] srckey, byte[] dstkey) {
throw new UnsupportedOperationException();
}
public Response rpush(String key, String string) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.rpush(key, string));
return response;
}
public Response rpush(byte[] key, byte[] string) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.rpush(key, string));
return response;
}
public Response rpushx(String key, String string) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.rpushx(key, string));
return response;
}
public Response rpushx(byte[] key, byte[] string) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.rpushx(key, string));
return response;
}
public Response sadd(String key, String member) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.sadd(key, member));
return response;
}
public Response sadd(byte[] key, byte[] member) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.sadd(key, member));
return response;
}
@Override
public Response scard(String key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.scard(key));
return response;
}
@Override
public Response scard(byte[] key) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.scard(key));
return response;
}
@Override
public Response> sdiff(String... keys) {
throw new UnsupportedOperationException();
}
@Override
public Response> sdiff(byte[] ... keys) {
throw new UnsupportedOperationException();
}
@Override
public Response sdiffstore(String dstkey, String... keys) {
throw new UnsupportedOperationException();
}
@Override
public Response sdiffstore(byte[] dstkey, byte[] ... keys) {
throw new UnsupportedOperationException();
}
@Override
public Response set(String key, String value) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.set(key, value));
return response;
}
@Override
public Response set(byte[] key, byte[] value) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.set(key, value));
return response;
}
@Override
public Response setbit(String key, long offset, boolean value) {
Response response = getResponse(BuilderFactory.BOOLEAN);
response.set(jedis.setbit(key, offset, value));
return response;
}
@Override
public Response setex(String key, int seconds, String value) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.setex(key, seconds, value));
return response;
}
@Override
public Response setex(byte[] key, int seconds, byte[] value) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.setex(key, seconds, value));
return response;
}
@Override
public Response setnx(String key, String value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.setnx(key, value));
return response;
}
@Override
public Response setnx(byte[] key, byte[] value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.setnx(key, value));
return response;
}
@Override
public Response setrange(String key, long offset, String value) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.setrange(key, offset, value));
return response;
}
@Override
public Response> sinter(String... keys) {
throw new UnsupportedOperationException();
}
@Override
public Response> sinter(byte[] ... keys) {
throw new UnsupportedOperationException();
}
@Override
public Response sinterstore(String dstkey, String... keys) {
throw new UnsupportedOperationException();
}
@Override
public Response sinterstore(byte[] dstkey, byte[] ... keys) {
throw new UnsupportedOperationException();
}
@Override
public Response sismember(String key, String member) {
Response response = getResponse(BuilderFactory.BOOLEAN);
response.set(jedis.sismember(key, member));
return response;
}
@Override
public Response sismember(byte[] key, byte[] member) {
Response response = getResponse(BuilderFactory.BOOLEAN);
response.set(jedis.sismember(key, member));
return response;
}
@Override
public Response> smembers(String key) {
Response> response = getResponse(BuilderFactory.STRING_SET);
response.set(jedis.smembers(key));
return response;
}
@Override
public Response> smembers(byte[] key) {
Response> response = getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
response.set(jedis.smembers(key));
return response;
}
@Override
public Response smove(String srckey, String dstkey, String member) {
throw new UnsupportedOperationException();
}
@Override
public Response smove(byte[] srckey, byte[] dstkey, byte[] member) {
throw new UnsupportedOperationException();
}
@Override
public Response> sort(String key) {
Response> response = getResponse(BuilderFactory.STRING_LIST);
response.set(jedis.sort(key));
return response;
}
@Override
public Response> sort(byte[] key) {
Response> response = getResponse(BuilderFactory.BYTE_ARRAY_LIST);
response.set(jedis.sort(key));
return response;
}
@Override
public Response> sort(String key, SortingParams sortingParameters) {
Response> response = getResponse(BuilderFactory.STRING_LIST);
response.set(jedis.sort(key, sortingParameters));
return response;
}
@Override
public Response> sort(byte[] key, SortingParams sortingParameters) {
Response> response = getResponse(BuilderFactory.BYTE_ARRAY_LIST);
response.set(jedis.sort(key, sortingParameters));
return response;
}
@Override
public Response sort(String key, SortingParams sortingParameters, String dstkey) {
throw new UnsupportedOperationException();
}
@Override
public Response sort(byte[] key, SortingParams sortingParameters, byte[] dstkey) {
throw new UnsupportedOperationException();
}
@Override
public Response sort(String key, String dstkey) {
throw new UnsupportedOperationException();
}
@Override
public Response sort(byte[] key, byte[] dstkey) {
throw new UnsupportedOperationException();
}
@Override
public Response spop(String key) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.spop(key));
return response;
}
@Override
public Response spop(byte[] key) {
Response response = getResponse(BuilderFactory.BYTE_ARRAY);
response.set(jedis.spop(key));
return response;
}
@Override
public Response srandmember(String key) {
Response response = getResponse(BuilderFactory.STRING);
response.set(jedis.srandmember(key));
return response;
}
@Override
public Response srandmember(byte[] key) {
Response response = getResponse(BuilderFactory.BYTE_ARRAY);
response.set(jedis.srandmember(key));
return response;
}
public Response srem(String key, String member) {
Response response = getResponse(BuilderFactory.LONG);
response.set(jedis.srem(key, member));
return response;
}
public Response srem(byte[] key, byte[] member) {
Response