Xudong Ma | f7f57b7 | 2015-09-24 11:16:07 -0700 | [diff] [blame] | 1 | package io.grpc.testing.integration.nano; |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 2 | |
Kun Zhang | 2ee4d02 | 2015-06-04 16:39:25 -0700 | [diff] [blame] | 3 | import static io.grpc.stub.ClientCalls.asyncUnaryCall; |
| 4 | import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; |
| 5 | import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 6 | import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; |
Kun Zhang | 2ee4d02 | 2015-06-04 16:39:25 -0700 | [diff] [blame] | 7 | import static io.grpc.stub.ClientCalls.blockingUnaryCall; |
| 8 | import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; |
Kun Zhang | 686dcff | 2015-07-16 12:34:37 -0700 | [diff] [blame] | 9 | import static io.grpc.stub.ClientCalls.futureUnaryCall; |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 10 | import static io.grpc.MethodDescriptor.generateFullMethodName; |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame] | 11 | import static io.grpc.stub.ServerCalls.asyncUnaryCall; |
| 12 | import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; |
| 13 | import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 14 | import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; |
Lukasz Strzalkowski | 2fbf142 | 2016-04-08 02:28:32 +0200 | [diff] [blame] | 15 | import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; |
| 16 | import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 17 | |
| 18 | import java.io.IOException; |
| 19 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 20 | /** |
| 21 | * <pre> |
| 22 | * Test service that supports all call types. |
| 23 | * </pre> |
| 24 | */ |
Carl Mastrangelo | 72f1e88 | 2016-02-29 18:05:33 -0800 | [diff] [blame] | 25 | @javax.annotation.Generated( |
Carl Mastrangelo | 3c5b5a5 | 2016-04-29 13:37:20 -0700 | [diff] [blame] | 26 | value = "by gRPC proto compiler (version 0.15.0-SNAPSHOT)", |
Carl Mastrangelo | 72f1e88 | 2016-02-29 18:05:33 -0800 | [diff] [blame] | 27 | comments = "Source: test.proto") |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 28 | public class TestServiceGrpc { |
| 29 | |
Eric Anderson | be0d7e9 | 2015-09-10 09:47:17 -0700 | [diff] [blame] | 30 | private TestServiceGrpc() {} |
| 31 | |
David P. Baker | 66b984c | 2015-08-21 13:00:26 -0400 | [diff] [blame] | 32 | public static final String SERVICE_NAME = "grpc.testing.TestService"; |
| 33 | |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 34 | // Static method descriptors that strictly reflect the proto. |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 35 | private static final int ARG_IN_METHOD_UNARY_CALL = 0; |
| 36 | private static final int ARG_OUT_METHOD_UNARY_CALL = 1; |
Eric Anderson | 7c722e4 | 2016-06-07 15:00:29 -0700 | [diff] [blame] | 37 | @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 38 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.SimpleRequest, |
| 39 | io.grpc.testing.integration.nano.Test.SimpleResponse> METHOD_UNARY_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 40 | io.grpc.MethodDescriptor.create( |
| 41 | io.grpc.MethodDescriptor.MethodType.UNARY, |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 42 | generateFullMethodName( |
| 43 | "grpc.testing.TestService", "UnaryCall"), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 44 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.SimpleRequest>marshaller( |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 45 | new NanoFactory<io.grpc.testing.integration.nano.Test.SimpleRequest>(ARG_IN_METHOD_UNARY_CALL)), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 46 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.SimpleResponse>marshaller( |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 47 | new NanoFactory<io.grpc.testing.integration.nano.Test.SimpleResponse>(ARG_OUT_METHOD_UNARY_CALL)) |
| 48 | ); |
| 49 | private static final int ARG_IN_METHOD_STREAMING_OUTPUT_CALL = 2; |
| 50 | private static final int ARG_OUT_METHOD_STREAMING_OUTPUT_CALL = 3; |
Eric Anderson | 7c722e4 | 2016-06-07 15:00:29 -0700 | [diff] [blame] | 51 | @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 52 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
| 53 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 54 | io.grpc.MethodDescriptor.create( |
| 55 | io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 56 | generateFullMethodName( |
| 57 | "grpc.testing.TestService", "StreamingOutputCall"), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 58 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller( |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 59 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>(ARG_IN_METHOD_STREAMING_OUTPUT_CALL)), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 60 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller( |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 61 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(ARG_OUT_METHOD_STREAMING_OUTPUT_CALL)) |
| 62 | ); |
| 63 | private static final int ARG_IN_METHOD_STREAMING_INPUT_CALL = 4; |
| 64 | private static final int ARG_OUT_METHOD_STREAMING_INPUT_CALL = 5; |
Eric Anderson | 7c722e4 | 2016-06-07 15:00:29 -0700 | [diff] [blame] | 65 | @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 66 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest, |
| 67 | io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 68 | io.grpc.MethodDescriptor.create( |
| 69 | io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING, |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 70 | generateFullMethodName( |
| 71 | "grpc.testing.TestService", "StreamingInputCall"), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 72 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest>marshaller( |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 73 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest>(ARG_IN_METHOD_STREAMING_INPUT_CALL)), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 74 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>marshaller( |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 75 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>(ARG_OUT_METHOD_STREAMING_INPUT_CALL)) |
| 76 | ); |
| 77 | private static final int ARG_IN_METHOD_FULL_BIDI_CALL = 6; |
| 78 | private static final int ARG_OUT_METHOD_FULL_BIDI_CALL = 7; |
Eric Anderson | 7c722e4 | 2016-06-07 15:00:29 -0700 | [diff] [blame] | 79 | @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 80 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
| 81 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 82 | io.grpc.MethodDescriptor.create( |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 83 | io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 84 | generateFullMethodName( |
| 85 | "grpc.testing.TestService", "FullBidiCall"), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 86 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller( |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 87 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>(ARG_IN_METHOD_FULL_BIDI_CALL)), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 88 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller( |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 89 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(ARG_OUT_METHOD_FULL_BIDI_CALL)) |
| 90 | ); |
| 91 | private static final int ARG_IN_METHOD_HALF_BIDI_CALL = 8; |
| 92 | private static final int ARG_OUT_METHOD_HALF_BIDI_CALL = 9; |
Eric Anderson | 7c722e4 | 2016-06-07 15:00:29 -0700 | [diff] [blame] | 93 | @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 94 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
| 95 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 96 | io.grpc.MethodDescriptor.create( |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 97 | io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 98 | generateFullMethodName( |
| 99 | "grpc.testing.TestService", "HalfBidiCall"), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 100 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller( |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 101 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>(ARG_IN_METHOD_HALF_BIDI_CALL)), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 102 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller( |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 103 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(ARG_OUT_METHOD_HALF_BIDI_CALL)) |
| 104 | ); |
| 105 | |
| 106 | private static final class NanoFactory<T extends com.google.protobuf.nano.MessageNano> |
| 107 | implements io.grpc.protobuf.nano.MessageNanoFactory<T> { |
| 108 | private final int id; |
| 109 | |
| 110 | NanoFactory(int id) { |
| 111 | this.id = id; |
| 112 | } |
| 113 | |
Lukasz Strzalkowski | 2fbf142 | 2016-04-08 02:28:32 +0200 | [diff] [blame] | 114 | @java.lang.Override |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame] | 115 | public T newInstance() { |
| 116 | Object o; |
| 117 | switch (id) { |
| 118 | case ARG_IN_METHOD_UNARY_CALL: |
| 119 | o = new io.grpc.testing.integration.nano.Test.SimpleRequest(); |
| 120 | break; |
| 121 | case ARG_OUT_METHOD_UNARY_CALL: |
| 122 | o = new io.grpc.testing.integration.nano.Test.SimpleResponse(); |
| 123 | break; |
| 124 | case ARG_IN_METHOD_STREAMING_OUTPUT_CALL: |
| 125 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest(); |
| 126 | break; |
| 127 | case ARG_OUT_METHOD_STREAMING_OUTPUT_CALL: |
| 128 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse(); |
| 129 | break; |
| 130 | case ARG_IN_METHOD_STREAMING_INPUT_CALL: |
| 131 | o = new io.grpc.testing.integration.nano.Test.StreamingInputCallRequest(); |
| 132 | break; |
| 133 | case ARG_OUT_METHOD_STREAMING_INPUT_CALL: |
| 134 | o = new io.grpc.testing.integration.nano.Test.StreamingInputCallResponse(); |
| 135 | break; |
| 136 | case ARG_IN_METHOD_FULL_BIDI_CALL: |
| 137 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest(); |
| 138 | break; |
| 139 | case ARG_OUT_METHOD_FULL_BIDI_CALL: |
| 140 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse(); |
| 141 | break; |
| 142 | case ARG_IN_METHOD_HALF_BIDI_CALL: |
| 143 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest(); |
| 144 | break; |
| 145 | case ARG_OUT_METHOD_HALF_BIDI_CALL: |
| 146 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse(); |
| 147 | break; |
| 148 | default: |
| 149 | throw new AssertionError(); |
| 150 | } |
| 151 | @java.lang.SuppressWarnings("unchecked") |
| 152 | T t = (T) o; |
| 153 | return t; |
| 154 | } |
| 155 | } |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 156 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 157 | /** |
| 158 | * Creates a new async stub that supports all call types for the service |
| 159 | */ |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 160 | public static TestServiceStub newStub(io.grpc.Channel channel) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 161 | return new TestServiceStub(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 162 | } |
| 163 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 164 | /** |
| 165 | * Creates a new blocking-style stub that supports unary and streaming output calls on the service |
| 166 | */ |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 167 | public static TestServiceBlockingStub newBlockingStub( |
| 168 | io.grpc.Channel channel) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 169 | return new TestServiceBlockingStub(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 170 | } |
| 171 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 172 | /** |
| 173 | * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service |
| 174 | */ |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 175 | public static TestServiceFutureStub newFutureStub( |
| 176 | io.grpc.Channel channel) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 177 | return new TestServiceFutureStub(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 178 | } |
| 179 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 180 | /** |
| 181 | * <pre> |
| 182 | * Test service that supports all call types. |
| 183 | * </pre> |
| 184 | */ |
ZHANG Dapeng | f149e4c | 2016-06-29 21:17:03 -0700 | [diff] [blame^] | 185 | @java.lang.Deprecated public static interface TestService { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 186 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 187 | /** |
| 188 | * <pre> |
| 189 | * One request followed by one response. |
| 190 | * The server returns the client payload as-is. |
| 191 | * </pre> |
| 192 | */ |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 193 | public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request, |
| 194 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 195 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 196 | /** |
| 197 | * <pre> |
| 198 | * One request followed by a sequence of responses (streamed download). |
| 199 | * The server returns the payload with client desired type and sizes. |
| 200 | * </pre> |
| 201 | */ |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 202 | public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request, |
| 203 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 204 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 205 | /** |
| 206 | * <pre> |
| 207 | * A sequence of requests followed by one response (streamed upload). |
| 208 | * The server returns the aggregated size of client payload as the result. |
| 209 | * </pre> |
| 210 | */ |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 211 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> streamingInputCall( |
| 212 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 213 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 214 | /** |
| 215 | * <pre> |
| 216 | * A sequence of requests with each request served by the server immediately. |
| 217 | * As one request could lead to multiple responses, this interface |
| 218 | * demonstrates the idea of full bidirectionality. |
| 219 | * </pre> |
| 220 | */ |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 221 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> fullBidiCall( |
| 222 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 223 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 224 | /** |
| 225 | * <pre> |
| 226 | * A sequence of requests followed by a sequence of responses. |
| 227 | * The server buffers all the client requests and then serves them in order. A |
| 228 | * stream of responses are returned to the client when the server starts with |
| 229 | * first request. |
| 230 | * </pre> |
| 231 | */ |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 232 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> halfBidiCall( |
| 233 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 234 | } |
| 235 | |
Eric Anderson | 7c722e4 | 2016-06-07 15:00:29 -0700 | [diff] [blame] | 236 | @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1469") |
ZHANG Dapeng | f149e4c | 2016-06-29 21:17:03 -0700 | [diff] [blame^] | 237 | public static abstract class TestServiceImplBase implements TestService, io.grpc.BindableService { |
Lukasz Strzalkowski | 2fbf142 | 2016-04-08 02:28:32 +0200 | [diff] [blame] | 238 | |
| 239 | @java.lang.Override |
| 240 | public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request, |
| 241 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver) { |
| 242 | asyncUnimplementedUnaryCall(METHOD_UNARY_CALL, responseObserver); |
| 243 | } |
| 244 | |
| 245 | @java.lang.Override |
| 246 | public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request, |
| 247 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
| 248 | asyncUnimplementedUnaryCall(METHOD_STREAMING_OUTPUT_CALL, responseObserver); |
| 249 | } |
| 250 | |
| 251 | @java.lang.Override |
| 252 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> streamingInputCall( |
| 253 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver) { |
| 254 | return asyncUnimplementedStreamingCall(METHOD_STREAMING_INPUT_CALL, responseObserver); |
| 255 | } |
| 256 | |
| 257 | @java.lang.Override |
| 258 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> fullBidiCall( |
| 259 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
| 260 | return asyncUnimplementedStreamingCall(METHOD_FULL_BIDI_CALL, responseObserver); |
| 261 | } |
| 262 | |
| 263 | @java.lang.Override |
| 264 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> halfBidiCall( |
| 265 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
| 266 | return asyncUnimplementedStreamingCall(METHOD_HALF_BIDI_CALL, responseObserver); |
| 267 | } |
| 268 | |
| 269 | @java.lang.Override public io.grpc.ServerServiceDefinition bindService() { |
| 270 | return TestServiceGrpc.bindService(this); |
| 271 | } |
| 272 | } |
| 273 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 274 | /** |
| 275 | * <pre> |
| 276 | * Test service that supports all call types. |
| 277 | * </pre> |
| 278 | */ |
ZHANG Dapeng | f149e4c | 2016-06-29 21:17:03 -0700 | [diff] [blame^] | 279 | @java.lang.Deprecated public static interface TestServiceBlockingClient { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 280 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 281 | /** |
| 282 | * <pre> |
| 283 | * One request followed by one response. |
| 284 | * The server returns the client payload as-is. |
| 285 | * </pre> |
| 286 | */ |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 287 | public io.grpc.testing.integration.nano.Test.SimpleResponse unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 288 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 289 | /** |
| 290 | * <pre> |
| 291 | * One request followed by a sequence of responses (streamed download). |
| 292 | * The server returns the payload with client desired type and sizes. |
| 293 | * </pre> |
| 294 | */ |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 295 | public java.util.Iterator<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 296 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 297 | } |
| 298 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 299 | /** |
| 300 | * <pre> |
| 301 | * Test service that supports all call types. |
| 302 | * </pre> |
| 303 | */ |
ZHANG Dapeng | f149e4c | 2016-06-29 21:17:03 -0700 | [diff] [blame^] | 304 | @java.lang.Deprecated public static interface TestServiceFutureClient { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 305 | |
nmittler | 7e8b504 | 2016-04-15 12:52:00 -0700 | [diff] [blame] | 306 | /** |
| 307 | * <pre> |
| 308 | * One request followed by one response. |
| 309 | * The server returns the client payload as-is. |
| 310 | * </pre> |
| 311 | */ |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 312 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.nano.Test.SimpleResponse> unaryCall( |
| 313 | io.grpc.testing.integration.nano.Test.SimpleRequest request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 314 | } |
| 315 | |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 316 | public static class TestServiceStub extends io.grpc.stub.AbstractStub<TestServiceStub> |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 317 | implements TestService { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 318 | private TestServiceStub(io.grpc.Channel channel) { |
| 319 | super(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 320 | } |
| 321 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 322 | private TestServiceStub(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 323 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 324 | super(channel, callOptions); |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 325 | } |
| 326 | |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 327 | @java.lang.Override |
| 328 | protected TestServiceStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 329 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 330 | return new TestServiceStub(channel, callOptions); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 331 | } |
| 332 | |
| 333 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 334 | public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request, |
| 335 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver) { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 336 | asyncUnaryCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 337 | getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request, responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 338 | } |
| 339 | |
| 340 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 341 | public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request, |
| 342 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 343 | asyncServerStreamingCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 344 | getChannel().newCall(METHOD_STREAMING_OUTPUT_CALL, getCallOptions()), request, responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 345 | } |
| 346 | |
| 347 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 348 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> streamingInputCall( |
| 349 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver) { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 350 | return asyncClientStreamingCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 351 | getChannel().newCall(METHOD_STREAMING_INPUT_CALL, getCallOptions()), responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 352 | } |
| 353 | |
| 354 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 355 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> fullBidiCall( |
| 356 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 357 | return asyncBidiStreamingCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 358 | getChannel().newCall(METHOD_FULL_BIDI_CALL, getCallOptions()), responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 362 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> halfBidiCall( |
| 363 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 364 | return asyncBidiStreamingCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 365 | getChannel().newCall(METHOD_HALF_BIDI_CALL, getCallOptions()), responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 366 | } |
| 367 | } |
| 368 | |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 369 | public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub<TestServiceBlockingStub> |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 370 | implements TestServiceBlockingClient { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 371 | private TestServiceBlockingStub(io.grpc.Channel channel) { |
| 372 | super(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 373 | } |
| 374 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 375 | private TestServiceBlockingStub(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 376 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 377 | super(channel, callOptions); |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 378 | } |
| 379 | |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 380 | @java.lang.Override |
| 381 | protected TestServiceBlockingStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 382 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 383 | return new TestServiceBlockingStub(channel, callOptions); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 384 | } |
| 385 | |
| 386 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 387 | public io.grpc.testing.integration.nano.Test.SimpleResponse unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request) { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 388 | return blockingUnaryCall( |
Eric Anderson | 4168f67 | 2015-08-04 16:37:00 -0700 | [diff] [blame] | 389 | getChannel(), METHOD_UNARY_CALL, getCallOptions(), request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 390 | } |
| 391 | |
| 392 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 393 | public java.util.Iterator<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 394 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request) { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 395 | return blockingServerStreamingCall( |
Eric Anderson | 4168f67 | 2015-08-04 16:37:00 -0700 | [diff] [blame] | 396 | getChannel(), METHOD_STREAMING_OUTPUT_CALL, getCallOptions(), request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 397 | } |
| 398 | } |
| 399 | |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 400 | public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub<TestServiceFutureStub> |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 401 | implements TestServiceFutureClient { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 402 | private TestServiceFutureStub(io.grpc.Channel channel) { |
| 403 | super(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 404 | } |
| 405 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 406 | private TestServiceFutureStub(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 407 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 408 | super(channel, callOptions); |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 409 | } |
| 410 | |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 411 | @java.lang.Override |
| 412 | protected TestServiceFutureStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 413 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 414 | return new TestServiceFutureStub(channel, callOptions); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 415 | } |
| 416 | |
| 417 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 418 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.nano.Test.SimpleResponse> unaryCall( |
| 419 | io.grpc.testing.integration.nano.Test.SimpleRequest request) { |
Kun Zhang | 686dcff | 2015-07-16 12:34:37 -0700 | [diff] [blame] | 420 | return futureUnaryCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 421 | getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 422 | } |
| 423 | } |
| 424 | |
ZHANG Dapeng | f149e4c | 2016-06-29 21:17:03 -0700 | [diff] [blame^] | 425 | @java.lang.Deprecated public static abstract class AbstractTestService extends TestServiceImplBase {} |
| 426 | |
Eric Anderson | d52429d | 2015-11-13 16:50:08 -0800 | [diff] [blame] | 427 | private static final int METHODID_UNARY_CALL = 0; |
| 428 | private static final int METHODID_STREAMING_OUTPUT_CALL = 1; |
| 429 | private static final int METHODID_STREAMING_INPUT_CALL = 2; |
| 430 | private static final int METHODID_FULL_BIDI_CALL = 3; |
| 431 | private static final int METHODID_HALF_BIDI_CALL = 4; |
| 432 | |
| 433 | private static class MethodHandlers<Req, Resp> implements |
| 434 | io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, |
| 435 | io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, |
| 436 | io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, |
| 437 | io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { |
| 438 | private final TestService serviceImpl; |
| 439 | private final int methodId; |
| 440 | |
| 441 | public MethodHandlers(TestService serviceImpl, int methodId) { |
| 442 | this.serviceImpl = serviceImpl; |
| 443 | this.methodId = methodId; |
| 444 | } |
| 445 | |
Carl Mastrangelo | ffe0dce | 2016-03-04 14:15:02 -0800 | [diff] [blame] | 446 | @java.lang.Override |
Eric Anderson | d52429d | 2015-11-13 16:50:08 -0800 | [diff] [blame] | 447 | @java.lang.SuppressWarnings("unchecked") |
| 448 | public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { |
| 449 | switch (methodId) { |
| 450 | case METHODID_UNARY_CALL: |
| 451 | serviceImpl.unaryCall((io.grpc.testing.integration.nano.Test.SimpleRequest) request, |
| 452 | (io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse>) responseObserver); |
| 453 | break; |
| 454 | case METHODID_STREAMING_OUTPUT_CALL: |
| 455 | serviceImpl.streamingOutputCall((io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest) request, |
| 456 | (io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>) responseObserver); |
| 457 | break; |
| 458 | default: |
| 459 | throw new AssertionError(); |
| 460 | } |
| 461 | } |
| 462 | |
Carl Mastrangelo | ffe0dce | 2016-03-04 14:15:02 -0800 | [diff] [blame] | 463 | @java.lang.Override |
Eric Anderson | d52429d | 2015-11-13 16:50:08 -0800 | [diff] [blame] | 464 | @java.lang.SuppressWarnings("unchecked") |
| 465 | public io.grpc.stub.StreamObserver<Req> invoke( |
| 466 | io.grpc.stub.StreamObserver<Resp> responseObserver) { |
| 467 | switch (methodId) { |
| 468 | case METHODID_STREAMING_INPUT_CALL: |
| 469 | return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamingInputCall( |
| 470 | (io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>) responseObserver); |
| 471 | case METHODID_FULL_BIDI_CALL: |
| 472 | return (io.grpc.stub.StreamObserver<Req>) serviceImpl.fullBidiCall( |
| 473 | (io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>) responseObserver); |
| 474 | case METHODID_HALF_BIDI_CALL: |
| 475 | return (io.grpc.stub.StreamObserver<Req>) serviceImpl.halfBidiCall( |
| 476 | (io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>) responseObserver); |
| 477 | default: |
| 478 | throw new AssertionError(); |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | |
Eric Anderson | 66ab956 | 2016-06-20 15:22:23 -0700 | [diff] [blame] | 483 | public static io.grpc.ServiceDescriptor getServiceDescriptor() { |
| 484 | return new io.grpc.ServiceDescriptor(SERVICE_NAME, |
| 485 | METHOD_UNARY_CALL, |
| 486 | METHOD_STREAMING_OUTPUT_CALL, |
| 487 | METHOD_STREAMING_INPUT_CALL, |
| 488 | METHOD_FULL_BIDI_CALL, |
| 489 | METHOD_HALF_BIDI_CALL); |
| 490 | } |
| 491 | |
ZHANG Dapeng | f149e4c | 2016-06-29 21:17:03 -0700 | [diff] [blame^] | 492 | @java.lang.Deprecated public static io.grpc.ServerServiceDefinition bindService( |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 493 | final TestService serviceImpl) { |
Eric Anderson | 66ab956 | 2016-06-20 15:22:23 -0700 | [diff] [blame] | 494 | return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) |
Eric Anderson | d52429d | 2015-11-13 16:50:08 -0800 | [diff] [blame] | 495 | .addMethod( |
| 496 | METHOD_UNARY_CALL, |
| 497 | asyncUnaryCall( |
| 498 | new MethodHandlers< |
Eric Anderson | a6621da | 2015-09-10 17:37:21 -0700 | [diff] [blame] | 499 | io.grpc.testing.integration.nano.Test.SimpleRequest, |
Eric Anderson | d52429d | 2015-11-13 16:50:08 -0800 | [diff] [blame] | 500 | io.grpc.testing.integration.nano.Test.SimpleResponse>( |
| 501 | serviceImpl, METHODID_UNARY_CALL))) |
| 502 | .addMethod( |
| 503 | METHOD_STREAMING_OUTPUT_CALL, |
| 504 | asyncServerStreamingCall( |
| 505 | new MethodHandlers< |
Eric Anderson | a6621da | 2015-09-10 17:37:21 -0700 | [diff] [blame] | 506 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
Eric Anderson | d52429d | 2015-11-13 16:50:08 -0800 | [diff] [blame] | 507 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>( |
| 508 | serviceImpl, METHODID_STREAMING_OUTPUT_CALL))) |
| 509 | .addMethod( |
| 510 | METHOD_STREAMING_INPUT_CALL, |
| 511 | asyncClientStreamingCall( |
| 512 | new MethodHandlers< |
Eric Anderson | a6621da | 2015-09-10 17:37:21 -0700 | [diff] [blame] | 513 | io.grpc.testing.integration.nano.Test.StreamingInputCallRequest, |
Eric Anderson | d52429d | 2015-11-13 16:50:08 -0800 | [diff] [blame] | 514 | io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>( |
| 515 | serviceImpl, METHODID_STREAMING_INPUT_CALL))) |
| 516 | .addMethod( |
| 517 | METHOD_FULL_BIDI_CALL, |
| 518 | asyncBidiStreamingCall( |
| 519 | new MethodHandlers< |
Eric Anderson | a6621da | 2015-09-10 17:37:21 -0700 | [diff] [blame] | 520 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
Eric Anderson | d52429d | 2015-11-13 16:50:08 -0800 | [diff] [blame] | 521 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>( |
| 522 | serviceImpl, METHODID_FULL_BIDI_CALL))) |
| 523 | .addMethod( |
| 524 | METHOD_HALF_BIDI_CALL, |
| 525 | asyncBidiStreamingCall( |
| 526 | new MethodHandlers< |
Eric Anderson | a6621da | 2015-09-10 17:37:21 -0700 | [diff] [blame] | 527 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
Eric Anderson | d52429d | 2015-11-13 16:50:08 -0800 | [diff] [blame] | 528 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>( |
| 529 | serviceImpl, METHODID_HALF_BIDI_CALL))) |
| 530 | .build(); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 531 | } |
| 532 | } |