org.hyperledger.fabric.protos.gossip.GossipGrpc Maven / Gradle / Ivy
package org.hyperledger.fabric.protos.gossip;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*
* Gossip
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.68.0)",
comments = "Source: gossip/message.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class GossipGrpc {
private GossipGrpc() {}
public static final java.lang.String SERVICE_NAME = "gossip.Gossip";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getGossipStreamMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GossipStream",
requestType = org.hyperledger.fabric.protos.gossip.Envelope.class,
responseType = org.hyperledger.fabric.protos.gossip.Envelope.class,
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
public static io.grpc.MethodDescriptor getGossipStreamMethod() {
io.grpc.MethodDescriptor getGossipStreamMethod;
if ((getGossipStreamMethod = GossipGrpc.getGossipStreamMethod) == null) {
synchronized (GossipGrpc.class) {
if ((getGossipStreamMethod = GossipGrpc.getGossipStreamMethod) == null) {
GossipGrpc.getGossipStreamMethod = getGossipStreamMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GossipStream"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.gossip.Envelope.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.gossip.Envelope.getDefaultInstance()))
.setSchemaDescriptor(new GossipMethodDescriptorSupplier("GossipStream"))
.build();
}
}
}
return getGossipStreamMethod;
}
private static volatile io.grpc.MethodDescriptor getPingMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Ping",
requestType = org.hyperledger.fabric.protos.gossip.Empty.class,
responseType = org.hyperledger.fabric.protos.gossip.Empty.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getPingMethod() {
io.grpc.MethodDescriptor getPingMethod;
if ((getPingMethod = GossipGrpc.getPingMethod) == null) {
synchronized (GossipGrpc.class) {
if ((getPingMethod = GossipGrpc.getPingMethod) == null) {
GossipGrpc.getPingMethod = getPingMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Ping"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.gossip.Empty.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.gossip.Empty.getDefaultInstance()))
.setSchemaDescriptor(new GossipMethodDescriptorSupplier("Ping"))
.build();
}
}
}
return getPingMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static GossipStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public GossipStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new GossipStub(channel, callOptions);
}
};
return GossipStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static GossipBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public GossipBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new GossipBlockingStub(channel, callOptions);
}
};
return GossipBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static GossipFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public GossipFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new GossipFutureStub(channel, callOptions);
}
};
return GossipFutureStub.newStub(factory, channel);
}
/**
*
* Gossip
*
*/
public interface AsyncService {
/**
*
* GossipStream is the gRPC stream used for sending and receiving messages
*
*/
default io.grpc.stub.StreamObserver gossipStream(
io.grpc.stub.StreamObserver responseObserver) {
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGossipStreamMethod(), responseObserver);
}
/**
*
* Ping is used to probe a remote peer's aliveness
*
*/
default void ping(org.hyperledger.fabric.protos.gossip.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPingMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service Gossip.
*
* Gossip
*
*/
public static abstract class GossipImplBase
implements io.grpc.BindableService, AsyncService {
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return GossipGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service Gossip.
*
* Gossip
*
*/
public static final class GossipStub
extends io.grpc.stub.AbstractAsyncStub {
private GossipStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected GossipStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new GossipStub(channel, callOptions);
}
/**
*
* GossipStream is the gRPC stream used for sending and receiving messages
*
*/
public io.grpc.stub.StreamObserver gossipStream(
io.grpc.stub.StreamObserver responseObserver) {
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
getChannel().newCall(getGossipStreamMethod(), getCallOptions()), responseObserver);
}
/**
*
* Ping is used to probe a remote peer's aliveness
*
*/
public void ping(org.hyperledger.fabric.protos.gossip.Empty request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getPingMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service Gossip.
*
* Gossip
*
*/
public static final class GossipBlockingStub
extends io.grpc.stub.AbstractBlockingStub {
private GossipBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected GossipBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new GossipBlockingStub(channel, callOptions);
}
/**
*
* Ping is used to probe a remote peer's aliveness
*
*/
public org.hyperledger.fabric.protos.gossip.Empty ping(org.hyperledger.fabric.protos.gossip.Empty request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getPingMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service Gossip.
*
* Gossip
*
*/
public static final class GossipFutureStub
extends io.grpc.stub.AbstractFutureStub {
private GossipFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected GossipFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new GossipFutureStub(channel, callOptions);
}
/**
*
* Ping is used to probe a remote peer's aliveness
*
*/
public com.google.common.util.concurrent.ListenableFuture ping(
org.hyperledger.fabric.protos.gossip.Empty request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getPingMethod(), getCallOptions()), request);
}
}
private static final int METHODID_PING = 0;
private static final int METHODID_GOSSIP_STREAM = 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 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_PING:
serviceImpl.ping((org.hyperledger.fabric.protos.gossip.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) {
case METHODID_GOSSIP_STREAM:
return (io.grpc.stub.StreamObserver) serviceImpl.gossipStream(
(io.grpc.stub.StreamObserver) responseObserver);
default:
throw new AssertionError();
}
}
}
public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getGossipStreamMethod(),
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
new MethodHandlers<
org.hyperledger.fabric.protos.gossip.Envelope,
org.hyperledger.fabric.protos.gossip.Envelope>(
service, METHODID_GOSSIP_STREAM)))
.addMethod(
getPingMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
org.hyperledger.fabric.protos.gossip.Empty,
org.hyperledger.fabric.protos.gossip.Empty>(
service, METHODID_PING)))
.build();
}
private static abstract class GossipBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
GossipBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return org.hyperledger.fabric.protos.gossip.MessageProto.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("Gossip");
}
}
private static final class GossipFileDescriptorSupplier
extends GossipBaseDescriptorSupplier {
GossipFileDescriptorSupplier() {}
}
private static final class GossipMethodDescriptorSupplier
extends GossipBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final java.lang.String methodName;
GossipMethodDescriptorSupplier(java.lang.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 (GossipGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new GossipFileDescriptorSupplier())
.addMethod(getGossipStreamMethod())
.addMethod(getPingMethod())
.build();
}
}
}
return result;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy