Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 1 | package io.grpc.testing.integration; |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 2 | |
| 3 | import static io.grpc.stub.ClientCalls.asyncUnaryCall; |
| 4 | import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; |
| 5 | import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; |
| 6 | import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; |
| 7 | import static io.grpc.stub.ClientCalls.blockingUnaryCall; |
| 8 | import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; |
| 9 | import static io.grpc.stub.ClientCalls.futureUnaryCall; |
| 10 | import static io.grpc.MethodDescriptor.generateFullMethodName; |
| 11 | import static io.grpc.stub.ServerCalls.asyncUnaryCall; |
| 12 | import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; |
| 13 | import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; |
| 14 | import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; |
| 15 | |
| 16 | @javax.annotation.Generated( |
| 17 | value = "by gRPC proto compiler", |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 18 | comments = "Source: test.proto") |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 19 | public class TestServiceGrpc { |
| 20 | |
| 21 | private TestServiceGrpc() {} |
| 22 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 23 | public static final String SERVICE_NAME = "grpc.testing.TestService"; |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 24 | |
| 25 | // Static method descriptors that strictly reflect the proto. |
| 26 | @io.grpc.ExperimentalApi |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 27 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
| 28 | io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL = |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 29 | io.grpc.MethodDescriptor.create( |
| 30 | io.grpc.MethodDescriptor.MethodType.UNARY, |
| 31 | generateFullMethodName( |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 32 | "grpc.testing.TestService", "UnaryCall"), |
| 33 | io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.getDefaultInstance()), |
| 34 | io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.getDefaultInstance())); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 35 | @io.grpc.ExperimentalApi |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 36 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 37 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL = |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 38 | io.grpc.MethodDescriptor.create( |
| 39 | io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, |
| 40 | generateFullMethodName( |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 41 | "grpc.testing.TestService", "StreamingOutputCall"), |
| 42 | io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), |
| 43 | io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 44 | @io.grpc.ExperimentalApi |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 45 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 46 | io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL = |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 47 | io.grpc.MethodDescriptor.create( |
| 48 | io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING, |
| 49 | generateFullMethodName( |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 50 | "grpc.testing.TestService", "StreamingInputCall"), |
| 51 | io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.getDefaultInstance()), |
| 52 | io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.getDefaultInstance())); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 53 | @io.grpc.ExperimentalApi |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 54 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 55 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL = |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 56 | io.grpc.MethodDescriptor.create( |
| 57 | io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, |
| 58 | generateFullMethodName( |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 59 | "grpc.testing.TestService", "FullBidiCall"), |
| 60 | io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), |
| 61 | io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 62 | @io.grpc.ExperimentalApi |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 63 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 64 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL = |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 65 | io.grpc.MethodDescriptor.create( |
| 66 | io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, |
| 67 | generateFullMethodName( |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 68 | "grpc.testing.TestService", "HalfBidiCall"), |
| 69 | io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()), |
| 70 | io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.getDefaultInstance())); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 71 | |
| 72 | public static TestServiceStub newStub(io.grpc.Channel channel) { |
| 73 | return new TestServiceStub(channel); |
| 74 | } |
| 75 | |
| 76 | public static TestServiceBlockingStub newBlockingStub( |
| 77 | io.grpc.Channel channel) { |
| 78 | return new TestServiceBlockingStub(channel); |
| 79 | } |
| 80 | |
| 81 | public static TestServiceFutureStub newFutureStub( |
| 82 | io.grpc.Channel channel) { |
| 83 | return new TestServiceFutureStub(channel); |
| 84 | } |
| 85 | |
| 86 | public static interface TestService { |
| 87 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 88 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 89 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 90 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 91 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 92 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 93 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 94 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 95 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 96 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 97 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall( |
| 98 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 99 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 100 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall( |
| 101 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | public static interface TestServiceBlockingClient { |
| 105 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 106 | public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 107 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 108 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 109 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | public static interface TestServiceFutureClient { |
| 113 | |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 114 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 115 | io.grpc.testing.integration.Test.SimpleRequest request); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | public static class TestServiceStub extends io.grpc.stub.AbstractStub<TestServiceStub> |
| 119 | implements TestService { |
| 120 | private TestServiceStub(io.grpc.Channel channel) { |
| 121 | super(channel); |
| 122 | } |
| 123 | |
| 124 | private TestServiceStub(io.grpc.Channel channel, |
| 125 | io.grpc.CallOptions callOptions) { |
| 126 | super(channel, callOptions); |
| 127 | } |
| 128 | |
| 129 | @java.lang.Override |
| 130 | protected TestServiceStub build(io.grpc.Channel channel, |
| 131 | io.grpc.CallOptions callOptions) { |
| 132 | return new TestServiceStub(channel, callOptions); |
| 133 | } |
| 134 | |
| 135 | @java.lang.Override |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 136 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 137 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 138 | asyncUnaryCall( |
| 139 | getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request, responseObserver); |
| 140 | } |
| 141 | |
| 142 | @java.lang.Override |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 143 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 144 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 145 | asyncServerStreamingCall( |
| 146 | getChannel().newCall(METHOD_STREAMING_OUTPUT_CALL, getCallOptions()), request, responseObserver); |
| 147 | } |
| 148 | |
| 149 | @java.lang.Override |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 150 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 151 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 152 | return asyncClientStreamingCall( |
| 153 | getChannel().newCall(METHOD_STREAMING_INPUT_CALL, getCallOptions()), responseObserver); |
| 154 | } |
| 155 | |
| 156 | @java.lang.Override |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 157 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall( |
| 158 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 159 | return asyncBidiStreamingCall( |
| 160 | getChannel().newCall(METHOD_FULL_BIDI_CALL, getCallOptions()), responseObserver); |
| 161 | } |
| 162 | |
| 163 | @java.lang.Override |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 164 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall( |
| 165 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 166 | return asyncBidiStreamingCall( |
| 167 | getChannel().newCall(METHOD_HALF_BIDI_CALL, getCallOptions()), responseObserver); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub<TestServiceBlockingStub> |
| 172 | implements TestServiceBlockingClient { |
| 173 | private TestServiceBlockingStub(io.grpc.Channel channel) { |
| 174 | super(channel); |
| 175 | } |
| 176 | |
| 177 | private TestServiceBlockingStub(io.grpc.Channel channel, |
| 178 | io.grpc.CallOptions callOptions) { |
| 179 | super(channel, callOptions); |
| 180 | } |
| 181 | |
| 182 | @java.lang.Override |
| 183 | protected TestServiceBlockingStub build(io.grpc.Channel channel, |
| 184 | io.grpc.CallOptions callOptions) { |
| 185 | return new TestServiceBlockingStub(channel, callOptions); |
| 186 | } |
| 187 | |
| 188 | @java.lang.Override |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 189 | public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) { |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 190 | return blockingUnaryCall( |
| 191 | getChannel(), METHOD_UNARY_CALL, getCallOptions(), request); |
| 192 | } |
| 193 | |
| 194 | @java.lang.Override |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 195 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 196 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request) { |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 197 | return blockingServerStreamingCall( |
| 198 | getChannel(), METHOD_STREAMING_OUTPUT_CALL, getCallOptions(), request); |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub<TestServiceFutureStub> |
| 203 | implements TestServiceFutureClient { |
| 204 | private TestServiceFutureStub(io.grpc.Channel channel) { |
| 205 | super(channel); |
| 206 | } |
| 207 | |
| 208 | private TestServiceFutureStub(io.grpc.Channel channel, |
| 209 | io.grpc.CallOptions callOptions) { |
| 210 | super(channel, callOptions); |
| 211 | } |
| 212 | |
| 213 | @java.lang.Override |
| 214 | protected TestServiceFutureStub build(io.grpc.Channel channel, |
| 215 | io.grpc.CallOptions callOptions) { |
| 216 | return new TestServiceFutureStub(channel, callOptions); |
| 217 | } |
| 218 | |
| 219 | @java.lang.Override |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 220 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 221 | io.grpc.testing.integration.Test.SimpleRequest request) { |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 222 | return futureUnaryCall( |
| 223 | getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request); |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | private static final int METHODID_UNARY_CALL = 0; |
| 228 | private static final int METHODID_STREAMING_OUTPUT_CALL = 1; |
| 229 | private static final int METHODID_STREAMING_INPUT_CALL = 2; |
| 230 | private static final int METHODID_FULL_BIDI_CALL = 3; |
| 231 | private static final int METHODID_HALF_BIDI_CALL = 4; |
| 232 | |
| 233 | private static class MethodHandlers<Req, Resp> implements |
| 234 | io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, |
| 235 | io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, |
| 236 | io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, |
| 237 | io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { |
| 238 | private final TestService serviceImpl; |
| 239 | private final int methodId; |
| 240 | |
| 241 | public MethodHandlers(TestService serviceImpl, int methodId) { |
| 242 | this.serviceImpl = serviceImpl; |
| 243 | this.methodId = methodId; |
| 244 | } |
| 245 | |
| 246 | @java.lang.Override |
| 247 | @java.lang.SuppressWarnings("unchecked") |
| 248 | public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { |
| 249 | switch (methodId) { |
| 250 | case METHODID_UNARY_CALL: |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 251 | serviceImpl.unaryCall((io.grpc.testing.integration.Test.SimpleRequest) request, |
| 252 | (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse>) responseObserver); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 253 | break; |
| 254 | case METHODID_STREAMING_OUTPUT_CALL: |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 255 | serviceImpl.streamingOutputCall((io.grpc.testing.integration.Test.StreamingOutputCallRequest) request, |
| 256 | (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse>) responseObserver); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 257 | break; |
| 258 | default: |
| 259 | throw new AssertionError(); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | @java.lang.Override |
| 264 | @java.lang.SuppressWarnings("unchecked") |
| 265 | public io.grpc.stub.StreamObserver<Req> invoke( |
| 266 | io.grpc.stub.StreamObserver<Resp> responseObserver) { |
| 267 | switch (methodId) { |
| 268 | case METHODID_STREAMING_INPUT_CALL: |
| 269 | return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamingInputCall( |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 270 | (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse>) responseObserver); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 271 | case METHODID_FULL_BIDI_CALL: |
| 272 | return (io.grpc.stub.StreamObserver<Req>) serviceImpl.fullBidiCall( |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 273 | (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse>) responseObserver); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 274 | case METHODID_HALF_BIDI_CALL: |
| 275 | return (io.grpc.stub.StreamObserver<Req>) serviceImpl.halfBidiCall( |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 276 | (io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse>) responseObserver); |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 277 | default: |
| 278 | throw new AssertionError(); |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | public static io.grpc.ServerServiceDefinition bindService( |
| 284 | final TestService serviceImpl) { |
| 285 | return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME) |
| 286 | .addMethod( |
| 287 | METHOD_UNARY_CALL, |
| 288 | asyncUnaryCall( |
| 289 | new MethodHandlers< |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 290 | io.grpc.testing.integration.Test.SimpleRequest, |
| 291 | io.grpc.testing.integration.Test.SimpleResponse>( |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 292 | serviceImpl, METHODID_UNARY_CALL))) |
| 293 | .addMethod( |
| 294 | METHOD_STREAMING_OUTPUT_CALL, |
| 295 | asyncServerStreamingCall( |
| 296 | new MethodHandlers< |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 297 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 298 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>( |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 299 | serviceImpl, METHODID_STREAMING_OUTPUT_CALL))) |
| 300 | .addMethod( |
| 301 | METHOD_STREAMING_INPUT_CALL, |
| 302 | asyncClientStreamingCall( |
| 303 | new MethodHandlers< |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 304 | io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 305 | io.grpc.testing.integration.Test.StreamingInputCallResponse>( |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 306 | serviceImpl, METHODID_STREAMING_INPUT_CALL))) |
| 307 | .addMethod( |
| 308 | METHOD_FULL_BIDI_CALL, |
| 309 | asyncBidiStreamingCall( |
| 310 | new MethodHandlers< |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 311 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 312 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>( |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 313 | serviceImpl, METHODID_FULL_BIDI_CALL))) |
| 314 | .addMethod( |
| 315 | METHOD_HALF_BIDI_CALL, |
| 316 | asyncBidiStreamingCall( |
| 317 | new MethodHandlers< |
Eric Anderson | b22bcdf | 2016-03-29 14:13:28 -0700 | [diff] [blame] | 318 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 319 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>( |
Eric Anderson | 99a6d8d | 2016-03-22 11:31:36 -0700 | [diff] [blame] | 320 | serviceImpl, METHODID_HALF_BIDI_CALL))) |
| 321 | .build(); |
| 322 | } |
| 323 | } |