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; |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 15 | |
| 16 | import java.io.IOException; |
| 17 | |
| 18 | @javax.annotation.Generated("by gRPC proto compiler") |
| 19 | public class TestServiceGrpc { |
| 20 | |
Eric Anderson | be0d7e9 | 2015-09-10 09:47:17 -0700 | [diff] [blame] | 21 | private TestServiceGrpc() {} |
| 22 | |
David P. Baker | 66b984c | 2015-08-21 13:00:26 -0400 | [diff] [blame] | 23 | public static final String SERVICE_NAME = "grpc.testing.TestService"; |
| 24 | |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 25 | // Static method descriptors that strictly reflect the proto. |
Eric Anderson | 1ee336d | 2015-10-02 20:09:10 -0700 | [diff] [blame^] | 26 | private static final int ARG_IN_METHOD_UNARY_CALL = 0; |
| 27 | private static final int ARG_OUT_METHOD_UNARY_CALL = 1; |
Kun Zhang | 5bb0ea9 | 2015-08-31 09:56:44 -0700 | [diff] [blame] | 28 | @io.grpc.ExperimentalApi |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 29 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.SimpleRequest, |
| 30 | io.grpc.testing.integration.nano.Test.SimpleResponse> METHOD_UNARY_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 31 | io.grpc.MethodDescriptor.create( |
| 32 | io.grpc.MethodDescriptor.MethodType.UNARY, |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 33 | generateFullMethodName( |
| 34 | "grpc.testing.TestService", "UnaryCall"), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 35 | 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^] | 36 | 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] | 37 | 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^] | 38 | new NanoFactory<io.grpc.testing.integration.nano.Test.SimpleResponse>(ARG_OUT_METHOD_UNARY_CALL)) |
| 39 | ); |
| 40 | private static final int ARG_IN_METHOD_STREAMING_OUTPUT_CALL = 2; |
| 41 | private static final int ARG_OUT_METHOD_STREAMING_OUTPUT_CALL = 3; |
Kun Zhang | 5bb0ea9 | 2015-08-31 09:56:44 -0700 | [diff] [blame] | 42 | @io.grpc.ExperimentalApi |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 43 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
| 44 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 45 | io.grpc.MethodDescriptor.create( |
| 46 | io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 47 | generateFullMethodName( |
| 48 | "grpc.testing.TestService", "StreamingOutputCall"), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 49 | 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^] | 50 | 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] | 51 | 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^] | 52 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(ARG_OUT_METHOD_STREAMING_OUTPUT_CALL)) |
| 53 | ); |
| 54 | private static final int ARG_IN_METHOD_STREAMING_INPUT_CALL = 4; |
| 55 | private static final int ARG_OUT_METHOD_STREAMING_INPUT_CALL = 5; |
Kun Zhang | 5bb0ea9 | 2015-08-31 09:56:44 -0700 | [diff] [blame] | 56 | @io.grpc.ExperimentalApi |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 57 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest, |
| 58 | io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 59 | io.grpc.MethodDescriptor.create( |
| 60 | io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING, |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 61 | generateFullMethodName( |
| 62 | "grpc.testing.TestService", "StreamingInputCall"), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 63 | 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^] | 64 | 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] | 65 | 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^] | 66 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>(ARG_OUT_METHOD_STREAMING_INPUT_CALL)) |
| 67 | ); |
| 68 | private static final int ARG_IN_METHOD_FULL_BIDI_CALL = 6; |
| 69 | private static final int ARG_OUT_METHOD_FULL_BIDI_CALL = 7; |
Kun Zhang | 5bb0ea9 | 2015-08-31 09:56:44 -0700 | [diff] [blame] | 70 | @io.grpc.ExperimentalApi |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 71 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
| 72 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 73 | io.grpc.MethodDescriptor.create( |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 74 | io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 75 | generateFullMethodName( |
| 76 | "grpc.testing.TestService", "FullBidiCall"), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 77 | 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^] | 78 | 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] | 79 | 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^] | 80 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(ARG_OUT_METHOD_FULL_BIDI_CALL)) |
| 81 | ); |
| 82 | private static final int ARG_IN_METHOD_HALF_BIDI_CALL = 8; |
| 83 | private static final int ARG_OUT_METHOD_HALF_BIDI_CALL = 9; |
Kun Zhang | 5bb0ea9 | 2015-08-31 09:56:44 -0700 | [diff] [blame] | 84 | @io.grpc.ExperimentalApi |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 85 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
| 86 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 87 | io.grpc.MethodDescriptor.create( |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 88 | io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, |
Kun Zhang | 042b278 | 2015-08-17 15:43:40 -0700 | [diff] [blame] | 89 | generateFullMethodName( |
| 90 | "grpc.testing.TestService", "HalfBidiCall"), |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 91 | 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^] | 92 | 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] | 93 | 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^] | 94 | new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(ARG_OUT_METHOD_HALF_BIDI_CALL)) |
| 95 | ); |
| 96 | |
| 97 | private static final class NanoFactory<T extends com.google.protobuf.nano.MessageNano> |
| 98 | implements io.grpc.protobuf.nano.MessageNanoFactory<T> { |
| 99 | private final int id; |
| 100 | |
| 101 | NanoFactory(int id) { |
| 102 | this.id = id; |
| 103 | } |
| 104 | |
| 105 | @Override |
| 106 | public T newInstance() { |
| 107 | Object o; |
| 108 | switch (id) { |
| 109 | case ARG_IN_METHOD_UNARY_CALL: |
| 110 | o = new io.grpc.testing.integration.nano.Test.SimpleRequest(); |
| 111 | break; |
| 112 | case ARG_OUT_METHOD_UNARY_CALL: |
| 113 | o = new io.grpc.testing.integration.nano.Test.SimpleResponse(); |
| 114 | break; |
| 115 | case ARG_IN_METHOD_STREAMING_OUTPUT_CALL: |
| 116 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest(); |
| 117 | break; |
| 118 | case ARG_OUT_METHOD_STREAMING_OUTPUT_CALL: |
| 119 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse(); |
| 120 | break; |
| 121 | case ARG_IN_METHOD_STREAMING_INPUT_CALL: |
| 122 | o = new io.grpc.testing.integration.nano.Test.StreamingInputCallRequest(); |
| 123 | break; |
| 124 | case ARG_OUT_METHOD_STREAMING_INPUT_CALL: |
| 125 | o = new io.grpc.testing.integration.nano.Test.StreamingInputCallResponse(); |
| 126 | break; |
| 127 | case ARG_IN_METHOD_FULL_BIDI_CALL: |
| 128 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest(); |
| 129 | break; |
| 130 | case ARG_OUT_METHOD_FULL_BIDI_CALL: |
| 131 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse(); |
| 132 | break; |
| 133 | case ARG_IN_METHOD_HALF_BIDI_CALL: |
| 134 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest(); |
| 135 | break; |
| 136 | case ARG_OUT_METHOD_HALF_BIDI_CALL: |
| 137 | o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse(); |
| 138 | break; |
| 139 | default: |
| 140 | throw new AssertionError(); |
| 141 | } |
| 142 | @java.lang.SuppressWarnings("unchecked") |
| 143 | T t = (T) o; |
| 144 | return t; |
| 145 | } |
| 146 | } |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 147 | |
| 148 | public static TestServiceStub newStub(io.grpc.Channel channel) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 149 | return new TestServiceStub(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | public static TestServiceBlockingStub newBlockingStub( |
| 153 | io.grpc.Channel channel) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 154 | return new TestServiceBlockingStub(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 155 | } |
| 156 | |
| 157 | public static TestServiceFutureStub newFutureStub( |
| 158 | io.grpc.Channel channel) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 159 | return new TestServiceFutureStub(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | public static interface TestService { |
| 163 | |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 164 | public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request, |
| 165 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 166 | |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 167 | public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request, |
| 168 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 169 | |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 170 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> streamingInputCall( |
| 171 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 172 | |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 173 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> fullBidiCall( |
| 174 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 175 | |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 176 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> halfBidiCall( |
| 177 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | public static interface TestServiceBlockingClient { |
| 181 | |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 182 | 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] | 183 | |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 184 | public java.util.Iterator<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 185 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | public static interface TestServiceFutureClient { |
| 189 | |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 190 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.nano.Test.SimpleResponse> unaryCall( |
| 191 | io.grpc.testing.integration.nano.Test.SimpleRequest request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 192 | } |
| 193 | |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 194 | public static class TestServiceStub extends io.grpc.stub.AbstractStub<TestServiceStub> |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 195 | implements TestService { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 196 | private TestServiceStub(io.grpc.Channel channel) { |
| 197 | super(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 198 | } |
| 199 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 200 | private TestServiceStub(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 201 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 202 | super(channel, callOptions); |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 203 | } |
| 204 | |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 205 | @java.lang.Override |
| 206 | protected TestServiceStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 207 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 208 | return new TestServiceStub(channel, callOptions); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 209 | } |
| 210 | |
| 211 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 212 | public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request, |
| 213 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver) { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 214 | asyncUnaryCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 215 | getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request, responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 216 | } |
| 217 | |
| 218 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 219 | public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request, |
| 220 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 221 | asyncServerStreamingCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 222 | getChannel().newCall(METHOD_STREAMING_OUTPUT_CALL, getCallOptions()), request, responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 226 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> streamingInputCall( |
| 227 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver) { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 228 | return asyncClientStreamingCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 229 | getChannel().newCall(METHOD_STREAMING_INPUT_CALL, getCallOptions()), responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 233 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> fullBidiCall( |
| 234 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 235 | return asyncBidiStreamingCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 236 | getChannel().newCall(METHOD_FULL_BIDI_CALL, getCallOptions()), responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 240 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> halfBidiCall( |
| 241 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 242 | return asyncBidiStreamingCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 243 | getChannel().newCall(METHOD_HALF_BIDI_CALL, getCallOptions()), responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 244 | } |
| 245 | } |
| 246 | |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 247 | public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub<TestServiceBlockingStub> |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 248 | implements TestServiceBlockingClient { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 249 | private TestServiceBlockingStub(io.grpc.Channel channel) { |
| 250 | super(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 251 | } |
| 252 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 253 | private TestServiceBlockingStub(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 254 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 255 | super(channel, callOptions); |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 256 | } |
| 257 | |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 258 | @java.lang.Override |
| 259 | protected TestServiceBlockingStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 260 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 261 | return new TestServiceBlockingStub(channel, callOptions); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 265 | 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] | 266 | return blockingUnaryCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 267 | getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 268 | } |
| 269 | |
| 270 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 271 | public java.util.Iterator<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 272 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request) { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 273 | return blockingServerStreamingCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 274 | getChannel().newCall(METHOD_STREAMING_OUTPUT_CALL, getCallOptions()), request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 275 | } |
| 276 | } |
| 277 | |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 278 | public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub<TestServiceFutureStub> |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 279 | implements TestServiceFutureClient { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 280 | private TestServiceFutureStub(io.grpc.Channel channel) { |
| 281 | super(channel); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 282 | } |
| 283 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 284 | private TestServiceFutureStub(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 285 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 286 | super(channel, callOptions); |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 287 | } |
| 288 | |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 289 | @java.lang.Override |
| 290 | protected TestServiceFutureStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 291 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 292 | return new TestServiceFutureStub(channel, callOptions); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 293 | } |
| 294 | |
| 295 | @java.lang.Override |
Kun Zhang | bd23a8d | 2015-08-28 18:47:06 -0700 | [diff] [blame] | 296 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.nano.Test.SimpleResponse> unaryCall( |
| 297 | io.grpc.testing.integration.nano.Test.SimpleRequest request) { |
Kun Zhang | 686dcff | 2015-07-16 12:34:37 -0700 | [diff] [blame] | 298 | return futureUnaryCall( |
Eric Anderson | 23e6318 | 2015-09-10 08:36:08 -0700 | [diff] [blame] | 299 | getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 300 | } |
| 301 | } |
| 302 | |
| 303 | public static io.grpc.ServerServiceDefinition bindService( |
| 304 | final TestService serviceImpl) { |
David P. Baker | 66b984c | 2015-08-21 13:00:26 -0400 | [diff] [blame] | 305 | return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME) |
Eric Anderson | a6621da | 2015-09-10 17:37:21 -0700 | [diff] [blame] | 306 | .addMethod( |
| 307 | METHOD_UNARY_CALL, |
| 308 | asyncUnaryCall( |
| 309 | new io.grpc.stub.ServerCalls.UnaryMethod< |
| 310 | io.grpc.testing.integration.nano.Test.SimpleRequest, |
| 311 | io.grpc.testing.integration.nano.Test.SimpleResponse>() { |
| 312 | @java.lang.Override |
| 313 | public void invoke( |
| 314 | io.grpc.testing.integration.nano.Test.SimpleRequest request, |
| 315 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver) { |
| 316 | serviceImpl.unaryCall(request, responseObserver); |
| 317 | } |
| 318 | })) |
| 319 | .addMethod( |
| 320 | METHOD_STREAMING_OUTPUT_CALL, |
| 321 | asyncServerStreamingCall( |
| 322 | new io.grpc.stub.ServerCalls.ServerStreamingMethod< |
| 323 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
| 324 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>() { |
| 325 | @java.lang.Override |
| 326 | public void invoke( |
| 327 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request, |
| 328 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
| 329 | serviceImpl.streamingOutputCall(request, responseObserver); |
| 330 | } |
| 331 | })) |
| 332 | .addMethod( |
| 333 | METHOD_STREAMING_INPUT_CALL, |
| 334 | asyncClientStreamingCall( |
| 335 | new io.grpc.stub.ServerCalls.ClientStreamingMethod< |
| 336 | io.grpc.testing.integration.nano.Test.StreamingInputCallRequest, |
| 337 | io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>() { |
| 338 | @java.lang.Override |
| 339 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> invoke( |
| 340 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver) { |
| 341 | return serviceImpl.streamingInputCall(responseObserver); |
| 342 | } |
| 343 | })) |
| 344 | .addMethod( |
| 345 | METHOD_FULL_BIDI_CALL, |
| 346 | asyncBidiStreamingCall( |
| 347 | new io.grpc.stub.ServerCalls.BidiStreamingMethod< |
| 348 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
| 349 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>() { |
| 350 | @java.lang.Override |
| 351 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> invoke( |
| 352 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
| 353 | return serviceImpl.fullBidiCall(responseObserver); |
| 354 | } |
| 355 | })) |
| 356 | .addMethod( |
| 357 | METHOD_HALF_BIDI_CALL, |
| 358 | asyncBidiStreamingCall( |
| 359 | new io.grpc.stub.ServerCalls.BidiStreamingMethod< |
| 360 | io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest, |
| 361 | io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>() { |
| 362 | @java.lang.Override |
| 363 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> invoke( |
| 364 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) { |
| 365 | return serviceImpl.halfBidiCall(responseObserver); |
| 366 | } |
| 367 | })).build(); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 368 | } |
| 369 | } |