org.hyperledger.fabric.protos.discovery.DiscoveryGrpc 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.discovery;
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;
/**
*
* 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.23.0)",
comments = "Source: discovery/protocol.proto")
public final class DiscoveryGrpc {
private DiscoveryGrpc() {}
public static final 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.Protocol.SignedRequest.class,
responseType = org.hyperledger.fabric.protos.discovery.Protocol.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.Protocol.SignedRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.discovery.Protocol.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) {
return new DiscoveryStub(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) {
return new DiscoveryBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static DiscoveryFutureStub newFutureStub(
io.grpc.Channel channel) {
return new DiscoveryFutureStub(channel);
}
/**
*
* 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 {
/**
*
* Discover receives a signed request, and returns a response.
*
*/
public void discover(org.hyperledger.fabric.protos.discovery.Protocol.SignedRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getDiscoverMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getDiscoverMethod(),
asyncUnaryCall(
new MethodHandlers<
org.hyperledger.fabric.protos.discovery.Protocol.SignedRequest,
org.hyperledger.fabric.protos.discovery.Protocol.Response>(
this, METHODID_DISCOVER)))
.build();
}
}
/**
*
* 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.AbstractStub {
private DiscoveryStub(io.grpc.Channel channel) {
super(channel);
}
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.Protocol.SignedRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(getDiscoverMethod(), getCallOptions()), request, responseObserver);
}
}
/**
*
* 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.AbstractStub {
private DiscoveryBlockingStub(io.grpc.Channel channel) {
super(channel);
}
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.Protocol.Response discover(org.hyperledger.fabric.protos.discovery.Protocol.SignedRequest request) {
return blockingUnaryCall(
getChannel(), getDiscoverMethod(), getCallOptions(), request);
}
}
/**
*
* 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.AbstractStub {
private DiscoveryFutureStub(io.grpc.Channel channel) {
super(channel);
}
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.Protocol.SignedRequest request) {
return 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 DiscoveryImplBase serviceImpl;
private final int methodId;
MethodHandlers(DiscoveryImplBase 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.Protocol.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();
}
}
}
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.Protocol.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 String methodName;
DiscoveryMethodDescriptorSupplier(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;
}
}