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

io.tarantool.driver.proxy.AbstractProxyOperation Maven / Gradle / Ivy

Go to download

Tarantool Cartridge driver for Tarantool versions 1.10+ based on Netty framework

There is a newer version: 0.14.0
Show newest version
package io.tarantool.driver.proxy;

import io.tarantool.driver.api.TarantoolClient;
import io.tarantool.driver.api.TarantoolResult;
import io.tarantool.driver.mappers.TarantoolCallResultMapper;

import java.util.List;
import java.util.concurrent.CompletableFuture;

/**
 * @author Alexey Kuzin
 * @author Sergey Volgin
 */
abstract class AbstractProxyOperation implements ProxyOperation {

    protected final TarantoolClient client;
    protected final String functionName;
    protected final List arguments;
    protected final TarantoolCallResultMapper resultMapper;

    AbstractProxyOperation(TarantoolClient client,
                           String functionName,
                           List arguments,
                           TarantoolCallResultMapper resultMapper) {
        this.client = client;
        this.arguments = arguments;
        this.functionName = functionName;
        this.resultMapper = resultMapper;
    }

    public TarantoolClient getClient() {
        return client;
    }

    public String getFunctionName() {
        return functionName;
    }

    public List getArguments() {
        return arguments;
    }

    public TarantoolCallResultMapper getResultMapper() {
        return resultMapper;
    }

    @Override
    public CompletableFuture> execute() {
        return client.call(functionName, arguments, client.getConfig().getMessagePackMapper(), resultMapper);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy