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

io.quarkus.redis.runtime.client.RedisClientImpl Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.redis.runtime.client;

import java.time.Duration;
import java.util.List;

import io.quarkus.redis.client.RedisClient;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Command;
import io.vertx.mutiny.redis.client.Redis;
import io.vertx.mutiny.redis.client.RedisAPI;
import io.vertx.mutiny.redis.client.Request;
import io.vertx.redis.client.Response;

class RedisClientImpl implements RedisClient {
    private final RedisAPI redisAPI;
    private final Duration timeout;

    private final Redis redis;

    public RedisClientImpl(Redis redis, RedisAPI redisAPI, Duration timeout) {
        this.redis = redis;
        this.redisAPI = redisAPI;
        this.timeout = timeout;
    }

    @Override
    public void close() {
        redisAPI.close();
    }

    @Override
    public Response append(String arg0, String arg1) {
        return await(redisAPI.append(arg0, arg1));
    }

    @Override
    public Response asking() {
        return await(redisAPI.asking());
    }

    @Override
    public Response auth(List args) {
        return await(redisAPI.auth(args));
    }

    @Override
    public Response bgrewriteaof() {
        return await(redisAPI.bgrewriteaof());
    }

    @Override
    public Response bgsave(List args) {
        return await(redisAPI.bgsave(args));
    }

    @Override
    public Response bitcount(List args) {
        return await(redisAPI.bitcount(args));
    }

    @Override
    public Response bitfield(List args) {
        return await(redisAPI.bitfield(args));
    }

    @Override
    public Response bitop(List args) {
        return await(redisAPI.bitop(args));
    }

    @Override
    public Response bitpos(List args) {
        return await(redisAPI.bitpos(args));
    }

    @Override
    public Response blpop(List args) {
        return await(redisAPI.blpop(args));
    }

    @Override
    public Response brpop(List args) {
        return await(redisAPI.brpop(args));
    }

    @Override
    public Response brpoplpush(String arg0, String arg1, String arg2) {
        return await(redisAPI.brpoplpush(arg0, arg1, arg2));
    }

    @Override
    public Response bzpopmax(List args) {
        return await(redisAPI.bzpopmax(args));
    }

    @Override
    public Response bzpopmin(List args) {
        return await(redisAPI.bzpopmin(args));
    }

    @Override
    public Response client(List args) {
        return await(redisAPI.client(args));
    }

    @Override
    public Response cluster(List args) {
        return await(redisAPI.cluster(args));
    }

    @Override
    public Response command(List args) {
        return await(redisAPI.command(args));
    }

    @Override
    public Response config(List args) {
        return await(redisAPI.config(args));
    }

    @Override
    public Response dbsize() {
        return await(redisAPI.dbsize());
    }

    @Override
    public Response debug(List args) {
        return await(redisAPI.debug(args));
    }

    @Override
    public Response decr(String arg0) {
        return await(redisAPI.decr(arg0));
    }

    @Override
    public Response decrby(String arg0, String arg1) {
        return await(redisAPI.decrby(arg0, arg1));
    }

    @Override
    public Response del(List args) {
        return await(redisAPI.del(args));
    }

    @Override
    public Response discard() {
        return await(redisAPI.discard());
    }

    @Override
    public Response dump(String arg0) {
        return await(redisAPI.dump(arg0));
    }

    @Override
    public Response echo(String arg0) {
        return await(redisAPI.echo(arg0));
    }

    @Override
    public Response eval(List args) {
        return await(redisAPI.eval(args));
    }

    @Override
    public Response evalsha(List args) {
        return await(redisAPI.evalsha(args));
    }

    @Override
    public Response exec() {
        return await(redisAPI.exec());
    }

    @Override
    public Response exists(List args) {
        return await(redisAPI.exists(args));
    }

    @Override
    public Response expire(String arg0, String arg1) {
        return await(redisAPI.expire(List.of(arg0, arg1)));
    }

    @Override
    public Response expireat(String arg0, String arg1) {
        return await(redisAPI.expireat(List.of(arg0, arg1)));
    }

    @Override
    public Response flushall(List args) {
        return await(redisAPI.flushall(args));
    }

    @Override
    public Response flushdb(List args) {
        return await(redisAPI.flushdb(args));
    }

    @Override
    public Response geoadd(List args) {
        return await(redisAPI.geoadd(args));
    }

    @Override
    public Response geodist(List args) {
        return await(redisAPI.geodist(args));
    }

    @Override
    public Response geohash(List args) {
        return await(redisAPI.geohash(args));
    }

    @Override
    public Response geopos(List args) {
        return await(redisAPI.geopos(args));
    }

    @Override
    public Response georadius(List args) {
        return await(redisAPI.georadius(args));
    }

    @Override
    public Response georadiusRo(List args) {
        return await(redisAPI.georadiusRo(args));
    }

    @Override
    public Response georadiusbymember(List args) {
        return await(redisAPI.georadiusbymember(args));
    }

    @Override
    public Response georadiusbymemberRo(List args) {
        return await(redisAPI.georadiusbymemberRo(args));
    }

    @Override
    public Response get(String arg0) {
        return await(redisAPI.get(arg0));
    }

    @Override
    public Response getbit(String arg0, String arg1) {
        return await(redisAPI.getbit(arg0, arg1));
    }

    @Override
    public Response getrange(String arg0, String arg1, String arg2) {
        return await(redisAPI.getrange(arg0, arg1, arg2));
    }

    @Override
    public Response getset(String arg0, String arg1) {
        return await(redisAPI.getset(arg0, arg1));
    }

    @Override
    public Response hdel(List args) {
        return await(redisAPI.hdel(args));
    }

    @Override
    public Response hexists(String arg0, String arg1) {
        return await(redisAPI.hexists(arg0, arg1));
    }

    @Override
    public Response hget(String arg0, String arg1) {
        return await(redisAPI.hget(arg0, arg1));
    }

    @Override
    public Response hgetall(String arg0) {
        return await(redisAPI.hgetall(arg0));
    }

    @Override
    public Response hincrby(String arg0, String arg1, String arg2) {
        return await(redisAPI.hincrby(arg0, arg1, arg2));
    }

    @Override
    public Response hincrbyfloat(String arg0, String arg1, String arg2) {
        return await(redisAPI.hincrbyfloat(arg0, arg1, arg2));
    }

    @Override
    public Response hkeys(String arg0) {
        return await(redisAPI.hkeys(arg0));
    }

    @Override
    public Response hlen(String arg0) {
        return await(redisAPI.hlen(arg0));
    }

    @Override
    public Response hmget(List args) {
        return await(redisAPI.hmget(args));
    }

    @Override
    public Response hmset(List args) {
        return await(redisAPI.hmset(args));
    }

    @Override
    public Response host(List args) {
        return await(redis.send(Request.cmd(Command.create("host"), args.toArray(new String[0]))));
    }

    @Override
    public Response hscan(List args) {
        return await(redisAPI.hscan(args));
    }

    @Override
    public Response hset(List args) {
        return await(redisAPI.hset(args));
    }

    @Override
    public Response hsetnx(String arg0, String arg1, String arg2) {
        return await(redisAPI.hsetnx(arg0, arg1, arg2));
    }

    @Override
    public Response hstrlen(String arg0, String arg1) {
        return await(redisAPI.hstrlen(arg0, arg1));
    }

    @Override
    public Response hvals(String arg0) {
        return await(redisAPI.hvals(arg0));
    }

    @Override
    public Response incr(String arg0) {
        return await(redisAPI.incr(arg0));
    }

    @Override
    public Response incrby(String arg0, String arg1) {
        return await(redisAPI.incrby(arg0, arg1));
    }

    @Override
    public Response incrbyfloat(String arg0, String arg1) {
        return await(redisAPI.incrbyfloat(arg0, arg1));
    }

