org.hyperledger.fabric.protos.discovery.DiscoveryGrpc Maven / Gradle / Ivy
package org.hyperledger.fabric.protos.discovery;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*
* Discovery defines a service that serves information about the fabric network
* like which peers, orderers, chaincodes, etc.
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.68.0)",
comments = "Source: discovery/protocol.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class DiscoveryGrpc {
private DiscoveryGrpc() {}
public static final java.lang.String SERVICE_NAME = "discovery.Discovery";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getDiscoverMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Discover",
requestType = org.hyperledger.fabric.protos.discovery.SignedRequest.class,
responseType = org.hyperledger.fabric.protos.discovery.Response.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getDiscoverMethod() {
io.grpc.MethodDescriptor getDiscoverMethod;
if ((getDiscoverMethod = DiscoveryGrpc.getDiscoverMethod) == null) {
synchronized (DiscoveryGrpc.class) {
if ((getDiscoverMethod = DiscoveryGrpc.getDiscoverMethod) == null) {
DiscoveryGrpc.getDiscoverMethod = getDiscoverMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Discover"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.discovery.SignedRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.discovery.Response.getDefaultInstance()))
.setSchemaDescriptor(new DiscoveryMethodDescriptorSupplier("Discover"))
.build();
}
}
}
return getDiscoverMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static DiscoveryStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public DiscoveryStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new DiscoveryStub(channel, callOptions);
}
};
return DiscoveryStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static DiscoveryBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public DiscoveryBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new DiscoveryBlockingStub(channel, callOptions);
}
};
return DiscoveryBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static DiscoveryFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public DiscoveryFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new DiscoveryFutureStub(channel, callOptions);
}
};
return DiscoveryFutureStub.newStub(factory, channel);
}
/**
*
* Discovery defines a service that serves information about the fabric network
* like which peers, orderers, chaincodes, etc.
*
*/
public interface AsyncService {
/**
*
* Discover receives a signed request, and returns a response.
*
*/
default void discover(org.hyperledger.fabric.protos.discovery.SignedRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDiscoverMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service Discovery.
*
* Discovery defines a service that serves information about the fabric network
* like which peers, orderers, chaincodes, etc.
*
*/
public static abstract class DiscoveryImplBase
implements io.grpc.BindableService, AsyncService {
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return DiscoveryGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service Discovery.
*
* Discovery defines a service that serves information about the fabric network
* like which peers, orderers, chaincodes, etc.
*
*/
public static final class DiscoveryStub
extends io.grpc.stub.AbstractAsyncStub {
private DiscoveryStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected DiscoveryStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new DiscoveryStub(channel, callOptions);
}
/**
*
* Discover receives a signed request, and returns a response.
*
*/
public void discover(org.hyperledger.fabric.protos.discovery.SignedRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDiscoverMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service Discovery.
*
* Discovery defines a service that serves information about the fabric network
* like which peers, orderers, chaincodes, etc.
*
*/
public static final class DiscoveryBlockingStub
extends io.grpc.stub.AbstractBlockingStub {
private DiscoveryBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected DiscoveryBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new DiscoveryBlockingStub(channel, callOptions);
}
/**
*
* Discover receives a signed request, and returns a response.
*
*/
public org.hyperledger.fabric.protos.discovery.Response discover(org.hyperledger.fabric.protos.discovery.SignedRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDiscoverMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service Discovery.
*
* Discovery defines a service that serves information about the fabric network
* like which peers, orderers, chaincodes, etc.
*
*/
public static final class DiscoveryFutureStub
extends io.grpc.stub.AbstractFutureStub {
private DiscoveryFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected DiscoveryFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new DiscoveryFutureStub(channel, callOptions);
}
/**
*
* Discover receives a signed request, and returns a response.
*
*/
public com.google.common.util.concurrent.ListenableFuture discover(
org.hyperledger.fabric.protos.discovery.SignedRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDiscoverMethod(), getCallOptions()), request);
}
}
private static final int METHODID_DISCOVER = 0;
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_DISCOVER:
serviceImpl.discover((org.hyperledger.fabric.protos.discovery.SignedRequest) 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(
getDiscoverMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
org.hyperledger.fabric.protos.discovery.SignedRequest,
org.hyperledger.fabric.protos.discovery.Response>(
service, METHODID_DISCOVER)))
.build();
}
private static abstract class DiscoveryBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
DiscoveryBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return org.hyperledger.fabric.protos.discovery.ProtocolProto.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("Discovery");
}
}
private static final class DiscoveryFileDescriptorSupplier
extends DiscoveryBaseDescriptorSupplier {
DiscoveryFileDescriptorSupplier() {}
}
private static final class DiscoveryMethodDescriptorSupplier
extends DiscoveryBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final java.lang.String methodName;
DiscoveryMethodDescriptorSupplier(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 (DiscoveryGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new DiscoveryFileDescriptorSupplier())
.addMethod(getDiscoverMethod())
.build();
}
}
}
return result;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy