Class RateLimitRequest.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
io.envoyproxy.envoy.service.ratelimit.v2.RateLimitRequest.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, RateLimitRequestOrBuilder, Cloneable
Enclosing class:
RateLimitRequest

public static final class RateLimitRequest.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder> implements RateLimitRequestOrBuilder
 Main message for a rate limit request. The rate limit service is designed to be fully generic
 in the sense that it can operate on arbitrary hierarchical key/value pairs. The loaded
 configuration will parse the request and find the most specific limit to apply. In addition,
 a RateLimitRequest can contain multiple "descriptors" to limit on. When multiple descriptors
 are provided, the server will limit on *ALL* of them and return an OVER_LIMIT response if any
 of them are over limit. This enables more complex application level rate limiting scenarios
 if desired.
 
Protobuf type envoy.service.ratelimit.v2.RateLimitRequest
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • clear

      public RateLimitRequest.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • getDefaultInstanceForType

      public RateLimitRequest getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public RateLimitRequest build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public RateLimitRequest buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public RateLimitRequest.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • setField

      public RateLimitRequest.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • clearField

      public RateLimitRequest.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • clearOneof

      public RateLimitRequest.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • setRepeatedField

      public RateLimitRequest.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • addRepeatedField

      public RateLimitRequest.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • mergeFrom

      public RateLimitRequest.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<RateLimitRequest.Builder>
    • mergeFrom

      public RateLimitRequest.Builder mergeFrom(RateLimitRequest other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • mergeFrom

      public RateLimitRequest.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<RateLimitRequest.Builder>
      Throws:
      IOException
    • getDomain

      public String getDomain()
       All rate limit requests must specify a domain. This enables the configuration to be per
       application without fear of overlap. E.g., "envoy".
       
      string domain = 1;
      Specified by:
      getDomain in interface RateLimitRequestOrBuilder
      Returns:
      The domain.
    • getDomainBytes

      public com.google.protobuf.ByteString getDomainBytes()
       All rate limit requests must specify a domain. This enables the configuration to be per
       application without fear of overlap. E.g., "envoy".
       
      string domain = 1;
      Specified by:
      getDomainBytes in interface RateLimitRequestOrBuilder
      Returns:
      The bytes for domain.
    • setDomain

      public RateLimitRequest.Builder setDomain(String value)
       All rate limit requests must specify a domain. This enables the configuration to be per
       application without fear of overlap. E.g., "envoy".
       
      string domain = 1;
      Parameters:
      value - The domain to set.
      Returns:
      This builder for chaining.
    • clearDomain

      public RateLimitRequest.Builder clearDomain()
       All rate limit requests must specify a domain. This enables the configuration to be per
       application without fear of overlap. E.g., "envoy".
       
      string domain = 1;
      Returns:
      This builder for chaining.
    • setDomainBytes

      public RateLimitRequest.Builder setDomainBytes(com.google.protobuf.ByteString value)
       All rate limit requests must specify a domain. This enables the configuration to be per
       application without fear of overlap. E.g., "envoy".
       
      string domain = 1;
      Parameters:
      value - The bytes for domain to set.
      Returns:
      This builder for chaining.
    • getDescriptorsList

      public List<RateLimitDescriptor> getDescriptorsList()
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
      Specified by:
      getDescriptorsList in interface RateLimitRequestOrBuilder
    • getDescriptorsCount

      public int getDescriptorsCount()
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
      Specified by:
      getDescriptorsCount in interface RateLimitRequestOrBuilder
    • getDescriptors

      public RateLimitDescriptor getDescriptors(int index)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
      Specified by:
      getDescriptors in interface RateLimitRequestOrBuilder
    • setDescriptors

      public RateLimitRequest.Builder setDescriptors(int index, RateLimitDescriptor value)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • setDescriptors

      public RateLimitRequest.Builder setDescriptors(int index, RateLimitDescriptor.Builder builderForValue)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • addDescriptors

      public RateLimitRequest.Builder addDescriptors(RateLimitDescriptor value)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • addDescriptors

      public RateLimitRequest.Builder addDescriptors(int index, RateLimitDescriptor value)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • addDescriptors

      public RateLimitRequest.Builder addDescriptors(RateLimitDescriptor.Builder builderForValue)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • addDescriptors

      public RateLimitRequest.Builder addDescriptors(int index, RateLimitDescriptor.Builder builderForValue)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • addAllDescriptors

      public RateLimitRequest.Builder addAllDescriptors(Iterable<? extends RateLimitDescriptor> values)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • clearDescriptors

      public RateLimitRequest.Builder clearDescriptors()
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • removeDescriptors

      public RateLimitRequest.Builder removeDescriptors(int index)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • getDescriptorsBuilder

      public RateLimitDescriptor.Builder getDescriptorsBuilder(int index)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • getDescriptorsOrBuilder

      public RateLimitDescriptorOrBuilder getDescriptorsOrBuilder(int index)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
      Specified by:
      getDescriptorsOrBuilder in interface RateLimitRequestOrBuilder
    • getDescriptorsOrBuilderList

      public List<? extends RateLimitDescriptorOrBuilder> getDescriptorsOrBuilderList()
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
      Specified by:
      getDescriptorsOrBuilderList in interface RateLimitRequestOrBuilder
    • addDescriptorsBuilder

      public RateLimitDescriptor.Builder addDescriptorsBuilder()
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • addDescriptorsBuilder

      public RateLimitDescriptor.Builder addDescriptorsBuilder(int index)
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • getDescriptorsBuilderList

      public List<RateLimitDescriptor.Builder> getDescriptorsBuilderList()
       All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is
       processed by the service (see below). If any of the descriptors are over limit, the entire
       request is considered to be over limit.
       
      repeated .envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2;
    • getHitsAddend

      public int getHitsAddend()
       Rate limit requests can optionally specify the number of hits a request adds to the matched
       limit. If the value is not set in the message, a request increases the matched limit by 1.
       
      uint32 hits_addend = 3;
      Specified by:
      getHitsAddend in interface RateLimitRequestOrBuilder
      Returns:
      The hitsAddend.
    • setHitsAddend

      public RateLimitRequest.Builder setHitsAddend(int value)
       Rate limit requests can optionally specify the number of hits a request adds to the matched
       limit. If the value is not set in the message, a request increases the matched limit by 1.
       
      uint32 hits_addend = 3;
      Parameters:
      value - The hitsAddend to set.
      Returns:
      This builder for chaining.
    • clearHitsAddend

      public RateLimitRequest.Builder clearHitsAddend()
       Rate limit requests can optionally specify the number of hits a request adds to the matched
       limit. If the value is not set in the message, a request increases the matched limit by 1.
       
      uint32 hits_addend = 3;
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final RateLimitRequest.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>
    • mergeUnknownFields

      public final RateLimitRequest.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<RateLimitRequest.Builder>