    @Override
    public Response info(List args) {
        return await(redisAPI.info(args));
    }

    @Override
    public Response keys(String arg0) {
        return await(redisAPI.keys(arg0));
    }

    @Override
    public Response lastsave() {
        return await(redisAPI.lastsave());
    }

    @Override
    public Response latency(List args) {
        return await(redisAPI.latency(args));
    }

    @Override
    public Response lindex(String arg0, String arg1) {
        return await(redisAPI.lindex(arg0, arg1));
    }

    @Override
    public Response linsert(String arg0, String arg1, String arg2, String arg3) {
        return await(redisAPI.linsert(arg0, arg1, arg2, arg3));
    }

    @Override
    public Response llen(String arg0) {
        return await(redisAPI.llen(arg0));
    }

    @Override
    public Response lolwut(List args) {
        return await(redisAPI.lolwut(args));
    }

    @Override
    public Response lpop(String arg0) {
        return await(redisAPI.lpop(List.of(arg0)));
    }

    @Override
    public Response lpop(List args) {
        return await(redisAPI.lpop(args));
    }

    @Override
    public Response lpush(List args) {
        return await(redisAPI.lpush(args));
    }

    @Override
    public Response lpushx(List args) {
        return await(redisAPI.lpushx(args));
    }

    @Override
    public Response lrange(String arg0, String arg1, String arg2) {
        return await(redisAPI.lrange(arg0, arg1, arg2));
    }

    @Override
    public Response lrem(String arg0, String arg1, String arg2) {
        return await(redisAPI.lrem(arg0, arg1, arg2));
    }

    @Override
    public Response lset(String arg0, String arg1, String arg2) {
        return await(redisAPI.lset(arg0, arg1, arg2));
    }

    @Override
    public Response ltrim(String arg0, String arg1, String arg2) {
        return await(redisAPI.ltrim(arg0, arg1, arg2));
    }

    @Override
    public Response memory(List args) {
        return await(redisAPI.memory(args));
    }

    @Override
    public Response mget(List args) {
        return await(redisAPI.mget(args));
    }

    @Override
    public Response migrate(List args) {
        return await(redisAPI.migrate(args));
    }

    @Override
    public Response module(List args) {
        return await(redisAPI.module(args));
    }

    @Override
    public Response monitor() {
        return await(redisAPI.monitor());
    }

    @Override
    public Response move(String arg0, String arg1) {
        return await(redisAPI.move(arg0, arg1));
    }

    @Override
    public Response mset(List args) {
        return await(redisAPI.mset(args));
    }

    @Override
    public Response msetnx(List args) {
        return await(redisAPI.msetnx(args));
    }

    @Override
    public Response multi() {
        return await(redisAPI.multi());
    }

    @Override
    public Response object(List args) {
        return await(redisAPI.object(args));
    }

    @Override
    public Response persist(String arg0) {
        return await(redisAPI.persist(arg0));
    }

    @Override
    public Response pexpire(String arg0, String arg1) {
        return await(redisAPI.pexpire(List.of(arg0, arg1)));
    }

    @Override
    public Response pexpireat(String arg0, String arg1) {
        return await(redisAPI.pexpireat(List.of(arg0, arg1)));
    }

    @Override
    public Response pfadd(List args) {
        return await(redisAPI.pfadd(args));
    }

    @Override
    public Response pfcount(List args) {
        return await(redisAPI.pfcount(args));
    }

    @Override
    public Response pfdebug(List args) {
        return await(redisAPI.pfdebug(args.get(0), args.get(1)));
    }

    @Override
    public Response pfdebug(String command, String key) {
        return await(redisAPI.pfdebug(command, key));
    }

    @Override
    public Response pfmerge(List args) {
        return await(redisAPI.pfmerge(args));
    }

    @Override
    public Response pfselftest() {
        return await(redisAPI.pfselftest());
    }

    @Override
    public Response ping(List args) {
        return await(redisAPI.ping(args));
    }

    @Override
    public Response post(List args) {
        return await(redis.send(Request.cmd(Command.create("post"), args.toArray(new String[0]))));
    }

    @Override
    public Response psetex(String arg0, String arg1, String arg2) {
        return await(redisAPI.psetex(arg0, arg1, arg2));
    }

    @Override
    public Response psubscribe(List args) {
        return await(redisAPI.psubscribe(args));
    }

    @Override
    public Response psync(String arg0, String arg1) {
        return await(redisAPI.psync(List.of(arg0, arg1)));
    }

    @Override
    public Response psync(List args) {
        return await(redisAPI.psync(args));
    }

    @Override
    public Response pttl(String arg0) {
        return await(redisAPI.pttl(arg0));
    }

    @Override
    public Response publish(String arg0, String arg1) {
        return await(redisAPI.publish(arg0, arg1));
    }

    @Override
    public Response pubsub(List args) {
        return await(redisAPI.pubsub(args));
    }

    @Override
    public Response punsubscribe(List args) {
        return await(redisAPI.punsubscribe(args));
    }

    @Override
    public Response randomkey() {
        return await(redisAPI.randomkey());
    }

    @Override
    public Response readonly() {
        return await(redisAPI.readonly());
    }

    @Override
    public Response readwrite() {
        return await(redisAPI.readwrite());
    }

    @Override
    public Response rename(String arg0, String arg1) {
        return await(redisAPI.rename(arg0, arg1));
    }

    @Override
    public Response renamenx(String arg0, String arg1) {
        return await(redisAPI.renamenx(arg0, arg1));
    }

    @Override
    public Response replconf(List args) {
        return await(redisAPI.replconf(args));
    }

    @Override
    public Response replicaof(String arg0, String arg1) {
        return await(redisAPI.replicaof(arg0, arg1));
    }

    @Override
    public Response restore(List args) {
        return await(redisAPI.restore(args));
    }

    @Override
    public Response restoreAsking(List args) {
        return await(redisAPI.restoreAsking(args));
    }

    @Override
    public Response role() {
        return await(redisAPI.role());
    }

    @Override
    public Response rpop(String arg0) {
        return await(redisAPI.rpop(List.of(arg0)));
    }

    @Override
    public Response rpop(List args) {
        return await(redisAPI.rpop(args));
    }

    @Override
    public Response rpoplpush(String arg0, String arg1) {
        return await(redisAPI.rpoplpush(arg0, arg1));
    }

    @Override
    public Response rpush(List args) {
        return await(redisAPI.rpush(args));
    }

    @Override
    public Response rpushx(List args) {
        return await(redisAPI.rpushx(args));
    }

    @Override
    public Response sadd(List args) {
        return await(redisAPI.sadd(args));
    }

    @Override
    public Response save() {
        return await(redisAPI.save());
    }

    @Override
    public Response scan(List args) {
        return await(redisAPI.scan(args));
    }

    @Override
    public Response scard(String arg0) {
        return await(redisAPI.scard(arg0));
    }

    @Override
    public Response script(List args) {
        return await(redisAPI.script(args));
    }

    @Override
    public Response sdiff(List args) {
        return await(redisAPI.sdiff(args));
    }

    @Override
    public Response sdiffstore(List args) {
        return await(redisAPI.sdiffstore(args));
    }

    @Override
    public Response select(String arg0) {
        return await(redisAPI.select(arg0));
    }

    @Override
    public Response set(List args) {
        return await(redisAPI.set(args));
    }

    @Override
    public Response setbit(String arg0, String arg1, String arg2) {
        return await(redisAPI.setbit(arg0, arg1, arg2));
    }

    @Override
    public Response setex(String arg0, String arg1, String arg2) {
        return await(redisAPI.setex(arg0, arg1, arg2));
    }

    @Override
    public Response setnx(String arg0, String arg1) {
        return await(redisAPI.setnx(arg0, arg1));
    }

