Class VirtualCluster.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<VirtualCluster.Builder>
io.envoyproxy.envoy.api.v2.route.VirtualCluster.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, VirtualClusterOrBuilder, Cloneable
Enclosing class:
VirtualCluster

public static final class VirtualCluster.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<VirtualCluster.Builder> implements VirtualClusterOrBuilder
 A virtual cluster is a way of specifying a regex matching rule against
 certain important endpoints such that statistics are generated explicitly for
 the matched requests. The reason this is useful is that when doing
 prefix/path matching Envoy does not always know what the application
 considers to be an endpoint. Thus, it’s impossible for Envoy to generically
 emit per endpoint statistics. However, often systems have highly critical
 endpoints that they wish to get “perfect” statistics on. Virtual cluster
 statistics are perfect in the sense that they are emitted on the downstream
 side such that they include network level failures.

 Documentation for :ref:`virtual cluster statistics <config_http_filters_router_vcluster_stats>`.

 .. note::

    Virtual clusters are a useful tool, but we do not recommend setting up a virtual cluster for
    every application endpoint. This is both not easily maintainable and as well the matching and
    statistics output are not free.
 
Protobuf type envoy.api.v2.route.VirtualCluster
  • 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<VirtualCluster.Builder>
    • clear

      public VirtualCluster.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<VirtualCluster.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<VirtualCluster.Builder>
    • getDefaultInstanceForType

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

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

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

      public VirtualCluster.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<VirtualCluster.Builder>
    • setField

      public VirtualCluster.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<VirtualCluster.Builder>
    • clearField

      public VirtualCluster.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<VirtualCluster.Builder>
    • clearOneof

      public VirtualCluster.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<VirtualCluster.Builder>
    • setRepeatedField

      public VirtualCluster.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<VirtualCluster.Builder>
    • addRepeatedField

      public VirtualCluster.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<VirtualCluster.Builder>
    • mergeFrom

      public VirtualCluster.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<VirtualCluster.Builder>
    • mergeFrom

      public VirtualCluster.Builder mergeFrom(VirtualCluster other)
    • isInitialized

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

      public VirtualCluster.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<VirtualCluster.Builder>
      Throws:
      IOException
    • getPattern

      @Deprecated public String getPattern()
      Deprecated.
      envoy.api.v2.route.VirtualCluster.pattern is deprecated. See envoy/api/v2/route/route_components.proto;l=1329
       Specifies a regex pattern to use for matching requests. The entire path of the request
       must match the regex. The regex grammar used is defined `here
       <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
      
       Examples:
      
       * The regex ``/rides/\d+`` matches the path */rides/0*
       * The regex ``/rides/\d+`` matches the path */rides/123*
       * The regex ``/rides/\d+`` does not match the path */rides/123/456*
      
       .. attention::
         This field has been deprecated in favor of `headers` as it is not safe for use with
         untrusted input in all cases.
       
      string pattern = 1 [deprecated = true, (.validate.rules) = { ... }
      Specified by:
      getPattern in interface VirtualClusterOrBuilder
      Returns:
      The pattern.
    • getPatternBytes

      @Deprecated public com.google.protobuf.ByteString getPatternBytes()
      Deprecated.
      envoy.api.v2.route.VirtualCluster.pattern is deprecated. See envoy/api/v2/route/route_components.proto;l=1329
       Specifies a regex pattern to use for matching requests. The entire path of the request
       must match the regex. The regex grammar used is defined `here
       <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
      
       Examples:
      
       * The regex ``/rides/\d+`` matches the path */rides/0*
       * The regex ``/rides/\d+`` matches the path */rides/123*
       * The regex ``/rides/\d+`` does not match the path */rides/123/456*
      
       .. attention::
         This field has been deprecated in favor of `headers` as it is not safe for use with
         untrusted input in all cases.
       
      string pattern = 1 [deprecated = true, (.validate.rules) = { ... }
      Specified by:
      getPatternBytes in interface VirtualClusterOrBuilder
      Returns:
      The bytes for pattern.
    • setPattern

      @Deprecated public VirtualCluster.Builder setPattern(String value)
      Deprecated.
      envoy.api.v2.route.VirtualCluster.pattern is deprecated. See envoy/api/v2/route/route_components.proto;l=1329
       Specifies a regex pattern to use for matching requests. The entire path of the request
       must match the regex. The regex grammar used is defined `here
       <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
      
       Examples:
      
       * The regex ``/rides/\d+`` matches the path */rides/0*
       * The regex ``/rides/\d+`` matches the path */rides/123*
       * The regex ``/rides/\d+`` does not match the path */rides/123/456*
      
       .. attention::
         This field has been deprecated in favor of `headers` as it is not safe for use with
         untrusted input in all cases.
       
      string pattern = 1 [deprecated = true, (.validate.rules) = { ... }
      Parameters:
      value - The pattern to set.
      Returns:
      This builder for chaining.
    • clearPattern

      @Deprecated public VirtualCluster.Builder clearPattern()
      Deprecated.
      envoy.api.v2.route.VirtualCluster.pattern is deprecated. See envoy/api/v2/route/route_components.proto;l=1329
       Specifies a regex pattern to use for matching requests. The entire path of the request
       must match the regex. The regex grammar used is defined `here
       <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
      
       Examples:
      
       * The regex ``/rides/\d+`` matches the path */rides/0*
       * The regex ``/rides/\d+`` matches the path */rides/123*
       * The regex ``/rides/\d+`` does not match the path */rides/123/456*
      
       .. attention::
         This field has been deprecated in favor of `headers` as it is not safe for use with
         untrusted input in all cases.
       
      string pattern = 1 [deprecated = true, (.validate.rules) = { ... }
      Returns:
      This builder for chaining.
    • setPatternBytes

      @Deprecated public VirtualCluster.Builder setPatternBytes(com.google.protobuf.ByteString value)
      Deprecated.
      envoy.api.v2.route.VirtualCluster.pattern is deprecated. See envoy/api/v2/route/route_components.proto;l=1329
       Specifies a regex pattern to use for matching requests. The entire path of the request
       must match the regex. The regex grammar used is defined `here
       <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
      
       Examples:
      
       * The regex ``/rides/\d+`` matches the path */rides/0*
       * The regex ``/rides/\d+`` matches the path */rides/123*
       * The regex ``/rides/\d+`` does not match the path */rides/123/456*
      
       .. attention::
         This field has been deprecated in favor of `headers` as it is not safe for use with
         untrusted input in all cases.
       
      string pattern = 1 [deprecated = true, (.validate.rules) = { ... }
      Parameters:
      value - The bytes for pattern to set.
      Returns:
      This builder for chaining.
    • getHeadersList

      public List<HeaderMatcher> getHeadersList()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
      Specified by:
      getHeadersList in interface VirtualClusterOrBuilder
    • getHeadersCount

      public int getHeadersCount()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
      Specified by:
      getHeadersCount in interface VirtualClusterOrBuilder
    • getHeaders

      public HeaderMatcher getHeaders(int index)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
      Specified by:
      getHeaders in interface VirtualClusterOrBuilder
    • setHeaders

      public VirtualCluster.Builder setHeaders(int index, HeaderMatcher value)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • setHeaders

      public VirtualCluster.Builder setHeaders(int index, HeaderMatcher.Builder builderForValue)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • addHeaders

      public VirtualCluster.Builder addHeaders(HeaderMatcher value)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • addHeaders

      public VirtualCluster.Builder addHeaders(int index, HeaderMatcher value)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • addHeaders

      public VirtualCluster.Builder addHeaders(HeaderMatcher.Builder builderForValue)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • addHeaders

      public VirtualCluster.Builder addHeaders(int index, HeaderMatcher.Builder builderForValue)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • addAllHeaders

      public VirtualCluster.Builder addAllHeaders(Iterable<? extends HeaderMatcher> values)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • clearHeaders

      public VirtualCluster.Builder clearHeaders()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • removeHeaders

      public VirtualCluster.Builder removeHeaders(int index)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • getHeadersBuilder

      public HeaderMatcher.Builder getHeadersBuilder(int index)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • getHeadersOrBuilder

      public HeaderMatcherOrBuilder getHeadersOrBuilder(int index)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
      Specified by:
      getHeadersOrBuilder in interface VirtualClusterOrBuilder
    • getHeadersOrBuilderList

      public List<? extends HeaderMatcherOrBuilder> getHeadersOrBuilderList()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
      Specified by:
      getHeadersOrBuilderList in interface VirtualClusterOrBuilder
    • addHeadersBuilder

      public HeaderMatcher.Builder addHeadersBuilder()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • addHeadersBuilder

      public HeaderMatcher.Builder addHeadersBuilder(int index)
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • getHeadersBuilderList

      public List<HeaderMatcher.Builder> getHeadersBuilderList()
       Specifies a list of header matchers to use for matching requests. Each specified header must
       match. The pseudo-headers `:path` and `:method` can be used to match the request path and
       method, respectively.
       
      repeated .envoy.api.v2.route.HeaderMatcher headers = 4;
    • getName

      public String getName()
       Specifies the name of the virtual cluster. The virtual cluster name as well
       as the virtual host name are used when emitting statistics. The statistics are emitted by the
       router filter and are documented :ref:`here <config_http_filters_router_stats>`.
       
      string name = 2 [(.validate.rules) = { ... }
      Specified by:
      getName in interface VirtualClusterOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Specifies the name of the virtual cluster. The virtual cluster name as well
       as the virtual host name are used when emitting statistics. The statistics are emitted by the
       router filter and are documented :ref:`here <config_http_filters_router_stats>`.
       
      string name = 2 [(.validate.rules) = { ... }
      Specified by:
      getNameBytes in interface VirtualClusterOrBuilder
      Returns:
      The bytes for name.
    • setName

      public VirtualCluster.Builder setName(String value)
       Specifies the name of the virtual cluster. The virtual cluster name as well
       as the virtual host name are used when emitting statistics. The statistics are emitted by the
       router filter and are documented :ref:`here <config_http_filters_router_stats>`.
       
      string name = 2 [(.validate.rules) = { ... }
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public VirtualCluster.Builder clearName()
       Specifies the name of the virtual cluster. The virtual cluster name as well
       as the virtual host name are used when emitting statistics. The statistics are emitted by the
       router filter and are documented :ref:`here <config_http_filters_router_stats>`.
       
      string name = 2 [(.validate.rules) = { ... }
      Returns:
      This builder for chaining.
    • setNameBytes

      public VirtualCluster.Builder setNameBytes(com.google.protobuf.ByteString value)
       Specifies the name of the virtual cluster. The virtual cluster name as well
       as the virtual host name are used when emitting statistics. The statistics are emitted by the
       router filter and are documented :ref:`here <config_http_filters_router_stats>`.
       
      string name = 2 [(.validate.rules) = { ... }
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getMethodValue

      @Deprecated public int getMethodValue()
      Deprecated.
      envoy.api.v2.route.VirtualCluster.method is deprecated. See envoy/api/v2/route/route_components.proto;l=1350
       Optionally specifies the HTTP method to match on. For example GET, PUT,
       etc.
      
       .. attention::
         This field has been deprecated in favor of `headers`.
       
      .envoy.api.v2.core.RequestMethod method = 3 [deprecated = true, (.envoy.annotations.disallowed_by_default) = true];
      Specified by:
      getMethodValue in interface VirtualClusterOrBuilder
      Returns:
      The enum numeric value on the wire for method.
    • setMethodValue

      @Deprecated public VirtualCluster.Builder setMethodValue(int value)
      Deprecated.
      envoy.api.v2.route.VirtualCluster.method is deprecated. See envoy/api/v2/route/route_components.proto;l=1350
       Optionally specifies the HTTP method to match on. For example GET, PUT,
       etc.
      
       .. attention::
         This field has been deprecated in favor of `headers`.
       
      .envoy.api.v2.core.RequestMethod method = 3 [deprecated = true, (.envoy.annotations.disallowed_by_default) = true];
      Parameters:
      value - The enum numeric value on the wire for method to set.
      Returns:
      This builder for chaining.
    • getMethod

      @Deprecated public RequestMethod getMethod()
      Deprecated.
      envoy.api.v2.route.VirtualCluster.method is deprecated. See envoy/api/v2/route/route_components.proto;l=1350
       Optionally specifies the HTTP method to match on. For example GET, PUT,
       etc.
      
       .. attention::
         This field has been deprecated in favor of `headers`.
       
      .envoy.api.v2.core.RequestMethod method = 3 [deprecated = true, (.envoy.annotations.disallowed_by_default) = true];
      Specified by:
      getMethod in interface VirtualClusterOrBuilder
      Returns:
      The method.
    • setMethod

      Deprecated.
      envoy.api.v2.route.VirtualCluster.method is deprecated. See envoy/api/v2/route/route_components.proto;l=1350
       Optionally specifies the HTTP method to match on. For example GET, PUT,
       etc.
      
       .. attention::
         This field has been deprecated in favor of `headers`.
       
      .envoy.api.v2.core.RequestMethod method = 3 [deprecated = true, (.envoy.annotations.disallowed_by_default) = true];
      Parameters:
      value - The method to set.
      Returns:
      This builder for chaining.
    • clearMethod

      @Deprecated public VirtualCluster.Builder clearMethod()
      Deprecated.
      envoy.api.v2.route.VirtualCluster.method is deprecated. See envoy/api/v2/route/route_components.proto;l=1350
       Optionally specifies the HTTP method to match on. For example GET, PUT,
       etc.
      
       .. attention::
         This field has been deprecated in favor of `headers`.
       
      .envoy.api.v2.core.RequestMethod method = 3 [deprecated = true, (.envoy.annotations.disallowed_by_default) = true];
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final VirtualCluster.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<VirtualCluster.Builder>
    • mergeUnknownFields

      public final VirtualCluster.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<VirtualCluster.Builder>