All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lordofthejars.nosqlunit.redis.embedded.EmbeddedPipeline Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
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 response = getResponse(BuilderFactory.LONG);
        response.set(jedis.srem(key, member));
        return response;
    }

    @Override
    public Response strlen(String key) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response strlen(byte[] key) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response substr(String key, int start, int end) {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.substr(key, start, end));
        return response;
    }

    @Override
    public Response substr(byte[] key, int start, int end) {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.substr(key, start, end));
        return response;
    }

    @Override
    public Response> sunion(String... keys) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response> sunion(byte[] ... keys) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response sunionstore(String dstkey, String... keys) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response sunionstore(byte[] dstkey, byte[] ... keys) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response ttl(String key) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.ttl(key));
        return response;
    }

    @Override
    public Response ttl(byte[] key) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.ttl(key));
        return response;
    }

    @Override
    public Response type(String key) {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.type(key));
        return response;
    }

    @Override
    public Response type(byte[] key) {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.type(key));
        return response;
    }

    @Override
    public Response watch(String... keys) {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.watch(keys));
        return response;
    }

    @Override
    public Response watch(byte[] ... keys) {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.watch(keys));
        return response;
    }

    @Override
    public Response zadd(String key, double score, String member) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zadd(key, score, member));
        return response;
    }

    @Override
    public Response zadd(byte[] key, double score, byte[] member) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zadd(key, score, member));
        return response;
    }

    @Override
    public Response zcard(String key) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zcard(key));
        return response;
    }

    @Override
    public Response zcard(byte[] key) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zcard(key));
        return response;
    }

    @Override
    public Response zcount(String key, double min, double max) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zcount(key, min, max));
        return response;
    }

    @Override
    public Response zcount(byte[] key, double min, double max) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zcount(key, min, max));
        return response;
    }

    @Override
    public Response zincrby(String key, double score, String member) {
        Response response = getResponse(BuilderFactory.DOUBLE);
        response.set(jedis.zincrby(key, score, member));
        return response;
    }

    @Override
    public Response zincrby(byte[] key, double score, byte[] member) {
        Response response = getResponse(BuilderFactory.DOUBLE);
        response.set(jedis.zincrby(key, score, member));
        return response;
    }

    @Override
    public Response zinterstore(String dstkey, String... sets) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response zinterstore(byte[] dstkey, byte[] ... sets) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response zinterstore(String dstkey, ZParams params, String... sets) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response zinterstore(byte[] dstkey, ZParams params, byte[] ... sets) {
        throw new UnsupportedOperationException();
    }

    public Response> zrange(String key, int start, int end) {
        Response> response = getResponse(BuilderFactory.STRING_SET);
        response.set(jedis.zrange(key, start, end));
        return response;
    }

    public Response> zrange(byte[] key, int start, int end) {
        Response> response = getResponse(BuilderFactory.STRING_SET);
        response.set(jedis.zrange(key, start, end));
        return response;
    }

    @Override
    public Response> zrangeByScore(String key, double min, double max) {
        Response> response = getResponse(BuilderFactory.STRING_SET);
        response.set(jedis.zrangeByScore(key, min, max));
        return response;
    }

    @Override
    public Response> zrangeByScore(byte[] key, double min, double max) {
        Response> response = getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
        response.set(jedis.zrangeByScore(key, min, max));
        return response;
    }

    @Override
    public Response> zrangeByScore(String key, String min, String max) {
        Response> response = getResponse(BuilderFactory.STRING_SET);
        response.set(jedis.zrangeByScore(key, min, max));
        return response;
    }

    @Override
    public Response> zrangeByScore(byte[] key, byte[] min, byte[] max) {
        Response> response = getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
        response.set(jedis.zrangeByScore(key, min, max));
        return response;
    }

    @Override
    public Response> zrangeByScore(String key, double min, double max, int offset, int count) {
        Response> response = getResponse(BuilderFactory.STRING_SET);
        response.set(jedis.zrangeByScore(key, min, max, offset, count));
        return response;
    }

    @Override
    public Response> zrangeByScore(byte[] key, double min, double max, int offset, int count) {
        Response> response = getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
        response.set(jedis.zrangeByScore(key, min, max, offset, count));
        return response;
    }

    @Override
    public Response> zrangeByScore(byte[] key, byte[] min, byte[] max, int offset, int count) {
        Response> response = getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
        response.set(jedis.zrangeByScore(key, min, max, offset, count));
        return response;
    }

    @Override
    public Response> zrangeByScoreWithScores(String key, double min, double max) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrangeByScoreWithScores(key, min, max));
        return response;
    }

    @Override
    public Response> zrangeByScoreWithScores(byte[] key, double min, double max) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrangeByScoreWithScores(key, min, max));
        return response;
    }

    @Override
    public Response> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrangeByScoreWithScores(key, min, max));
        return response;
    }

    @Override
    public Response> zrangeByScoreWithScores(String key, double min, double max, int offset, int count) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrangeByScoreWithScores(key, min, max, offset, count));
        return response;
    }

    @Override
    public Response> zrangeByScoreWithScores(byte[] key, double min, double max, int offset, int count) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrangeByScoreWithScores(key, min, max, offset, count));
        return response;
    }

    @Override
    public Response> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max, int offset, int count) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrangeByScoreWithScores(key, min, max, offset, count));
        return response;
    }

    @Override
    public Response> zrevrangeByScore(String key, double max, double min) {
        Response> response = getResponse(BuilderFactory.STRING_SET);
        response.set(jedis.zrevrange(key, (long) max, (long) min));
        return response;
    }

    @Override
    public Response> zrevrangeByScore(byte[] key, double max, double min) {
        Response> response = getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
        response.set(jedis.zrevrange(key, (int) max, (int) min));
        return response;
    }

    @Override
    public Response> zrevrangeByScore(String key, String max, String min) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response> zrevrangeByScore(byte[] key, byte[] max, byte[] min) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response> zrevrangeByScore(String key, double max, double min, int offset, int count) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response> zrevrangeByScore(byte[] key, double max, double min, int offset, int count) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response> zrevrangeByScore(byte[] key, byte[] max, byte[] min, int offset, int count) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response> zrevrangeByScoreWithScores(String key, double max, double min) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrevrangeByScoreWithScores(key, max, min));
        return response;
    }

    @Override
    public Response> zrevrangeByScoreWithScores(byte[] key, double max, double min) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrevrangeByScoreWithScores(key, max, min));
        return response;
    }

    @Override
    public Response> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrevrangeByScoreWithScores(key, max, min));
        return response;
    }

    @Override
    public Response> zrevrangeByScoreWithScores(String key, double max, double min, int offset, int count) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrevrangeByScoreWithScores(key, max, min, offset, count));
        return response;
    }

    @Override
    public Response> zrevrangeByScoreWithScores(byte[] key, double max, double min, int offset, int count) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrevrangeByScoreWithScores(key, max, min, offset, count));
        return response;
    }

    @Override
    public Response> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min, int offset, int count) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrevrangeByScoreWithScores(key, max, min, offset, count));
        return response;
    }

    public Response> zrangeWithScores(String key, int start, int end) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrangeWithScores(key, (long) start, (long) end));
        return response;
    }
    
    public Response> zrangeWithScores(byte[] key, int start, int end) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrangeWithScores(key, start, end));
        return response;
    }

    @Override
    public Response zrank(String key, String member) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zrank(key, member));
        return response;
    }

    @Override
    public Response zrank(byte[] key, byte[] member) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zrank(key, member));
        return response;
    }

    public Response zrem(String key, String member) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zrem(key, member));
        return response;
    }

    public Response zrem(byte[] key, byte[] member) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zrem(key, member));
        return response;
    }

    public Response zremrangeByRank(String key, int start, int end) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zremrangeByRank(key, start, end));
        return response;
    }

    public Response zremrangeByRank(byte[] key, int start, int end) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zremrangeByRank(key, start, end));
        return response;
    }

    @Override
    public Response zremrangeByScore(String key, double start, double end) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zremrangeByScore(key, start, end));
        return response;
    }

    @Override
    public Response zremrangeByScore(byte[] key, double start, double end) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zremrangeByScore(key, start, end));
        return response;
    }

    @Override
    public Response zremrangeByScore(byte[] key, byte[] start, byte[] end) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zremrangeByScore(key, start, end));
        return response;
    }

    public Response> zrevrange(String key, int start, int end) {
        Response> response = getResponse(BuilderFactory.STRING_SET);
        response.set(jedis.zrevrange(key, start, end));
        return response;
    }

    public Response> zrevrange(byte[] key, int start, int end) {
        Response> response = getResponse(BuilderFactory.STRING_SET);
        response.set(jedis.zrevrange(key, start, end));
        return response;
    }

    public Response> zrevrangeWithScores(String key, int start, int end) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrevrangeWithScores(key, start, end));
        return response;
    }

    public Response> zrevrangeWithScores(byte[] key, int start, int end) {
        Response> response = getResponse(BuilderFactory.TUPLE_ZSET);
        response.set(jedis.zrevrangeWithScores(key, start, end));
        return response;
    }

    @Override
    public Response zrevrank(String key, String member) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zrevrank(key, member));
        return response;
    }

    @Override
    public Response zrevrank(byte[] key, byte[] member) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.zrevrank(key, member));
        return response;
    }

    @Override
   public  Response zscore(String key, String member) {
        Response response = getResponse(BuilderFactory.DOUBLE);
        response.set(jedis.zscore(key, member));
        return response;
    }

    @Override
    public Response zscore(byte[] key, byte[] member) {
        Response response = getResponse(BuilderFactory.DOUBLE);
        response.set(jedis.zscore(key, member));
        return response;
    }

    @Override
    public Response zunionstore(String dstkey, String... sets) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response zunionstore(byte[] dstkey, byte[] ... sets) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response zunionstore(String dstkey, ZParams params, String... sets) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response zunionstore(byte[] dstkey, ZParams params, byte[] ... sets) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response bgrewriteaof() {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.bgrewriteaof());
        return response;
    }
    
    @Override
    public Response bgsave() {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.bgsave());
        return response;
    }

    @Override
    public Response configGet(String pattern) {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.configGet(pattern));
        return response;
    }

    @Override
    public Response configSet(String parameter, String value) {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.configSet(parameter, value));
        return response;
    }

    @Override
    public Response brpoplpush(String source, String destination, int timeout) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response brpoplpush(byte[] source, byte[] destination, int timeout) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response configResetStat() {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.configResetStat());
        return response;
    }

    @Override
    public Response save() {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.save());
        return response;
    }

    @Override
    public Response lastsave() {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.lastsave());
        return response;
    }

    @Override
    public Response discard() {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response> exec() {
        Response> response = super.getResponse(currentMulti);
        currentMulti = null;
        return response;
    }

    @Override
    public Response multi() {
        Response response = getResponse(BuilderFactory.STRING); //Expecting OK
        currentMulti = new MultiResponseBuilder();
        return response;
    }

    @Override
    public Response publish(String channel, String message) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.publish(channel, message));
        return response;
    }

    @Override
    public Response publish(byte[] channel, byte[] message) {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.publish(channel, message));
        return response;
    }
    
    @Override
    public Response flushDB() {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.flushDB());
        return response;
    }

    @Override
    public Response flushAll() {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.flushAll());
        return response;
    }

    @Override
    public Response info() {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.info());
        return response;
    }

    @Override
    public Response dbSize() {
        Response response = getResponse(BuilderFactory.LONG);
        response.set(jedis.dbSize());
        return response;
    }

    @Override
    public Response shutdown() {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.shutdown());
        return response;
    }

    @Override
    public Response ping() {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.ping());
        return response;
    }

    @Override
    public Response randomKey() {
        throw new UnsupportedOperationException();
    }

    @Override
    public Response select(int index) {
        Response response = getResponse(BuilderFactory.STRING);
        response.set(jedis.select(index));
        return response;
    }

    @Override
    public void sync() {
    }

    @Override
    public List syncAndReturnAll() {
        return Collections.EMPTY_LIST;
    }
    
    @Override
    protected  Response getResponse(Builder builder) {
        if (currentMulti != null){
            super.getResponse(BuilderFactory.STRING); //Expected QUEUED

            Response lr = new Response(builder);
            currentMulti.addResponse(lr);
            return lr;
        }
        return super.getResponse(builder);
    }

    private class MultiResponseBuilder extends Builder> {
        private final List> responses = new ArrayList>();

        @Override
        public List build(Object data) {
            List list = (List) data;
            List values = new ArrayList();

            if (list.size() != responses.size()) {
                throw new JedisDataException("Expected data size "
                        + responses.size() + " but was " + list.size());
            }

            for (int i = 0; i < list.size(); i++) {
                Response response = responses.get(i);
                response.set(list.get(i));
                values.add(response.get());
            }
            return values;
        }

        public void addResponse(Response response) {
            responses.add(response);
        }
    }

}