    @Override
    public Response setrange(String arg0, String arg1, String arg2) {
        return await(redisAPI.setrange(arg0, arg1, arg2));
    }

    @Override
    public Response shutdown(List args) {
        return await(redisAPI.shutdown(args));
    }

    @Override
    public Response sinter(List args) {
        return await(redisAPI.sinter(args));
    }

    @Override
    public Response sinterstore(List args) {
        return await(redisAPI.sinterstore(args));
    }

    @Override
    public Response sismember(String arg0, String arg1) {
        return await(redisAPI.sismember(arg0, arg1));
    }

    @Override
    public Response slaveof(String arg0, String arg1) {
        return await(redisAPI.slaveof(arg0, arg1));
    }

    @Override
    public Response slowlog(List args) {
        return await(redisAPI.slowlog(args));
    }

    @Override
    public Response smembers(String arg0) {
        return await(redisAPI.smembers(arg0));
    }

    @Override
    public Response smove(String arg0, String arg1, String arg2) {
        return await(redisAPI.smove(arg0, arg1, arg2));
    }

    @Override
    public Response sort(List args) {
        return await(redisAPI.sort(args));
    }

    @Override
    public Response spop(List args) {
        return await(redisAPI.spop(args));
    }

    @Override
    public Response srandmember(List args) {
        return await(redisAPI.srandmember(args));
    }

    @Override
    public Response srem(List args) {
        return await(redisAPI.srem(args));
    }

    @Override
    public Response sscan(List args) {
        return await(redisAPI.sscan(args));
    }

    @Override
    public Response strlen(String arg0) {
        return await(redisAPI.strlen(arg0));
    }

    @Override
    public Response subscribe(List args) {
        return await(redisAPI.subscribe(args));
    }

    @Override
    public Response substr(String arg0, String arg1, String arg2) {
        return await(redisAPI.substr(arg0, arg1, arg2));
    }

    @Override
    public Response sunion(List args) {
        return await(redisAPI.sunion(args));
    }

    @Override
    public Response sunionstore(List args) {
        return await(redisAPI.sunionstore(args));
    }

    @Override
    public Response swapdb(String arg0, String arg1) {
        return await(redisAPI.swapdb(arg0, arg1));
    }

    @Override
    public Response sync() {
        return await(redisAPI.sync());
    }

    @Override
    public Response time() {
        return await(redisAPI.time());
    }

    @Override
    public Response touch(List args) {
        return await(redisAPI.touch(args));
    }

    @Override
    public Response ttl(String arg0) {
        return await(redisAPI.ttl(arg0));
    }

    @Override
    public Response type(String arg0) {
        return await(redisAPI.type(arg0));
    }

    @Override
    public Response unlink(List args) {
        return await(redisAPI.unlink(args));
    }

    @Override
    public Response unsubscribe(List args) {
        return await(redisAPI.unsubscribe(args));
    }

    @Override
    public Response unwatch() {
        return await(redisAPI.unwatch());
    }

    @Override
    public Response wait(String arg0, String arg1) {
        return await(redisAPI.wait(arg0, arg1));
    }

    @Override
    public Response watch(List args) {
        return await(redisAPI.watch(args));
    }

    @Override
    public Response xack(List args) {
        return await(redisAPI.xack(args));
    }

    @Override
    public Response xadd(List args) {
        return await(redisAPI.xadd(args));
    }

    @Override
    public Response xclaim(List args) {
        return await(redisAPI.xclaim(args));
    }

    @Override
    public Response xdel(List args) {
        return await(redisAPI.xdel(args));
    }

    @Override
    public Response xgroup(List args) {
        return await(redisAPI.xgroup(args));
    }

    @Override
    public Response xinfo(List args) {
        return await(redisAPI.xinfo(args));
    }

    @Override
    public Response xlen(String arg0) {
        return await(redisAPI.xlen(arg0));
    }

