xds: Import RLQS protos (#11418) · grpc/grpc-java@c29763d
1+package io.envoyproxy.envoy.service.rate_limit_quota.v3;
2+3+import static io.grpc.MethodDescriptor.generateFullMethodName;
4+5+/**
6+ * <pre>
7+ * Defines the Rate Limit Quota Service (RLQS).
8+ * </pre>
9+ */
10+@javax.annotation.Generated(
11+value = "by gRPC proto compiler",
12+comments = "Source: envoy/service/rate_limit_quota/v3/rlqs.proto")
13+@io.grpc.stub.annotations.GrpcGenerated
14+public final class RateLimitQuotaServiceGrpc {
15+16+private RateLimitQuotaServiceGrpc() {}
17+18+public static final java.lang.String SERVICE_NAME = "envoy.service.rate_limit_quota.v3.RateLimitQuotaService";
19+20+// Static method descriptors that strictly reflect the proto.
21+private static volatile io.grpc.MethodDescriptor<io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaUsageReports,
22+io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaResponse> getStreamRateLimitQuotasMethod;
23+24+@io.grpc.stub.annotations.RpcMethod(
25+fullMethodName = SERVICE_NAME + '/' + "StreamRateLimitQuotas",
26+requestType = io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaUsageReports.class,
27+responseType = io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaResponse.class,
28+methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
29+public static io.grpc.MethodDescriptor<io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaUsageReports,
30+io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaResponse> getStreamRateLimitQuotasMethod() {
31+io.grpc.MethodDescriptor<io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaUsageReports, io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaResponse> getStreamRateLimitQuotasMethod;
32+if ((getStreamRateLimitQuotasMethod = RateLimitQuotaServiceGrpc.getStreamRateLimitQuotasMethod) == null) {
33+synchronized (RateLimitQuotaServiceGrpc.class) {
34+if ((getStreamRateLimitQuotasMethod = RateLimitQuotaServiceGrpc.getStreamRateLimitQuotasMethod) == null) {
35+RateLimitQuotaServiceGrpc.getStreamRateLimitQuotasMethod = getStreamRateLimitQuotasMethod =
36+io.grpc.MethodDescriptor.<io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaUsageReports, io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaResponse>newBuilder()
37+ .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
38+ .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamRateLimitQuotas"))
39+ .setSampledToLocalTracing(true)
40+ .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
41+io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaUsageReports.getDefaultInstance()))
42+ .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
43+io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaResponse.getDefaultInstance()))
44+ .setSchemaDescriptor(new RateLimitQuotaServiceMethodDescriptorSupplier("StreamRateLimitQuotas"))
45+ .build();
46+ }
47+ }
48+ }
49+return getStreamRateLimitQuotasMethod;
50+ }
51+52+/**
53+ * Creates a new async stub that supports all call types for the service
54+ */
55+public static RateLimitQuotaServiceStub newStub(io.grpc.Channel channel) {
56+io.grpc.stub.AbstractStub.StubFactory<RateLimitQuotaServiceStub> factory =
57+new io.grpc.stub.AbstractStub.StubFactory<RateLimitQuotaServiceStub>() {
58+@java.lang.Override
59+public RateLimitQuotaServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
60+return new RateLimitQuotaServiceStub(channel, callOptions);
61+ }
62+ };
63+return RateLimitQuotaServiceStub.newStub(factory, channel);
64+ }
65+66+/**
67+ * Creates a new blocking-style stub that supports unary and streaming output calls on the service
68+ */
69+public static RateLimitQuotaServiceBlockingStub newBlockingStub(
70+io.grpc.Channel channel) {
71+io.grpc.stub.AbstractStub.StubFactory<RateLimitQuotaServiceBlockingStub> factory =
72+new io.grpc.stub.AbstractStub.StubFactory<RateLimitQuotaServiceBlockingStub>() {
73+@java.lang.Override
74+public RateLimitQuotaServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
75+return new RateLimitQuotaServiceBlockingStub(channel, callOptions);
76+ }
77+ };
78+return RateLimitQuotaServiceBlockingStub.newStub(factory, channel);
79+ }
80+81+/**
82+ * Creates a new ListenableFuture-style stub that supports unary calls on the service
83+ */
84+public static RateLimitQuotaServiceFutureStub newFutureStub(
85+io.grpc.Channel channel) {
86+io.grpc.stub.AbstractStub.StubFactory<RateLimitQuotaServiceFutureStub> factory =
87+new io.grpc.stub.AbstractStub.StubFactory<RateLimitQuotaServiceFutureStub>() {
88+@java.lang.Override
89+public RateLimitQuotaServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
90+return new RateLimitQuotaServiceFutureStub(channel, callOptions);
91+ }
92+ };
93+return RateLimitQuotaServiceFutureStub.newStub(factory, channel);
94+ }
95+96+/**
97+ * <pre>
98+ * Defines the Rate Limit Quota Service (RLQS).
99+ * </pre>
100+ */
101+public interface AsyncService {
102+103+/**
104+ * <pre>
105+ * Main communication channel: the data plane sends usage reports to the RLQS server,
106+ * and the server asynchronously responding with the assignments.
107+ * </pre>
108+ */
109+default io.grpc.stub.StreamObserver<io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaUsageReports> streamRateLimitQuotas(
110+io.grpc.stub.StreamObserver<io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaResponse> responseObserver) {
111+return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamRateLimitQuotasMethod(), responseObserver);
112+ }
113+ }
114+115+/**
116+ * Base class for the server implementation of the service RateLimitQuotaService.
117+ * <pre>
118+ * Defines the Rate Limit Quota Service (RLQS).
119+ * </pre>
120+ */
121+public static abstract class RateLimitQuotaServiceImplBase
122+implements io.grpc.BindableService, AsyncService {
123+124+@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
125+return RateLimitQuotaServiceGrpc.bindService(this);
126+ }
127+ }
128+129+/**
130+ * A stub to allow clients to do asynchronous rpc calls to service RateLimitQuotaService.
131+ * <pre>
132+ * Defines the Rate Limit Quota Service (RLQS).
133+ * </pre>
134+ */
135+public static final class RateLimitQuotaServiceStub
136+extends io.grpc.stub.AbstractAsyncStub<RateLimitQuotaServiceStub> {
137+private RateLimitQuotaServiceStub(
138+io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
139+super(channel, callOptions);
140+ }
141+142+@java.lang.Override
143+protected RateLimitQuotaServiceStub build(
144+io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
145+return new RateLimitQuotaServiceStub(channel, callOptions);
146+ }
147+148+/**
149+ * <pre>
150+ * Main communication channel: the data plane sends usage reports to the RLQS server,
151+ * and the server asynchronously responding with the assignments.
152+ * </pre>
153+ */
154+public io.grpc.stub.StreamObserver<io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaUsageReports> streamRateLimitQuotas(
155+io.grpc.stub.StreamObserver<io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaResponse> responseObserver) {
156+return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
157+getChannel().newCall(getStreamRateLimitQuotasMethod(), getCallOptions()), responseObserver);
158+ }
159+ }
160+161+/**
162+ * A stub to allow clients to do synchronous rpc calls to service RateLimitQuotaService.
163+ * <pre>
164+ * Defines the Rate Limit Quota Service (RLQS).
165+ * </pre>
166+ */
167+public static final class RateLimitQuotaServiceBlockingStub
168+extends io.grpc.stub.AbstractBlockingStub<RateLimitQuotaServiceBlockingStub> {
169+private RateLimitQuotaServiceBlockingStub(
170+io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
171+super(channel, callOptions);
172+ }
173+174+@java.lang.Override
175+protected RateLimitQuotaServiceBlockingStub build(
176+io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
177+return new RateLimitQuotaServiceBlockingStub(channel, callOptions);
178+ }
179+ }
180+181+/**
182+ * A stub to allow clients to do ListenableFuture-style rpc calls to service RateLimitQuotaService.
183+ * <pre>
184+ * Defines the Rate Limit Quota Service (RLQS).
185+ * </pre>
186+ */
187+public static final class RateLimitQuotaServiceFutureStub
188+extends io.grpc.stub.AbstractFutureStub<RateLimitQuotaServiceFutureStub> {
189+private RateLimitQuotaServiceFutureStub(
190+io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
191+super(channel, callOptions);
192+ }
193+194+@java.lang.Override
195+protected RateLimitQuotaServiceFutureStub build(
196+io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
197+return new RateLimitQuotaServiceFutureStub(channel, callOptions);
198+ }
199+ }
200+201+private static final int METHODID_STREAM_RATE_LIMIT_QUOTAS = 0;
202+203+private static final class MethodHandlers<Req, Resp> implements
204+io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
205+io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
206+io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
207+io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
208+private final AsyncService serviceImpl;
209+private final int methodId;
210+211+MethodHandlers(AsyncService serviceImpl, int methodId) {
212+this.serviceImpl = serviceImpl;
213+this.methodId = methodId;
214+ }
215+216+@java.lang.Override
217+@java.lang.SuppressWarnings("unchecked")
218+public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
219+switch (methodId) {
220+default:
221+throw new AssertionError();
222+ }
223+ }
224+225+@java.lang.Override
226+@java.lang.SuppressWarnings("unchecked")
227+public io.grpc.stub.StreamObserver<Req> invoke(
228+io.grpc.stub.StreamObserver<Resp> responseObserver) {
229+switch (methodId) {
230+case METHODID_STREAM_RATE_LIMIT_QUOTAS:
231+return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamRateLimitQuotas(
232+ (io.grpc.stub.StreamObserver<io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaResponse>) responseObserver);
233+default:
234+throw new AssertionError();
235+ }
236+ }
237+ }
238+239+public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
240+return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
241+ .addMethod(
242+getStreamRateLimitQuotasMethod(),
243+io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
244+new MethodHandlers<
245+io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaUsageReports,
246+io.envoyproxy.envoy.service.rate_limit_quota.v3.RateLimitQuotaResponse>(
247+service, METHODID_STREAM_RATE_LIMIT_QUOTAS)))
248+ .build();
249+ }
250+251+private static abstract class RateLimitQuotaServiceBaseDescriptorSupplier
252+implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
253+RateLimitQuotaServiceBaseDescriptorSupplier() {}
254+255+@java.lang.Override
256+public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
257+return io.envoyproxy.envoy.service.rate_limit_quota.v3.RlqsProto.getDescriptor();
258+ }
259+260+@java.lang.Override
261+public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
262+return getFileDescriptor().findServiceByName("RateLimitQuotaService");
263+ }
264+ }
265+266+private static final class RateLimitQuotaServiceFileDescriptorSupplier
267+extends RateLimitQuotaServiceBaseDescriptorSupplier {
268+RateLimitQuotaServiceFileDescriptorSupplier() {}
269+ }
270+271+private static final class RateLimitQuotaServiceMethodDescriptorSupplier
272+extends RateLimitQuotaServiceBaseDescriptorSupplier
273+implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
274+private final java.lang.String methodName;
275+276+RateLimitQuotaServiceMethodDescriptorSupplier(java.lang.String methodName) {
277+this.methodName = methodName;
278+ }
279+280+@java.lang.Override
281+public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
282+return getServiceDescriptor().findMethodByName(methodName);
283+ }
284+ }
285+286+private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
287+288+public static io.grpc.ServiceDescriptor getServiceDescriptor() {
289+io.grpc.ServiceDescriptor result = serviceDescriptor;
290+if (result == null) {
291+synchronized (RateLimitQuotaServiceGrpc.class) {
292+result = serviceDescriptor;
293+if (result == null) {
294+serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
295+ .setSchemaDescriptor(new RateLimitQuotaServiceFileDescriptorSupplier())
296+ .addMethod(getStreamRateLimitQuotasMethod())
297+ .build();
298+ }
299+ }
300+ }
301+return result;
302+ }
303+}