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.createMethodDescriptor; |
| 4 | import static io.grpc.stub.ClientCalls.asyncUnaryCall; |
| 5 | import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; |
| 6 | import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; |
| 7 | import static io.grpc.stub.ClientCalls.duplexStreamingCall; |
| 8 | import static io.grpc.stub.ClientCalls.blockingUnaryCall; |
| 9 | import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; |
| 10 | import static io.grpc.stub.ClientCalls.unaryFutureCall; |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 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", |
Kun Zhang | af9fb6d | 2015-06-30 16:08:46 -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", |
Kun Zhang | af9fb6d | 2015-06-30 16:08:46 -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", |
Kun Zhang | af9fb6d | 2015-06-30 16:08:46 -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", |
Kun Zhang | af9fb6d | 2015-06-30 16:08:46 -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", |
Kun Zhang | af9fb6d | 2015-06-30 16:08:46 -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 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 170 | private TestServiceStub(io.grpc.Channel channel, |
| 171 | TestServiceServiceDescriptor config, |
| 172 | io.grpc.CallOptions callOptions) { |
| 173 | super(channel, config, callOptions); |
| 174 | } |
| 175 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 176 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 177 | protected TestServiceStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 178 | TestServiceServiceDescriptor config, |
| 179 | io.grpc.CallOptions callOptions) { |
| 180 | return new TestServiceStub(channel, config, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 181 | } |
| 182 | |
| 183 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 184 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 185 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 186 | asyncUnaryCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 187 | channel.newCall(config.unaryCall, callOptions), request, responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 191 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 192 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 193 | asyncServerStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 194 | channel.newCall(config.streamingOutputCall, callOptions), request, responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 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.StreamingInputCallRequest> streamingInputCall( |
| 199 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 200 | return asyncClientStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 201 | channel.newCall(config.streamingInputCall, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 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> fullDuplexCall( |
| 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( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 208 | channel.newCall(config.fullDuplexCall, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 209 | } |
| 210 | |
| 211 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 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) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 214 | return duplexStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 215 | channel.newCall(config.halfDuplexCall, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 216 | } |
| 217 | } |
| 218 | |
| 219 | public static class TestServiceBlockingStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 220 | io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 221 | implements TestServiceBlockingClient { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 222 | private TestServiceBlockingStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 223 | TestServiceServiceDescriptor config) { |
| 224 | super(channel, config); |
| 225 | } |
| 226 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 227 | private TestServiceBlockingStub(io.grpc.Channel channel, |
| 228 | TestServiceServiceDescriptor config, |
| 229 | io.grpc.CallOptions callOptions) { |
| 230 | super(channel, config, callOptions); |
| 231 | } |
| 232 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 233 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 234 | protected TestServiceBlockingStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 235 | TestServiceServiceDescriptor config, |
| 236 | io.grpc.CallOptions callOptions) { |
| 237 | return new TestServiceBlockingStub(channel, config, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 238 | } |
| 239 | |
| 240 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 241 | 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] | 242 | return blockingUnaryCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 243 | channel.newCall(config.unaryCall, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 247 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 248 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 249 | return blockingServerStreamingCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 250 | channel.newCall(config.streamingOutputCall, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 251 | } |
| 252 | } |
| 253 | |
| 254 | public static class TestServiceFutureStub extends |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 255 | io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 256 | implements TestServiceFutureClient { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 257 | private TestServiceFutureStub(io.grpc.Channel channel, |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 258 | TestServiceServiceDescriptor config) { |
| 259 | super(channel, config); |
| 260 | } |
| 261 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 262 | private TestServiceFutureStub(io.grpc.Channel channel, |
| 263 | TestServiceServiceDescriptor config, |
| 264 | io.grpc.CallOptions callOptions) { |
| 265 | super(channel, config, callOptions); |
| 266 | } |
| 267 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 268 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 269 | protected TestServiceFutureStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 270 | TestServiceServiceDescriptor config, |
| 271 | io.grpc.CallOptions callOptions) { |
| 272 | return new TestServiceFutureStub(channel, config, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 276 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 277 | io.grpc.testing.integration.Test.SimpleRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 278 | return unaryFutureCall( |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 279 | channel.newCall(config.unaryCall, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 280 | } |
| 281 | } |
| 282 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 283 | public static io.grpc.ServerServiceDefinition bindService( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 284 | final TestService serviceImpl) { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 285 | return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService") |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 286 | .addMethod(createMethodDefinition( |
| 287 | METHOD_UNARY_CALL, |
| 288 | asyncUnaryRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 289 | new io.grpc.stub.ServerCalls.UnaryRequestMethod< |
| 290 | io.grpc.testing.integration.Test.SimpleRequest, |
| 291 | io.grpc.testing.integration.Test.SimpleResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 292 | @java.lang.Override |
| 293 | public void invoke( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 294 | io.grpc.testing.integration.Test.SimpleRequest request, |
| 295 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 296 | serviceImpl.unaryCall(request, responseObserver); |
| 297 | } |
| 298 | }))) |
| 299 | .addMethod(createMethodDefinition( |
| 300 | METHOD_STREAMING_OUTPUT_CALL, |
| 301 | asyncUnaryRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 302 | new io.grpc.stub.ServerCalls.UnaryRequestMethod< |
| 303 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 304 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 305 | @java.lang.Override |
| 306 | public void invoke( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 307 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 308 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 309 | serviceImpl.streamingOutputCall(request, responseObserver); |
| 310 | } |
| 311 | }))) |
| 312 | .addMethod(createMethodDefinition( |
| 313 | METHOD_STREAMING_INPUT_CALL, |
| 314 | asyncStreamingRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 315 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 316 | io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 317 | io.grpc.testing.integration.Test.StreamingInputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 318 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 319 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> invoke( |
| 320 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 321 | return serviceImpl.streamingInputCall(responseObserver); |
| 322 | } |
| 323 | }))) |
| 324 | .addMethod(createMethodDefinition( |
| 325 | METHOD_FULL_DUPLEX_CALL, |
| 326 | asyncStreamingRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 327 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 328 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 329 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 330 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 331 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 332 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 333 | return serviceImpl.fullDuplexCall(responseObserver); |
| 334 | } |
| 335 | }))) |
| 336 | .addMethod(createMethodDefinition( |
| 337 | METHOD_HALF_DUPLEX_CALL, |
| 338 | asyncStreamingRequestCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 339 | new io.grpc.stub.ServerCalls.StreamingRequestMethod< |
| 340 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 341 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 342 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 343 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 344 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 345 | return serviceImpl.halfDuplexCall(responseObserver); |
| 346 | } |
| 347 | }))).build(); |
| 348 | } |
| 349 | } |