    @Override
    public Response xpending(List args) {
        return await(redisAPI.xpending(args));
    }

    @Override
    public Response xrange(List args) {
        return await(redisAPI.xrange(args));
    }

    @Override
    public Response xread(List args) {
        return await(redisAPI.xread(args));
    }

    @Override
    public Response xreadgroup(List args) {
        return await(redisAPI.xreadgroup(args));
    }

    @Override
    public Response xrevrange(List args) {
        return await(redisAPI.xrevrange(args));
    }

    @Override
    public Response xsetid(String arg0, String arg1) {
        return await(redisAPI.xsetid(List.of(arg0, arg1)));
    }

    @Override
    public Response xtrim(List args) {
        return await(redisAPI.xtrim(args));
    }

    @Override
    public Response zadd(List args) {
        return await(redisAPI.zadd(args));
    }

    @Override
    public Response zcard(String arg0) {
        return await(redisAPI.zcard(arg0));
    }

    @Override
    public Response zcount(String arg0, String arg1, String arg2) {
        return await(redisAPI.zcount(arg0, arg1, arg2));
    }

    @Override
    public Response zincrby(String arg0, String arg1, String arg2) {
        return await(redisAPI.zincrby(arg0, arg1, arg2));
    }

    @Override
    public Response zinterstore(List args) {
        return await(redisAPI.zinterstore(args));
    }

    @Override
    public Response zlexcount(String arg0, String arg1, String arg2) {
        return await(redisAPI.zlexcount(arg0, arg1, arg2));
    }

    @Override
    public Response zpopmax(List args) {
        return await(redisAPI.zpopmax(args));
    }

    @Override
    public Response zpopmin(List args) {
        return await(redisAPI.zpopmin(args));
    }

    @Override
    public Response zrange(List args) {
        return await(redisAPI.zrange(args));
    }

    @Override
    public Response zrangebylex(List args) {
        return await(redisAPI.zrangebylex(args));
    }

    @Override
    public Response zrangebyscore(List args) {
        return await(redisAPI.zrangebyscore(args));
    }

    @Override
    public Response zrank(String arg0, String arg1) {
        return await(redisAPI.zrank(arg0, arg1));
    }

    @Override
    public Response zrem(List args) {
        return await(redisAPI.zrem(args));
    }

    @Override
    public Response zremrangebylex(String arg0, String arg1, String arg2) {
        return await(redisAPI.zremrangebylex(arg0, arg1, arg2));
    }

    @Override
    public Response zremrangebyrank(String arg0, String arg1, String arg2) {
        return await(redisAPI.zremrangebyrank(arg0, arg1, arg2));
    }

    @Override
    public Response zremrangebyscore(String arg0, String arg1, String arg2) {
        return await(redisAPI.zremrangebyscore(arg0, arg1, arg2));
    }

    @Override
    public Response zrevrange(List args) {
        return await(redisAPI.zrevrange(args));
    }

    @Override
    public Response zrevrangebylex(List args) {
        return await(redisAPI.zrevrangebylex(args));
    }

    @Override
    public Response zrevrangebyscore(List args) {
        return await(redisAPI.zrevrangebyscore(args));
    }

    @Override
    public Response zrevrank(String arg0, String arg1) {
        return await(redisAPI.zrevrank(arg0, arg1));
    }

    @Override
    public Response zscan(List args) {
        return await(redisAPI.zscan(args));
    }

    @Override
    public Response zscore(String arg0, String arg1) {
        return await(redisAPI.zscore(arg0, arg1));
    }

    @Override
    public Response zunion(List args) {
        return await(redisAPI.zunion(args));
    }

    @Override
    public Response zunionstore(List args) {
        return await(redisAPI.zunionstore(args));
    }

    private Response await(Uni mutinyResponse) {
        io.vertx.mutiny.redis.client.Response response = mutinyResponse.await().atMost(timeout);
        if (response == null) {
            return null;
        }
        return response.getDelegate();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy