com.wavesplatform.api.grpc.BlocksApiGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protobuf-schemas Show documentation
Show all versions of protobuf-schemas Show documentation
Waves Node protobuf java classes
package com.wavesplatform.api.grpc;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.25.0)",
comments = "Source: waves/node/grpc/blocks_api.proto")
public final class BlocksApiGrpc {
private BlocksApiGrpc() {}
public static final String SERVICE_NAME = "waves.node.grpc.BlocksApi";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getGetBlockMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetBlock",
requestType = com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRequest.class,
responseType = com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockWithHeight.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getGetBlockMethod() {
io.grpc.MethodDescriptor getGetBlockMethod;
if ((getGetBlockMethod = BlocksApiGrpc.getGetBlockMethod) == null) {
synchronized (BlocksApiGrpc.class) {
if ((getGetBlockMethod = BlocksApiGrpc.getGetBlockMethod) == null) {
BlocksApiGrpc.getGetBlockMethod = getGetBlockMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBlock"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockWithHeight.getDefaultInstance()))
.setSchemaDescriptor(new BlocksApiMethodDescriptorSupplier("GetBlock"))
.build();
}
}
}
return getGetBlockMethod;
}
private static volatile io.grpc.MethodDescriptor getGetBlockRangeMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetBlockRange",
requestType = com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRangeRequest.class,
responseType = com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockWithHeight.class,
methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
public static io.grpc.MethodDescriptor getGetBlockRangeMethod() {
io.grpc.MethodDescriptor getGetBlockRangeMethod;
if ((getGetBlockRangeMethod = BlocksApiGrpc.getGetBlockRangeMethod) == null) {
synchronized (BlocksApiGrpc.class) {
if ((getGetBlockRangeMethod = BlocksApiGrpc.getGetBlockRangeMethod) == null) {
BlocksApiGrpc.getGetBlockRangeMethod = getGetBlockRangeMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBlockRange"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRangeRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockWithHeight.getDefaultInstance()))
.setSchemaDescriptor(new BlocksApiMethodDescriptorSupplier("GetBlockRange"))
.build();
}
}
}
return getGetBlockRangeMethod;
}
private static volatile io.grpc.MethodDescriptor getGetCurrentHeightMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetCurrentHeight",
requestType = com.google.protobuf.Empty.class,
responseType = com.google.protobuf.UInt32Value.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getGetCurrentHeightMethod() {
io.grpc.MethodDescriptor getGetCurrentHeightMethod;
if ((getGetCurrentHeightMethod = BlocksApiGrpc.getGetCurrentHeightMethod) == null) {
synchronized (BlocksApiGrpc.class) {
if ((getGetCurrentHeightMethod = BlocksApiGrpc.getGetCurrentHeightMethod) == null) {
BlocksApiGrpc.getGetCurrentHeightMethod = getGetCurrentHeightMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCurrentHeight"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.protobuf.Empty.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.protobuf.UInt32Value.getDefaultInstance()))
.setSchemaDescriptor(new BlocksApiMethodDescriptorSupplier("GetCurrentHeight"))
.build();
}
}
}
return getGetCurrentHeightMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static BlocksApiStub newStub(io.grpc.Channel channel) {
return new BlocksApiStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static BlocksApiBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new BlocksApiBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static BlocksApiFutureStub newFutureStub(
io.grpc.Channel channel) {
return new BlocksApiFutureStub(channel);
}
/**
*/
public static abstract class BlocksApiImplBase implements io.grpc.BindableService {
/**
*/
public void getBlock(com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getGetBlockMethod(), responseObserver);
}
/**
*/
public void getBlockRange(com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRangeRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getGetBlockRangeMethod(), responseObserver);
}
/**
*/
public void getCurrentHeight(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getGetCurrentHeightMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getGetBlockMethod(),
asyncUnaryCall(
new MethodHandlers<
com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRequest,
com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockWithHeight>(
this, METHODID_GET_BLOCK)))
.addMethod(
getGetBlockRangeMethod(),
asyncServerStreamingCall(
new MethodHandlers<
com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRangeRequest,
com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockWithHeight>(
this, METHODID_GET_BLOCK_RANGE)))
.addMethod(
getGetCurrentHeightMethod(),
asyncUnaryCall(
new MethodHandlers<
com.google.protobuf.Empty,
com.google.protobuf.UInt32Value>(
this, METHODID_GET_CURRENT_HEIGHT)))
.build();
}
}
/**
*/
public static final class BlocksApiStub extends io.grpc.stub.AbstractStub {
private BlocksApiStub(io.grpc.Channel channel) {
super(channel);
}
private BlocksApiStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected BlocksApiStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new BlocksApiStub(channel, callOptions);
}
/**
*/
public void getBlock(com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(getGetBlockMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void getBlockRange(com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRangeRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncServerStreamingCall(
getChannel().newCall(getGetBlockRangeMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void getCurrentHeight(com.google.protobuf.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(getGetCurrentHeightMethod(), getCallOptions()), request, responseObserver);
}
}
/**
*/
public static final class BlocksApiBlockingStub extends io.grpc.stub.AbstractStub {
private BlocksApiBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private BlocksApiBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected BlocksApiBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new BlocksApiBlockingStub(channel, callOptions);
}
/**
*/
public com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockWithHeight getBlock(com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRequest request) {
return blockingUnaryCall(
getChannel(), getGetBlockMethod(), getCallOptions(), request);
}
/**
*/
public java.util.Iterator getBlockRange(
com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRangeRequest request) {
return blockingServerStreamingCall(
getChannel(), getGetBlockRangeMethod(), getCallOptions(), request);
}
/**
*/
public com.google.protobuf.UInt32Value getCurrentHeight(com.google.protobuf.Empty request) {
return blockingUnaryCall(
getChannel(), getGetCurrentHeightMethod(), getCallOptions(), request);
}
}
/**
*/
public static final class BlocksApiFutureStub extends io.grpc.stub.AbstractStub {
private BlocksApiFutureStub(io.grpc.Channel channel) {
super(channel);
}
private BlocksApiFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected BlocksApiFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new BlocksApiFutureStub(channel, callOptions);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture getBlock(
com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRequest request) {
return futureUnaryCall(
getChannel().newCall(getGetBlockMethod(), getCallOptions()), request);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture getCurrentHeight(
com.google.protobuf.Empty request) {
return futureUnaryCall(
getChannel().newCall(getGetCurrentHeightMethod(), getCallOptions()), request);
}
}
private static final int METHODID_GET_BLOCK = 0;
private static final int METHODID_GET_BLOCK_RANGE = 1;
private static final int METHODID_GET_CURRENT_HEIGHT = 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 BlocksApiImplBase serviceImpl;
private final int methodId;
MethodHandlers(BlocksApiImplBase 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_GET_BLOCK:
serviceImpl.getBlock((com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_GET_BLOCK_RANGE:
serviceImpl.getBlockRange((com.wavesplatform.api.grpc.BlocksApiOuterClass.BlockRangeRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_GET_CURRENT_HEIGHT:
serviceImpl.getCurrentHeight((com.google.protobuf.Empty) 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();
}
}
}
private static abstract class BlocksApiBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
BlocksApiBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.wavesplatform.api.grpc.BlocksApiOuterClass.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("BlocksApi");
}
}
private static final class BlocksApiFileDescriptorSupplier
extends BlocksApiBaseDescriptorSupplier {
BlocksApiFileDescriptorSupplier() {}
}
private static final class BlocksApiMethodDescriptorSupplier
extends BlocksApiBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
BlocksApiMethodDescriptorSupplier(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 (BlocksApiGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new BlocksApiFileDescriptorSupplier())
.addMethod(getGetBlockMethod())
.addMethod(getGetBlockRangeMethod())
.addMethod(getGetCurrentHeightMethod())
.build();
}
}
}
return result;
}
}