blob: 834f93cb13cf4aba4abee879da6f8d7eb00f81be [file] [log] [blame]
Xiao Hangdcff3152015-02-20 15:03:06 -08001package io.grpc.testing.integration;
2
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;
Kun Zhang690b26e2015-07-15 17:20:29 -07006import static io.grpc.stub.ClientCalls.asyncDuplexStreamingCall;
Kun Zhang2ee4d022015-06-04 16:39:25 -07007import static io.grpc.stub.ClientCalls.blockingUnaryCall;
8import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9import static io.grpc.stub.ClientCalls.unaryFutureCall;
Kun Zhang867c76d2015-07-13 17:15:34 -070010import static io.grpc.stub.ServerCalls.asyncUnaryCall;
11import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
12import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
13import static io.grpc.stub.ServerCalls.asyncDuplexStreamingCall;
Xiao Hangdcff3152015-02-20 15:03:06 -080014
15import java.io.IOException;
16
17@javax.annotation.Generated("by gRPC proto compiler")
18public class TestServiceGrpc {
19
Kun Zhang73acc732015-06-26 16:32:05 -070020 // Static method descriptors that strictly reflect the proto.
21 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
Xiao Hangdcff3152015-02-20 15:03:06 -080022 io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070023 io.grpc.MethodDescriptor.create(
24 io.grpc.MethodDescriptor.MethodType.UNARY,
25 "grpc.testing.TestService", "UnaryCall",
Eric Anderson3666de42015-04-10 16:35:23 -070026 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.SimpleRequest>marshaller(
27 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.SimpleRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080028 @Override
29 public io.grpc.testing.integration.Test.SimpleRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
30 return io.grpc.testing.integration.Test.SimpleRequest.parseFrom(input);
31 }
32 }),
Eric Anderson3666de42015-04-10 16:35:23 -070033 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.SimpleResponse>marshaller(
34 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.SimpleResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080035 @Override
36 public io.grpc.testing.integration.Test.SimpleResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
37 return io.grpc.testing.integration.Test.SimpleResponse.parseFrom(input);
38 }
39 }));
Kun Zhang73acc732015-06-26 16:32:05 -070040 // Static method descriptors that strictly reflect the proto.
41 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Xiao Hangdcff3152015-02-20 15:03:06 -080042 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070043 io.grpc.MethodDescriptor.create(
44 io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
45 "grpc.testing.TestService", "StreamingOutputCall",
Eric Anderson3666de42015-04-10 16:35:23 -070046 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallRequest>marshaller(
47 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080048 @Override
49 public io.grpc.testing.integration.Test.StreamingOutputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
50 return io.grpc.testing.integration.Test.StreamingOutputCallRequest.parseFrom(input);
51 }
52 }),
Eric Anderson3666de42015-04-10 16:35:23 -070053 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallResponse>marshaller(
54 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080055 @Override
56 public io.grpc.testing.integration.Test.StreamingOutputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
57 return io.grpc.testing.integration.Test.StreamingOutputCallResponse.parseFrom(input);
58 }
59 }));
Kun Zhang73acc732015-06-26 16:32:05 -070060 // Static method descriptors that strictly reflect the proto.
61 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
Xiao Hangdcff3152015-02-20 15:03:06 -080062 io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070063 io.grpc.MethodDescriptor.create(
64 io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING,
65 "grpc.testing.TestService", "StreamingInputCall",
Eric Anderson3666de42015-04-10 16:35:23 -070066 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingInputCallRequest>marshaller(
67 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingInputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080068 @Override
69 public io.grpc.testing.integration.Test.StreamingInputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
70 return io.grpc.testing.integration.Test.StreamingInputCallRequest.parseFrom(input);
71 }
72 }),
Eric Anderson3666de42015-04-10 16:35:23 -070073 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingInputCallResponse>marshaller(
74 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingInputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080075 @Override
76 public io.grpc.testing.integration.Test.StreamingInputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
77 return io.grpc.testing.integration.Test.StreamingInputCallResponse.parseFrom(input);
78 }
79 }));
Kun Zhang73acc732015-06-26 16:32:05 -070080 // Static method descriptors that strictly reflect the proto.
81 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Xiao Hangdcff3152015-02-20 15:03:06 -080082 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070083 io.grpc.MethodDescriptor.create(
84 io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
85 "grpc.testing.TestService", "FullDuplexCall",
Eric Anderson3666de42015-04-10 16:35:23 -070086 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallRequest>marshaller(
87 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080088 @Override
89 public io.grpc.testing.integration.Test.StreamingOutputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
90 return io.grpc.testing.integration.Test.StreamingOutputCallRequest.parseFrom(input);
91 }
92 }),
Eric Anderson3666de42015-04-10 16:35:23 -070093 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallResponse>marshaller(
94 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080095 @Override
96 public io.grpc.testing.integration.Test.StreamingOutputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
97 return io.grpc.testing.integration.Test.StreamingOutputCallResponse.parseFrom(input);
98 }
99 }));
Kun Zhang73acc732015-06-26 16:32:05 -0700100 // Static method descriptors that strictly reflect the proto.
101 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Xiao Hangdcff3152015-02-20 15:03:06 -0800102 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -0700103 io.grpc.MethodDescriptor.create(
104 io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
105 "grpc.testing.TestService", "HalfDuplexCall",
Eric Anderson3666de42015-04-10 16:35:23 -0700106 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallRequest>marshaller(
107 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800108 @Override
109 public io.grpc.testing.integration.Test.StreamingOutputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
110 return io.grpc.testing.integration.Test.StreamingOutputCallRequest.parseFrom(input);
111 }
112 }),
Eric Anderson3666de42015-04-10 16:35:23 -0700113 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallResponse>marshaller(
114 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800115 @Override
116 public io.grpc.testing.integration.Test.StreamingOutputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
117 return io.grpc.testing.integration.Test.StreamingOutputCallResponse.parseFrom(input);
118 }
119 }));
120
121 public static TestServiceStub newStub(io.grpc.Channel channel) {
122 return new TestServiceStub(channel, CONFIG);
123 }
124
125 public static TestServiceBlockingStub newBlockingStub(
126 io.grpc.Channel channel) {
127 return new TestServiceBlockingStub(channel, CONFIG);
128 }
129
130 public static TestServiceFutureStub newFutureStub(
131 io.grpc.Channel channel) {
132 return new TestServiceFutureStub(channel, CONFIG);
133 }
134
Kun Zhang73acc732015-06-26 16:32:05 -0700135 // The default service descriptor
136 private static final TestServiceServiceDescriptor CONFIG =
Xiao Hangdcff3152015-02-20 15:03:06 -0800137 new TestServiceServiceDescriptor();
138
139 @javax.annotation.concurrent.Immutable
140 public static class TestServiceServiceDescriptor extends
141 io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
142 public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
143 io.grpc.testing.integration.Test.SimpleResponse> unaryCall;
144 public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
145 io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall;
146 public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
147 io.grpc.testing.integration.Test.StreamingInputCallResponse> streamingInputCall;
148 public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
149 io.grpc.testing.integration.Test.StreamingOutputCallResponse> fullDuplexCall;
150 public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
151 io.grpc.testing.integration.Test.StreamingOutputCallResponse> halfDuplexCall;
152
153 private TestServiceServiceDescriptor() {
Kun Zhang73acc732015-06-26 16:32:05 -0700154 unaryCall = METHOD_UNARY_CALL;
155 streamingOutputCall = METHOD_STREAMING_OUTPUT_CALL;
156 streamingInputCall = METHOD_STREAMING_INPUT_CALL;
157 fullDuplexCall = METHOD_FULL_DUPLEX_CALL;
158 halfDuplexCall = METHOD_HALF_DUPLEX_CALL;
Xiao Hangdcff3152015-02-20 15:03:06 -0800159 }
160
Eric Anderson76d09552015-03-12 15:25:11 -0700161 @SuppressWarnings("unchecked")
Xiao Hangdcff3152015-02-20 15:03:06 -0800162 private TestServiceServiceDescriptor(
163 java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
164 unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
165 io.grpc.testing.integration.Test.SimpleResponse>) methodMap.get(
Kun Zhang73acc732015-06-26 16:32:05 -0700166 CONFIG.unaryCall.getFullMethodName());
Xiao Hangdcff3152015-02-20 15:03:06 -0800167 streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
168 io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
Kun Zhang73acc732015-06-26 16:32:05 -0700169 CONFIG.streamingOutputCall.getFullMethodName());
Xiao Hangdcff3152015-02-20 15:03:06 -0800170 streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
171 io.grpc.testing.integration.Test.StreamingInputCallResponse>) methodMap.get(
Kun Zhang73acc732015-06-26 16:32:05 -0700172 CONFIG.streamingInputCall.getFullMethodName());
Xiao Hangdcff3152015-02-20 15:03:06 -0800173 fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
174 io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
Kun Zhang73acc732015-06-26 16:32:05 -0700175 CONFIG.fullDuplexCall.getFullMethodName());
Xiao Hangdcff3152015-02-20 15:03:06 -0800176 halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
177 io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
Kun Zhang73acc732015-06-26 16:32:05 -0700178 CONFIG.halfDuplexCall.getFullMethodName());
Xiao Hangdcff3152015-02-20 15:03:06 -0800179 }
180
181 @java.lang.Override
182 protected TestServiceServiceDescriptor build(
183 java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
184 return new TestServiceServiceDescriptor(methodMap);
185 }
186
187 @java.lang.Override
Kun Zhangc73b75e2015-07-09 10:15:58 -0700188 public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800189 return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
190 unaryCall,
191 streamingOutputCall,
192 streamingInputCall,
193 fullDuplexCall,
194 halfDuplexCall);
195 }
196 }
197
198 public static interface TestService {
199
200 public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
201 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver);
202
203 public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
204 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
205
206 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
207 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver);
208
209 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
210 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
211
212 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
213 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
214 }
215
216 public static interface TestServiceBlockingClient {
217
218 public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request);
219
220 public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
221 io.grpc.testing.integration.Test.StreamingOutputCallRequest request);
222 }
223
224 public static interface TestServiceFutureClient {
225
226 public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
227 io.grpc.testing.integration.Test.SimpleRequest request);
228 }
229
230 public static class TestServiceStub extends
231 io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
232 implements TestService {
233 private TestServiceStub(io.grpc.Channel channel,
234 TestServiceServiceDescriptor config) {
235 super(channel, config);
236 }
237
Kun Zhangd3c5b002015-06-25 20:24:01 -0700238 private TestServiceStub(io.grpc.Channel channel,
239 TestServiceServiceDescriptor config,
240 io.grpc.CallOptions callOptions) {
241 super(channel, config, callOptions);
242 }
243
Xiao Hangdcff3152015-02-20 15:03:06 -0800244 @java.lang.Override
245 protected TestServiceStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700246 TestServiceServiceDescriptor config,
247 io.grpc.CallOptions callOptions) {
248 return new TestServiceStub(channel, config, callOptions);
Xiao Hangdcff3152015-02-20 15:03:06 -0800249 }
250
251 @java.lang.Override
252 public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
253 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
254 asyncUnaryCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700255 channel.newCall(config.unaryCall, callOptions), request, responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800256 }
257
258 @java.lang.Override
259 public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
260 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
261 asyncServerStreamingCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700262 channel.newCall(config.streamingOutputCall, callOptions), request, responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800263 }
264
265 @java.lang.Override
266 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
267 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
268 return asyncClientStreamingCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700269 channel.newCall(config.streamingInputCall, callOptions), responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800270 }
271
272 @java.lang.Override
273 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
274 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
Kun Zhang690b26e2015-07-15 17:20:29 -0700275 return asyncDuplexStreamingCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700276 channel.newCall(config.fullDuplexCall, callOptions), responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800277 }
278
279 @java.lang.Override
280 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
281 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
Kun Zhang690b26e2015-07-15 17:20:29 -0700282 return asyncDuplexStreamingCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700283 channel.newCall(config.halfDuplexCall, callOptions), responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800284 }
285 }
286
287 public static class TestServiceBlockingStub extends
288 io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
289 implements TestServiceBlockingClient {
290 private TestServiceBlockingStub(io.grpc.Channel channel,
291 TestServiceServiceDescriptor config) {
292 super(channel, config);
293 }
294
Kun Zhangd3c5b002015-06-25 20:24:01 -0700295 private TestServiceBlockingStub(io.grpc.Channel channel,
296 TestServiceServiceDescriptor config,
297 io.grpc.CallOptions callOptions) {
298 super(channel, config, callOptions);
299 }
300
Xiao Hangdcff3152015-02-20 15:03:06 -0800301 @java.lang.Override
302 protected TestServiceBlockingStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700303 TestServiceServiceDescriptor config,
304 io.grpc.CallOptions callOptions) {
305 return new TestServiceBlockingStub(channel, config, callOptions);
Xiao Hangdcff3152015-02-20 15:03:06 -0800306 }
307
308 @java.lang.Override
309 public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) {
310 return blockingUnaryCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700311 channel.newCall(config.unaryCall, callOptions), request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800312 }
313
314 @java.lang.Override
315 public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
316 io.grpc.testing.integration.Test.StreamingOutputCallRequest request) {
317 return blockingServerStreamingCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700318 channel.newCall(config.streamingOutputCall, callOptions), request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800319 }
320 }
321
322 public static class TestServiceFutureStub extends
323 io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
324 implements TestServiceFutureClient {
325 private TestServiceFutureStub(io.grpc.Channel channel,
326 TestServiceServiceDescriptor config) {
327 super(channel, config);
328 }
329
Kun Zhangd3c5b002015-06-25 20:24:01 -0700330 private TestServiceFutureStub(io.grpc.Channel channel,
331 TestServiceServiceDescriptor config,
332 io.grpc.CallOptions callOptions) {
333 super(channel, config, callOptions);
334 }
335
Xiao Hangdcff3152015-02-20 15:03:06 -0800336 @java.lang.Override
337 protected TestServiceFutureStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700338 TestServiceServiceDescriptor config,
339 io.grpc.CallOptions callOptions) {
340 return new TestServiceFutureStub(channel, config, callOptions);
Xiao Hangdcff3152015-02-20 15:03:06 -0800341 }
342
343 @java.lang.Override
344 public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
345 io.grpc.testing.integration.Test.SimpleRequest request) {
346 return unaryFutureCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700347 channel.newCall(config.unaryCall, callOptions), request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800348 }
349 }
350
351 public static io.grpc.ServerServiceDefinition bindService(
352 final TestService serviceImpl) {
353 return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService")
Kun Zhang73acc732015-06-26 16:32:05 -0700354 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800355 METHOD_UNARY_CALL,
Kun Zhang867c76d2015-07-13 17:15:34 -0700356 asyncUnaryCall(
357 new io.grpc.stub.ServerCalls.UnaryMethod<
Xiao Hangdcff3152015-02-20 15:03:06 -0800358 io.grpc.testing.integration.Test.SimpleRequest,
359 io.grpc.testing.integration.Test.SimpleResponse>() {
360 @java.lang.Override
361 public void invoke(
362 io.grpc.testing.integration.Test.SimpleRequest request,
363 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
364 serviceImpl.unaryCall(request, responseObserver);
365 }
366 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700367 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800368 METHOD_STREAMING_OUTPUT_CALL,
Kun Zhang867c76d2015-07-13 17:15:34 -0700369 asyncServerStreamingCall(
370 new io.grpc.stub.ServerCalls.ServerStreamingMethod<
Xiao Hangdcff3152015-02-20 15:03:06 -0800371 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
372 io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
373 @java.lang.Override
374 public void invoke(
375 io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
376 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
377 serviceImpl.streamingOutputCall(request, responseObserver);
378 }
379 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700380 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800381 METHOD_STREAMING_INPUT_CALL,
Kun Zhang867c76d2015-07-13 17:15:34 -0700382 asyncClientStreamingCall(
383 new io.grpc.stub.ServerCalls.ClientStreamingMethod<
Xiao Hangdcff3152015-02-20 15:03:06 -0800384 io.grpc.testing.integration.Test.StreamingInputCallRequest,
385 io.grpc.testing.integration.Test.StreamingInputCallResponse>() {
386 @java.lang.Override
387 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> invoke(
388 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
389 return serviceImpl.streamingInputCall(responseObserver);
390 }
391 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700392 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800393 METHOD_FULL_DUPLEX_CALL,
Kun Zhang867c76d2015-07-13 17:15:34 -0700394 asyncDuplexStreamingCall(
395 new io.grpc.stub.ServerCalls.DuplexStreamingMethod<
Xiao Hangdcff3152015-02-20 15:03:06 -0800396 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
397 io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
398 @java.lang.Override
399 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke(
400 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
401 return serviceImpl.fullDuplexCall(responseObserver);
402 }
403 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700404 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800405 METHOD_HALF_DUPLEX_CALL,
Kun Zhang867c76d2015-07-13 17:15:34 -0700406 asyncDuplexStreamingCall(
407 new io.grpc.stub.ServerCalls.DuplexStreamingMethod<
Xiao Hangdcff3152015-02-20 15:03:06 -0800408 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
409 io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
410 @java.lang.Override
411 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke(
412 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
413 return serviceImpl.halfDuplexCall(responseObserver);
414 }
415 }))).build();
416 }
417}