blob: 4e631f2b2995297a56338289acd3b89302c39ed7 [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;
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;
Xiao Hangdcff3152015-02-20 15:03:06 -080015
16import java.io.IOException;
17
18@javax.annotation.Generated("by gRPC proto compiler")
19public class 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 Zhangbd23a8d2015-08-28 18:47:06 -070025 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.SimpleRequest,
26 io.grpc.testing.integration.nano.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"),
Kun Zhangbd23a8d2015-08-28 18:47:06 -070031 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.SimpleRequest>marshaller(
Eric Andersond42559c2015-09-03 17:14:29 -070032 new io.grpc.protobuf.nano.MessageNanoFactory<io.grpc.testing.integration.nano.Test.SimpleRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080033 @Override
Eric Andersond42559c2015-09-03 17:14:29 -070034 public io.grpc.testing.integration.nano.Test.SimpleRequest newInstance() {
35 return new io.grpc.testing.integration.nano.Test.SimpleRequest();
Xiao Hangdcff3152015-02-20 15:03:06 -080036 }
37 }),
Kun Zhangbd23a8d2015-08-28 18:47:06 -070038 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.SimpleResponse>marshaller(
Eric Andersond42559c2015-09-03 17:14:29 -070039 new io.grpc.protobuf.nano.MessageNanoFactory<io.grpc.testing.integration.nano.Test.SimpleResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080040 @Override
Eric Andersond42559c2015-09-03 17:14:29 -070041 public io.grpc.testing.integration.nano.Test.SimpleResponse newInstance() {
42 return new io.grpc.testing.integration.nano.Test.SimpleResponse();
Xiao Hangdcff3152015-02-20 15:03:06 -080043 }
44 }));
Kun Zhang5bb0ea92015-08-31 09:56:44 -070045 @io.grpc.ExperimentalApi
Kun Zhangbd23a8d2015-08-28 18:47:06 -070046 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
47 io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070048 io.grpc.MethodDescriptor.create(
49 io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
Kun Zhang042b2782015-08-17 15:43:40 -070050 generateFullMethodName(
51 "grpc.testing.TestService", "StreamingOutputCall"),
Kun Zhangbd23a8d2015-08-28 18:47:06 -070052 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller(
Eric Andersond42559c2015-09-03 17:14:29 -070053 new io.grpc.protobuf.nano.MessageNanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080054 @Override
Eric Andersond42559c2015-09-03 17:14:29 -070055 public io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest newInstance() {
56 return new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest();
Xiao Hangdcff3152015-02-20 15:03:06 -080057 }
58 }),
Kun Zhangbd23a8d2015-08-28 18:47:06 -070059 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller(
Eric Andersond42559c2015-09-03 17:14:29 -070060 new io.grpc.protobuf.nano.MessageNanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080061 @Override
Eric Andersond42559c2015-09-03 17:14:29 -070062 public io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse newInstance() {
63 return new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse();
Xiao Hangdcff3152015-02-20 15:03:06 -080064 }
65 }));
Kun Zhang5bb0ea92015-08-31 09:56:44 -070066 @io.grpc.ExperimentalApi
Kun Zhangbd23a8d2015-08-28 18:47:06 -070067 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest,
68 io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070069 io.grpc.MethodDescriptor.create(
70 io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING,
Kun Zhang042b2782015-08-17 15:43:40 -070071 generateFullMethodName(
72 "grpc.testing.TestService", "StreamingInputCall"),
Kun Zhangbd23a8d2015-08-28 18:47:06 -070073 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest>marshaller(
Eric Andersond42559c2015-09-03 17:14:29 -070074 new io.grpc.protobuf.nano.MessageNanoFactory<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080075 @Override
Eric Andersond42559c2015-09-03 17:14:29 -070076 public io.grpc.testing.integration.nano.Test.StreamingInputCallRequest newInstance() {
77 return new io.grpc.testing.integration.nano.Test.StreamingInputCallRequest();
Xiao Hangdcff3152015-02-20 15:03:06 -080078 }
79 }),
Kun Zhangbd23a8d2015-08-28 18:47:06 -070080 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>marshaller(
Eric Andersond42559c2015-09-03 17:14:29 -070081 new io.grpc.protobuf.nano.MessageNanoFactory<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080082 @Override
Eric Andersond42559c2015-09-03 17:14:29 -070083 public io.grpc.testing.integration.nano.Test.StreamingInputCallResponse newInstance() {
84 return new io.grpc.testing.integration.nano.Test.StreamingInputCallResponse();
Xiao Hangdcff3152015-02-20 15:03:06 -080085 }
86 }));
Kun Zhang5bb0ea92015-08-31 09:56:44 -070087 @io.grpc.ExperimentalApi
Kun Zhangbd23a8d2015-08-28 18:47:06 -070088 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
89 io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -070090 io.grpc.MethodDescriptor.create(
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -070091 io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
Kun Zhang042b2782015-08-17 15:43:40 -070092 generateFullMethodName(
93 "grpc.testing.TestService", "FullBidiCall"),
Kun Zhangbd23a8d2015-08-28 18:47:06 -070094 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller(
Eric Andersond42559c2015-09-03 17:14:29 -070095 new io.grpc.protobuf.nano.MessageNanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -080096 @Override
Eric Andersond42559c2015-09-03 17:14:29 -070097 public io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest newInstance() {
98 return new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest();
Xiao Hangdcff3152015-02-20 15:03:06 -080099 }
100 }),
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700101 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller(
Eric Andersond42559c2015-09-03 17:14:29 -0700102 new io.grpc.protobuf.nano.MessageNanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800103 @Override
Eric Andersond42559c2015-09-03 17:14:29 -0700104 public io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse newInstance() {
105 return new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse();
Xiao Hangdcff3152015-02-20 15:03:06 -0800106 }
107 }));
Kun Zhang5bb0ea92015-08-31 09:56:44 -0700108 @io.grpc.ExperimentalApi
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700109 public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
110 io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL =
Kun Zhang73acc732015-06-26 16:32:05 -0700111 io.grpc.MethodDescriptor.create(
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700112 io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
Kun Zhang042b2782015-08-17 15:43:40 -0700113 generateFullMethodName(
114 "grpc.testing.TestService", "HalfBidiCall"),
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700115 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller(
Eric Andersond42559c2015-09-03 17:14:29 -0700116 new io.grpc.protobuf.nano.MessageNanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800117 @Override
Eric Andersond42559c2015-09-03 17:14:29 -0700118 public io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest newInstance() {
119 return new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest();
Xiao Hangdcff3152015-02-20 15:03:06 -0800120 }
121 }),
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700122 io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller(
Eric Andersond42559c2015-09-03 17:14:29 -0700123 new io.grpc.protobuf.nano.MessageNanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800124 @Override
Eric Andersond42559c2015-09-03 17:14:29 -0700125 public io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse newInstance() {
126 return new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse();
Xiao Hangdcff3152015-02-20 15:03:06 -0800127 }
128 }));
129
130 public static TestServiceStub newStub(io.grpc.Channel channel) {
Kun Zhangeb929672015-07-17 17:02:58 -0700131 return new TestServiceStub(channel);
Xiao Hangdcff3152015-02-20 15:03:06 -0800132 }
133
134 public static TestServiceBlockingStub newBlockingStub(
135 io.grpc.Channel channel) {
Kun Zhangeb929672015-07-17 17:02:58 -0700136 return new TestServiceBlockingStub(channel);
Xiao Hangdcff3152015-02-20 15:03:06 -0800137 }
138
139 public static TestServiceFutureStub newFutureStub(
140 io.grpc.Channel channel) {
Kun Zhangeb929672015-07-17 17:02:58 -0700141 return new TestServiceFutureStub(channel);
Xiao Hangdcff3152015-02-20 15:03:06 -0800142 }
143
144 public static interface TestService {
145
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700146 public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request,
147 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800148
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700149 public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request,
150 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800151
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700152 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> streamingInputCall(
153 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800154
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700155 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> fullBidiCall(
156 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800157
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700158 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> halfBidiCall(
159 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800160 }
161
162 public static interface TestServiceBlockingClient {
163
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700164 public io.grpc.testing.integration.nano.Test.SimpleResponse unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800165
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700166 public java.util.Iterator<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> streamingOutputCall(
167 io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800168 }
169
170 public static interface TestServiceFutureClient {
171
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700172 public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.nano.Test.SimpleResponse> unaryCall(
173 io.grpc.testing.integration.nano.Test.SimpleRequest request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800174 }
175
Kun Zhangeb929672015-07-17 17:02:58 -0700176 public static class TestServiceStub extends io.grpc.stub.AbstractStub<TestServiceStub>
Xiao Hangdcff3152015-02-20 15:03:06 -0800177 implements TestService {
Kun Zhangeb929672015-07-17 17:02:58 -0700178 private TestServiceStub(io.grpc.Channel channel) {
179 super(channel);
Xiao Hangdcff3152015-02-20 15:03:06 -0800180 }
181
Kun Zhangd3c5b002015-06-25 20:24:01 -0700182 private TestServiceStub(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700183 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700184 super(channel, callOptions);
Kun Zhangd3c5b002015-06-25 20:24:01 -0700185 }
186
Xiao Hangdcff3152015-02-20 15:03:06 -0800187 @java.lang.Override
188 protected TestServiceStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700189 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700190 return new TestServiceStub(channel, callOptions);
Xiao Hangdcff3152015-02-20 15:03:06 -0800191 }
192
193 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700194 public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request,
195 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver) {
Xiao Hangdcff3152015-02-20 15:03:06 -0800196 asyncUnaryCall(
Kun Zhangeb929672015-07-17 17:02:58 -0700197 channel.newCall(METHOD_UNARY_CALL, callOptions), request, responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800198 }
199
200 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700201 public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request,
202 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
Xiao Hangdcff3152015-02-20 15:03:06 -0800203 asyncServerStreamingCall(
Kun Zhangeb929672015-07-17 17:02:58 -0700204 channel.newCall(METHOD_STREAMING_OUTPUT_CALL, callOptions), request, responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800205 }
206
207 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700208 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> streamingInputCall(
209 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver) {
Xiao Hangdcff3152015-02-20 15:03:06 -0800210 return asyncClientStreamingCall(
Kun Zhangeb929672015-07-17 17:02:58 -0700211 channel.newCall(METHOD_STREAMING_INPUT_CALL, callOptions), responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800212 }
213
214 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700215 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> fullBidiCall(
216 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700217 return asyncBidiStreamingCall(
218 channel.newCall(METHOD_FULL_BIDI_CALL, callOptions), responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800219 }
220
221 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700222 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> halfBidiCall(
223 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700224 return asyncBidiStreamingCall(
225 channel.newCall(METHOD_HALF_BIDI_CALL, callOptions), responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800226 }
227 }
228
Kun Zhangeb929672015-07-17 17:02:58 -0700229 public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub<TestServiceBlockingStub>
Xiao Hangdcff3152015-02-20 15:03:06 -0800230 implements TestServiceBlockingClient {
Kun Zhangeb929672015-07-17 17:02:58 -0700231 private TestServiceBlockingStub(io.grpc.Channel channel) {
232 super(channel);
Xiao Hangdcff3152015-02-20 15:03:06 -0800233 }
234
Kun Zhangd3c5b002015-06-25 20:24:01 -0700235 private TestServiceBlockingStub(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700236 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700237 super(channel, callOptions);
Kun Zhangd3c5b002015-06-25 20:24:01 -0700238 }
239
Xiao Hangdcff3152015-02-20 15:03:06 -0800240 @java.lang.Override
241 protected TestServiceBlockingStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700242 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700243 return new TestServiceBlockingStub(channel, callOptions);
Xiao Hangdcff3152015-02-20 15:03:06 -0800244 }
245
246 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700247 public io.grpc.testing.integration.nano.Test.SimpleResponse unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request) {
Xiao Hangdcff3152015-02-20 15:03:06 -0800248 return blockingUnaryCall(
Kun Zhangeb929672015-07-17 17:02:58 -0700249 channel.newCall(METHOD_UNARY_CALL, callOptions), request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800250 }
251
252 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700253 public java.util.Iterator<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> streamingOutputCall(
254 io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request) {
Xiao Hangdcff3152015-02-20 15:03:06 -0800255 return blockingServerStreamingCall(
Kun Zhangeb929672015-07-17 17:02:58 -0700256 channel.newCall(METHOD_STREAMING_OUTPUT_CALL, callOptions), request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800257 }
258 }
259
Kun Zhangeb929672015-07-17 17:02:58 -0700260 public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub<TestServiceFutureStub>
Xiao Hangdcff3152015-02-20 15:03:06 -0800261 implements TestServiceFutureClient {
Kun Zhangeb929672015-07-17 17:02:58 -0700262 private TestServiceFutureStub(io.grpc.Channel channel) {
263 super(channel);
Xiao Hangdcff3152015-02-20 15:03:06 -0800264 }
265
Kun Zhangd3c5b002015-06-25 20:24:01 -0700266 private TestServiceFutureStub(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700267 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700268 super(channel, callOptions);
Kun Zhangd3c5b002015-06-25 20:24:01 -0700269 }
270
Xiao Hangdcff3152015-02-20 15:03:06 -0800271 @java.lang.Override
272 protected TestServiceFutureStub build(io.grpc.Channel channel,
Kun Zhangd3c5b002015-06-25 20:24:01 -0700273 io.grpc.CallOptions callOptions) {
Kun Zhangeb929672015-07-17 17:02:58 -0700274 return new TestServiceFutureStub(channel, callOptions);
Xiao Hangdcff3152015-02-20 15:03:06 -0800275 }
276
277 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700278 public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.nano.Test.SimpleResponse> unaryCall(
279 io.grpc.testing.integration.nano.Test.SimpleRequest request) {
Kun Zhang686dcff2015-07-16 12:34:37 -0700280 return futureUnaryCall(
Kun Zhangeb929672015-07-17 17:02:58 -0700281 channel.newCall(METHOD_UNARY_CALL, callOptions), request);
Xiao Hangdcff3152015-02-20 15:03:06 -0800282 }
283 }
284
285 public static io.grpc.ServerServiceDefinition bindService(
286 final TestService serviceImpl) {
David P. Baker66b984c2015-08-21 13:00:26 -0400287 return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME)
Kun Zhang73acc732015-06-26 16:32:05 -0700288 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800289 METHOD_UNARY_CALL,
Kun Zhang867c76d2015-07-13 17:15:34 -0700290 asyncUnaryCall(
291 new io.grpc.stub.ServerCalls.UnaryMethod<
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700292 io.grpc.testing.integration.nano.Test.SimpleRequest,
293 io.grpc.testing.integration.nano.Test.SimpleResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800294 @java.lang.Override
295 public void invoke(
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700296 io.grpc.testing.integration.nano.Test.SimpleRequest request,
297 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver) {
Xiao Hangdcff3152015-02-20 15:03:06 -0800298 serviceImpl.unaryCall(request, responseObserver);
299 }
300 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700301 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800302 METHOD_STREAMING_OUTPUT_CALL,
Kun Zhang867c76d2015-07-13 17:15:34 -0700303 asyncServerStreamingCall(
304 new io.grpc.stub.ServerCalls.ServerStreamingMethod<
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700305 io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
306 io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800307 @java.lang.Override
308 public void invoke(
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700309 io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request,
310 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
Xiao Hangdcff3152015-02-20 15:03:06 -0800311 serviceImpl.streamingOutputCall(request, responseObserver);
312 }
313 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700314 .addMethod(io.grpc.ServerMethodDefinition.create(
Xiao Hangdcff3152015-02-20 15:03:06 -0800315 METHOD_STREAMING_INPUT_CALL,
Kun Zhang867c76d2015-07-13 17:15:34 -0700316 asyncClientStreamingCall(
317 new io.grpc.stub.ServerCalls.ClientStreamingMethod<
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700318 io.grpc.testing.integration.nano.Test.StreamingInputCallRequest,
319 io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800320 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700321 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> invoke(
322 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver) {
Xiao Hangdcff3152015-02-20 15:03:06 -0800323 return serviceImpl.streamingInputCall(responseObserver);
324 }
325 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700326 .addMethod(io.grpc.ServerMethodDefinition.create(
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700327 METHOD_FULL_BIDI_CALL,
328 asyncBidiStreamingCall(
329 new io.grpc.stub.ServerCalls.BidiStreamingMethod<
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700330 io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
331 io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800332 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700333 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> invoke(
334 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700335 return serviceImpl.fullBidiCall(responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800336 }
337 })))
Kun Zhang73acc732015-06-26 16:32:05 -0700338 .addMethod(io.grpc.ServerMethodDefinition.create(
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700339 METHOD_HALF_BIDI_CALL,
340 asyncBidiStreamingCall(
341 new io.grpc.stub.ServerCalls.BidiStreamingMethod<
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700342 io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
343 io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>() {
Xiao Hangdcff3152015-02-20 15:03:06 -0800344 @java.lang.Override
Kun Zhangbd23a8d2015-08-28 18:47:06 -0700345 public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> invoke(
346 io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
Carl Mastrangelo67fc45d2015-08-05 13:56:50 -0700347 return serviceImpl.halfBidiCall(responseObserver);
Xiao Hangdcff3152015-02-20 15:03:06 -0800348 }
349 }))).build();
350 }
351}