com.exactpro.th2.read.db.grpc.ReadDbGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grpc-read-db Show documentation
Show all versions of grpc-read-db Show documentation
gRPC API for executing requests in read-db application
package com.exactpro.th2.read.db.grpc;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.56.0)",
comments = "Source: th2_grpc_read_db/read_db.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ReadDbGrpc {
private ReadDbGrpc() {}
public static final String SERVICE_NAME = "th2.read_db.ReadDb";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getExecuteMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Execute",
requestType = com.exactpro.th2.read.db.grpc.QueryRequest.class,
responseType = com.exactpro.th2.read.db.grpc.QueryResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
public static io.grpc.MethodDescriptor getExecuteMethod() {
io.grpc.MethodDescriptor getExecuteMethod;
if ((getExecuteMethod = ReadDbGrpc.getExecuteMethod) == null) {
synchronized (ReadDbGrpc.class) {
if ((getExecuteMethod = ReadDbGrpc.getExecuteMethod) == null) {
ReadDbGrpc.getExecuteMethod = getExecuteMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Execute"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.exactpro.th2.read.db.grpc.QueryRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.exactpro.th2.read.db.grpc.QueryResponse.getDefaultInstance()))
.setSchemaDescriptor(new ReadDbMethodDescriptorSupplier("Execute"))
.build();
}
}
}
return getExecuteMethod;
}
private static volatile io.grpc.MethodDescriptor getStartPullingMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "StartPulling",
requestType = com.exactpro.th2.read.db.grpc.DbPullRequest.class,
responseType = com.exactpro.th2.read.db.grpc.DbPullResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getStartPullingMethod() {
io.grpc.MethodDescriptor getStartPullingMethod;
if ((getStartPullingMethod = ReadDbGrpc.getStartPullingMethod) == null) {
synchronized (ReadDbGrpc.class) {
if ((getStartPullingMethod = ReadDbGrpc.getStartPullingMethod) == null) {
ReadDbGrpc.getStartPullingMethod = getStartPullingMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartPulling"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.exactpro.th2.read.db.grpc.DbPullRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.exactpro.th2.read.db.grpc.DbPullResponse.getDefaultInstance()))
.setSchemaDescriptor(new ReadDbMethodDescriptorSupplier("StartPulling"))
.build();
}
}
}
return getStartPullingMethod;
}
private static volatile io.grpc.MethodDescriptor getStopPullingMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "StopPulling",
requestType = com.exactpro.th2.read.db.grpc.StopPullingRequest.class,
responseType = com.google.protobuf.Empty.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getStopPullingMethod() {
io.grpc.MethodDescriptor getStopPullingMethod;
if ((getStopPullingMethod = ReadDbGrpc.getStopPullingMethod) == null) {
synchronized (ReadDbGrpc.class) {
if ((getStopPullingMethod = ReadDbGrpc.getStopPullingMethod) == null) {
ReadDbGrpc.getStopPullingMethod = getStopPullingMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopPulling"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.exactpro.th2.read.db.grpc.StopPullingRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.protobuf.Empty.getDefaultInstance()))
.setSchemaDescriptor(new ReadDbMethodDescriptorSupplier("StopPulling"))
.build();
}
}
}
return getStopPullingMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static ReadDbStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public ReadDbStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReadDbStub(channel, callOptions);
}
};
return ReadDbStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static ReadDbBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public ReadDbBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReadDbBlockingStub(channel, callOptions);
}
};
return ReadDbBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static ReadDbFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public ReadDbFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReadDbFutureStub(channel, callOptions);
}
};
return ReadDbFutureStub.newStub(factory, channel);
}
/**
*/
public interface AsyncService {
/**
*/
default void execute(com.exactpro.th2.read.db.grpc.QueryRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExecuteMethod(), responseObserver);
}
/**
*/
default void startPulling(com.exactpro.th2.read.db.grpc.DbPullRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStartPullingMethod(), responseObserver);
}
/**
*/
default void stopPulling(com.exactpro.th2.read.db.grpc.StopPullingRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStopPullingMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service ReadDb.
*/
public static abstract class ReadDbImplBase
implements io.grpc.BindableService, AsyncService {
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return ReadDbGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service ReadDb.
*/
public static final class ReadDbStub
extends io.grpc.stub.AbstractAsyncStub {
private ReadDbStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ReadDbStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReadDbStub(channel, callOptions);
}
/**
*/
public void execute(com.exactpro.th2.read.db.grpc.QueryRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncServerStreamingCall(
getChannel().newCall(getExecuteMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void startPulling(com.exactpro.th2.read.db.grpc.DbPullRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getStartPullingMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void stopPulling(com.exactpro.th2.read.db.grpc.StopPullingRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getStopPullingMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service ReadDb.
*/
public static final class ReadDbBlockingStub
extends io.grpc.stub.AbstractBlockingStub {
private ReadDbBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ReadDbBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReadDbBlockingStub(channel, callOptions);
}
/**
*/
public java.util.Iterator execute(
com.exactpro.th2.read.db.grpc.QueryRequest request) {
return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
getChannel(), getExecuteMethod(), getCallOptions(), request);
}
/**
*/
public com.exactpro.th2.read.db.grpc.DbPullResponse startPulling(com.exactpro.th2.read.db.grpc.DbPullRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getStartPullingMethod(), getCallOptions(), request);
}
/**
*/
public com.google.protobuf.Empty stopPulling(com.exactpro.th2.read.db.grpc.StopPullingRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getStopPullingMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service ReadDb.
*/
public static final class ReadDbFutureStub
extends io.grpc.stub.AbstractFutureStub {
private ReadDbFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ReadDbFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReadDbFutureStub(channel, callOptions);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture startPulling(
com.exactpro.th2.read.db.grpc.DbPullRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getStartPullingMethod(), getCallOptions()), request);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture stopPulling(
com.exactpro.th2.read.db.grpc.StopPullingRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getStopPullingMethod(), getCallOptions()), request);
}
}
private static final int METHODID_EXECUTE = 0;
private static final int METHODID_START_PULLING = 1;
private static final int METHODID_STOP_PULLING = 2;
private static final class MethodHandlers implements
io.grpc.stub.ServerCalls.UnaryMethod,
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
private final AsyncService serviceImpl;
private final int methodId;
MethodHandlers(AsyncService serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
case METHODID_EXECUTE:
serviceImpl.execute((com.exactpro.th2.read.db.grpc.QueryRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_START_PULLING:
serviceImpl.startPulling((com.exactpro.th2.read.db.grpc.DbPullRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_STOP_PULLING:
serviceImpl.stopPulling((com.exactpro.th2.read.db.grpc.StopPullingRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver invoke(
io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getExecuteMethod(),
io.grpc.stub.ServerCalls.asyncServerStreamingCall(
new MethodHandlers<
com.exactpro.th2.read.db.grpc.QueryRequest,
com.exactpro.th2.read.db.grpc.QueryResponse>(
service, METHODID_EXECUTE)))
.addMethod(
getStartPullingMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.exactpro.th2.read.db.grpc.DbPullRequest,
com.exactpro.th2.read.db.grpc.DbPullResponse>(
service, METHODID_START_PULLING)))
.addMethod(
getStopPullingMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.exactpro.th2.read.db.grpc.StopPullingRequest,
com.google.protobuf.Empty>(
service, METHODID_STOP_PULLING)))
.build();
}
private static abstract class ReadDbBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
ReadDbBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.exactpro.th2.read.db.grpc.ReadDbOuterClass.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("ReadDb");
}
}
private static final class ReadDbFileDescriptorSupplier
extends ReadDbBaseDescriptorSupplier {
ReadDbFileDescriptorSupplier() {}
}
private static final class ReadDbMethodDescriptorSupplier
extends ReadDbBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
ReadDbMethodDescriptorSupplier(String methodName) {
this.methodName = methodName;
}
@java.lang.Override
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
return getServiceDescriptor().findMethodByName(methodName);
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (ReadDbGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new ReadDbFileDescriptorSupplier())
.addMethod(getExecuteMethod())
.addMethod(getStartPullingMethod())
.addMethod(getStopPullingMethod())
.build();
}
}
}
return result;
}
}