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; |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 6 | import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; |
Kun Zhang | 2ee4d02 | 2015-06-04 16:39:25 -0700 | [diff] [blame] | 7 | import static io.grpc.stub.ClientCalls.blockingUnaryCall; |
| 8 | import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; |
Kun Zhang | 686dcff | 2015-07-16 12:34:37 -0700 | [diff] [blame] | 9 | import static io.grpc.stub.ClientCalls.futureUnaryCall; |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame] | 10 | import static io.grpc.stub.ServerCalls.asyncUnaryCall; |
| 11 | import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; |
| 12 | import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 13 | import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; |
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 | |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 18 | // Static method descriptors that strictly reflect the proto. |
| 19 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 20 | io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 21 | io.grpc.MethodDescriptor.create( |
| 22 | io.grpc.MethodDescriptor.MethodType.UNARY, |
| 23 | "grpc.testing.TestService", "UnaryCall", |
Kun Zhang | 79f3f02 | 2015-07-15 16:55:26 -0700 | [diff] [blame] | 24 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.parser()), |
| 25 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.parser())); |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 26 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 27 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 28 | io.grpc.MethodDescriptor.create( |
| 29 | io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING, |
| 30 | "grpc.testing.TestService", "StreamingOutputCall", |
Kun Zhang | 79f3f02 | 2015-07-15 16:55:26 -0700 | [diff] [blame] | 31 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()), |
| 32 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser())); |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 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", |
Kun Zhang | 79f3f02 | 2015-07-15 16:55:26 -0700 | [diff] [blame] | 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())); |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 40 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 41 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 42 | io.grpc.MethodDescriptor.create( |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 43 | io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, |
| 44 | "grpc.testing.TestService", "FullBidiCall", |
Kun Zhang | 79f3f02 | 2015-07-15 16:55:26 -0700 | [diff] [blame] | 45 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()), |
| 46 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser())); |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 47 | public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 48 | io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL = |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 49 | io.grpc.MethodDescriptor.create( |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 50 | io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING, |
| 51 | "grpc.testing.TestService", "HalfBidiCall", |
Kun Zhang | 79f3f02 | 2015-07-15 16:55:26 -0700 | [diff] [blame] | 52 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()), |
| 53 | io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser())); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 54 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 55 | public static TestServiceStub newStub(io.grpc.Channel channel) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 56 | return new TestServiceStub(channel); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | public static TestServiceBlockingStub newBlockingStub( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 60 | io.grpc.Channel channel) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 61 | return new TestServiceBlockingStub(channel); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | public static TestServiceFutureStub newFutureStub( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 65 | io.grpc.Channel channel) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 66 | return new TestServiceFutureStub(channel); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | public static interface TestService { |
| 70 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 71 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 72 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 73 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 74 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 75 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 76 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 77 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 78 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 79 | |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 80 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 81 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 82 | |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 83 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 84 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | public static interface TestServiceBlockingClient { |
| 88 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 89 | 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] | 90 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 91 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 92 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 93 | } |
| 94 | |
| 95 | public static interface TestServiceFutureClient { |
| 96 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 97 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 98 | io.grpc.testing.integration.Test.SimpleRequest request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 99 | } |
| 100 | |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 101 | public static class TestServiceStub extends io.grpc.stub.AbstractStub<TestServiceStub> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 102 | implements TestService { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 103 | private TestServiceStub(io.grpc.Channel channel) { |
| 104 | super(channel); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 105 | } |
| 106 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 107 | private TestServiceStub(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 108 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 109 | super(channel, callOptions); |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 110 | } |
| 111 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 112 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 113 | protected TestServiceStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 114 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 115 | return new TestServiceStub(channel, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 119 | public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request, |
| 120 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 121 | asyncUnaryCall( |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 122 | channel.newCall(METHOD_UNARY_CALL, callOptions), request, responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 126 | public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 127 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 128 | asyncServerStreamingCall( |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 129 | channel.newCall(METHOD_STREAMING_OUTPUT_CALL, callOptions), request, responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 133 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall( |
| 134 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 135 | return asyncClientStreamingCall( |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 136 | channel.newCall(METHOD_STREAMING_INPUT_CALL, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | @java.lang.Override |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 140 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullBidiCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 141 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 142 | return asyncBidiStreamingCall( |
| 143 | channel.newCall(METHOD_FULL_BIDI_CALL, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | @java.lang.Override |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 147 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfBidiCall( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 148 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 149 | return asyncBidiStreamingCall( |
| 150 | channel.newCall(METHOD_HALF_BIDI_CALL, callOptions), responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 151 | } |
| 152 | } |
| 153 | |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 154 | public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub<TestServiceBlockingStub> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 155 | implements TestServiceBlockingClient { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 156 | private TestServiceBlockingStub(io.grpc.Channel channel) { |
| 157 | super(channel); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 158 | } |
| 159 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 160 | private TestServiceBlockingStub(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 161 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 162 | super(channel, callOptions); |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 163 | } |
| 164 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 165 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 166 | protected TestServiceBlockingStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 167 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 168 | return new TestServiceBlockingStub(channel, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 169 | } |
| 170 | |
| 171 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 172 | 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] | 173 | return blockingUnaryCall( |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 174 | channel.newCall(METHOD_UNARY_CALL, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 178 | public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall( |
| 179 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 180 | return blockingServerStreamingCall( |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 181 | channel.newCall(METHOD_STREAMING_OUTPUT_CALL, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 182 | } |
| 183 | } |
| 184 | |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 185 | public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub<TestServiceFutureStub> |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 186 | implements TestServiceFutureClient { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 187 | private TestServiceFutureStub(io.grpc.Channel channel) { |
| 188 | super(channel); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 189 | } |
| 190 | |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 191 | private TestServiceFutureStub(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 192 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 193 | super(channel, callOptions); |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 194 | } |
| 195 | |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 196 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 197 | protected TestServiceFutureStub build(io.grpc.Channel channel, |
Kun Zhang | d3c5b00 | 2015-06-25 20:24:01 -0700 | [diff] [blame] | 198 | io.grpc.CallOptions callOptions) { |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 199 | return new TestServiceFutureStub(channel, callOptions); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 203 | public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall( |
| 204 | io.grpc.testing.integration.Test.SimpleRequest request) { |
Kun Zhang | 686dcff | 2015-07-16 12:34:37 -0700 | [diff] [blame] | 205 | return futureUnaryCall( |
Kun Zhang | eb92967 | 2015-07-17 17:02:58 -0700 | [diff] [blame] | 206 | channel.newCall(METHOD_UNARY_CALL, callOptions), request); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 207 | } |
| 208 | } |
| 209 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 210 | public static io.grpc.ServerServiceDefinition bindService( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 211 | final TestService serviceImpl) { |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 212 | return io.grpc.ServerServiceDefinition.builder("grpc.testing.TestService") |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 213 | .addMethod(io.grpc.ServerMethodDefinition.create( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 214 | METHOD_UNARY_CALL, |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame] | 215 | asyncUnaryCall( |
| 216 | new io.grpc.stub.ServerCalls.UnaryMethod< |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 217 | io.grpc.testing.integration.Test.SimpleRequest, |
| 218 | io.grpc.testing.integration.Test.SimpleResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 219 | @java.lang.Override |
| 220 | public void invoke( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 221 | io.grpc.testing.integration.Test.SimpleRequest request, |
| 222 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 223 | serviceImpl.unaryCall(request, responseObserver); |
| 224 | } |
| 225 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 226 | .addMethod(io.grpc.ServerMethodDefinition.create( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 227 | METHOD_STREAMING_OUTPUT_CALL, |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame] | 228 | asyncServerStreamingCall( |
| 229 | new io.grpc.stub.ServerCalls.ServerStreamingMethod< |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 230 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 231 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 232 | @java.lang.Override |
| 233 | public void invoke( |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 234 | io.grpc.testing.integration.Test.StreamingOutputCallRequest request, |
| 235 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 236 | serviceImpl.streamingOutputCall(request, responseObserver); |
| 237 | } |
| 238 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 239 | .addMethod(io.grpc.ServerMethodDefinition.create( |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 240 | METHOD_STREAMING_INPUT_CALL, |
Kun Zhang | 867c76d | 2015-07-13 17:15:34 -0700 | [diff] [blame] | 241 | asyncClientStreamingCall( |
| 242 | new io.grpc.stub.ServerCalls.ClientStreamingMethod< |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 243 | io.grpc.testing.integration.Test.StreamingInputCallRequest, |
| 244 | io.grpc.testing.integration.Test.StreamingInputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 245 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 246 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> invoke( |
| 247 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 248 | return serviceImpl.streamingInputCall(responseObserver); |
| 249 | } |
| 250 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 251 | .addMethod(io.grpc.ServerMethodDefinition.create( |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 252 | METHOD_FULL_BIDI_CALL, |
| 253 | asyncBidiStreamingCall( |
| 254 | new io.grpc.stub.ServerCalls.BidiStreamingMethod< |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 255 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 256 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 257 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 258 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 259 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 260 | return serviceImpl.fullBidiCall(responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 261 | } |
| 262 | }))) |
Kun Zhang | 73acc73 | 2015-06-26 16:32:05 -0700 | [diff] [blame] | 263 | .addMethod(io.grpc.ServerMethodDefinition.create( |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 264 | METHOD_HALF_BIDI_CALL, |
| 265 | asyncBidiStreamingCall( |
| 266 | new io.grpc.stub.ServerCalls.BidiStreamingMethod< |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 267 | io.grpc.testing.integration.Test.StreamingOutputCallRequest, |
| 268 | io.grpc.testing.integration.Test.StreamingOutputCallResponse>() { |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 269 | @java.lang.Override |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 270 | public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> invoke( |
| 271 | io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) { |
Carl Mastrangelo | 67fc45d | 2015-08-05 13:56:50 -0700 | [diff] [blame] | 272 | return serviceImpl.halfBidiCall(responseObserver); |
zhangkun83 | 5e60785 | 2015-01-22 12:31:56 -0800 | [diff] [blame] | 273 | } |
| 274 | }))).build(); |
| 275 | } |
| 276 | } |