All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.envoyproxy.envoy.service.ratelimit.v2.RateLimitServiceGrpc Maven / Gradle / Ivy

There is a newer version: 1.0.47
Show newest version
package io.envoyproxy.envoy.service.ratelimit.v2;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.22.1)",
    comments = "Source: envoy/service/ratelimit/v2/rls.proto")
public final class RateLimitServiceGrpc {

  private RateLimitServiceGrpc() {}

  public static final String SERVICE_NAME = "envoy.service.ratelimit.v2.RateLimitService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor getShouldRateLimitMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "ShouldRateLimit",
      requestType = io.envoyproxy.envoy.service.ratelimit.v2.RateLimitRequest.class,
      responseType = io.envoyproxy.envoy.service.ratelimit.v2.RateLimitResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getShouldRateLimitMethod() {
    io.grpc.MethodDescriptor getShouldRateLimitMethod;
    if ((getShouldRateLimitMethod = RateLimitServiceGrpc.getShouldRateLimitMethod) == null) {
      synchronized (RateLimitServiceGrpc.class) {
        if ((getShouldRateLimitMethod = RateLimitServiceGrpc.getShouldRateLimitMethod) == null) {
          RateLimitServiceGrpc.getShouldRateLimitMethod = getShouldRateLimitMethod = 
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(
                  "envoy.service.ratelimit.v2.RateLimitService", "ShouldRateLimit"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.envoyproxy.envoy.service.ratelimit.v2.RateLimitRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.envoyproxy.envoy.service.ratelimit.v2.RateLimitResponse.getDefaultInstance()))
                  .setSchemaDescriptor(new RateLimitServiceMethodDescriptorSupplier("ShouldRateLimit"))
                  .build();
          }
        }
     }
     return getShouldRateLimitMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static RateLimitServiceStub newStub(io.grpc.Channel channel) {
    return new RateLimitServiceStub(channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static RateLimitServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    return new RateLimitServiceBlockingStub(channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static RateLimitServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    return new RateLimitServiceFutureStub(channel);
  }

  /**
   */
  public static abstract class RateLimitServiceImplBase implements io.grpc.BindableService {

    /**
     * 
     * Determine whether rate limiting should take place.
     * 
*/ public void shouldRateLimit(io.envoyproxy.envoy.service.ratelimit.v2.RateLimitRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getShouldRateLimitMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getShouldRateLimitMethod(), asyncUnaryCall( new MethodHandlers< io.envoyproxy.envoy.service.ratelimit.v2.RateLimitRequest, io.envoyproxy.envoy.service.ratelimit.v2.RateLimitResponse>( this, METHODID_SHOULD_RATE_LIMIT))) .build(); } } /** */ public static final class RateLimitServiceStub extends io.grpc.stub.AbstractStub { private RateLimitServiceStub(io.grpc.Channel channel) { super(channel); } private RateLimitServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected RateLimitServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new RateLimitServiceStub(channel, callOptions); } /** *
     * Determine whether rate limiting should take place.
     * 
*/ public void shouldRateLimit(io.envoyproxy.envoy.service.ratelimit.v2.RateLimitRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(getShouldRateLimitMethod(), getCallOptions()), request, responseObserver); } } /** */ public static final class RateLimitServiceBlockingStub extends io.grpc.stub.AbstractStub { private RateLimitServiceBlockingStub(io.grpc.Channel channel) { super(channel); } private RateLimitServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected RateLimitServiceBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new RateLimitServiceBlockingStub(channel, callOptions); } /** *
     * Determine whether rate limiting should take place.
     * 
*/ public io.envoyproxy.envoy.service.ratelimit.v2.RateLimitResponse shouldRateLimit(io.envoyproxy.envoy.service.ratelimit.v2.RateLimitRequest request) { return blockingUnaryCall( getChannel(), getShouldRateLimitMethod(), getCallOptions(), request); } } /** */ public static final class RateLimitServiceFutureStub extends io.grpc.stub.AbstractStub { private RateLimitServiceFutureStub(io.grpc.Channel channel) { super(channel); } private RateLimitServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected RateLimitServiceFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new RateLimitServiceFutureStub(channel, callOptions); } /** *
     * Determine whether rate limiting should take place.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture shouldRateLimit( io.envoyproxy.envoy.service.ratelimit.v2.RateLimitRequest request) { return futureUnaryCall( getChannel().newCall(getShouldRateLimitMethod(), getCallOptions()), request); } } private static final int METHODID_SHOULD_RATE_LIMIT = 0; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { private final RateLimitServiceImplBase serviceImpl; private final int methodId; MethodHandlers(RateLimitServiceImplBase serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { case METHODID_SHOULD_RATE_LIMIT: serviceImpl.shouldRateLimit((io.envoyproxy.envoy.service.ratelimit.v2.RateLimitRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; default: throw new AssertionError(); } } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver invoke( io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { default: throw new AssertionError(); } } } private static abstract class RateLimitServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { RateLimitServiceBaseDescriptorSupplier() {} @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return io.envoyproxy.envoy.service.ratelimit.v2.RlsProto.getDescriptor(); } @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("RateLimitService"); } } private static final class RateLimitServiceFileDescriptorSupplier extends RateLimitServiceBaseDescriptorSupplier { RateLimitServiceFileDescriptorSupplier() {} } private static final class RateLimitServiceMethodDescriptorSupplier extends RateLimitServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final String methodName; RateLimitServiceMethodDescriptorSupplier(String methodName) { this.methodName = methodName; } @java.lang.Override public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { return getServiceDescriptor().findMethodByName(methodName); } } private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { io.grpc.ServiceDescriptor result = serviceDescriptor; if (result == null) { synchronized (RateLimitServiceGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new RateLimitServiceFileDescriptorSupplier()) .addMethod(getShouldRateLimitMethod()) .build(); } } } return result; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy