|
| 1 | +package org.hyperledger.fabric.protos.peer; |
| 2 | + |
| 3 | +import static io.grpc.MethodDescriptor.generateFullMethodName; |
| 4 | +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; |
| 5 | +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; |
| 6 | +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; |
| 7 | +import static io.grpc.stub.ClientCalls.asyncUnaryCall; |
| 8 | +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; |
| 9 | +import static io.grpc.stub.ClientCalls.blockingUnaryCall; |
| 10 | +import static io.grpc.stub.ClientCalls.futureUnaryCall; |
| 11 | +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; |
| 12 | +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; |
| 13 | +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; |
| 14 | +import static io.grpc.stub.ServerCalls.asyncUnaryCall; |
| 15 | +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; |
| 16 | +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; |
| 17 | + |
| 18 | +/** |
| 19 | + * <pre> |
| 20 | + * Chaincode as a server - peer establishes a connection to the chaincode as a client |
| 21 | + * Currently only supports a stream connection. |
| 22 | + * </pre> |
| 23 | + */ |
| 24 | +@javax.annotation.Generated( |
| 25 | + value = "by gRPC proto compiler (version 1.23.0)", |
| 26 | + comments = "Source: peer/chaincode_shim.proto") |
| 27 | +public final class ChaincodeGrpc { |
| 28 | + |
| 29 | + private ChaincodeGrpc() {} |
| 30 | + |
| 31 | + public static final String SERVICE_NAME = "protos.Chaincode"; |
| 32 | + |
| 33 | + // Static method descriptors that strictly reflect the proto. |
| 34 | + private static volatile io.grpc.MethodDescriptor<org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage, |
| 35 | + org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage> getConnectMethod; |
| 36 | + |
| 37 | + @io.grpc.stub.annotations.RpcMethod( |
| 38 | + fullMethodName = SERVICE_NAME + '/' + "Connect", |
| 39 | + requestType = org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.class, |
| 40 | + responseType = org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.class, |
| 41 | + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) |
| 42 | + public static io.grpc.MethodDescriptor<org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage, |
| 43 | + org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage> getConnectMethod() { |
| 44 | + io.grpc.MethodDescriptor<org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage, org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage> getConnectMethod; |
| 45 | + if ((getConnectMethod = ChaincodeGrpc.getConnectMethod) == null) { |
| 46 | + synchronized (ChaincodeGrpc.class) { |
| 47 | + if ((getConnectMethod = ChaincodeGrpc.getConnectMethod) == null) { |
| 48 | + ChaincodeGrpc.getConnectMethod = getConnectMethod = |
| 49 | + io.grpc.MethodDescriptor.<org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage, org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage>newBuilder() |
| 50 | + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) |
| 51 | + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Connect")) |
| 52 | + .setSampledToLocalTracing(true) |
| 53 | + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( |
| 54 | + org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.getDefaultInstance())) |
| 55 | + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( |
| 56 | + org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage.getDefaultInstance())) |
| 57 | + .setSchemaDescriptor(new ChaincodeMethodDescriptorSupplier("Connect")) |
| 58 | + .build(); |
| 59 | + } |
| 60 | + } |
| 61 | + } |
| 62 | + return getConnectMethod; |
| 63 | + } |
| 64 | + |
| 65 | + /** |
| 66 | + * Creates a new async stub that supports all call types for the service |
| 67 | + */ |
| 68 | + public static ChaincodeStub newStub(io.grpc.Channel channel) { |
| 69 | + return new ChaincodeStub(channel); |
| 70 | + } |
| 71 | + |
| 72 | + /** |
| 73 | + * Creates a new blocking-style stub that supports unary and streaming output calls on the service |
| 74 | + */ |
| 75 | + public static ChaincodeBlockingStub newBlockingStub( |
| 76 | + io.grpc.Channel channel) { |
| 77 | + return new ChaincodeBlockingStub(channel); |
| 78 | + } |
| 79 | + |
| 80 | + /** |
| 81 | + * Creates a new ListenableFuture-style stub that supports unary calls on the service |
| 82 | + */ |
| 83 | + public static ChaincodeFutureStub newFutureStub( |
| 84 | + io.grpc.Channel channel) { |
| 85 | + return new ChaincodeFutureStub(channel); |
| 86 | + } |
| 87 | + |
| 88 | + /** |
| 89 | + * <pre> |
| 90 | + * Chaincode as a server - peer establishes a connection to the chaincode as a client |
| 91 | + * Currently only supports a stream connection. |
| 92 | + * </pre> |
| 93 | + */ |
| 94 | + public static abstract class ChaincodeImplBase implements io.grpc.BindableService { |
| 95 | + |
| 96 | + /** |
| 97 | + */ |
| 98 | + public io.grpc.stub.StreamObserver<org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage> connect( |
| 99 | + io.grpc.stub.StreamObserver<org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage> responseObserver) { |
| 100 | + return asyncUnimplementedStreamingCall(getConnectMethod(), responseObserver); |
| 101 | + } |
| 102 | + |
| 103 | + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { |
| 104 | + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) |
| 105 | + .addMethod( |
| 106 | + getConnectMethod(), |
| 107 | + asyncBidiStreamingCall( |
| 108 | + new MethodHandlers< |
| 109 | + org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage, |
| 110 | + org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage>( |
| 111 | + this, METHODID_CONNECT))) |
| 112 | + .build(); |
| 113 | + } |
| 114 | + } |
| 115 | + |
| 116 | + /** |
| 117 | + * <pre> |
| 118 | + * Chaincode as a server - peer establishes a connection to the chaincode as a client |
| 119 | + * Currently only supports a stream connection. |
| 120 | + * </pre> |
| 121 | + */ |
| 122 | + public static final class ChaincodeStub extends io.grpc.stub.AbstractStub<ChaincodeStub> { |
| 123 | + private ChaincodeStub(io.grpc.Channel channel) { |
| 124 | + super(channel); |
| 125 | + } |
| 126 | + |
| 127 | + private ChaincodeStub(io.grpc.Channel channel, |
| 128 | + io.grpc.CallOptions callOptions) { |
| 129 | + super(channel, callOptions); |
| 130 | + } |
| 131 | + |
| 132 | + @java.lang.Override |
| 133 | + protected ChaincodeStub build(io.grpc.Channel channel, |
| 134 | + io.grpc.CallOptions callOptions) { |
| 135 | + return new ChaincodeStub(channel, callOptions); |
| 136 | + } |
| 137 | + |
| 138 | + /** |
| 139 | + */ |
| 140 | + public io.grpc.stub.StreamObserver<org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage> connect( |
| 141 | + io.grpc.stub.StreamObserver<org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage> responseObserver) { |
| 142 | + return asyncBidiStreamingCall( |
| 143 | + getChannel().newCall(getConnectMethod(), getCallOptions()), responseObserver); |
| 144 | + } |
| 145 | + } |
| 146 | + |
| 147 | + /** |
| 148 | + * <pre> |
| 149 | + * Chaincode as a server - peer establishes a connection to the chaincode as a client |
| 150 | + * Currently only supports a stream connection. |
| 151 | + * </pre> |
| 152 | + */ |
| 153 | + public static final class ChaincodeBlockingStub extends io.grpc.stub.AbstractStub<ChaincodeBlockingStub> { |
| 154 | + private ChaincodeBlockingStub(io.grpc.Channel channel) { |
| 155 | + super(channel); |
| 156 | + } |
| 157 | + |
| 158 | + private ChaincodeBlockingStub(io.grpc.Channel channel, |
| 159 | + io.grpc.CallOptions callOptions) { |
| 160 | + super(channel, callOptions); |
| 161 | + } |
| 162 | + |
| 163 | + @java.lang.Override |
| 164 | + protected ChaincodeBlockingStub build(io.grpc.Channel channel, |
| 165 | + io.grpc.CallOptions callOptions) { |
| 166 | + return new ChaincodeBlockingStub(channel, callOptions); |
| 167 | + } |
| 168 | + } |
| 169 | + |
| 170 | + /** |
| 171 | + * <pre> |
| 172 | + * Chaincode as a server - peer establishes a connection to the chaincode as a client |
| 173 | + * Currently only supports a stream connection. |
| 174 | + * </pre> |
| 175 | + */ |
| 176 | + public static final class ChaincodeFutureStub extends io.grpc.stub.AbstractStub<ChaincodeFutureStub> { |
| 177 | + private ChaincodeFutureStub(io.grpc.Channel channel) { |
| 178 | + super(channel); |
| 179 | + } |
| 180 | + |
| 181 | + private ChaincodeFutureStub(io.grpc.Channel channel, |
| 182 | + io.grpc.CallOptions callOptions) { |
| 183 | + super(channel, callOptions); |
| 184 | + } |
| 185 | + |
| 186 | + @java.lang.Override |
| 187 | + protected ChaincodeFutureStub build(io.grpc.Channel channel, |
| 188 | + io.grpc.CallOptions callOptions) { |
| 189 | + return new ChaincodeFutureStub(channel, callOptions); |
| 190 | + } |
| 191 | + } |
| 192 | + |
| 193 | + private static final int METHODID_CONNECT = 0; |
| 194 | + |
| 195 | + private static final class MethodHandlers<Req, Resp> implements |
| 196 | + io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, |
| 197 | + io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, |
| 198 | + io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, |
| 199 | + io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { |
| 200 | + private final ChaincodeImplBase serviceImpl; |
| 201 | + private final int methodId; |
| 202 | + |
| 203 | + MethodHandlers(ChaincodeImplBase serviceImpl, int methodId) { |
| 204 | + this.serviceImpl = serviceImpl; |
| 205 | + this.methodId = methodId; |
| 206 | + } |
| 207 | + |
| 208 | + @java.lang.Override |
| 209 | + @java.lang.SuppressWarnings("unchecked") |
| 210 | + public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { |
| 211 | + switch (methodId) { |
| 212 | + default: |
| 213 | + throw new AssertionError(); |
| 214 | + } |
| 215 | + } |
| 216 | + |
| 217 | + @java.lang.Override |
| 218 | + @java.lang.SuppressWarnings("unchecked") |
| 219 | + public io.grpc.stub.StreamObserver<Req> invoke( |
| 220 | + io.grpc.stub.StreamObserver<Resp> responseObserver) { |
| 221 | + switch (methodId) { |
| 222 | + case METHODID_CONNECT: |
| 223 | + return (io.grpc.stub.StreamObserver<Req>) serviceImpl.connect( |
| 224 | + (io.grpc.stub.StreamObserver<org.hyperledger.fabric.protos.peer.ChaincodeShim.ChaincodeMessage>) responseObserver); |
| 225 | + default: |
| 226 | + throw new AssertionError(); |
| 227 | + } |
| 228 | + } |
| 229 | + } |
| 230 | + |
| 231 | + private static abstract class ChaincodeBaseDescriptorSupplier |
| 232 | + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { |
| 233 | + ChaincodeBaseDescriptorSupplier() {} |
| 234 | + |
| 235 | + @java.lang.Override |
| 236 | + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { |
| 237 | + return org.hyperledger.fabric.protos.peer.ChaincodeShim.getDescriptor(); |
| 238 | + } |
| 239 | + |
| 240 | + @java.lang.Override |
| 241 | + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { |
| 242 | + return getFileDescriptor().findServiceByName("Chaincode"); |
| 243 | + } |
| 244 | + } |
| 245 | + |
| 246 | + private static final class ChaincodeFileDescriptorSupplier |
| 247 | + extends ChaincodeBaseDescriptorSupplier { |
| 248 | + ChaincodeFileDescriptorSupplier() {} |
| 249 | + } |
| 250 | + |
| 251 | + private static final class ChaincodeMethodDescriptorSupplier |
| 252 | + extends ChaincodeBaseDescriptorSupplier |
| 253 | + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { |
| 254 | + private final String methodName; |
| 255 | + |
| 256 | + ChaincodeMethodDescriptorSupplier(String methodName) { |
| 257 | + this.methodName = methodName; |
| 258 | + } |
| 259 | + |
| 260 | + @java.lang.Override |
| 261 | + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { |
| 262 | + return getServiceDescriptor().findMethodByName(methodName); |
| 263 | + } |
| 264 | + } |
| 265 | + |
| 266 | + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; |
| 267 | + |
| 268 | + public static io.grpc.ServiceDescriptor getServiceDescriptor() { |
| 269 | + io.grpc.ServiceDescriptor result = serviceDescriptor; |
| 270 | + if (result == null) { |
| 271 | + synchronized (ChaincodeGrpc.class) { |
| 272 | + result = serviceDescriptor; |
| 273 | + if (result == null) { |
| 274 | + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) |
| 275 | + .setSchemaDescriptor(new ChaincodeFileDescriptorSupplier()) |
| 276 | + .addMethod(getConnectMethod()) |
| 277 | + .build(); |
| 278 | + } |
| 279 | + } |
| 280 | + } |
| 281 | + return result; |
| 282 | + } |
| 283 | +} |
0 commit comments