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

io.quarkus.redis.runtime.datasource.BlockingTransactionalRedisDataSourceImpl Maven / Gradle / Ivy

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

import java.time.Duration;

import io.quarkus.redis.datasource.autosuggest.TransactionalAutoSuggestCommands;
import io.quarkus.redis.datasource.bitmap.TransactionalBitMapCommands;
import io.quarkus.redis.datasource.bloom.TransactionalBloomCommands;
import io.quarkus.redis.datasource.countmin.TransactionalCountMinCommands;
import io.quarkus.redis.datasource.cuckoo.TransactionalCuckooCommands;
import io.quarkus.redis.datasource.geo.TransactionalGeoCommands;
import io.quarkus.redis.datasource.graph.TransactionalGraphCommands;
import io.quarkus.redis.datasource.hash.TransactionalHashCommands;
import io.quarkus.redis.datasource.hyperloglog.TransactionalHyperLogLogCommands;
import io.quarkus.redis.datasource.json.TransactionalJsonCommands;
import io.quarkus.redis.datasource.keys.TransactionalKeyCommands;
import io.quarkus.redis.datasource.list.TransactionalListCommands;
import io.quarkus.redis.datasource.search.TransactionalSearchCommands;
import io.quarkus.redis.datasource.set.TransactionalSetCommands;
import io.quarkus.redis.datasource.sortedset.TransactionalSortedSetCommands;
import io.quarkus.redis.datasource.stream.TransactionalStreamCommands;
import io.quarkus.redis.datasource.string.TransactionalStringCommands;
import io.quarkus.redis.datasource.timeseries.TransactionalTimeSeriesCommands;
import io.quarkus.redis.datasource.topk.TransactionalTopKCommands;
import io.quarkus.redis.datasource.transactions.ReactiveTransactionalRedisDataSource;
import io.quarkus.redis.datasource.transactions.TransactionalRedisDataSource;
import io.quarkus.redis.datasource.value.TransactionalValueCommands;
import io.vertx.mutiny.redis.client.Command;

public class BlockingTransactionalRedisDataSourceImpl implements TransactionalRedisDataSource {

    private final ReactiveTransactionalRedisDataSource reactive;
    private final Duration timeout;

    public BlockingTransactionalRedisDataSourceImpl(ReactiveTransactionalRedisDataSource api, Duration timeout) {
        this.reactive = api;
        this.timeout = timeout;
    }

    @Override
    public void discard() {
        reactive.discard().await().atMost(timeout);
    }

    @Override
    public boolean discarded() {
        return reactive.discarded();
    }

    @Override
    public  TransactionalHashCommands hash(Class redisKeyType, Class typeOfField,
            Class typeOfValue) {
        return new BlockingTransactionalHashCommandsImpl<>(this, reactive.hash(redisKeyType, typeOfField, typeOfValue),
                timeout);
    }

    @Override
    public  TransactionalGeoCommands geo(Class redisKeyType, Class memberType) {
        return new BlockingTransactionalGeoCommandsImpl<>(this, reactive.geo(redisKeyType, memberType), timeout);
    }

    @Override
    public  TransactionalKeyCommands key(Class redisKeyType) {
        return new BlockingTransactionalKeyCommandsImpl<>(this, reactive.key(redisKeyType), timeout);
    }

    @Override
    public  TransactionalSetCommands set(Class redisKeyType, Class memberType) {
        return new BlockingTransactionalSetCommandsImpl<>(this, reactive.set(redisKeyType, memberType), timeout);
    }

    @Override
    public  TransactionalSortedSetCommands sortedSet(Class redisKeyType, Class valueType) {
        return new BlockingTransactionalSortedSetCommandsImpl<>(this, reactive.sortedSet(redisKeyType, valueType), timeout);
    }

    @Override
    public  TransactionalStringCommands string(Class redisKeyType, Class valueType) {
        return new BlockingTransactionalStringCommandsImpl<>(this, reactive.value(redisKeyType, valueType), timeout);
    }

    @Override
    public  TransactionalValueCommands value(Class redisKeyType, Class valueType) {
        return new BlockingTransactionalStringCommandsImpl<>(this, reactive.value(redisKeyType, valueType), timeout);
    }

    @Override
    public  TransactionalListCommands list(Class redisKeyType, Class memberType) {
        return new BlockingTransactionalListCommandsImpl<>(this, reactive.list(redisKeyType, memberType), timeout);
    }

    @Override
    public  TransactionalHyperLogLogCommands hyperloglog(Class redisKeyType, Class memberType) {
        return new BlockingTransactionalHyperLogLogCommandsImpl<>(this, reactive.hyperloglog(redisKeyType, memberType),
                timeout);
    }

    @Override
    public  TransactionalBitMapCommands bitmap(Class redisKeyType) {
        return new BlockingTransactionalBitMapCommandsImpl<>(this, reactive.bitmap(redisKeyType), timeout);
    }

    @Override
    public  TransactionalStreamCommands stream(Class redisKeyType, Class typeOfField,
            Class typeOfValue) {
        return new BlockingTransactionalStreamCommandsImpl<>(this, reactive.stream(redisKeyType, typeOfField, typeOfValue),
                timeout);
    }

    @Override
    public  TransactionalJsonCommands json(Class redisKeyType) {
        return new BlockingTransactionalJsonCommandsImpl<>(this, reactive.json(redisKeyType), timeout);
    }

    @Override
    public  TransactionalBloomCommands bloom(Class redisKeyType, Class valueType) {
        return new BlockingTransactionalBloomCommandsImpl<>(this, reactive.bloom(redisKeyType, valueType), timeout);
    }

    @Override
    public  TransactionalCuckooCommands cuckoo(Class redisKeyType, Class valueType) {
        return new BlockingTransactionalCuckooCommandsImpl<>(this, reactive.cuckoo(redisKeyType, valueType), timeout);
    }

    @Override
    public  TransactionalCountMinCommands countmin(Class redisKeyType, Class valueType) {
        return new BlockingTransactionalCountMinCommandsImpl<>(this, reactive.countmin(redisKeyType, valueType), timeout);
    }

    @Override
    public  TransactionalTopKCommands topk(Class redisKeyType, Class valueType) {
        return new BlockingTransactionalTopKCommandsImpl<>(this, reactive.topk(redisKeyType, valueType), timeout);
    }

    @Override
    public  TransactionalGraphCommands graph(Class redisKeyType) {
        return new BlockingTransactionalGraphCommandsImpl<>(this, reactive.graph(redisKeyType), timeout);
    }

    @Override
    public  TransactionalSearchCommands search(Class redisKeyType) {
        return new BlockingTransactionalSearchCommandsImpl(this, reactive.search(redisKeyType), timeout);
    }

    @Override
    public  TransactionalAutoSuggestCommands autosuggest(Class redisKeyType) {
        return new BlockingTransactionalAutoSuggestCommandsImpl<>(this, reactive.autosuggest(redisKeyType), timeout);
    }

    @Override
    public  TransactionalTimeSeriesCommands timeseries(Class redisKeyType) {
        return new BlockingTransactionalTimeSeriesCommandsImpl<>(this, reactive.timeseries(redisKeyType), timeout);
    }

    @Override
    public void execute(String command, String... args) {
        reactive.execute(command, args).await().atMost(timeout);
    }

    @Override
    public void execute(Command command, String... args) {
        reactive.execute(command, args).await().atMost(timeout);
    }

    @Override
    public void execute(io.vertx.redis.client.Command command, String... args) {
        reactive.execute(command, args).await().atMost(timeout);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy