nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 1 | package io.grpc.testing.integration; |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 2 | |
Kun Zhang | 2ee4d02 | 2015-06-04 16:39:25 -0700 | [diff] [blame] | 3 | import static io.grpc.stub.ClientCalls.asyncUnaryCall; |
| 4 | import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; |
| 5 | import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; |
| 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; |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 10 | import static io.grpc.stub.ServerCalls.asyncUnaryRequestCall; |
| 11 | import static io.grpc.stub.ServerCalls.asyncStreamingRequestCall; |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 12 | |
| 13 | @javax.annotation.Generated("by gRPC proto compiler") |
| 14 | public class TestServiceGrpc { |
| 15 | |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 16 | // Static method descriptors that strictly reflect the proto. |
| 17 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 18 | io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 19 | io.grpc.MethodDescriptor.create( |
| 20 | io.grpc.MethodDescriptor.MethodType.UNARY, |
| 21 | "grpc.testing.TestService", "UnaryCall", |
| 22 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.PARSER), |
| 23 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.PARSER)); |
| 24 | // Static method descriptors that strictly reflect the proto. |
| 25 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 26 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 27 | io.grpc.MethodDescriptor.create( |
| 28 | io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, |
| 29 | "grpc.testing.TestService", "StreamingOutputCall", |
| 30 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER), |
| 31 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER)); |
| 32 | // Static method descriptors that strictly reflect the proto. |
| 33 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 34 | io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 35 | io.grpc.MethodDescriptor.create( |
| 36 | io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING, |
| 37 | "grpc.testing.TestService", "StreamingInputCall", |
| 38 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.PARSER), |
| 39 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.PARSER)); |
| 40 | // Static method descriptors that strictly reflect the proto. |
| 41 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 42 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 43 | io.grpc.MethodDescriptor.create( |
| 44 | io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING, |
| 45 | "grpc.testing.TestService", "FullDuplexCall", |
| 46 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER), |
| 47 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER)); |
| 48 | // Static method descriptors that strictly reflect the proto. |
| 49 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 50 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 51 | io.grpc.MethodDescriptor.create( |
| 52 | io.grpc.MethodDescriptor.MethodType.DUPLEX_STREAMING, |
| 53 | "grpc.testing.TestService", "HalfDuplexCall", |
| 54 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER), |
| 55 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER)); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 56 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 57 | public static TestServiceStub newStub(io.grpc.Channel channel) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 58 | return new TestServiceStub(channel, CONFIG); |
| 59 | } |
| 60 | |
| 61 | public static TestServiceBlockingStub newBlockingStub( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 62 | io.grpc.Channel channel) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 63 | return new TestServiceBlockingStub(channel, CONFIG); |
| 64 | } |
| 65 | |
| 66 | public static TestServiceFutureStub newFutureStub( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 67 | io.grpc.Channel channel) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 68 | return new TestServiceFutureStub(channel, CONFIG); |
| 69 | } |
| 70 | |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 71 | // The default service descriptor |
| 72 | private static final TestServiceServiceDescriptor CONFIG = |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 73 | new TestServiceServiceDescriptor(); |
| 74 | |
| 75 | @javax.annotation.concurrent.Immutable |
| 76 | public static class TestServiceServiceDescriptor extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 77 | io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> { |
| 78 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
| 79 | io.grpc.testing.integration.Test.SimpleResponse> unaryCall; |
| 80 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 81 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall; |
| 82 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 83 | io.grpc.testing.integration.Test.StreamingInputCallResponse> streamingInputCall; |
| 84 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 85 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> fullDuplexCall; |
| 86 | public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 87 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> halfDuplexCall; |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 88 | |
| 89 | private TestServiceServiceDescriptor() { |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 90 | unaryCall = METHOD_UNARY_CALL; |
| 91 | streamingOutputCall = METHOD_STREAMING_OUTPUT_CALL; |
| 92 | streamingInputCall = METHOD_STREAMING_INPUT_CALL; |
| 93 | fullDuplexCall = METHOD_FULL_DUPLEX_CALL; |
| 94 | halfDuplexCall = METHOD_HALF_DUPLEX_CALL; |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 95 | } |
| 96 | |
Eric Anderson | 76d0955 | 2015-03-12 15:25:11 -0700 | [diff] [blame] | 97 | @SuppressWarnings("unchecked") |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 98 | private TestServiceServiceDescriptor( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 99 | java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) { |
| 100 | unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
| 101 | io.grpc.testing.integration.Test.SimpleResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 102 | CONFIG.unaryCall.getFullMethodName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 103 | streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 104 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 105 | CONFIG.streamingOutputCall.getFullMethodName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 106 | streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 107 | io.grpc.testing.integration.Test.StreamingInputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 108 | CONFIG.streamingInputCall.getFullMethodName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 109 | fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 110 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 111 | CONFIG.fullDuplexCall.getFullMethodName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 112 | halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 113 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 114 | CONFIG.halfDuplexCall.getFullMethodName()); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | @java.lang.Override |
| 118 | protected TestServiceServiceDescriptor build( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 119 | java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 120 | return new TestServiceServiceDescriptor(methodMap); |
| 121 | } |
| 122 | |
| 123 | @java.lang.Override |
Kun Zhang | c73b75e | 2015-07-09 10:15:58 -0700 | [diff] [blame^] | 124 | public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 125 | return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 126 | unaryCall, |
| 127 | streamingOutputCall, |
| 128 | streamingInputCall, |
| 129 | fullDuplexCall, |
| 130 | halfDuplexCall); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | public static interface TestService { |
| 135 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 136 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 137 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 138 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 139 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 140 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 141 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 142 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 143 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 144 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 145 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall( |
| 146 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 147 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 148 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall( |
| 149 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | public static interface TestServiceBlockingClient { |
| 153 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 154 | public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 155 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 156 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 157 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | public static interface TestServiceFutureClient { |
| 161 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 162 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 163 | io.grpc.testing.integration.Test.SimpleRequest request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | public static class TestServiceStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 167 | io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 168 | implements TestService { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 169 | private TestServiceStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 170 | TestServiceServiceDescriptor config) { |
| 171 | super(channel, config); |
| 172 | } |
| 173 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 174 | private TestServiceStub(io.grpc.Channel channel, |
| 175 | TestServiceServiceDescriptor config, |
| 176 | io.grpc.CallOptions callOptions) { |
| 177 | super(channel, config, callOptions); |
| 178 | } |
| 179 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 180 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 181 | protected TestServiceStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 182 | TestServiceServiceDescriptor config, |
| 183 | io.grpc.CallOptions callOptions) { |
| 184 | return new TestServiceStub(channel, config, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 188 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 189 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 190 | asyncUnaryCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 191 | channel.newCall(config.unaryCall, callOptions), request, responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 195 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 196 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 197 | asyncServerStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 198 | channel.newCall(config.streamingOutputCall, callOptions), request, responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 202 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 203 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 204 | return asyncClientStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 205 | channel.newCall(config.streamingInputCall, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 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) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 211 | return duplexStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 212 | channel.newCall(config.fullDuplexCall, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 216 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall( |
| 217 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 218 | return duplexStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 219 | channel.newCall(config.halfDuplexCall, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 220 | } |
| 221 | } |
| 222 | |
| 223 | public static class TestServiceBlockingStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 224 | io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 225 | implements TestServiceBlockingClient { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 226 | private TestServiceBlockingStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 227 | TestServiceServiceDescriptor config) { |
| 228 | super(channel, config); |
| 229 | } |
| 230 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 231 | private TestServiceBlockingStub(io.grpc.Channel channel, |
| 232 | TestServiceServiceDescriptor config, |
| 233 | io.grpc.CallOptions callOptions) { |
| 234 | super(channel, config, callOptions); |
| 235 | } |
| 236 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 237 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 238 | protected TestServiceBlockingStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 239 | TestServiceServiceDescriptor config, |
| 240 | io.grpc.CallOptions callOptions) { |
| 241 | return new TestServiceBlockingStub(channel, config, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 242 | } |
| 243 | |
| 244 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 245 | public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 246 | return blockingUnaryCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 247 | channel.newCall(config.unaryCall, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 251 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 252 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 253 | return blockingServerStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 254 | channel.newCall(config.streamingOutputCall, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 255 | } |
| 256 | } |
| 257 | |
| 258 | public static class TestServiceFutureStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 259 | io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 260 | implements TestServiceFutureClient { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 261 | private TestServiceFutureStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 262 | TestServiceServiceDescriptor config) { |
| 263 | super(channel, config); |
| 264 | } |
| 265 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 266 | private TestServiceFutureStub(io.grpc.Channel channel, |
| 267 | TestServiceServiceDescriptor config, |
| 268 | io.grpc.CallOptions callOptions) { |
| 269 | super(channel, config, callOptions); |
| 270 | } |
| 271 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 272 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 273 | protected TestServiceFutureStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 274 | TestServiceServiceDescriptor config, |
| 275 | io.grpc.CallOptions callOptions) { |
| 276 | return new TestServiceFutureStub(channel, config, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 277 | } |
| 278 | |
| 279 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 280 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 281 | io.grpc.testing.integration.Test.SimpleRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 282 | return unaryFutureCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 283 | channel.newCall(config.unaryCall, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 284 | } |
| 285 | } |
| 286 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 287 | public static io.grpc.ServerServiceDefinition bindService( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 288 | final TestService serviceImpl) { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 289 | return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService") |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 290 | .addMethod(io.grpc.ServerMethodDefinition.create( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 291 | METHOD_UNARY_CALL, |
| 292 | asyncUnaryRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 293 | new io.grpc.stub.ServerCalls.UnaryRequestMethod< |
| 294 | io.grpc.testing.integration.Test.SimpleRequest, |
| 295 | io.grpc.testing.integration.Test.SimpleResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 296 | @java.lang.Override |
| 297 | public void invoke( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 298 | io.grpc.testing.integration.Test.SimpleRequest request, |
| 299 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -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( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 304 | METHOD_STREAMING_OUTPUT_CALL, |
| 305 | asyncUnaryRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 306 | new io.grpc.stub.ServerCalls.UnaryRequestMethod< |
| 307 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 308 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 309 | @java.lang.Override |
| 310 | public void invoke( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 311 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 312 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -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( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 317 | METHOD_STREAMING_INPUT_CALL, |
| 318 | asyncStreamingRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 319 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 320 | io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 321 | io.grpc.testing.integration.Test.StreamingInputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 322 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 323 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> invoke( |
| 324 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -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( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 329 | METHOD_FULL_DUPLEX_CALL, |
| 330 | asyncStreamingRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 331 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 332 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 333 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 334 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 335 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 336 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 337 | return serviceImpl.fullDuplexCall(responseObserver); |
| 338 | } |
| 339 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 340 | .addMethod(io.grpc.ServerMethodDefinition.create( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 341 | METHOD_HALF_DUPLEX_CALL, |
| 342 | asyncStreamingRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 343 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 344 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 345 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 346 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 347 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 348 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 349 | return serviceImpl.halfDuplexCall(responseObserver); |
| 350 | } |
| 351 | }))).build(); |
| 352 | } |
| 353 | } |