• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package io.grpc.testing.compiler;
2
3import static io.grpc.MethodDescriptor.generateFullMethodName;
4import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
5import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
6import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
7import static io.grpc.stub.ClientCalls.asyncUnaryCall;
8import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9import static io.grpc.stub.ClientCalls.blockingUnaryCall;
10import static io.grpc.stub.ClientCalls.futureUnaryCall;
11import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
12import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
13import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
14import static io.grpc.stub.ServerCalls.asyncUnaryCall;
15import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
16import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
17
18/**
19 * <pre>
20 * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
21 * </pre>
22 */
23@javax.annotation.Generated(
24    value = "by gRPC proto compiler (version 1.16.1)",
25    comments = "Source: grpc/testing/compiler/test.proto")
26@java.lang.Deprecated
27public final class TestDeprecatedServiceGrpc {
28
29  private TestDeprecatedServiceGrpc() {}
30
31  public static final String SERVICE_NAME = "grpc.testing.compiler.TestDeprecatedService";
32
33  // Static method descriptors that strictly reflect the proto.
34  private static volatile io.grpc.MethodDescriptor<io.grpc.testing.compiler.Test.SimpleRequest,
35      io.grpc.testing.compiler.Test.SimpleResponse> getDeprecatedMethodMethod;
36
37  @io.grpc.stub.annotations.RpcMethod(
38      fullMethodName = SERVICE_NAME + '/' + "DeprecatedMethod",
39      requestType = io.grpc.testing.compiler.Test.SimpleRequest.class,
40      responseType = io.grpc.testing.compiler.Test.SimpleResponse.class,
41      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
42  public static io.grpc.MethodDescriptor<io.grpc.testing.compiler.Test.SimpleRequest,
43      io.grpc.testing.compiler.Test.SimpleResponse> getDeprecatedMethodMethod() {
44    io.grpc.MethodDescriptor<io.grpc.testing.compiler.Test.SimpleRequest, io.grpc.testing.compiler.Test.SimpleResponse> getDeprecatedMethodMethod;
45    if ((getDeprecatedMethodMethod = TestDeprecatedServiceGrpc.getDeprecatedMethodMethod) == null) {
46      synchronized (TestDeprecatedServiceGrpc.class) {
47        if ((getDeprecatedMethodMethod = TestDeprecatedServiceGrpc.getDeprecatedMethodMethod) == null) {
48          TestDeprecatedServiceGrpc.getDeprecatedMethodMethod = getDeprecatedMethodMethod =
49              io.grpc.MethodDescriptor.<io.grpc.testing.compiler.Test.SimpleRequest, io.grpc.testing.compiler.Test.SimpleResponse>newBuilder()
50              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
51              .setFullMethodName(generateFullMethodName(
52                  "grpc.testing.compiler.TestDeprecatedService", "DeprecatedMethod"))
53              .setSampledToLocalTracing(true)
54              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
55                  io.grpc.testing.compiler.Test.SimpleRequest.getDefaultInstance()))
56              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
57                  io.grpc.testing.compiler.Test.SimpleResponse.getDefaultInstance()))
58                  .setSchemaDescriptor(new TestDeprecatedServiceMethodDescriptorSupplier("DeprecatedMethod"))
59                  .build();
60          }
61        }
62     }
63     return getDeprecatedMethodMethod;
64  }
65
66  /**
67   * Creates a new async stub that supports all call types for the service
68   */
69  public static TestDeprecatedServiceStub newStub(io.grpc.Channel channel) {
70    return new TestDeprecatedServiceStub(channel);
71  }
72
73  /**
74   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
75   */
76  public static TestDeprecatedServiceBlockingStub newBlockingStub(
77      io.grpc.Channel channel) {
78    return new TestDeprecatedServiceBlockingStub(channel);
79  }
80
81  /**
82   * Creates a new ListenableFuture-style stub that supports unary calls on the service
83   */
84  public static TestDeprecatedServiceFutureStub newFutureStub(
85      io.grpc.Channel channel) {
86    return new TestDeprecatedServiceFutureStub(channel);
87  }
88
89  /**
90   * <pre>
91   * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
92   * </pre>
93   */
94  @java.lang.Deprecated
95  public static abstract class TestDeprecatedServiceImplBase implements io.grpc.BindableService {
96
97    /**
98     * <pre>
99     * An RPC method that has been deprecated and should generate with Java's &#64;Deprecated annotation
100     * </pre>
101     */
102    @java.lang.Deprecated
103    public void deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request,
104        io.grpc.stub.StreamObserver<io.grpc.testing.compiler.Test.SimpleResponse> responseObserver) {
105      asyncUnimplementedUnaryCall(getDeprecatedMethodMethod(), responseObserver);
106    }
107
108    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
109      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
110          .addMethod(
111            getDeprecatedMethodMethod(),
112            asyncUnaryCall(
113              new MethodHandlers<
114                io.grpc.testing.compiler.Test.SimpleRequest,
115                io.grpc.testing.compiler.Test.SimpleResponse>(
116                  this, METHODID_DEPRECATED_METHOD)))
117          .build();
118    }
119  }
120
121  /**
122   * <pre>
123   * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
124   * </pre>
125   */
126  @java.lang.Deprecated
127  public static final class TestDeprecatedServiceStub extends io.grpc.stub.AbstractStub<TestDeprecatedServiceStub> {
128    private TestDeprecatedServiceStub(io.grpc.Channel channel) {
129      super(channel);
130    }
131
132    private TestDeprecatedServiceStub(io.grpc.Channel channel,
133        io.grpc.CallOptions callOptions) {
134      super(channel, callOptions);
135    }
136
137    @java.lang.Override
138    protected TestDeprecatedServiceStub build(io.grpc.Channel channel,
139        io.grpc.CallOptions callOptions) {
140      return new TestDeprecatedServiceStub(channel, callOptions);
141    }
142
143    /**
144     * <pre>
145     * An RPC method that has been deprecated and should generate with Java's &#64;Deprecated annotation
146     * </pre>
147     */
148    @java.lang.Deprecated
149    public void deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request,
150        io.grpc.stub.StreamObserver<io.grpc.testing.compiler.Test.SimpleResponse> responseObserver) {
151      asyncUnaryCall(
152          getChannel().newCall(getDeprecatedMethodMethod(), getCallOptions()), request, responseObserver);
153    }
154  }
155
156  /**
157   * <pre>
158   * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
159   * </pre>
160   */
161  @java.lang.Deprecated
162  public static final class TestDeprecatedServiceBlockingStub extends io.grpc.stub.AbstractStub<TestDeprecatedServiceBlockingStub> {
163    private TestDeprecatedServiceBlockingStub(io.grpc.Channel channel) {
164      super(channel);
165    }
166
167    private TestDeprecatedServiceBlockingStub(io.grpc.Channel channel,
168        io.grpc.CallOptions callOptions) {
169      super(channel, callOptions);
170    }
171
172    @java.lang.Override
173    protected TestDeprecatedServiceBlockingStub build(io.grpc.Channel channel,
174        io.grpc.CallOptions callOptions) {
175      return new TestDeprecatedServiceBlockingStub(channel, callOptions);
176    }
177
178    /**
179     * <pre>
180     * An RPC method that has been deprecated and should generate with Java's &#64;Deprecated annotation
181     * </pre>
182     */
183    @java.lang.Deprecated
184    public io.grpc.testing.compiler.Test.SimpleResponse deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request) {
185      return blockingUnaryCall(
186          getChannel(), getDeprecatedMethodMethod(), getCallOptions(), request);
187    }
188  }
189
190  /**
191   * <pre>
192   * Test service that has been deprecated and should generate with Java's &#64;Deprecated annotation
193   * </pre>
194   */
195  @java.lang.Deprecated
196  public static final class TestDeprecatedServiceFutureStub extends io.grpc.stub.AbstractStub<TestDeprecatedServiceFutureStub> {
197    private TestDeprecatedServiceFutureStub(io.grpc.Channel channel) {
198      super(channel);
199    }
200
201    private TestDeprecatedServiceFutureStub(io.grpc.Channel channel,
202        io.grpc.CallOptions callOptions) {
203      super(channel, callOptions);
204    }
205
206    @java.lang.Override
207    protected TestDeprecatedServiceFutureStub build(io.grpc.Channel channel,
208        io.grpc.CallOptions callOptions) {
209      return new TestDeprecatedServiceFutureStub(channel, callOptions);
210    }
211
212    /**
213     * <pre>
214     * An RPC method that has been deprecated and should generate with Java's &#64;Deprecated annotation
215     * </pre>
216     */
217    @java.lang.Deprecated
218    public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.compiler.Test.SimpleResponse> deprecatedMethod(
219        io.grpc.testing.compiler.Test.SimpleRequest request) {
220      return futureUnaryCall(
221          getChannel().newCall(getDeprecatedMethodMethod(), getCallOptions()), request);
222    }
223  }
224
225  private static final int METHODID_DEPRECATED_METHOD = 0;
226
227  private static final class MethodHandlers<Req, Resp> implements
228      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
229      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
230      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
231      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
232    private final TestDeprecatedServiceImplBase serviceImpl;
233    private final int methodId;
234
235    MethodHandlers(TestDeprecatedServiceImplBase serviceImpl, int methodId) {
236      this.serviceImpl = serviceImpl;
237      this.methodId = methodId;
238    }
239
240    @java.lang.Override
241    @java.lang.SuppressWarnings("unchecked")
242    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
243      switch (methodId) {
244        case METHODID_DEPRECATED_METHOD:
245          serviceImpl.deprecatedMethod((io.grpc.testing.compiler.Test.SimpleRequest) request,
246              (io.grpc.stub.StreamObserver<io.grpc.testing.compiler.Test.SimpleResponse>) responseObserver);
247          break;
248        default:
249          throw new AssertionError();
250      }
251    }
252
253    @java.lang.Override
254    @java.lang.SuppressWarnings("unchecked")
255    public io.grpc.stub.StreamObserver<Req> invoke(
256        io.grpc.stub.StreamObserver<Resp> responseObserver) {
257      switch (methodId) {
258        default:
259          throw new AssertionError();
260      }
261    }
262  }
263
264  private static abstract class TestDeprecatedServiceBaseDescriptorSupplier
265      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
266    TestDeprecatedServiceBaseDescriptorSupplier() {}
267
268    @java.lang.Override
269    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
270      return io.grpc.testing.compiler.Test.getDescriptor();
271    }
272
273    @java.lang.Override
274    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
275      return getFileDescriptor().findServiceByName("TestDeprecatedService");
276    }
277  }
278
279  private static final class TestDeprecatedServiceFileDescriptorSupplier
280      extends TestDeprecatedServiceBaseDescriptorSupplier {
281    TestDeprecatedServiceFileDescriptorSupplier() {}
282  }
283
284  private static final class TestDeprecatedServiceMethodDescriptorSupplier
285      extends TestDeprecatedServiceBaseDescriptorSupplier
286      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
287    private final String methodName;
288
289    TestDeprecatedServiceMethodDescriptorSupplier(String methodName) {
290      this.methodName = methodName;
291    }
292
293    @java.lang.Override
294    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
295      return getServiceDescriptor().findMethodByName(methodName);
296    }
297  }
298
299  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
300
301  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
302    io.grpc.ServiceDescriptor result = serviceDescriptor;
303    if (result == null) {
304      synchronized (TestDeprecatedServiceGrpc.class) {
305        result = serviceDescriptor;
306        if (result == null) {
307          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
308              .setSchemaDescriptor(new TestDeprecatedServiceFileDescriptorSupplier())
309              .addMethod(getDeprecatedMethodMethod())
310              .build();
311        }
312      }
313    }
314    return result;
315  }
316}
317