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