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; |
| 6 | import static io.grpc.stub.ClientCalls.duplexStreamingCall; |
| 7 | import static io.grpc.stub.ClientCalls.blockingUnaryCall; |
| 8 | import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; |
| 9 | import static io.grpc.stub.ClientCalls.unaryFutureCall; |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 10 | import static io.grpc.stub.ServerCalls.asyncUnaryRequestCall; |
| 11 | import static io.grpc.stub.ServerCalls.asyncStreamingRequestCall; |
| 12 | |
| 13 | import java.io.IOException; |
| 14 | |
| 15 | @javax.annotation.Generated("by gRPC proto compiler") |
| 16 | public class TestServiceGrpc { |
| 17 | |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 18 | // Static method descriptors that strictly reflect the proto. |
| 19 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 20 | io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 21 | io.grpc.MethodDescriptor.create( |
| 22 | io.grpc.MethodDescriptor.MethodType.UNARY, |
| 23 | "grpc.testing.TestService", "UnaryCall", |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 24 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.SimpleRequest>marshaller( |
| 25 | new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.SimpleRequest>() { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 26 | @Override |
| 27 | public io.grpc.testing.integration.Test.SimpleRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException { |
| 28 | return io.grpc.testing.integration.Test.SimpleRequest.parseFrom(input); |
| 29 | } |
| 30 | }), |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 31 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.SimpleResponse>marshaller( |
| 32 | new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.SimpleResponse>() { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 33 | @Override |
| 34 | public io.grpc.testing.integration.Test.SimpleResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException { |
| 35 | return io.grpc.testing.integration.Test.SimpleResponse.parseFrom(input); |
| 36 | } |
| 37 | })); |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 38 | // Static method descriptors that strictly reflect the proto. |
| 39 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 40 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 41 | io.grpc.MethodDescriptor.create( |
| 42 | io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, |
| 43 | "grpc.testing.TestService", "StreamingOutputCall", |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 44 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallRequest>marshaller( |
| 45 | new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallRequest>() { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 46 | @Override |
| 47 | public io.grpc.testing.integration.Test.StreamingOutputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException { |
| 48 | return io.grpc.testing.integration.Test.StreamingOutputCallRequest.parseFrom(input); |
| 49 | } |
| 50 | }), |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 51 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallResponse>marshaller( |
| 52 | new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 53 | @Override |
| 54 | public io.grpc.testing.integration.Test.StreamingOutputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException { |
| 55 | return io.grpc.testing.integration.Test.StreamingOutputCallResponse.parseFrom(input); |
| 56 | } |
| 57 | })); |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 58 | // Static method descriptors that strictly reflect the proto. |
| 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 | // Static method descriptors that strictly reflect the proto. |
| 79 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 80 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 81 | io.grpc.MethodDescriptor.create( |
| 82 | io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING, |
| 83 | "grpc.testing.TestService", "FullDuplexCall", |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 84 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallRequest>marshaller( |
| 85 | new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallRequest>() { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 86 | @Override |
| 87 | public io.grpc.testing.integration.Test.StreamingOutputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException { |
| 88 | return io.grpc.testing.integration.Test.StreamingOutputCallRequest.parseFrom(input); |
| 89 | } |
| 90 | }), |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 91 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallResponse>marshaller( |
| 92 | new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 93 | @Override |
| 94 | public io.grpc.testing.integration.Test.StreamingOutputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException { |
| 95 | return io.grpc.testing.integration.Test.StreamingOutputCallResponse.parseFrom(input); |
| 96 | } |
| 97 | })); |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 98 | // Static method descriptors that strictly reflect the proto. |
| 99 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 100 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 101 | io.grpc.MethodDescriptor.create( |
| 102 | io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING, |
| 103 | "grpc.testing.TestService", "HalfDuplexCall", |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 104 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallRequest>marshaller( |
| 105 | new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallRequest>() { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 106 | @Override |
| 107 | public io.grpc.testing.integration.Test.StreamingOutputCallRequest parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException { |
| 108 | return io.grpc.testing.integration.Test.StreamingOutputCallRequest.parseFrom(input); |
| 109 | } |
| 110 | }), |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 111 | io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.Test.StreamingOutputCallResponse>marshaller( |
| 112 | new io.grpc.protobuf.nano.Parser<io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 113 | @Override |
| 114 | public io.grpc.testing.integration.Test.StreamingOutputCallResponse parse(com.google.protobuf.nano.CodedInputByteBufferNano input) throws IOException { |
| 115 | return io.grpc.testing.integration.Test.StreamingOutputCallResponse.parseFrom(input); |
| 116 | } |
| 117 | })); |
| 118 | |
| 119 | public static TestServiceStub newStub(io.grpc.Channel channel) { |
| 120 | return new TestServiceStub(channel, CONFIG); |
| 121 | } |
| 122 | |
| 123 | public static TestServiceBlockingStub newBlockingStub( |
| 124 | io.grpc.Channel channel) { |
| 125 | return new TestServiceBlockingStub(channel, CONFIG); |
| 126 | } |
| 127 | |
| 128 | public static TestServiceFutureStub newFutureStub( |
| 129 | io.grpc.Channel channel) { |
| 130 | return new TestServiceFutureStub(channel, CONFIG); |
| 131 | } |
| 132 | |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 133 | // The default service descriptor |
| 134 | private static final TestServiceServiceDescriptor CONFIG = |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 135 | new TestServiceServiceDescriptor(); |
| 136 | |
| 137 | @javax.annotation.concurrent.Immutable |
| 138 | public static class TestServiceServiceDescriptor extends |
| 139 | io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> { |
| 140 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
| 141 | io.grpc.testing.integration.Test.SimpleResponse> unaryCall; |
| 142 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 143 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall; |
| 144 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 145 | io.grpc.testing.integration.Test.StreamingInputCallResponse> streamingInputCall; |
| 146 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 147 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> fullDuplexCall; |
| 148 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 149 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> halfDuplexCall; |
| 150 | |
| 151 | private TestServiceServiceDescriptor() { |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 152 | unaryCall = METHOD_UNARY_CALL; |
| 153 | streamingOutputCall = METHOD_STREAMING_OUTPUT_CALL; |
| 154 | streamingInputCall = METHOD_STREAMING_INPUT_CALL; |
| 155 | fullDuplexCall = METHOD_FULL_DUPLEX_CALL; |
| 156 | halfDuplexCall = METHOD_HALF_DUPLEX_CALL; |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 157 | } |
| 158 | |
Eric Anderson | 76d0955 | 2015-03-12 15:25:11 -0700 | [diff] [blame] | 159 | @SuppressWarnings("unchecked") |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 160 | private TestServiceServiceDescriptor( |
| 161 | java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) { |
| 162 | unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
| 163 | io.grpc.testing.integration.Test.SimpleResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 164 | CONFIG.unaryCall.getFullMethodName()); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 165 | streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 166 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 167 | CONFIG.streamingOutputCall.getFullMethodName()); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 168 | streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 169 | io.grpc.testing.integration.Test.StreamingInputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 170 | CONFIG.streamingInputCall.getFullMethodName()); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 171 | fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 172 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 173 | CONFIG.fullDuplexCall.getFullMethodName()); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 174 | halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 175 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 176 | CONFIG.halfDuplexCall.getFullMethodName()); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | @java.lang.Override |
| 180 | protected TestServiceServiceDescriptor build( |
| 181 | java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) { |
| 182 | return new TestServiceServiceDescriptor(methodMap); |
| 183 | } |
| 184 | |
| 185 | @java.lang.Override |
| 186 | public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() { |
| 187 | return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of( |
| 188 | unaryCall, |
| 189 | streamingOutputCall, |
| 190 | streamingInputCall, |
| 191 | fullDuplexCall, |
| 192 | halfDuplexCall); |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | public static interface TestService { |
| 197 | |
| 198 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 199 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver); |
| 200 | |
| 201 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 202 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
| 203 | |
| 204 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 205 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver); |
| 206 | |
| 207 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall( |
| 208 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
| 209 | |
| 210 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall( |
| 211 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
| 212 | } |
| 213 | |
| 214 | public static interface TestServiceBlockingClient { |
| 215 | |
| 216 | public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request); |
| 217 | |
| 218 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 219 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request); |
| 220 | } |
| 221 | |
| 222 | public static interface TestServiceFutureClient { |
| 223 | |
| 224 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 225 | io.grpc.testing.integration.Test.SimpleRequest request); |
| 226 | } |
| 227 | |
| 228 | public static class TestServiceStub extends |
| 229 | io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor> |
| 230 | implements TestService { |
| 231 | private TestServiceStub(io.grpc.Channel channel, |
| 232 | TestServiceServiceDescriptor config) { |
| 233 | super(channel, config); |
| 234 | } |
| 235 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 236 | private TestServiceStub(io.grpc.Channel channel, |
| 237 | TestServiceServiceDescriptor config, |
| 238 | io.grpc.CallOptions callOptions) { |
| 239 | super(channel, config, callOptions); |
| 240 | } |
| 241 | |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 242 | @java.lang.Override |
| 243 | protected TestServiceStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 244 | TestServiceServiceDescriptor config, |
| 245 | io.grpc.CallOptions callOptions) { |
| 246 | return new TestServiceStub(channel, config, callOptions); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | @java.lang.Override |
| 250 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 251 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
| 252 | asyncUnaryCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 253 | channel.newCall(config.unaryCall, callOptions), request, responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | @java.lang.Override |
| 257 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 258 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
| 259 | asyncServerStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 260 | channel.newCall(config.streamingOutputCall, callOptions), request, responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | @java.lang.Override |
| 264 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 265 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
| 266 | return asyncClientStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 267 | channel.newCall(config.streamingInputCall, callOptions), responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 268 | } |
| 269 | |
| 270 | @java.lang.Override |
| 271 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall( |
| 272 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
| 273 | return duplexStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 274 | channel.newCall(config.fullDuplexCall, callOptions), responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | @java.lang.Override |
| 278 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall( |
| 279 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
| 280 | return duplexStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 281 | channel.newCall(config.halfDuplexCall, callOptions), responseObserver); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 282 | } |
| 283 | } |
| 284 | |
| 285 | public static class TestServiceBlockingStub extends |
| 286 | io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor> |
| 287 | implements TestServiceBlockingClient { |
| 288 | private TestServiceBlockingStub(io.grpc.Channel channel, |
| 289 | TestServiceServiceDescriptor config) { |
| 290 | super(channel, config); |
| 291 | } |
| 292 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 293 | private TestServiceBlockingStub(io.grpc.Channel channel, |
| 294 | TestServiceServiceDescriptor config, |
| 295 | io.grpc.CallOptions callOptions) { |
| 296 | super(channel, config, callOptions); |
| 297 | } |
| 298 | |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 299 | @java.lang.Override |
| 300 | protected TestServiceBlockingStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 301 | TestServiceServiceDescriptor config, |
| 302 | io.grpc.CallOptions callOptions) { |
| 303 | return new TestServiceBlockingStub(channel, config, callOptions); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 304 | } |
| 305 | |
| 306 | @java.lang.Override |
| 307 | public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) { |
| 308 | return blockingUnaryCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 309 | channel.newCall(config.unaryCall, callOptions), request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | @java.lang.Override |
| 313 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 314 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request) { |
| 315 | return blockingServerStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 316 | channel.newCall(config.streamingOutputCall, callOptions), request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 317 | } |
| 318 | } |
| 319 | |
| 320 | public static class TestServiceFutureStub extends |
| 321 | io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor> |
| 322 | implements TestServiceFutureClient { |
| 323 | private TestServiceFutureStub(io.grpc.Channel channel, |
| 324 | TestServiceServiceDescriptor config) { |
| 325 | super(channel, config); |
| 326 | } |
| 327 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 328 | private TestServiceFutureStub(io.grpc.Channel channel, |
| 329 | TestServiceServiceDescriptor config, |
| 330 | io.grpc.CallOptions callOptions) { |
| 331 | super(channel, config, callOptions); |
| 332 | } |
| 333 | |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 334 | @java.lang.Override |
| 335 | protected TestServiceFutureStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 336 | TestServiceServiceDescriptor config, |
| 337 | io.grpc.CallOptions callOptions) { |
| 338 | return new TestServiceFutureStub(channel, config, callOptions); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 339 | } |
| 340 | |
| 341 | @java.lang.Override |
| 342 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 343 | io.grpc.testing.integration.Test.SimpleRequest request) { |
| 344 | return unaryFutureCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 345 | channel.newCall(config.unaryCall, callOptions), request); |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 346 | } |
| 347 | } |
| 348 | |
| 349 | public static io.grpc.ServerServiceDefinition bindService( |
| 350 | final TestService serviceImpl) { |
| 351 | return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService") |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 352 | .addMethod(io.grpc.ServerMethodDefinition.create( |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 353 | METHOD_UNARY_CALL, |
| 354 | asyncUnaryRequestCall( |
| 355 | new io.grpc.stub.ServerCalls.UnaryRequestMethod< |
| 356 | io.grpc.testing.integration.Test.SimpleRequest, |
| 357 | io.grpc.testing.integration.Test.SimpleResponse>() { |
| 358 | @java.lang.Override |
| 359 | public void invoke( |
| 360 | io.grpc.testing.integration.Test.SimpleRequest request, |
| 361 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
| 362 | serviceImpl.unaryCall(request, responseObserver); |
| 363 | } |
| 364 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 365 | .addMethod(io.grpc.ServerMethodDefinition.create( |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 366 | METHOD_STREAMING_OUTPUT_CALL, |
| 367 | asyncUnaryRequestCall( |
| 368 | new io.grpc.stub.ServerCalls.UnaryRequestMethod< |
| 369 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 370 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
| 371 | @java.lang.Override |
| 372 | public void invoke( |
| 373 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 374 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
| 375 | serviceImpl.streamingOutputCall(request, responseObserver); |
| 376 | } |
| 377 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 378 | .addMethod(io.grpc.ServerMethodDefinition.create( |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 379 | METHOD_STREAMING_INPUT_CALL, |
| 380 | asyncStreamingRequestCall( |
| 381 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 382 | io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 383 | io.grpc.testing.integration.Test.StreamingInputCallResponse>() { |
| 384 | @java.lang.Override |
| 385 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> invoke( |
| 386 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
| 387 | return serviceImpl.streamingInputCall(responseObserver); |
| 388 | } |
| 389 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 390 | .addMethod(io.grpc.ServerMethodDefinition.create( |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 391 | METHOD_FULL_DUPLEX_CALL, |
| 392 | asyncStreamingRequestCall( |
| 393 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 394 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 395 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
| 396 | @java.lang.Override |
| 397 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 398 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
| 399 | return serviceImpl.fullDuplexCall(responseObserver); |
| 400 | } |
| 401 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 402 | .addMethod(io.grpc.ServerMethodDefinition.create( |
Xiao Hang | dcff315 | 2015-02-20 15:03:06 -0800 | [diff] [blame] | 403 | METHOD_HALF_DUPLEX_CALL, |
| 404 | asyncStreamingRequestCall( |
| 405 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 406 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 407 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
| 408 | @java.lang.Override |
| 409 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 410 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
| 411 | return serviceImpl.halfDuplexCall(responseObserver); |
| 412 | } |
| 413 | }))).build(); |
| 414 | } |
| 415 | } |