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", |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 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)); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 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", |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 28 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER), |
| 29 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER)); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 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", |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 34 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.PARSER), |
| 35 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.PARSER)); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 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", |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 40 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.PARSER), |
| 41 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.PARSER)); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 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", |
Eric Anderson | 3666de4 | 2015-04-10 16:35:23 -0700 | [diff] [blame] | 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)); |
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 | |
Eric Anderson | 76d0955 | 2015-03-12 15:25:11 -0700 | [diff] [blame] | 93 | @SuppressWarnings("unchecked") |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 94 | private TestServiceServiceDescriptor( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 95 | java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) { |
| 96 | unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
| 97 | io.grpc.testing.integration.Test.SimpleResponse>) methodMap.get( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 98 | CONFIG.unaryCall.getName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 99 | streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 100 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 101 | CONFIG.streamingOutputCall.getName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 102 | streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 103 | io.grpc.testing.integration.Test.StreamingInputCallResponse>) methodMap.get( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 104 | CONFIG.streamingInputCall.getName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 105 | fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 106 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 107 | CONFIG.fullDuplexCall.getName()); |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 108 | halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 109 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 110 | CONFIG.halfDuplexCall.getName()); |
| 111 | } |
| 112 | |
| 113 | @java.lang.Override |
| 114 | protected TestServiceServiceDescriptor build( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 115 | java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 116 | return new TestServiceServiceDescriptor(methodMap); |
| 117 | } |
| 118 | |
| 119 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 120 | public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() { |
| 121 | return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 122 | unaryCall, |
| 123 | streamingOutputCall, |
| 124 | streamingInputCall, |
| 125 | fullDuplexCall, |
| 126 | halfDuplexCall); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | public static interface TestService { |
| 131 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 132 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 133 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 134 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 135 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 136 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 137 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 138 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 139 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 140 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 141 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall( |
| 142 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 143 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 144 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall( |
| 145 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 146 | } |
| 147 | |
| 148 | public static interface TestServiceBlockingClient { |
| 149 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 150 | 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] | 151 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 152 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 153 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | public static interface TestServiceFutureClient { |
| 157 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 158 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 159 | io.grpc.testing.integration.Test.SimpleRequest request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | public static class TestServiceStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 163 | io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 164 | implements TestService { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 165 | private TestServiceStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 166 | TestServiceServiceDescriptor config) { |
| 167 | super(channel, config); |
| 168 | } |
| 169 | |
| 170 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 171 | protected TestServiceStub build(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 172 | TestServiceServiceDescriptor config) { |
| 173 | return new TestServiceStub(channel, config); |
| 174 | } |
| 175 | |
| 176 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 177 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 178 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 179 | asyncUnaryCall( |
| 180 | channel.newCall(config.unaryCall), request, responseObserver); |
| 181 | } |
| 182 | |
| 183 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 184 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 185 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 186 | asyncServerStreamingCall( |
| 187 | channel.newCall(config.streamingOutputCall), request, responseObserver); |
| 188 | } |
| 189 | |
| 190 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 191 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 192 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 193 | return asyncClientStreamingCall( |
| 194 | channel.newCall(config.streamingInputCall), responseObserver); |
| 195 | } |
| 196 | |
| 197 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 198 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall( |
| 199 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 200 | return duplexStreamingCall( |
| 201 | channel.newCall(config.fullDuplexCall), responseObserver); |
| 202 | } |
| 203 | |
| 204 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 205 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall( |
| 206 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 207 | return duplexStreamingCall( |
| 208 | channel.newCall(config.halfDuplexCall), responseObserver); |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | public static class TestServiceBlockingStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 213 | io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 214 | implements TestServiceBlockingClient { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 215 | private TestServiceBlockingStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 216 | TestServiceServiceDescriptor config) { |
| 217 | super(channel, config); |
| 218 | } |
| 219 | |
| 220 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 221 | protected TestServiceBlockingStub build(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 222 | TestServiceServiceDescriptor config) { |
| 223 | return new TestServiceBlockingStub(channel, config); |
| 224 | } |
| 225 | |
| 226 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 227 | 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] | 228 | return blockingUnaryCall( |
| 229 | channel.newCall(config.unaryCall), request); |
| 230 | } |
| 231 | |
| 232 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 233 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 234 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 235 | return blockingServerStreamingCall( |
| 236 | channel.newCall(config.streamingOutputCall), request); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | public static class TestServiceFutureStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 241 | io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 242 | implements TestServiceFutureClient { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 243 | private TestServiceFutureStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 244 | TestServiceServiceDescriptor config) { |
| 245 | super(channel, config); |
| 246 | } |
| 247 | |
| 248 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 249 | protected TestServiceFutureStub build(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 250 | TestServiceServiceDescriptor config) { |
| 251 | return new TestServiceFutureStub(channel, config); |
| 252 | } |
| 253 | |
| 254 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 255 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 256 | io.grpc.testing.integration.Test.SimpleRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 257 | return unaryFutureCall( |
| 258 | channel.newCall(config.unaryCall), request); |
| 259 | } |
| 260 | } |
| 261 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 262 | public static io.grpc.ServerServiceDefinition bindService( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 263 | final TestService serviceImpl) { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 264 | return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService") |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 265 | .addMethod(createMethodDefinition( |
| 266 | METHOD_UNARY_CALL, |
| 267 | asyncUnaryRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 268 | new io.grpc.stub.ServerCalls.UnaryRequestMethod< |
| 269 | io.grpc.testing.integration.Test.SimpleRequest, |
| 270 | io.grpc.testing.integration.Test.SimpleResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 271 | @java.lang.Override |
| 272 | public void invoke( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 273 | io.grpc.testing.integration.Test.SimpleRequest request, |
| 274 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 275 | serviceImpl.unaryCall(request, responseObserver); |
| 276 | } |
| 277 | }))) |
| 278 | .addMethod(createMethodDefinition( |
| 279 | METHOD_STREAMING_OUTPUT_CALL, |
| 280 | asyncUnaryRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 281 | new io.grpc.stub.ServerCalls.UnaryRequestMethod< |
| 282 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 283 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 284 | @java.lang.Override |
| 285 | public void invoke( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 286 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 287 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 288 | serviceImpl.streamingOutputCall(request, responseObserver); |
| 289 | } |
| 290 | }))) |
| 291 | .addMethod(createMethodDefinition( |
| 292 | METHOD_STREAMING_INPUT_CALL, |
| 293 | asyncStreamingRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 294 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 295 | io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 296 | io.grpc.testing.integration.Test.StreamingInputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 297 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 298 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> invoke( |
| 299 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 300 | return serviceImpl.streamingInputCall(responseObserver); |
| 301 | } |
| 302 | }))) |
| 303 | .addMethod(createMethodDefinition( |
| 304 | METHOD_FULL_DUPLEX_CALL, |
| 305 | asyncStreamingRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 306 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 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 |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 310 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 311 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 312 | return serviceImpl.fullDuplexCall(responseObserver); |
| 313 | } |
| 314 | }))) |
| 315 | .addMethod(createMethodDefinition( |
| 316 | METHOD_HALF_DUPLEX_CALL, |
| 317 | asyncStreamingRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 318 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 319 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 320 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 321 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 322 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 323 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 324 | return serviceImpl.halfDuplexCall(responseObserver); |
| 325 | } |
| 326 | }))).build(); |
| 327 | } |
| 328 | } |