org.hyperledger.fabric.protos.peer.DeliverGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fabric-sdk-java Show documentation
Show all versions of fabric-sdk-java Show documentation
Java SDK for Hyperledger Fabric. Deprecated as of Fabric v2.5, replaced by org.hyperledger.fabric:fabric-gateway.
package org.hyperledger.fabric.protos.peer;
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.11.0)",
comments = "Source: peer/events.proto")
public final class DeliverGrpc {
private DeliverGrpc() {}
public static final String SERVICE_NAME = "protos.Deliver";
// Static method descriptors that strictly reflect the proto.
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
@java.lang.Deprecated // Use {@link #getDeliverMethod()} instead.
public static final io.grpc.MethodDescriptor METHOD_DELIVER = getDeliverMethodHelper();
private static volatile io.grpc.MethodDescriptor getDeliverMethod;
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static io.grpc.MethodDescriptor getDeliverMethod() {
return getDeliverMethodHelper();
}
private static io.grpc.MethodDescriptor getDeliverMethodHelper() {
io.grpc.MethodDescriptor getDeliverMethod;
if ((getDeliverMethod = DeliverGrpc.getDeliverMethod) == null) {
synchronized (DeliverGrpc.class) {
if ((getDeliverMethod = DeliverGrpc.getDeliverMethod) == null) {
DeliverGrpc.getDeliverMethod = getDeliverMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(
"protos.Deliver", "Deliver"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.common.Common.Envelope.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.peer.PeerEvents.DeliverResponse.getDefaultInstance()))
.setSchemaDescriptor(new DeliverMethodDescriptorSupplier("Deliver"))
.build();
}
}
}
return getDeliverMethod;
}
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
@java.lang.Deprecated // Use {@link #getDeliverFilteredMethod()} instead.
public static final io.grpc.MethodDescriptor METHOD_DELIVER_FILTERED = getDeliverFilteredMethodHelper();
private static volatile io.grpc.MethodDescriptor getDeliverFilteredMethod;
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static io.grpc.MethodDescriptor getDeliverFilteredMethod() {
return getDeliverFilteredMethodHelper();
}
private static io.grpc.MethodDescriptor getDeliverFilteredMethodHelper() {
io.grpc.MethodDescriptor getDeliverFilteredMethod;
if ((getDeliverFilteredMethod = DeliverGrpc.getDeliverFilteredMethod) == null) {
synchronized (DeliverGrpc.class) {
if ((getDeliverFilteredMethod = DeliverGrpc.getDeliverFilteredMethod) == null) {
DeliverGrpc.getDeliverFilteredMethod = getDeliverFilteredMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(
"protos.Deliver", "DeliverFiltered"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.common.Common.Envelope.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.peer.PeerEvents.DeliverResponse.getDefaultInstance()))
.setSchemaDescriptor(new DeliverMethodDescriptorSupplier("DeliverFiltered"))
.build();
}
}
}
return getDeliverFilteredMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static DeliverStub newStub(io.grpc.Channel channel) {
return new DeliverStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static DeliverBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new DeliverBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static DeliverFutureStub newFutureStub(
io.grpc.Channel channel) {
return new DeliverFutureStub(channel);
}
/**
*/
public static abstract class DeliverImplBase implements io.grpc.BindableService {
/**
*
* deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message,
* then a stream of block replies is received.
*
*/
public io.grpc.stub.StreamObserver deliver(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(getDeliverMethodHelper(), responseObserver);
}
/**
*
* deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message,
* then a stream of **filtered** block replies is received.
*
*/
public io.grpc.stub.StreamObserver deliverFiltered(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(getDeliverFilteredMethodHelper(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getDeliverMethodHelper(),
asyncBidiStreamingCall(
new MethodHandlers<
org.hyperledger.fabric.protos.common.Common.Envelope,
org.hyperledger.fabric.protos.peer.PeerEvents.DeliverResponse>(
this, METHODID_DELIVER)))
.addMethod(
getDeliverFilteredMethodHelper(),
asyncBidiStreamingCall(
new MethodHandlers<
org.hyperledger.fabric.protos.common.Common.Envelope,
org.hyperledger.fabric.protos.peer.PeerEvents.DeliverResponse>(
this, METHODID_DELIVER_FILTERED)))
.build();
}
}
/**
*/
public static final class DeliverStub extends io.grpc.stub.AbstractStub {
private DeliverStub(io.grpc.Channel channel) {
super(channel);
}
private DeliverStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected DeliverStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new DeliverStub(channel, callOptions);
}
/**
*
* deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message,
* then a stream of block replies is received.
*
*/
public io.grpc.stub.StreamObserver deliver(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
getChannel().newCall(getDeliverMethodHelper(), getCallOptions()), responseObserver);
}
/**
*
* deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message,
* then a stream of **filtered** block replies is received.
*
*/
public io.grpc.stub.StreamObserver deliverFiltered(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
getChannel().newCall(getDeliverFilteredMethodHelper(), getCallOptions()), responseObserver);
}
}
/**
*/
public static final class DeliverBlockingStub extends io.grpc.stub.AbstractStub {
private DeliverBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private DeliverBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected DeliverBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new DeliverBlockingStub(channel, callOptions);
}
}
/**
*/
public static final class DeliverFutureStub extends io.grpc.stub.AbstractStub {
private DeliverFutureStub(io.grpc.Channel channel) {
super(channel);
}
private DeliverFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected DeliverFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new DeliverFutureStub(channel, callOptions);
}
}
private static final int METHODID_DELIVER = 0;
private static final int METHODID_DELIVER_FILTERED = 1;
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 DeliverImplBase serviceImpl;
private final int methodId;
MethodHandlers(DeliverImplBase 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) {
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver invoke(
io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
case METHODID_DELIVER:
return (io.grpc.stub.StreamObserver) serviceImpl.deliver(
(io.grpc.stub.StreamObserver) responseObserver);
case METHODID_DELIVER_FILTERED:
return (io.grpc.stub.StreamObserver) serviceImpl.deliverFiltered(
(io.grpc.stub.StreamObserver) responseObserver);
default:
throw new AssertionError();
}
}
}
private static abstract class DeliverBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
DeliverBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return org.hyperledger.fabric.protos.peer.PeerEvents.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("Deliver");
}
}
private static final class DeliverFileDescriptorSupplier
extends DeliverBaseDescriptorSupplier {
DeliverFileDescriptorSupplier() {}
}
private static final class DeliverMethodDescriptorSupplier
extends DeliverBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
DeliverMethodDescriptorSupplier(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 (DeliverGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new DeliverFileDescriptorSupplier())
.addMethod(getDeliverMethodHelper())
.addMethod(getDeliverFilteredMethodHelper())
.build();
}
}
}
return result;
}
}