blob: 77d5bb2ccb4536899cafad4eb2aabbec8fea2d5d [file] [log] [blame]
nmittlerf8314582015-01-27 10:25:39 -08001package io.grpc.testing.integration;
zhangkun835e607852015-01-22 12:31:56 -08002
Kun Zhang2ee4d022015-06-04 16:39:25 -07003import static io.grpc.stub.ClientCalls.asyncUnaryCall;
4import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
5import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -07006import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
Kun Zhang2ee4d022015-06-04 16:39:25 -07007import static io.grpc.stub.ClientCalls.blockingUnaryCall;
8import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
Kun Zhang686dcff2015-07-16 12:34:37 -07009import static io.grpc.stub.ClientCalls.futureUnaryCall;
Kun Zhang042b2782015-08-17 15:43:40 -070010import static io.grpc.MethodDescriptor.generateFullMethodName;
Kun Zhang867c76d2015-07-13 17:15:34 -070011import static io.grpc.stub.ServerCalls.asyncUnaryCall;
12import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
13import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -070014import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
zhangkun835e607852015-01-22 12:31:56 -080015
16@javax.annotation.Generated("by gRPC proto compiler")
17public class TestServiceGrpc {
18
Eric Andersonbe0d7e92015-09-10 09:47:17 -070019 private TestServiceGrpc() {}
20
David P. Baker66b984c2015-08-21 13:00:26 -040021 public static final String SERVICE_NAME = "grpc.testing.TestService";
22
Kun Zhang73acc732015-06-26 16:32:05 -070023 // Static method descriptors that strictly reflect the proto.
Kun Zhang5bb0ea92015-08-31 09:56:44 -070024 @io.grpc.ExperimentalApi
Kun Zhang73acc732015-06-26 16:32:05 -070025 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
nmittlerf8314582015-01-27 10:25:39 -080026 io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070027 io.grpc.MethodDescriptor.create(
28 io.grpc.MethodDescriptor.MethodType.UNARY,
Kun Zhang042b2782015-08-17 15:43:40 -070029 generateFullMethodName(
30 "grpc.testing.TestService", "UnaryCall"),
Eric Anderson47a7ccf2015-09-03 16:56:36 -070031 io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.getDefaultInstance()),
32 io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.getDefaultInstance()));
Kun Zhang5bb0ea92015-08-31 09:56:44 -070033 @io.grpc.ExperimentalApi
Kun Zhang73acc732015-06-26 16:32:05 -070034 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
nmittlerf8314582015-01-27 10:25:39 -080035 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070036 io.grpc.MethodDescriptor.create(
37 io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
Kun Zhang042b2782015-08-17 15:43:40 -070038 generateFullMethodName(
39 "grpc.testing.TestService", "StreamingOutputCall"),
Eric Anderson47a7ccf2015-09-03 16:56:36 -070040 io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()),
41 io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance()));
Kun Zhang5bb0ea92015-08-31 09:56:44 -070042 @io.grpc.ExperimentalApi
Kun Zhang73acc732015-06-26 16:32:05 -070043 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
nmittlerf8314582015-01-27 10:25:39 -080044 io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070045 io.grpc.MethodDescriptor.create(
46 io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING,
Kun Zhang042b2782015-08-17 15:43:40 -070047 generateFullMethodName(
48 "grpc.testing.TestService", "StreamingInputCall"),
Eric Anderson47a7ccf2015-09-03 16:56:36 -070049 io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.getDefaultInstance()),
50 io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.getDefaultInstance()));
Kun Zhang5bb0ea92015-08-31 09:56:44 -070051 @io.grpc.ExperimentalApi
Kun Zhang73acc732015-06-26 16:32:05 -070052 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -070053 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070054 io.grpc.MethodDescriptor.create(
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -070055 io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
Kun Zhang042b2782015-08-17 15:43:40 -070056 generateFullMethodName(
57 "grpc.testing.TestService", "FullBidiCall"),
Eric Anderson47a7ccf2015-09-03 16:56:36 -070058 io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()),
59 io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance()));
Kun Zhang5bb0ea92015-08-31 09:56:44 -070060 @io.grpc.ExperimentalApi
Kun Zhang73acc732015-06-26 16:32:05 -070061 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -070062 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070063 io.grpc.MethodDescriptor.create(
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -070064 io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
Kun Zhang042b2782015-08-17 15:43:40 -070065 generateFullMethodName(
66 "grpc.testing.TestService", "HalfBidiCall"),
Eric Anderson47a7ccf2015-09-03 16:56:36 -070067 io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()),
68 io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance()));
zhangkun835e607852015-01-22 12:31:56 -080069
nmittlerf8314582015-01-27 10:25:39 -080070 public static TestServiceStub newStub(io.grpc.Channel channel) {
Kun Zhangeb929672015-07-17 17:02:58 -070071 return new TestServiceStub(channel);
zhangkun835e607852015-01-22 12:31:56 -080072 }
73
74 public static TestServiceBlockingStub newBlockingStub(
nmittlerf8314582015-01-27 10:25:39 -080075 io.grpc.Channel channel) {
Kun Zhangeb929672015-07-17 17:02:58 -070076 return new TestServiceBlockingStub(channel);
zhangkun835e607852015-01-22 12:31:56 -080077 }
78
79 public static TestServiceFutureStub newFutureStub(
nmittlerf8314582015-01-27 10:25:39 -080080 io.grpc.Channel channel) {
Kun Zhangeb929672015-07-17 17:02:58 -070081 return new TestServiceFutureStub(channel);
zhangkun835e607852015-01-22 12:31:56 -080082 }
83
84 public static interface TestService {
85
nmittlerf8314582015-01-27 10:25:39 -080086 public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
87 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver);
zhangkun835e607852015-01-22 12:31:56 -080088
nmittlerf8314582015-01-27 10:25:39 -080089 public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
90 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
zhangkun835e607852015-01-22 12:31:56 -080091
nmittlerf8314582015-01-27 10:25:39 -080092 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
93 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver);
zhangkun835e607852015-01-22 12:31:56 -080094
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -070095 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall(
nmittlerf8314582015-01-27 10:25:39 -080096 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
zhangkun835e607852015-01-22 12:31:56 -080097
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -070098 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall(
nmittlerf8314582015-01-27 10:25:39 -080099 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
zhangkun835e607852015-01-22 12:31:56 -0800100 }
101
102 public static interface TestServiceBlockingClient {
103
nmittlerf8314582015-01-27 10:25:39 -0800104 public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request);
zhangkun835e607852015-01-22 12:31:56 -0800105
nmittlerf8314582015-01-27 10:25:39 -0800106 public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
107 io.grpc.testing.integration.Test.StreamingOutputCallRequest request);
zhangkun835e607852015-01-22 12:31:56 -0800108 }
109
110 public static interface TestServiceFutureClient {
111
nmittlerf8314582015-01-27 10:25:39 -0800112 public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
113 io.grpc.testing.integration.Test.SimpleRequest request);
zhangkun835e607852015-01-22 12:31:56 -0800114 }
115
Kun Zhangeb929672015-07-17 17:02:58 -0700116 public static class TestServiceStub extends io.grpc.stub.AbstractStub<TestServiceStub>
zhangkun835e607852015-01-22 12:31:56 -0800117 implements TestService {
Kun Zhangeb929672015-07-17 17:02:58 -0700118 private TestServiceStub(io.grpc.Channel channel) {
119 super(channel);
zhangkun835e607852015-01-22 12:31:56 -0800120 }
121
Kun Zhangd3c5b002015-06-25 20:24:01 -0700122 private TestServiceStub(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700123 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700124 super(channel, callOptions);
Kun Zhangd3c5b002015-06-25 20:24:01 -0700125 }
126
zhangkun835e607852015-01-22 12:31:56 -0800127 @java.lang.Override
nmittlerf8314582015-01-27 10:25:39 -0800128 protected TestServiceStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700129 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700130 return new TestServiceStub(channel, callOptions);
zhangkun835e607852015-01-22 12:31:56 -0800131 }
132
133 @java.lang.Override
nmittlerf8314582015-01-27 10:25:39 -0800134 public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
135 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
zhangkun835e607852015-01-22 12:31:56 -0800136 asyncUnaryCall(
Eric Anderson23e63182015-09-10 08:36:08 -0700137 getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request, responseObserver);
zhangkun835e607852015-01-22 12:31:56 -0800138 }
139
140 @java.lang.Override
nmittlerf8314582015-01-27 10:25:39 -0800141 public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
142 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
zhangkun835e607852015-01-22 12:31:56 -0800143 asyncServerStreamingCall(
Eric Anderson23e63182015-09-10 08:36:08 -0700144 getChannel().newCall(METHOD_STREAMING_OUTPUT_CALL, getCallOptions()), request, responseObserver);
zhangkun835e607852015-01-22 12:31:56 -0800145 }
146
147 @java.lang.Override
nmittlerf8314582015-01-27 10:25:39 -0800148 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
149 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
zhangkun835e607852015-01-22 12:31:56 -0800150 return asyncClientStreamingCall(
Eric Anderson23e63182015-09-10 08:36:08 -0700151 getChannel().newCall(METHOD_STREAMING_INPUT_CALL, getCallOptions()), responseObserver);
zhangkun835e607852015-01-22 12:31:56 -0800152 }
153
154 @java.lang.Override
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700155 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall(
nmittlerf8314582015-01-27 10:25:39 -0800156 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700157 return asyncBidiStreamingCall(
Eric Anderson23e63182015-09-10 08:36:08 -0700158 getChannel().newCall(METHOD_FULL_BIDI_CALL, getCallOptions()), responseObserver);
zhangkun835e607852015-01-22 12:31:56 -0800159 }
160
161 @java.lang.Override
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700162 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall(
nmittlerf8314582015-01-27 10:25:39 -0800163 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700164 return asyncBidiStreamingCall(
Eric Anderson23e63182015-09-10 08:36:08 -0700165 getChannel().newCall(METHOD_HALF_BIDI_CALL, getCallOptions()), responseObserver);
zhangkun835e607852015-01-22 12:31:56 -0800166 }
167 }
168
Kun Zhangeb929672015-07-17 17:02:58 -0700169 public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub<TestServiceBlockingStub>
zhangkun835e607852015-01-22 12:31:56 -0800170 implements TestServiceBlockingClient {
Kun Zhangeb929672015-07-17 17:02:58 -0700171 private TestServiceBlockingStub(io.grpc.Channel channel) {
172 super(channel);
zhangkun835e607852015-01-22 12:31:56 -0800173 }
174
Kun Zhangd3c5b002015-06-25 20:24:01 -0700175 private TestServiceBlockingStub(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700176 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700177 super(channel, callOptions);
Kun Zhangd3c5b002015-06-25 20:24:01 -0700178 }
179
zhangkun835e607852015-01-22 12:31:56 -0800180 @java.lang.Override
nmittlerf8314582015-01-27 10:25:39 -0800181 protected TestServiceBlockingStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700182 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700183 return new TestServiceBlockingStub(channel, callOptions);
zhangkun835e607852015-01-22 12:31:56 -0800184 }
185
186 @java.lang.Override
nmittlerf8314582015-01-27 10:25:39 -0800187 public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) {
zhangkun835e607852015-01-22 12:31:56 -0800188 return blockingUnaryCall(
Eric Anderson23e63182015-09-10 08:36:08 -0700189 getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request);
zhangkun835e607852015-01-22 12:31:56 -0800190 }
191
192 @java.lang.Override
nmittlerf8314582015-01-27 10:25:39 -0800193 public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
194 io.grpc.testing.integration.Test.StreamingOutputCallRequest request) {
zhangkun835e607852015-01-22 12:31:56 -0800195 return blockingServerStreamingCall(
Eric Anderson23e63182015-09-10 08:36:08 -0700196 getChannel().newCall(METHOD_STREAMING_OUTPUT_CALL, getCallOptions()), request);
zhangkun835e607852015-01-22 12:31:56 -0800197 }
198 }
199
Kun Zhangeb929672015-07-17 17:02:58 -0700200 public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub<TestServiceFutureStub>
zhangkun835e607852015-01-22 12:31:56 -0800201 implements TestServiceFutureClient {
Kun Zhangeb929672015-07-17 17:02:58 -0700202 private TestServiceFutureStub(io.grpc.Channel channel) {
203 super(channel);
zhangkun835e607852015-01-22 12:31:56 -0800204 }
205
Kun Zhangd3c5b002015-06-25 20:24:01 -0700206 private TestServiceFutureStub(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700207 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700208 super(channel, callOptions);
Kun Zhangd3c5b002015-06-25 20:24:01 -0700209 }
210
zhangkun835e607852015-01-22 12:31:56 -0800211 @java.lang.Override
nmittlerf8314582015-01-27 10:25:39 -0800212 protected TestServiceFutureStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700213 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700214 return new TestServiceFutureStub(channel, callOptions);
zhangkun835e607852015-01-22 12:31:56 -0800215 }
216
217 @java.lang.Override
nmittlerf8314582015-01-27 10:25:39 -0800218 public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
219 io.grpc.testing.integration.Test.SimpleRequest request) {
Kun Zhang686dcff2015-07-16 12:34:37 -0700220 return futureUnaryCall(
Eric Anderson23e63182015-09-10 08:36:08 -0700221 getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request);
zhangkun835e607852015-01-22 12:31:56 -0800222 }
223 }
224
Eric Andersond52429d2015-11-13 16:50:08 -0800225 private static final int METHODID_UNARY_CALL = 0;
226 private static final int METHODID_STREAMING_OUTPUT_CALL = 1;
227 private static final int METHODID_STREAMING_INPUT_CALL = 2;
228 private static final int METHODID_FULL_BIDI_CALL = 3;
229 private static final int METHODID_HALF_BIDI_CALL = 4;
230
231 private static class MethodHandlers<Req, Resp> implements
232 io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
233 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
234 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
235 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
236 private final TestService serviceImpl;
237 private final int methodId;
238
239 public MethodHandlers(TestService serviceImpl, int methodId) {
240 this.serviceImpl = serviceImpl;
241 this.methodId = methodId;
242 }
243
244 @java.lang.SuppressWarnings("unchecked")
245 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
246 switch (methodId) {
247 case METHODID_UNARY_CALL:
248 serviceImpl.unaryCall((io.grpc.testing.integration.Test.SimpleRequest) request,
249 (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse>) responseObserver);
250 break;
251 case METHODID_STREAMING_OUTPUT_CALL:
252 serviceImpl.streamingOutputCall((io.grpc.testing.integration.Test.StreamingOutputCallRequest) request,
253 (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse>) responseObserver);
254 break;
255 default:
256 throw new AssertionError();
257 }
258 }
259
260 @java.lang.SuppressWarnings("unchecked")
261 public io.grpc.stub.StreamObserver<Req> invoke(
262 io.grpc.stub.StreamObserver<Resp> responseObserver) {
263 switch (methodId) {
264 case METHODID_STREAMING_INPUT_CALL:
265 return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamingInputCall(
266 (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse>) responseObserver);
267 case METHODID_FULL_BIDI_CALL:
268 return (io.grpc.stub.StreamObserver<Req>) serviceImpl.fullBidiCall(
269 (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse>) responseObserver);
270 case METHODID_HALF_BIDI_CALL:
271 return (io.grpc.stub.StreamObserver<Req>) serviceImpl.halfBidiCall(
272 (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse>) responseObserver);
273 default:
274 throw new AssertionError();
275 }
276 }
277 }
278
nmittlerf8314582015-01-27 10:25:39 -0800279 public static io.grpc.ServerServiceDefinition bindService(
zhangkun835e607852015-01-22 12:31:56 -0800280 final TestService serviceImpl) {
David P. Baker66b984c2015-08-21 13:00:26 -0400281 return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME)
Eric Andersond52429d2015-11-13 16:50:08 -0800282 .addMethod(
283 METHOD_UNARY_CALL,
284 asyncUnaryCall(
285 new MethodHandlers<
Eric Andersona6621da2015-09-10 17:37:21 -0700286 io.grpc.testing.integration.Test.SimpleRequest,
Eric Andersond52429d2015-11-13 16:50:08 -0800287 io.grpc.testing.integration.Test.SimpleResponse>(
288 serviceImpl, METHODID_UNARY_CALL)))
289 .addMethod(
290 METHOD_STREAMING_OUTPUT_CALL,
291 asyncServerStreamingCall(
292 new MethodHandlers<
Eric Andersona6621da2015-09-10 17:37:21 -0700293 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Eric Andersond52429d2015-11-13 16:50:08 -0800294 io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
295 serviceImpl, METHODID_STREAMING_OUTPUT_CALL)))
296 .addMethod(
297 METHOD_STREAMING_INPUT_CALL,
298 asyncClientStreamingCall(
299 new MethodHandlers<
Eric Andersona6621da2015-09-10 17:37:21 -0700300 io.grpc.testing.integration.Test.StreamingInputCallRequest,
Eric Andersond52429d2015-11-13 16:50:08 -0800301 io.grpc.testing.integration.Test.StreamingInputCallResponse>(
302 serviceImpl, METHODID_STREAMING_INPUT_CALL)))
303 .addMethod(
304 METHOD_FULL_BIDI_CALL,
305 asyncBidiStreamingCall(
306 new MethodHandlers<
Eric Andersona6621da2015-09-10 17:37:21 -0700307 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Eric Andersond52429d2015-11-13 16:50:08 -0800308 io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
309 serviceImpl, METHODID_FULL_BIDI_CALL)))
310 .addMethod(
311 METHOD_HALF_BIDI_CALL,
312 asyncBidiStreamingCall(
313 new MethodHandlers<
Eric Andersona6621da2015-09-10 17:37:21 -0700314 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Eric Andersond52429d2015-11-13 16:50:08 -0800315 io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
316 serviceImpl, METHODID_HALF_BIDI_CALL)))
317 .build();
zhangkun835e607852015-01-22 12:31:56 -0800318 }
319}