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