org.hyperledger.fabric.protos.peer.ChaincodeSupportGrpc 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;
/**
*
* Interface that provides support to chaincode execution. ChaincodeContext
* provides the context necessary for the server to respond appropriately.
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.23.0)",
comments = "Source: peer/chaincode_shim.proto")
public final class ChaincodeSupportGrpc {
private ChaincodeSupportGrpc() {}
public static final String SERVICE_NAME = "protos.ChaincodeSupport";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getRegisterMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Register",
requestType = org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.class,
responseType = org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.class,
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
public static io.grpc.MethodDescriptor getRegisterMethod() {
io.grpc.MethodDescriptor getRegisterMethod;
if ((getRegisterMethod = ChaincodeSupportGrpc.getRegisterMethod) == null) {
synchronized (ChaincodeSupportGrpc.class) {
if ((getRegisterMethod = ChaincodeSupportGrpc.getRegisterMethod) == null) {
ChaincodeSupportGrpc.getRegisterMethod = getRegisterMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Register"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.getDefaultInstance()))
.setSchemaDescriptor(new ChaincodeSupportMethodDescriptorSupplier("Register"))
.build();
}
}
}
return getRegisterMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static ChaincodeSupportStub newStub(io.grpc.Channel channel) {
return new ChaincodeSupportStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static ChaincodeSupportBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new ChaincodeSupportBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static ChaincodeSupportFutureStub newFutureStub(
io.grpc.Channel channel) {
return new ChaincodeSupportFutureStub(channel);
}
/**
*
* Interface that provides support to chaincode execution. ChaincodeContext
* provides the context necessary for the server to respond appropriately.
*
*/
public static abstract class ChaincodeSupportImplBase implements io.grpc.BindableService {
/**
*/
public io.grpc.stub.StreamObserver register(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(getRegisterMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getRegisterMethod(),
asyncBidiStreamingCall(
new MethodHandlers<
org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage,
org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage>(
this, METHODID_REGISTER)))
.build();
}
}
/**
*
* Interface that provides support to chaincode execution. ChaincodeContext
* provides the context necessary for the server to respond appropriately.
*
*/
public static final class ChaincodeSupportStub extends io.grpc.stub.AbstractStub {
private ChaincodeSupportStub(io.grpc.Channel channel) {
super(channel);
}
private ChaincodeSupportStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ChaincodeSupportStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new ChaincodeSupportStub(channel, callOptions);
}
/**
*/
public io.grpc.stub.StreamObserver register(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
getChannel().newCall(getRegisterMethod(), getCallOptions()), responseObserver);
}
}
/**
*
* Interface that provides support to chaincode execution. ChaincodeContext
* provides the context necessary for the server to respond appropriately.
*
*/
public static final class ChaincodeSupportBlockingStub extends io.grpc.stub.AbstractStub {
private ChaincodeSupportBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private ChaincodeSupportBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ChaincodeSupportBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new ChaincodeSupportBlockingStub(channel, callOptions);
}
}
/**
*
* Interface that provides support to chaincode execution. ChaincodeContext
* provides the context necessary for the server to respond appropriately.
*
*/
public static final class ChaincodeSupportFutureStub extends io.grpc.stub.AbstractStub {
private ChaincodeSupportFutureStub(io.grpc.Channel channel) {
super(channel);
}
private ChaincodeSupportFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ChaincodeSupportFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new ChaincodeSupportFutureStub(channel, callOptions);
}
}
private static final int METHODID_REGISTER = 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 ChaincodeSupportImplBase serviceImpl;
private final int methodId;
MethodHandlers(ChaincodeSupportImplBase 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_REGISTER:
return (io.grpc.stub.StreamObserver) serviceImpl.register(
(io.grpc.stub.StreamObserver) responseObserver);
default:
throw new AssertionError();
}
}
}
private static abstract class ChaincodeSupportBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
ChaincodeSupportBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return org.hyperledger.fabric.protos.peer.ChaincodeShim.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("ChaincodeSupport");
}
}
private static final class ChaincodeSupportFileDescriptorSupplier
extends ChaincodeSupportBaseDescriptorSupplier {
ChaincodeSupportFileDescriptorSupplier() {}
}
private static final class ChaincodeSupportMethodDescriptorSupplier
extends ChaincodeSupportBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
ChaincodeSupportMethodDescriptorSupplier(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 (ChaincodeSupportGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new ChaincodeSupportFileDescriptorSupplier())
.addMethod(getRegisterMethod())
.build();
}
}
}
return result;
}
}