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