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