nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 1 | package io.grpc.testing.integration; |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 2 | |
Kun Zhang | 2ee4d02 | 2015-06-04 16:39:25 -0700 | [diff] [blame] | 3 | import static io.grpc.stub.ClientCalls.asyncUnaryCall; |
| 4 | import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; |
| 5 | import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; |
| 6 | import static io.grpc.stub.ClientCalls.duplexStreamingCall; |
| 7 | import static io.grpc.stub.ClientCalls.blockingUnaryCall; |
| 8 | import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; |
| 9 | import static io.grpc.stub.ClientCalls.unaryFutureCall; |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame^] | 10 | import static io.grpc.stub.ServerCalls.asyncUnaryCall; |
| 11 | import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; |
| 12 | import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; |
| 13 | import static io.grpc.stub.ServerCalls.asyncDuplexStreamingCall; |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 14 | |
| 15 | @javax.annotation.Generated("by gRPC proto compiler") |
| 16 | public class TestServiceGrpc { |
| 17 | |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 18 | // Static method descriptors that strictly reflect the proto. |
| 19 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 20 | io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 21 | io.grpc.MethodDescriptor.create( |
| 22 | io.grpc.MethodDescriptor.MethodType.UNARY, |
| 23 | "grpc.testing.TestService", "UnaryCall", |
| 24 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.PARSER), |
| 25 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.PARSER)); |
| 26 | // Static method descriptors that strictly reflect the proto. |
| 27 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 28 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 29 | io.grpc.MethodDescriptor.create( |
| 30 | io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, |
| 31 | "grpc.testing.TestService", "StreamingOutputCall", |
| 32 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER), |
| 33 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER)); |
| 34 | // Static method descriptors that strictly reflect the proto. |
| 35 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 36 | io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 37 | io.grpc.MethodDescriptor.create( |
| 38 | io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING, |
| 39 | "grpc.testing.TestService", "StreamingInputCall", |
| 40 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.PARSER), |
| 41 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.PARSER)); |
| 42 | // Static method descriptors that strictly reflect the proto. |
| 43 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 44 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 45 | io.grpc.MethodDescriptor.create( |
| 46 | io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING, |
| 47 | "grpc.testing.TestService", "FullDuplexCall", |
| 48 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER), |
| 49 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER)); |
| 50 | // Static method descriptors that strictly reflect the proto. |
| 51 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 52 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 53 | io.grpc.MethodDescriptor.create( |
| 54 | io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING, |
| 55 | "grpc.testing.TestService", "HalfDuplexCall", |
| 56 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER), |
| 57 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER)); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 58 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 59 | public static TestServiceStub newStub(io.grpc.Channel channel) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 60 | return new TestServiceStub(channel, CONFIG); |
| 61 | } |
| 62 | |
| 63 | public static TestServiceBlockingStub newBlockingStub( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 64 | io.grpc.Channel channel) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 65 | return new TestServiceBlockingStub(channel, CONFIG); |
| 66 | } |
| 67 | |
| 68 | public static TestServiceFutureStub newFutureStub( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 69 | io.grpc.Channel channel) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 70 | return new TestServiceFutureStub(channel, CONFIG); |
| 71 | } |
| 72 | |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 73 | // The default service descriptor |
| 74 | private static final TestServiceServiceDescriptor CONFIG = |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 75 | new TestServiceServiceDescriptor(); |
| 76 | |
| 77 | @javax.annotation.concurrent.Immutable |
| 78 | public static class TestServiceServiceDescriptor extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 79 | io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> { |
| 80 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
| 81 | io.grpc.testing.integration.Test.SimpleResponse> unaryCall; |
| 82 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 83 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall; |
| 84 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 85 | io.grpc.testing.integration.Test.StreamingInputCallResponse> streamingInputCall; |
| 86 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 87 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> fullDuplexCall; |
| 88 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 89 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> halfDuplexCall; |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 90 | |
| 91 | private TestServiceServiceDescriptor() { |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 92 | unaryCall = METHOD_UNARY_CALL; |
| 93 | streamingOutputCall = METHOD_STREAMING_OUTPUT_CALL; |
| 94 | streamingInputCall = METHOD_STREAMING_INPUT_CALL; |
| 95 | fullDuplexCall = METHOD_FULL_DUPLEX_CALL; |
| 96 | halfDuplexCall = METHOD_HALF_DUPLEX_CALL; |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 97 | } |
| 98 | |
Eric Anderson | 76d0955 | 2015-03-12 15:25:11 -0700 | [diff] [blame] | 99 | @SuppressWarnings("unchecked") |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 100 | private TestServiceServiceDescriptor( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 101 | java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) { |
| 102 | unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
| 103 | io.grpc.testing.integration.Test.SimpleResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 104 | CONFIG.unaryCall.getFullMethodName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 105 | streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 106 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 107 | CONFIG.streamingOutputCall.getFullMethodName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 108 | streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 109 | io.grpc.testing.integration.Test.StreamingInputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 110 | CONFIG.streamingInputCall.getFullMethodName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 111 | fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 112 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 113 | CONFIG.fullDuplexCall.getFullMethodName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 114 | halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 115 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 116 | CONFIG.halfDuplexCall.getFullMethodName()); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | @java.lang.Override |
| 120 | protected TestServiceServiceDescriptor build( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 121 | java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 122 | return new TestServiceServiceDescriptor(methodMap); |
| 123 | } |
| 124 | |
| 125 | @java.lang.Override |
Kun Zhang | c73b75e | 2015-07-09 10:15:58 -0700 | [diff] [blame] | 126 | public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 127 | return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 128 | unaryCall, |
| 129 | streamingOutputCall, |
| 130 | streamingInputCall, |
| 131 | fullDuplexCall, |
| 132 | halfDuplexCall); |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | public static interface TestService { |
| 137 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 138 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 139 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 140 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 141 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 142 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 143 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 144 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 145 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 146 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 147 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall( |
| 148 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 149 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 150 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall( |
| 151 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | public static interface TestServiceBlockingClient { |
| 155 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 156 | public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 157 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 158 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 159 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | public static interface TestServiceFutureClient { |
| 163 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 164 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 165 | io.grpc.testing.integration.Test.SimpleRequest request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | public static class TestServiceStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 169 | io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 170 | implements TestService { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 171 | private TestServiceStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 172 | TestServiceServiceDescriptor config) { |
| 173 | super(channel, config); |
| 174 | } |
| 175 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 176 | private TestServiceStub(io.grpc.Channel channel, |
| 177 | TestServiceServiceDescriptor config, |
| 178 | io.grpc.CallOptions callOptions) { |
| 179 | super(channel, config, callOptions); |
| 180 | } |
| 181 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 182 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 183 | protected TestServiceStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 184 | TestServiceServiceDescriptor config, |
| 185 | io.grpc.CallOptions callOptions) { |
| 186 | return new TestServiceStub(channel, config, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 190 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 191 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 192 | asyncUnaryCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 193 | channel.newCall(config.unaryCall, callOptions), request, responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 197 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 198 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 199 | asyncServerStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 200 | channel.newCall(config.streamingOutputCall, callOptions), request, responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 201 | } |
| 202 | |
| 203 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 204 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 205 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 206 | return asyncClientStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 207 | channel.newCall(config.streamingInputCall, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 211 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall( |
| 212 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 213 | return duplexStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 214 | channel.newCall(config.fullDuplexCall, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 218 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall( |
| 219 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 220 | return duplexStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 221 | channel.newCall(config.halfDuplexCall, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 222 | } |
| 223 | } |
| 224 | |
| 225 | public static class TestServiceBlockingStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 226 | io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 227 | implements TestServiceBlockingClient { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 228 | private TestServiceBlockingStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 229 | TestServiceServiceDescriptor config) { |
| 230 | super(channel, config); |
| 231 | } |
| 232 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 233 | private TestServiceBlockingStub(io.grpc.Channel channel, |
| 234 | TestServiceServiceDescriptor config, |
| 235 | io.grpc.CallOptions callOptions) { |
| 236 | super(channel, config, callOptions); |
| 237 | } |
| 238 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 239 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 240 | protected TestServiceBlockingStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 241 | TestServiceServiceDescriptor config, |
| 242 | io.grpc.CallOptions callOptions) { |
| 243 | return new TestServiceBlockingStub(channel, config, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 247 | public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 248 | return blockingUnaryCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 249 | channel.newCall(config.unaryCall, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 250 | } |
| 251 | |
| 252 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 253 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 254 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 255 | return blockingServerStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 256 | channel.newCall(config.streamingOutputCall, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 257 | } |
| 258 | } |
| 259 | |
| 260 | public static class TestServiceFutureStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 261 | io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 262 | implements TestServiceFutureClient { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 263 | private TestServiceFutureStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 264 | TestServiceServiceDescriptor config) { |
| 265 | super(channel, config); |
| 266 | } |
| 267 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 268 | private TestServiceFutureStub(io.grpc.Channel channel, |
| 269 | TestServiceServiceDescriptor config, |
| 270 | io.grpc.CallOptions callOptions) { |
| 271 | super(channel, config, callOptions); |
| 272 | } |
| 273 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 274 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 275 | protected TestServiceFutureStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 276 | TestServiceServiceDescriptor config, |
| 277 | io.grpc.CallOptions callOptions) { |
| 278 | return new TestServiceFutureStub(channel, config, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 279 | } |
| 280 | |
| 281 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 282 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 283 | io.grpc.testing.integration.Test.SimpleRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 284 | return unaryFutureCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 285 | channel.newCall(config.unaryCall, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 286 | } |
| 287 | } |
| 288 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 289 | public static io.grpc.ServerServiceDefinition bindService( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 290 | final TestService serviceImpl) { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 291 | return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService") |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 292 | .addMethod(io.grpc.ServerMethodDefinition.create( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 293 | METHOD_UNARY_CALL, |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame^] | 294 | asyncUnaryCall( |
| 295 | new io.grpc.stub.ServerCalls.UnaryMethod< |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 296 | io.grpc.testing.integration.Test.SimpleRequest, |
| 297 | io.grpc.testing.integration.Test.SimpleResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 298 | @java.lang.Override |
| 299 | public void invoke( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 300 | io.grpc.testing.integration.Test.SimpleRequest request, |
| 301 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 302 | serviceImpl.unaryCall(request, responseObserver); |
| 303 | } |
| 304 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 305 | .addMethod(io.grpc.ServerMethodDefinition.create( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 306 | METHOD_STREAMING_OUTPUT_CALL, |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame^] | 307 | asyncServerStreamingCall( |
| 308 | new io.grpc.stub.ServerCalls.ServerStreamingMethod< |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 309 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 310 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 311 | @java.lang.Override |
| 312 | public void invoke( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 313 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 314 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 315 | serviceImpl.streamingOutputCall(request, responseObserver); |
| 316 | } |
| 317 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 318 | .addMethod(io.grpc.ServerMethodDefinition.create( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 319 | METHOD_STREAMING_INPUT_CALL, |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame^] | 320 | asyncClientStreamingCall( |
| 321 | new io.grpc.stub.ServerCalls.ClientStreamingMethod< |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 322 | io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 323 | io.grpc.testing.integration.Test.StreamingInputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 324 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 325 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> invoke( |
| 326 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 327 | return serviceImpl.streamingInputCall(responseObserver); |
| 328 | } |
| 329 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 330 | .addMethod(io.grpc.ServerMethodDefinition.create( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 331 | METHOD_FULL_DUPLEX_CALL, |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame^] | 332 | asyncDuplexStreamingCall( |
| 333 | new io.grpc.stub.ServerCalls.DuplexStreamingMethod< |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 334 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 335 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 336 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 337 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 338 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 339 | return serviceImpl.fullDuplexCall(responseObserver); |
| 340 | } |
| 341 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 342 | .addMethod(io.grpc.ServerMethodDefinition.create( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 343 | METHOD_HALF_DUPLEX_CALL, |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame^] | 344 | asyncDuplexStreamingCall( |
| 345 | new io.grpc.stub.ServerCalls.DuplexStreamingMethod< |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 346 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 347 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 348 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 349 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 350 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 351 | return serviceImpl.halfDuplexCall(responseObserver); |
| 352 | } |
| 353 | }))).build(); |
| 354 | } |
| 355 | } |