blob: a75422d83fe1881de684943617e82574f106dfdf [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;
6import static io.grpc.stub.ClientCalls.duplexStreamingCall;
7import static io.grpc.stub.ClientCalls.blockingUnaryCall;
8import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9import static io.grpc.stub.ClientCalls.unaryFutureCall;
Xiao Hangdcff3152015-02-20 15:03:06 -080010import static io.grpc.stub.ServerCalls.asyncUnaryRequestCall;
11import static io.grpc.stub.ServerCalls.asyncStreamingRequestCall;
12
13import java.io.IOException;
14
15@javax.annotation.Generated("by gRPC proto compiler")
16public class TestServiceGrpc {
17
Kun Zhang73acc732015-06-26 16:32:05 -070018 // Static method descriptors that strictly reflect the proto.
19 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
Xiao Hangdcff3152015-02-20 15:03:06 -080020 io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070021 io.grpc.MethodDescriptor.create(
22 io.grpc.MethodDescriptor.MethodType.UNARY,
23 "grpc.testing.TestService", "UnaryCall",
Eric Anderson3666de42015-04-10 16:35:23 -070024 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.SimpleRequest>marshaller(
25 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.SimpleRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080026 @Override
27 public io.grpc.testing.integration.Test.SimpleRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
28 return io.grpc.testing.integration.Test.SimpleRequest.parseFrom(input);
29 }
30 }),
Eric Anderson3666de42015-04-10 16:35:23 -070031 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.SimpleResponse>marshaller(
32 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.SimpleResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080033 @Override
34 public io.grpc.testing.integration.Test.SimpleResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
35 return io.grpc.testing.integration.Test.SimpleResponse.parseFrom(input);
36 }
37 }));
Kun Zhang73acc732015-06-26 16:32:05 -070038 // Static method descriptors that strictly reflect the proto.
39 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Xiao Hangdcff3152015-02-20 15:03:06 -080040 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070041 io.grpc.MethodDescriptor.create(
42 io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
43 "grpc.testing.TestService", "StreamingOutputCall",
Eric Anderson3666de42015-04-10 16:35:23 -070044 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallRequest>marshaller(
45 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080046 @Override
47 public io.grpc.testing.integration.Test.StreamingOutputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
48 return io.grpc.testing.integration.Test.StreamingOutputCallRequest.parseFrom(input);
49 }
50 }),
Eric Anderson3666de42015-04-10 16:35:23 -070051 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallResponse>marshaller(
52 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080053 @Override
54 public io.grpc.testing.integration.Test.StreamingOutputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
55 return io.grpc.testing.integration.Test.StreamingOutputCallResponse.parseFrom(input);
56 }
57 }));
Kun Zhang73acc732015-06-26 16:32:05 -070058 // Static method descriptors that strictly reflect the proto.
59 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
Xiao Hangdcff3152015-02-20 15:03:06 -080060 io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070061 io.grpc.MethodDescriptor.create(
62 io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING,
63 "grpc.testing.TestService", "StreamingInputCall",
Eric Anderson3666de42015-04-10 16:35:23 -070064 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingInputCallRequest>marshaller(
65 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingInputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080066 @Override
67 public io.grpc.testing.integration.Test.StreamingInputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
68 return io.grpc.testing.integration.Test.StreamingInputCallRequest.parseFrom(input);
69 }
70 }),
Eric Anderson3666de42015-04-10 16:35:23 -070071 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingInputCallResponse>marshaller(
72 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingInputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080073 @Override
74 public io.grpc.testing.integration.Test.StreamingInputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
75 return io.grpc.testing.integration.Test.StreamingInputCallResponse.parseFrom(input);
76 }
77 }));
Kun Zhang73acc732015-06-26 16:32:05 -070078 // Static method descriptors that strictly reflect the proto.
79 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Xiao Hangdcff3152015-02-20 15:03:06 -080080 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070081 io.grpc.MethodDescriptor.create(
82 io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
83 "grpc.testing.TestService", "FullDuplexCall",
Eric Anderson3666de42015-04-10 16:35:23 -070084 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallRequest>marshaller(
85 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080086 @Override
87 public io.grpc.testing.integration.Test.StreamingOutputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
88 return io.grpc.testing.integration.Test.StreamingOutputCallRequest.parseFrom(input);
89 }
90 }),
Eric Anderson3666de42015-04-10 16:35:23 -070091 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallResponse>marshaller(
92 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080093 @Override
94 public io.grpc.testing.integration.Test.StreamingOutputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
95 return io.grpc.testing.integration.Test.StreamingOutputCallResponse.parseFrom(input);
96 }
97 }));
Kun Zhang73acc732015-06-26 16:32:05 -070098 // Static method descriptors that strictly reflect the proto.
99 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
Xiao Hangdcff3152015-02-20 15:03:06 -0800100 io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -0700101 io.grpc.MethodDescriptor.create(
102 io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING,
103 "grpc.testing.TestService", "HalfDuplexCall",
Eric Anderson3666de42015-04-10 16:35:23 -0700104 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallRequest>marshaller(
105 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800106 @Override
107 public io.grpc.testing.integration.Test.StreamingOutputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
108 return io.grpc.testing.integration.Test.StreamingOutputCallRequest.parseFrom(input);
109 }
110 }),
Eric Anderson3666de42015-04-10 16:35:23 -0700111 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallResponse>marshaller(
112 new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800113 @Override
114 public io.grpc.testing.integration.Test.StreamingOutputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException {
115 return io.grpc.testing.integration.Test.StreamingOutputCallResponse.parseFrom(input);
116 }
117 }));
118
119 public static TestServiceStub newStub(io.grpc.Channel channel) {
120 return new TestServiceStub(channel, CONFIG);
121 }
122
123 public static TestServiceBlockingStub newBlockingStub(
124 io.grpc.Channel channel) {
125 return new TestServiceBlockingStub(channel, CONFIG);
126 }
127
128 public static TestServiceFutureStub newFutureStub(
129 io.grpc.Channel channel) {
130 return new TestServiceFutureStub(channel, CONFIG);
131 }
132
Kun Zhang73acc732015-06-26 16:32:05 -0700133 // The default service descriptor
134 private static final TestServiceServiceDescriptor CONFIG =
Xiao Hangdcff3152015-02-20 15:03:06 -0800135 new TestServiceServiceDescriptor();
136
137 @javax.annotation.concurrent.Immutable
138 public static class TestServiceServiceDescriptor extends
139 io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
140 public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
141 io.grpc.testing.integration.Test.SimpleResponse> unaryCall;
142 public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
143 io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall;
144 public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
145 io.grpc.testing.integration.Test.StreamingInputCallResponse> streamingInputCall;
146 public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
147 io.grpc.testing.integration.Test.StreamingOutputCallResponse> fullDuplexCall;
148 public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
149 io.grpc.testing.integration.Test.StreamingOutputCallResponse> halfDuplexCall;
150
151 private TestServiceServiceDescriptor() {
Kun Zhang73acc732015-06-26 16:32:05 -0700152 unaryCall = METHOD_UNARY_CALL;
153 streamingOutputCall = METHOD_STREAMING_OUTPUT_CALL;
154 streamingInputCall = METHOD_STREAMING_INPUT_CALL;
155 fullDuplexCall = METHOD_FULL_DUPLEX_CALL;
156 halfDuplexCall = METHOD_HALF_DUPLEX_CALL;
Xiao Hangdcff3152015-02-20 15:03:06 -0800157 }
158
Eric Anderson76d09552015-03-12 15:25:11 -0700159 @SuppressWarnings("unchecked")
Xiao Hangdcff3152015-02-20 15:03:06 -0800160 private TestServiceServiceDescriptor(
161 java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
162 unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
163 io.grpc.testing.integration.Test.SimpleResponse>) methodMap.get(
Kun Zhang73acc732015-06-26 16:32:05 -0700164 CONFIG.unaryCall.getFullMethodName());
Xiao Hangdcff3152015-02-20 15:03:06 -0800165 streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
166 io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
Kun Zhang73acc732015-06-26 16:32:05 -0700167 CONFIG.streamingOutputCall.getFullMethodName());
Xiao Hangdcff3152015-02-20 15:03:06 -0800168 streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
169 io.grpc.testing.integration.Test.StreamingInputCallResponse>) methodMap.get(
Kun Zhang73acc732015-06-26 16:32:05 -0700170 CONFIG.streamingInputCall.getFullMethodName());
Xiao Hangdcff3152015-02-20 15:03:06 -0800171 fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
172 io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
Kun Zhang73acc732015-06-26 16:32:05 -0700173 CONFIG.fullDuplexCall.getFullMethodName());
Xiao Hangdcff3152015-02-20 15:03:06 -0800174 halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
175 io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
Kun Zhang73acc732015-06-26 16:32:05 -0700176 CONFIG.halfDuplexCall.getFullMethodName());
Xiao Hangdcff3152015-02-20 15:03:06 -0800177 }
178
179 @java.lang.Override
180 protected TestServiceServiceDescriptor build(
181 java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
182 return new TestServiceServiceDescriptor(methodMap);
183 }
184
185 @java.lang.Override
186 public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
187 return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
188 unaryCall,
189 streamingOutputCall,
190 streamingInputCall,
191 fullDuplexCall,
192 halfDuplexCall);
193 }
194 }
195
196 public static interface TestService {
197
198 public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
199 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver);
200
201 public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
202 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
203
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);
206
207 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
208 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
209
210 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
211 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver);
212 }
213
214 public static interface TestServiceBlockingClient {
215
216 public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request);
217
218 public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
219 io.grpc.testing.integration.Test.StreamingOutputCallRequest request);
220 }
221
222 public static interface TestServiceFutureClient {
223
224 public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
225 io.grpc.testing.integration.Test.SimpleRequest request);
226 }
227
228 public static class TestServiceStub extends
229 io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
230 implements TestService {
231 private TestServiceStub(io.grpc.Channel channel,
232 TestServiceServiceDescriptor config) {
233 super(channel, config);
234 }
235
Kun Zhangd3c5b002015-06-25 20:24:01 -0700236 private TestServiceStub(io.grpc.Channel channel,
237 TestServiceServiceDescriptor config,
238 io.grpc.CallOptions callOptions) {
239 super(channel, config, callOptions);
240 }
241
Xiao Hangdcff3152015-02-20 15:03:06 -0800242 @java.lang.Override
243 protected TestServiceStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700244 TestServiceServiceDescriptor config,
245 io.grpc.CallOptions callOptions) {
246 return new TestServiceStub(channel, config, callOptions);
Xiao Hangdcff3152015-02-20 15:03:06 -0800247 }
248
249 @java.lang.Override
250 public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
251 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
252 asyncUnaryCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700253 channel.newCall(config.unaryCall, callOptions), request, responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800254 }
255
256 @java.lang.Override
257 public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
258 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
259 asyncServerStreamingCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700260 channel.newCall(config.streamingOutputCall, callOptions), request, responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800261 }
262
263 @java.lang.Override
264 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
265 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
266 return asyncClientStreamingCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700267 channel.newCall(config.streamingInputCall, callOptions), responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800268 }
269
270 @java.lang.Override
271 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
272 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
273 return duplexStreamingCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700274 channel.newCall(config.fullDuplexCall, callOptions), responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800275 }
276
277 @java.lang.Override
278 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
279 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
280 return duplexStreamingCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700281 channel.newCall(config.halfDuplexCall, callOptions), responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800282 }
283 }
284
285 public static class TestServiceBlockingStub extends
286 io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
287 implements TestServiceBlockingClient {
288 private TestServiceBlockingStub(io.grpc.Channel channel,
289 TestServiceServiceDescriptor config) {
290 super(channel, config);
291 }
292
Kun Zhangd3c5b002015-06-25 20:24:01 -0700293 private TestServiceBlockingStub(io.grpc.Channel channel,
294 TestServiceServiceDescriptor config,
295 io.grpc.CallOptions callOptions) {
296 super(channel, config, callOptions);
297 }
298
Xiao Hangdcff3152015-02-20 15:03:06 -0800299 @java.lang.Override
300 protected TestServiceBlockingStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700301 TestServiceServiceDescriptor config,
302 io.grpc.CallOptions callOptions) {
303 return new TestServiceBlockingStub(channel, config, callOptions);
Xiao Hangdcff3152015-02-20 15:03:06 -0800304 }
305
306 @java.lang.Override
307 public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) {
308 return blockingUnaryCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700309 channel.newCall(config.unaryCall, callOptions), request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800310 }
311
312 @java.lang.Override
313 public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
314 io.grpc.testing.integration.Test.StreamingOutputCallRequest request) {
315 return blockingServerStreamingCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700316 channel.newCall(config.streamingOutputCall, callOptions), request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800317 }
318 }
319
320 public static class TestServiceFutureStub extends
321 io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
322 implements TestServiceFutureClient {
323 private TestServiceFutureStub(io.grpc.Channel channel,
324 TestServiceServiceDescriptor config) {
325 super(channel, config);
326 }
327
Kun Zhangd3c5b002015-06-25 20:24:01 -0700328 private TestServiceFutureStub(io.grpc.Channel channel,
329 TestServiceServiceDescriptor config,
330 io.grpc.CallOptions callOptions) {
331 super(channel, config, callOptions);
332 }
333
Xiao Hangdcff3152015-02-20 15:03:06 -0800334 @java.lang.Override
335 protected TestServiceFutureStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700336 TestServiceServiceDescriptor config,
337 io.grpc.CallOptions callOptions) {
338 return new TestServiceFutureStub(channel, config, callOptions);
Xiao Hangdcff3152015-02-20 15:03:06 -0800339 }
340
341 @java.lang.Override
342 public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
343 io.grpc.testing.integration.Test.SimpleRequest request) {
344 return unaryFutureCall(
Kun Zhangd3c5b002015-06-25 20:24:01 -0700345 channel.newCall(config.unaryCall, callOptions), request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800346 }
347 }
348
349 public static io.grpc.ServerServiceDefinition bindService(
350 final TestService serviceImpl) {
351 return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService")
Kun Zhang73acc732015-06-26 16:32:05 -0700352 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800353 METHOD_UNARY_CALL,
354 asyncUnaryRequestCall(
355 new io.grpc.stub.ServerCalls.UnaryRequestMethod<
356 io.grpc.testing.integration.Test.SimpleRequest,
357 io.grpc.testing.integration.Test.SimpleResponse>() {
358 @java.lang.Override
359 public void invoke(
360 io.grpc.testing.integration.Test.SimpleRequest request,
361 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
362 serviceImpl.unaryCall(request, responseObserver);
363 }
364 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700365 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800366 METHOD_STREAMING_OUTPUT_CALL,
367 asyncUnaryRequestCall(
368 new io.grpc.stub.ServerCalls.UnaryRequestMethod<
369 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
370 io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
371 @java.lang.Override
372 public void invoke(
373 io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
374 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
375 serviceImpl.streamingOutputCall(request, responseObserver);
376 }
377 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700378 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800379 METHOD_STREAMING_INPUT_CALL,
380 asyncStreamingRequestCall(
381 new io.grpc.stub.ServerCalls.StreamingRequestMethod<
382 io.grpc.testing.integration.Test.StreamingInputCallRequest,
383 io.grpc.testing.integration.Test.StreamingInputCallResponse>() {
384 @java.lang.Override
385 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> invoke(
386 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
387 return serviceImpl.streamingInputCall(responseObserver);
388 }
389 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700390 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800391 METHOD_FULL_DUPLEX_CALL,
392 asyncStreamingRequestCall(
393 new io.grpc.stub.ServerCalls.StreamingRequestMethod<
394 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
395 io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
396 @java.lang.Override
397 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke(
398 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
399 return serviceImpl.fullDuplexCall(responseObserver);
400 }
401 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700402 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800403 METHOD_HALF_DUPLEX_CALL,
404 asyncStreamingRequestCall(
405 new io.grpc.stub.ServerCalls.StreamingRequestMethod<
406 io.grpc.testing.integration.Test.StreamingOutputCallRequest,
407 io.grpc.testing.integration.Test.StreamingOutputCallResponse>() {
408 @java.lang.Override
409 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke(
410 io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
411 return serviceImpl.halfDuplexCall(responseObserver);
412 }
413 }))).build();
414 }
415}