io.tarantool.driver.proxy.AbstractProxyOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cartridge-driver Show documentation
Show all versions of cartridge-driver Show documentation
Tarantool Cartridge driver for Tarantool versions 1.10+ based on Netty framework
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);
}
}