blob: 9883c92a04314c2350d06e269b13dcc9c4bd2245 [file] [log] [blame]
Eric Andersonb22bcdf2016-03-29 14:13:28 -07001package io.grpc.testing.integration;
Eric Anderson99a6d8d2016-03-22 11:31:36 -07002
3import static io.grpc.stub.ClientCalls.asyncUnaryCall;
4import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
5import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
6import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
7import static io.grpc.stub.ClientCalls.blockingUnaryCall;
8import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9import static io.grpc.stub.ClientCalls.futureUnaryCall;
10import static io.grpc.MethodDescriptor.generateFullMethodName;
11import static io.grpc.stub.ServerCalls.asyncUnaryCall;
12import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
13import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
14import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
Lukasz Strzalkowski2fbf1422016-04-08 02:28:32 +020015import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
16import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
Eric Anderson99a6d8d2016-03-22 11:31:36 -070017
nmittler7e8b5042016-04-15 12:52:00 -070018/**
19 * <pre>
20 * Test service that supports all call types.
21 * </pre>
22 */
Eric Anderson99a6d8d2016-03-22 11:31:36 -070023@javax.annotation.Generated(
Carl Mastrangelo3c5b5a52016-04-29 13:37:20 -070024 value = "by gRPC proto compiler (version 0.15.0-SNAPSHOT)",
Eric Andersonb22bcdf2016-03-29 14:13:28 -070025 comments = "Source: test.proto")
Eric Anderson99a6d8d2016-03-22 11:31:36 -070026public class TestServiceGrpc {
27
28 private TestServiceGrpc() {}
29
Eric Andersonb22bcdf2016-03-29 14:13:28 -070030 public static final String SERVICE_NAME = "grpc.testing.TestService";
Eric Anderson99a6d8d2016-03-22 11:31:36 -070031
32 // Static method descriptors that strictly reflect the proto.
33 @io.grpc.ExperimentalApi
Eric Andersonb22bcdf2016-03-29 14:13:28 -070034 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
35 io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL =
Eric Anderson99a6d8d2016-03-22 11:31:36 -070036 io.grpc.MethodDescriptor.create(
37 io.grpc.MethodDescriptor.MethodType.UNARY,
38 generateFullMethodName(
Eric Andersonb22bcdf2016-03-29 14:13:28 -070039 "grpc.testing.TestService", "UnaryCall"),
40 io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.getDefaultInstance()),
41 io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.getDefaultInstance()));
Eric Anderson99a6d8d2016-03-22 11:31:36 -070042 @io.grpc.ExperimentalApi
Eric Andersonb22bcdf2016-03-29 14:13:28 -070043 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
44 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
Eric Anderson99a6d8d2016-03-22 11:31:36 -070045 io.grpc.MethodDescriptor.create(
46 io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
47 generateFullMethodName(
Eric Andersonb22bcdf2016-03-29 14:13:28 -070048 "grpc.testing.TestService", "StreamingOutputCall"),
49 io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()),
50 io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance()));
Eric Anderson99a6d8d2016-03-22 11:31:36 -070051 @io.grpc.ExperimentalApi
Eric Andersonb22bcdf2016-03-29 14:13:28 -070052 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
53 io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
Eric Anderson99a6d8d2016-03-22 11:31:36 -070054 io.grpc.MethodDescriptor.create(
55 io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING,
56 generateFullMethodName(
Eric Andersonb22bcdf2016-03-29 14:13:28 -070057 "grpc.testing.TestService", "StreamingInputCall"),
58 io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.getDefaultInstance()),
59 io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.getDefaultInstance()));
Eric Anderson99a6d8d2016-03-22 11:31:36 -070060 @io.grpc.ExperimentalApi
Eric Andersonb22bcdf2016-03-29 14:13:28 -070061 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
62 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL =
Eric Anderson99a6d8d2016-03-22 11:31:36 -070063 io.grpc.MethodDescriptor.create(
64 io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
65 generateFullMethodName(
Eric Andersonb22bcdf2016-03-29 14:13:28 -070066 "grpc.testing.TestService", "FullBidiCall"),
67 io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()),
68 io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance()));
Eric Anderson99a6d8d2016-03-22 11:31:36 -070069 @io.grpc.ExperimentalApi
Eric Andersonb22bcdf2016-03-29 14:13:28 -070070 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
71 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL =
Eric Anderson99a6d8d2016-03-22 11:31:36 -070072 io.grpc.MethodDescriptor.create(
73 io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
74 generateFullMethodName(
Eric Andersonb22bcdf2016-03-29 14:13:28 -070075 "grpc.testing.TestService", "HalfBidiCall"),
76 io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()),
77 io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance()));
Eric Anderson99a6d8d2016-03-22 11:31:36 -070078
nmittler7e8b5042016-04-15 12:52:00 -070079 /**
80 * Creates a new async stub that supports all call types for the service
81 */
Eric Anderson99a6d8d2016-03-22 11:31:36 -070082 public static TestServiceStub newStub(io.grpc.Channel channel) {
83 return new TestServiceStub(channel);
84 }
85
nmittler7e8b5042016-04-15 12:52:00 -070086 /**
87 * Creates a new blocking-style stub that supports unary and streaming output calls on the service
88 */
Eric Anderson99a6d8d2016-03-22 11:31:36 -070089 public static TestServiceBlockingStub newBlockingStub(
90 io.grpc.Channel channel) {
91 return new TestServiceBlockingStub(channel);
92 }
93
nmittler7e8b5042016-04-15 12:52:00 -070094 /**
95 * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
96 */
Eric Anderson99a6d8d2016-03-22 11:31:36 -070097 public static TestServiceFutureStub newFutureStub(
98 io.grpc.Channel channel) {
99 return new TestServiceFutureStub(channel);
100 }
101
nmittler7e8b5042016-04-15 12:52:00 -0700102 /**
103 * <pre>
104 * Test service that supports all call types.
105 * </pre>
106 */
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700107 public static interface TestService {
108
nmittler7e8b5042016-04-15 12:52:00 -0700109 /**
110 * <pre>
111 * One request followed by one response.
112 * The server returns the client payload as-is.
113 * </pre>
114 */
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700115 public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
116 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700117
nmittler7e8b5042016-04-15 12:52:00 -0700118 /**
119 * <pre>
120 * One request followed by a sequence of responses (streamed download).
121 * The server returns the payload with client desired type and sizes.
122 * </pre>
123 */
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700124 public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
125 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700126
nmittler7e8b5042016-04-15 12:52:00 -0700127 /**
128 * <pre>
129 * A sequence of requests followed by one response (streamed upload).
130 * The server returns the aggregated size of client payload as the result.
131 * </pre>
132 */
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700133 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
134 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700135
nmittler7e8b5042016-04-15 12:52:00 -0700136 /**
137 * <pre>
138 * A sequence of requests with each request served by the server immediately.
139 * As one request could lead to multiple responses, this interface
140 * demonstrates the idea of full bidirectionality.
141 * </pre>
142 */
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700143 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall(
144 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700145
nmittler7e8b5042016-04-15 12:52:00 -0700146 /**
147 * <pre>
148 * A sequence of requests followed by a sequence of responses.
149 * The server buffers all the client requests and then serves them in order. A
150 * stream of responses are returned to the client when the server starts with
151 * first request.
152 * </pre>
153 */
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700154 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall(
155 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700156 }
157
Eric Anderson9bc5d932016-04-19 09:36:24 -0700158 @io.grpc.ExperimentalApi
Lukasz Strzalkowski2fbf1422016-04-08 02:28:32 +0200159 public static abstract class AbstractTestService implements TestService, io.grpc.BindableService {
160
161 @java.lang.Override
162 public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
163 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
164 asyncUnimplementedUnaryCall(METHOD_UNARY_CALL, responseObserver);
165 }
166
167 @java.lang.Override
168 public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
169 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
170 asyncUnimplementedUnaryCall(METHOD_STREAMING_OUTPUT_CALL, responseObserver);
171 }
172
173 @java.lang.Override
174 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
175 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
176 return asyncUnimplementedStreamingCall(METHOD_STREAMING_INPUT_CALL, responseObserver);
177 }
178
179 @java.lang.Override
180 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall(
181 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
182 return asyncUnimplementedStreamingCall(METHOD_FULL_BIDI_CALL, responseObserver);
183 }
184
185 @java.lang.Override
186 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall(
187 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
188 return asyncUnimplementedStreamingCall(METHOD_HALF_BIDI_CALL, responseObserver);
189 }
190
191 @java.lang.Override public io.grpc.ServerServiceDefinition bindService() {
192 return TestServiceGrpc.bindService(this);
193 }
194 }
195
nmittler7e8b5042016-04-15 12:52:00 -0700196 /**
197 * <pre>
198 * Test service that supports all call types.
199 * </pre>
200 */
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700201 public static interface TestServiceBlockingClient {
202
nmittler7e8b5042016-04-15 12:52:00 -0700203 /**
204 * <pre>
205 * One request followed by one response.
206 * The server returns the client payload as-is.
207 * </pre>
208 */
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700209 public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700210
nmittler7e8b5042016-04-15 12:52:00 -0700211 /**
212 * <pre>
213 * One request followed by a sequence of responses (streamed download).
214 * The server returns the payload with client desired type and sizes.
215 * </pre>
216 */
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700217 public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
218 io.grpc.testing.integration.Test.StreamingOutputCallRequest request);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700219 }
220
nmittler7e8b5042016-04-15 12:52:00 -0700221 /**
222 * <pre>
223 * Test service that supports all call types.
224 * </pre>
225 */
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700226 public static interface TestServiceFutureClient {
227
nmittler7e8b5042016-04-15 12:52:00 -0700228 /**
229 * <pre>
230 * One request followed by one response.
231 * The server returns the client payload as-is.
232 * </pre>
233 */
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700234 public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
235 io.grpc.testing.integration.Test.SimpleRequest request);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700236 }
237
238 public static class TestServiceStub extends io.grpc.stub.AbstractStub<TestServiceStub>
239 implements TestService {
240 private TestServiceStub(io.grpc.Channel channel) {
241 super(channel);
242 }
243
244 private TestServiceStub(io.grpc.Channel channel,
245 io.grpc.CallOptions callOptions) {
246 super(channel, callOptions);
247 }
248
249 @java.lang.Override
250 protected TestServiceStub build(io.grpc.Channel channel,
251 io.grpc.CallOptions callOptions) {
252 return new TestServiceStub(channel, callOptions);
253 }
254
255 @java.lang.Override
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700256 public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
257 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700258 asyncUnaryCall(
259 getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request, responseObserver);
260 }
261
262 @java.lang.Override
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700263 public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
264 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700265 asyncServerStreamingCall(
266 getChannel().newCall(METHOD_STREAMING_OUTPUT_CALL, getCallOptions()), request, responseObserver);
267 }
268
269 @java.lang.Override
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700270 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
271 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700272 return asyncClientStreamingCall(
273 getChannel().newCall(METHOD_STREAMING_INPUT_CALL, getCallOptions()), responseObserver);
274 }
275
276 @java.lang.Override
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700277 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall(
278 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700279 return asyncBidiStreamingCall(
280 getChannel().newCall(METHOD_FULL_BIDI_CALL, getCallOptions()), responseObserver);
281 }
282
283 @java.lang.Override
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700284 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall(
285 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700286 return asyncBidiStreamingCall(
287 getChannel().newCall(METHOD_HALF_BIDI_CALL, getCallOptions()), responseObserver);
288 }
289 }
290
291 public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub<TestServiceBlockingStub>
292 implements TestServiceBlockingClient {
293 private TestServiceBlockingStub(io.grpc.Channel channel) {
294 super(channel);
295 }
296
297 private TestServiceBlockingStub(io.grpc.Channel channel,
298 io.grpc.CallOptions callOptions) {
299 super(channel, callOptions);
300 }
301
302 @java.lang.Override
303 protected TestServiceBlockingStub build(io.grpc.Channel channel,
304 io.grpc.CallOptions callOptions) {
305 return new TestServiceBlockingStub(channel, callOptions);
306 }
307
308 @java.lang.Override
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700309 public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) {
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700310 return blockingUnaryCall(
311 getChannel(), METHOD_UNARY_CALL, getCallOptions(), request);
312 }
313
314 @java.lang.Override
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700315 public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
316 io.grpc.testing.integration.Test.StreamingOutputCallRequest request) {
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700317 return blockingServerStreamingCall(
318 getChannel(), METHOD_STREAMING_OUTPUT_CALL, getCallOptions(), request);
319 }
320 }
321
322 public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub<TestServiceFutureStub>
323 implements TestServiceFutureClient {
324 private TestServiceFutureStub(io.grpc.Channel channel) {
325 super(channel);
326 }
327
328 private TestServiceFutureStub(io.grpc.Channel channel,
329 io.grpc.CallOptions callOptions) {
330 super(channel, callOptions);
331 }
332
333 @java.lang.Override
334 protected TestServiceFutureStub build(io.grpc.Channel channel,
335 io.grpc.CallOptions callOptions) {
336 return new TestServiceFutureStub(channel, callOptions);
337 }
338
339 @java.lang.Override
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700340 public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
341 io.grpc.testing.integration.Test.SimpleRequest request) {
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700342 return futureUnaryCall(
343 getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request);
344 }
345 }
346
347 private static final int METHODID_UNARY_CALL = 0;
348 private static final int METHODID_STREAMING_OUTPUT_CALL = 1;
349 private static final int METHODID_STREAMING_INPUT_CALL = 2;
350 private static final int METHODID_FULL_BIDI_CALL = 3;
351 private static final int METHODID_HALF_BIDI_CALL = 4;
352
353 private static class MethodHandlers<Req, Resp> implements
354 io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
355 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
356 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
357 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
358 private final TestService serviceImpl;
359 private final int methodId;
360
361 public MethodHandlers(TestService serviceImpl, int methodId) {
362 this.serviceImpl = serviceImpl;
363 this.methodId = methodId;
364 }
365
366 @java.lang.Override
367 @java.lang.SuppressWarnings("unchecked")
368 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
369 switch (methodId) {
370 case METHODID_UNARY_CALL:
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700371 serviceImpl.unaryCall((io.grpc.testing.integration.Test.SimpleRequest) request,
372 (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse>) responseObserver);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700373 break;
374 case METHODID_STREAMING_OUTPUT_CALL:
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700375 serviceImpl.streamingOutputCall((io.grpc.testing.integration.Test.StreamingOutputCallRequest) request,
376 (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse>) responseObserver);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700377 break;
378 default:
379 throw new AssertionError();
380 }
381 }
382
383 @java.lang.Override
384 @java.lang.SuppressWarnings("unchecked")
385 public io.grpc.stub.StreamObserver<Req> invoke(
386 io.grpc.stub.StreamObserver<Resp> responseObserver) {
387 switch (methodId) {
388 case METHODID_STREAMING_INPUT_CALL:
389 return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamingInputCall(
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700390 (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse>) responseObserver);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700391 case METHODID_FULL_BIDI_CALL:
392 return (io.grpc.stub.StreamObserver<Req>) serviceImpl.fullBidiCall(
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700393 (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse>) responseObserver);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700394 case METHODID_HALF_BIDI_CALL:
395 return (io.grpc.stub.StreamObserver<Req>) serviceImpl.halfBidiCall(
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700396 (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse>) responseObserver);
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700397 default:
398 throw new AssertionError();
399 }
400 }
401 }
402
403 public static io.grpc.ServerServiceDefinition bindService(
404 final TestService serviceImpl) {
405 return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME)
406 .addMethod(
407 METHOD_UNARY_CALL,
408 asyncUnaryCall(
409 new MethodHandlers<
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700410 io.grpc.testing.integration.Test.SimpleRequest,
411 io.grpc.testing.integration.Test.SimpleResponse>(
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700412 serviceImpl, METHODID_UNARY_CALL)))
413 .addMethod(
414 METHOD_STREAMING_OUTPUT_CALL,
415 asyncServerStreamingCall(
416 new MethodHandlers<
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700417 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
418 io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700419 serviceImpl, METHODID_STREAMING_OUTPUT_CALL)))
420 .addMethod(
421 METHOD_STREAMING_INPUT_CALL,
422 asyncClientStreamingCall(
423 new MethodHandlers<
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700424 io.grpc.testing.integration.Test.StreamingInputCallRequest,
425 io.grpc.testing.integration.Test.StreamingInputCallResponse>(
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700426 serviceImpl, METHODID_STREAMING_INPUT_CALL)))
427 .addMethod(
428 METHOD_FULL_BIDI_CALL,
429 asyncBidiStreamingCall(
430 new MethodHandlers<
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700431 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
432 io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700433 serviceImpl, METHODID_FULL_BIDI_CALL)))
434 .addMethod(
435 METHOD_HALF_BIDI_CALL,
436 asyncBidiStreamingCall(
437 new MethodHandlers<
Eric Andersonb22bcdf2016-03-29 14:13:28 -0700438 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
439 io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
Eric Anderson99a6d8d2016-03-22 11:31:36 -0700440 serviceImpl, METHODID_HALF_BIDI_CALL)))
441 .build();
442 }
443}