Class ResourceLocator.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<ResourceLocator.Builder>
com.google.protobuf.GeneratedMessage.Builder<ResourceLocator.Builder>
com.github.xds.core.v3.ResourceLocator.Builder
All Implemented Interfaces:
ResourceLocatorOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
ResourceLocator

public static final class ResourceLocator.Builder extends com.google.protobuf.GeneratedMessage.Builder<ResourceLocator.Builder> implements ResourceLocatorOrBuilder
 xDS resource locators identify a xDS resource name and instruct the
 data-plane load balancer on how the resource may be located.

 Resource locators have a canonical xdstp:// URI representation:

 xdstp://{authority}/{type_url}/{id}?{context_params}{#directive,*}

 where context_params take the form of URI query parameters.

 Resource locators have a similar canonical http:// URI representation:

 http://{authority}/{type_url}/{id}?{context_params}{#directive,*}

 Resource locators also have a simplified file:// URI representation:

 file:///{id}{#directive,*}
 
Protobuf type xds.core.v3.ResourceLocator
  • Field Details

  • Constructor Details

    • Builder

      private Builder()
    • Builder

      private Builder(com.google.protobuf.AbstractMessage.BuilderParent parent)
  • Method Details

    • getDescriptor

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

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

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

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

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

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

      private void buildPartialRepeatedFields(ResourceLocator result)
    • buildPartial0

      private void buildPartial0(ResourceLocator result)
    • buildPartialOneofs

      private void buildPartialOneofs(ResourceLocator result)
    • mergeFrom

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

      public ResourceLocator.Builder mergeFrom(ResourceLocator other)
    • isInitialized

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

      public ResourceLocator.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<ResourceLocator.Builder>
      Throws:
      IOException
    • getContextParamSpecifierCase

      public ResourceLocator.ContextParamSpecifierCase getContextParamSpecifierCase()
      Specified by:
      getContextParamSpecifierCase in interface ResourceLocatorOrBuilder
    • clearContextParamSpecifier

      public ResourceLocator.Builder clearContextParamSpecifier()
    • getSchemeValue

      public int getSchemeValue()
       URI scheme.
       
      .xds.core.v3.ResourceLocator.Scheme scheme = 1 [(.validate.rules) = { ... }
      Specified by:
      getSchemeValue in interface ResourceLocatorOrBuilder
      Returns:
      The enum numeric value on the wire for scheme.
    • setSchemeValue

      public ResourceLocator.Builder setSchemeValue(int value)
       URI scheme.
       
      .xds.core.v3.ResourceLocator.Scheme scheme = 1 [(.validate.rules) = { ... }
      Parameters:
      value - The enum numeric value on the wire for scheme to set.
      Returns:
      This builder for chaining.
    • getScheme

      public ResourceLocator.Scheme getScheme()
       URI scheme.
       
      .xds.core.v3.ResourceLocator.Scheme scheme = 1 [(.validate.rules) = { ... }
      Specified by:
      getScheme in interface ResourceLocatorOrBuilder
      Returns:
      The scheme.
    • setScheme

       URI scheme.
       
      .xds.core.v3.ResourceLocator.Scheme scheme = 1 [(.validate.rules) = { ... }
      Parameters:
      value - The scheme to set.
      Returns:
      This builder for chaining.
    • clearScheme

      public ResourceLocator.Builder clearScheme()
       URI scheme.
       
      .xds.core.v3.ResourceLocator.Scheme scheme = 1 [(.validate.rules) = { ... }
      Returns:
      This builder for chaining.
    • getId

      public String getId()
       Opaque identifier for the resource. Any '/' will not be escaped during URI
       encoding and will form part of the URI path. This may end
       with ‘*’ for glob collection references.
       
      string id = 2;
      Specified by:
      getId in interface ResourceLocatorOrBuilder
      Returns:
      The id.
    • getIdBytes

      public com.google.protobuf.ByteString getIdBytes()
       Opaque identifier for the resource. Any '/' will not be escaped during URI
       encoding and will form part of the URI path. This may end
       with ‘*’ for glob collection references.
       
      string id = 2;
      Specified by:
      getIdBytes in interface ResourceLocatorOrBuilder
      Returns:
      The bytes for id.
    • setId

      public ResourceLocator.Builder setId(String value)
       Opaque identifier for the resource. Any '/' will not be escaped during URI
       encoding and will form part of the URI path. This may end
       with ‘*’ for glob collection references.
       
      string id = 2;
      Parameters:
      value - The id to set.
      Returns:
      This builder for chaining.
    • clearId

      public ResourceLocator.Builder clearId()
       Opaque identifier for the resource. Any '/' will not be escaped during URI
       encoding and will form part of the URI path. This may end
       with ‘*’ for glob collection references.
       
      string id = 2;
      Returns:
      This builder for chaining.
    • setIdBytes

      public ResourceLocator.Builder setIdBytes(com.google.protobuf.ByteString value)
       Opaque identifier for the resource. Any '/' will not be escaped during URI
       encoding and will form part of the URI path. This may end
       with ‘*’ for glob collection references.
       
      string id = 2;
      Parameters:
      value - The bytes for id to set.
      Returns:
      This builder for chaining.
    • getAuthority

      public String getAuthority()
       Logical authority for resource (not necessarily transport network address).
       Authorities are opaque in the xDS API, data-plane load balancers will map
       them to concrete network transports such as an xDS management server, e.g.
       via envoy.config.core.v3.ConfigSource.
       
      string authority = 3;
      Specified by:
      getAuthority in interface ResourceLocatorOrBuilder
      Returns:
      The authority.
    • getAuthorityBytes

      public com.google.protobuf.ByteString getAuthorityBytes()
       Logical authority for resource (not necessarily transport network address).
       Authorities are opaque in the xDS API, data-plane load balancers will map
       them to concrete network transports such as an xDS management server, e.g.
       via envoy.config.core.v3.ConfigSource.
       
      string authority = 3;
      Specified by:
      getAuthorityBytes in interface ResourceLocatorOrBuilder
      Returns:
      The bytes for authority.
    • setAuthority

      public ResourceLocator.Builder setAuthority(String value)
       Logical authority for resource (not necessarily transport network address).
       Authorities are opaque in the xDS API, data-plane load balancers will map
       them to concrete network transports such as an xDS management server, e.g.
       via envoy.config.core.v3.ConfigSource.
       
      string authority = 3;
      Parameters:
      value - The authority to set.
      Returns:
      This builder for chaining.
    • clearAuthority

      public ResourceLocator.Builder clearAuthority()
       Logical authority for resource (not necessarily transport network address).
       Authorities are opaque in the xDS API, data-plane load balancers will map
       them to concrete network transports such as an xDS management server, e.g.
       via envoy.config.core.v3.ConfigSource.
       
      string authority = 3;
      Returns:
      This builder for chaining.
    • setAuthorityBytes

      public ResourceLocator.Builder setAuthorityBytes(com.google.protobuf.ByteString value)
       Logical authority for resource (not necessarily transport network address).
       Authorities are opaque in the xDS API, data-plane load balancers will map
       them to concrete network transports such as an xDS management server, e.g.
       via envoy.config.core.v3.ConfigSource.
       
      string authority = 3;
      Parameters:
      value - The bytes for authority to set.
      Returns:
      This builder for chaining.
    • getResourceType

      public String getResourceType()
       Fully qualified resource type (as in type URL without types.googleapis.com/
       prefix).
       
      string resource_type = 4 [(.validate.rules) = { ... }
      Specified by:
      getResourceType in interface ResourceLocatorOrBuilder
      Returns:
      The resourceType.
    • getResourceTypeBytes

      public com.google.protobuf.ByteString getResourceTypeBytes()
       Fully qualified resource type (as in type URL without types.googleapis.com/
       prefix).
       
      string resource_type = 4 [(.validate.rules) = { ... }
      Specified by:
      getResourceTypeBytes in interface ResourceLocatorOrBuilder
      Returns:
      The bytes for resourceType.
    • setResourceType

      public ResourceLocator.Builder setResourceType(String value)
       Fully qualified resource type (as in type URL without types.googleapis.com/
       prefix).
       
      string resource_type = 4 [(.validate.rules) = { ... }
      Parameters:
      value - The resourceType to set.
      Returns:
      This builder for chaining.
    • clearResourceType

      public ResourceLocator.Builder clearResourceType()
       Fully qualified resource type (as in type URL without types.googleapis.com/
       prefix).
       
      string resource_type = 4 [(.validate.rules) = { ... }
      Returns:
      This builder for chaining.
    • setResourceTypeBytes

      public ResourceLocator.Builder setResourceTypeBytes(com.google.protobuf.ByteString value)
       Fully qualified resource type (as in type URL without types.googleapis.com/
       prefix).
       
      string resource_type = 4 [(.validate.rules) = { ... }
      Parameters:
      value - The bytes for resourceType to set.
      Returns:
      This builder for chaining.
    • hasExactContext

      public boolean hasExactContext()
       Additional parameters that can be used to select resource variants.
       Matches must be exact, i.e. all context parameters must match exactly and
       there must be no additional context parameters set on the matched
       resource.
       
      .xds.core.v3.ContextParams exact_context = 5;
      Specified by:
      hasExactContext in interface ResourceLocatorOrBuilder
      Returns:
      Whether the exactContext field is set.
    • getExactContext

      public ContextParams getExactContext()
       Additional parameters that can be used to select resource variants.
       Matches must be exact, i.e. all context parameters must match exactly and
       there must be no additional context parameters set on the matched
       resource.
       
      .xds.core.v3.ContextParams exact_context = 5;
      Specified by:
      getExactContext in interface ResourceLocatorOrBuilder
      Returns:
      The exactContext.
    • setExactContext

      public ResourceLocator.Builder setExactContext(ContextParams value)
       Additional parameters that can be used to select resource variants.
       Matches must be exact, i.e. all context parameters must match exactly and
       there must be no additional context parameters set on the matched
       resource.
       
      .xds.core.v3.ContextParams exact_context = 5;
    • setExactContext

      public ResourceLocator.Builder setExactContext(ContextParams.Builder builderForValue)
       Additional parameters that can be used to select resource variants.
       Matches must be exact, i.e. all context parameters must match exactly and
       there must be no additional context parameters set on the matched
       resource.
       
      .xds.core.v3.ContextParams exact_context = 5;
    • mergeExactContext

      public ResourceLocator.Builder mergeExactContext(ContextParams value)
       Additional parameters that can be used to select resource variants.
       Matches must be exact, i.e. all context parameters must match exactly and
       there must be no additional context parameters set on the matched
       resource.
       
      .xds.core.v3.ContextParams exact_context = 5;
    • clearExactContext

      public ResourceLocator.Builder clearExactContext()
       Additional parameters that can be used to select resource variants.
       Matches must be exact, i.e. all context parameters must match exactly and
       there must be no additional context parameters set on the matched
       resource.
       
      .xds.core.v3.ContextParams exact_context = 5;
    • getExactContextBuilder

      public ContextParams.Builder getExactContextBuilder()
       Additional parameters that can be used to select resource variants.
       Matches must be exact, i.e. all context parameters must match exactly and
       there must be no additional context parameters set on the matched
       resource.
       
      .xds.core.v3.ContextParams exact_context = 5;
    • getExactContextOrBuilder

      public ContextParamsOrBuilder getExactContextOrBuilder()
       Additional parameters that can be used to select resource variants.
       Matches must be exact, i.e. all context parameters must match exactly and
       there must be no additional context parameters set on the matched
       resource.
       
      .xds.core.v3.ContextParams exact_context = 5;
      Specified by:
      getExactContextOrBuilder in interface ResourceLocatorOrBuilder
    • internalGetExactContextFieldBuilder

      private com.google.protobuf.SingleFieldBuilder<ContextParams,ContextParams.Builder,ContextParamsOrBuilder> internalGetExactContextFieldBuilder()
       Additional parameters that can be used to select resource variants.
       Matches must be exact, i.e. all context parameters must match exactly and
       there must be no additional context parameters set on the matched
       resource.
       
      .xds.core.v3.ContextParams exact_context = 5;
    • ensureDirectivesIsMutable

      private void ensureDirectivesIsMutable()
    • getDirectivesList

      public List<ResourceLocator.Directive> getDirectivesList()
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
      Specified by:
      getDirectivesList in interface ResourceLocatorOrBuilder
    • getDirectivesCount

      public int getDirectivesCount()
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
      Specified by:
      getDirectivesCount in interface ResourceLocatorOrBuilder
    • getDirectives

      public ResourceLocator.Directive getDirectives(int index)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
      Specified by:
      getDirectives in interface ResourceLocatorOrBuilder
    • setDirectives

      public ResourceLocator.Builder setDirectives(int index, ResourceLocator.Directive value)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • setDirectives

      public ResourceLocator.Builder setDirectives(int index, ResourceLocator.Directive.Builder builderForValue)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • addDirectives

      public ResourceLocator.Builder addDirectives(ResourceLocator.Directive value)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • addDirectives

      public ResourceLocator.Builder addDirectives(int index, ResourceLocator.Directive value)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • addDirectives

      public ResourceLocator.Builder addDirectives(ResourceLocator.Directive.Builder builderForValue)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • addDirectives

      public ResourceLocator.Builder addDirectives(int index, ResourceLocator.Directive.Builder builderForValue)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • addAllDirectives

      public ResourceLocator.Builder addAllDirectives(Iterable<? extends ResourceLocator.Directive> values)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • clearDirectives

      public ResourceLocator.Builder clearDirectives()
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • removeDirectives

      public ResourceLocator.Builder removeDirectives(int index)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • getDirectivesBuilder

      public ResourceLocator.Directive.Builder getDirectivesBuilder(int index)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • getDirectivesOrBuilder

      public ResourceLocator.DirectiveOrBuilder getDirectivesOrBuilder(int index)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
      Specified by:
      getDirectivesOrBuilder in interface ResourceLocatorOrBuilder
    • getDirectivesOrBuilderList

      public List<? extends ResourceLocator.DirectiveOrBuilder> getDirectivesOrBuilderList()
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
      Specified by:
      getDirectivesOrBuilderList in interface ResourceLocatorOrBuilder
    • addDirectivesBuilder

      public ResourceLocator.Directive.Builder addDirectivesBuilder()
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • addDirectivesBuilder

      public ResourceLocator.Directive.Builder addDirectivesBuilder(int index)
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • getDirectivesBuilderList

      public List<ResourceLocator.Directive.Builder> getDirectivesBuilderList()
       A list of directives that appear in the xDS resource locator #fragment.
      
       When encoding to URI form, directives are percent encoded with comma
       separation.
       
      repeated .xds.core.v3.ResourceLocator.Directive directives = 6;
    • internalGetDirectivesFieldBuilder

      private com.google.protobuf.RepeatedFieldBuilder<ResourceLocator.Directive,ResourceLocator.Directive.Builder,ResourceLocator.DirectiveOrBuilder> internalGetDirectivesFieldBuilder()