Class WeightedBackendService.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<WeightedBackendService.Builder>
com.google.cloud.compute.v1.WeightedBackendService.Builder
All Implemented Interfaces:
WeightedBackendServiceOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
WeightedBackendService

public static final class WeightedBackendService.Builder extends com.google.protobuf.GeneratedMessage.Builder<WeightedBackendService.Builder> implements WeightedBackendServiceOrBuilder
 In contrast to a single BackendService in
 HttpRouteAction to which all matching traffic is directed to,WeightedBackendService allows traffic to be split across
 multiple backend services. The volume of traffic for each
 backend service is proportional to the weight specified
 in each WeightedBackendService
 
Protobuf type google.cloud.compute.v1.WeightedBackendService
  • 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<WeightedBackendService.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<WeightedBackendService.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<WeightedBackendService.Builder>
    • getDefaultInstanceForType

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

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

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

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

    • isInitialized

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

      public WeightedBackendService.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<WeightedBackendService.Builder>
      Throws:
      IOException
    • hasBackendService

      public boolean hasBackendService()
       The full or partial URL to the default BackendService
       resource. Before
       forwarding the request to backendService, the load balancer
       applies any relevant headerActions specified as part of thisbackendServiceWeight.
       
      optional string backend_service = 306946058;
      Specified by:
      hasBackendService in interface WeightedBackendServiceOrBuilder
      Returns:
      Whether the backendService field is set.
    • getBackendService

      public String getBackendService()
       The full or partial URL to the default BackendService
       resource. Before
       forwarding the request to backendService, the load balancer
       applies any relevant headerActions specified as part of thisbackendServiceWeight.
       
      optional string backend_service = 306946058;
      Specified by:
      getBackendService in interface WeightedBackendServiceOrBuilder
      Returns:
      The backendService.
    • getBackendServiceBytes

      public com.google.protobuf.ByteString getBackendServiceBytes()
       The full or partial URL to the default BackendService
       resource. Before
       forwarding the request to backendService, the load balancer
       applies any relevant headerActions specified as part of thisbackendServiceWeight.
       
      optional string backend_service = 306946058;
      Specified by:
      getBackendServiceBytes in interface WeightedBackendServiceOrBuilder
      Returns:
      The bytes for backendService.
    • setBackendService

      public WeightedBackendService.Builder setBackendService(String value)
       The full or partial URL to the default BackendService
       resource. Before
       forwarding the request to backendService, the load balancer
       applies any relevant headerActions specified as part of thisbackendServiceWeight.
       
      optional string backend_service = 306946058;
      Parameters:
      value - The backendService to set.
      Returns:
      This builder for chaining.
    • clearBackendService

      public WeightedBackendService.Builder clearBackendService()
       The full or partial URL to the default BackendService
       resource. Before
       forwarding the request to backendService, the load balancer
       applies any relevant headerActions specified as part of thisbackendServiceWeight.
       
      optional string backend_service = 306946058;
      Returns:
      This builder for chaining.
    • setBackendServiceBytes

      public WeightedBackendService.Builder setBackendServiceBytes(com.google.protobuf.ByteString value)
       The full or partial URL to the default BackendService
       resource. Before
       forwarding the request to backendService, the load balancer
       applies any relevant headerActions specified as part of thisbackendServiceWeight.
       
      optional string backend_service = 306946058;
      Parameters:
      value - The bytes for backendService to set.
      Returns:
      This builder for chaining.
    • hasHeaderAction

      public boolean hasHeaderAction()
       Specifies changes to request and response headers that need to take
       effect for the selected backendService.
      
       headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap.
      
       headerAction is not supported for load balancers that have
       their loadBalancingScheme set to EXTERNAL.
      
       Not supported when the URL map is bound to a target gRPC proxy that
       has validateForProxyless field set to true.
       
      optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;
      Specified by:
      hasHeaderAction in interface WeightedBackendServiceOrBuilder
      Returns:
      Whether the headerAction field is set.
    • getHeaderAction

      public HttpHeaderAction getHeaderAction()
       Specifies changes to request and response headers that need to take
       effect for the selected backendService.
      
       headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap.
      
       headerAction is not supported for load balancers that have
       their loadBalancingScheme set to EXTERNAL.
      
       Not supported when the URL map is bound to a target gRPC proxy that
       has validateForProxyless field set to true.
       
      optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;
      Specified by:
      getHeaderAction in interface WeightedBackendServiceOrBuilder
      Returns:
      The headerAction.
    • setHeaderAction

      public WeightedBackendService.Builder setHeaderAction(HttpHeaderAction value)
       Specifies changes to request and response headers that need to take
       effect for the selected backendService.
      
       headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap.
      
       headerAction is not supported for load balancers that have
       their loadBalancingScheme set to EXTERNAL.
      
       Not supported when the URL map is bound to a target gRPC proxy that
       has validateForProxyless field set to true.
       
      optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;
    • setHeaderAction

      public WeightedBackendService.Builder setHeaderAction(HttpHeaderAction.Builder builderForValue)
       Specifies changes to request and response headers that need to take
       effect for the selected backendService.
      
       headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap.
      
       headerAction is not supported for load balancers that have
       their loadBalancingScheme set to EXTERNAL.
      
       Not supported when the URL map is bound to a target gRPC proxy that
       has validateForProxyless field set to true.
       
      optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;
    • mergeHeaderAction

      public WeightedBackendService.Builder mergeHeaderAction(HttpHeaderAction value)
       Specifies changes to request and response headers that need to take
       effect for the selected backendService.
      
       headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap.
      
       headerAction is not supported for load balancers that have
       their loadBalancingScheme set to EXTERNAL.
      
       Not supported when the URL map is bound to a target gRPC proxy that
       has validateForProxyless field set to true.
       
      optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;
    • clearHeaderAction

      public WeightedBackendService.Builder clearHeaderAction()
       Specifies changes to request and response headers that need to take
       effect for the selected backendService.
      
       headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap.
      
       headerAction is not supported for load balancers that have
       their loadBalancingScheme set to EXTERNAL.
      
       Not supported when the URL map is bound to a target gRPC proxy that
       has validateForProxyless field set to true.
       
      optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;
    • getHeaderActionBuilder

      public HttpHeaderAction.Builder getHeaderActionBuilder()
       Specifies changes to request and response headers that need to take
       effect for the selected backendService.
      
       headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap.
      
       headerAction is not supported for load balancers that have
       their loadBalancingScheme set to EXTERNAL.
      
       Not supported when the URL map is bound to a target gRPC proxy that
       has validateForProxyless field set to true.
       
      optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;
    • getHeaderActionOrBuilder

      public HttpHeaderActionOrBuilder getHeaderActionOrBuilder()
       Specifies changes to request and response headers that need to take
       effect for the selected backendService.
      
       headerAction specified here take effect beforeheaderAction in the enclosing HttpRouteRule,PathMatcher and UrlMap.
      
       headerAction is not supported for load balancers that have
       their loadBalancingScheme set to EXTERNAL.
      
       Not supported when the URL map is bound to a target gRPC proxy that
       has validateForProxyless field set to true.
       
      optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352;
      Specified by:
      getHeaderActionOrBuilder in interface WeightedBackendServiceOrBuilder
    • hasWeight

      public boolean hasWeight()
       Specifies the fraction of traffic sent to a backend service,
       computed asweight / (sum of all weightedBackendService weights in routeAction).
      
       The selection of a backend service is determined only for new traffic.
       Once a user's request has been directed to a backend service,
       subsequent requests are sent to the same backend service as
       determined by the backend service's session affinity policy.
       Don't configure session affinity if you're using weighted traffic
       splitting. If you do, the weighted traffic splitting configuration takes
       precedence.
      
       The value must be from 0 to 1000.
       
      optional uint32 weight = 282149496;
      Specified by:
      hasWeight in interface WeightedBackendServiceOrBuilder
      Returns:
      Whether the weight field is set.
    • getWeight

      public int getWeight()
       Specifies the fraction of traffic sent to a backend service,
       computed asweight / (sum of all weightedBackendService weights in routeAction).
      
       The selection of a backend service is determined only for new traffic.
       Once a user's request has been directed to a backend service,
       subsequent requests are sent to the same backend service as
       determined by the backend service's session affinity policy.
       Don't configure session affinity if you're using weighted traffic
       splitting. If you do, the weighted traffic splitting configuration takes
       precedence.
      
       The value must be from 0 to 1000.
       
      optional uint32 weight = 282149496;
      Specified by:
      getWeight in interface WeightedBackendServiceOrBuilder
      Returns:
      The weight.
    • setWeight

      public WeightedBackendService.Builder setWeight(int value)
       Specifies the fraction of traffic sent to a backend service,
       computed asweight / (sum of all weightedBackendService weights in routeAction).
      
       The selection of a backend service is determined only for new traffic.
       Once a user's request has been directed to a backend service,
       subsequent requests are sent to the same backend service as
       determined by the backend service's session affinity policy.
       Don't configure session affinity if you're using weighted traffic
       splitting. If you do, the weighted traffic splitting configuration takes
       precedence.
      
       The value must be from 0 to 1000.
       
      optional uint32 weight = 282149496;
      Parameters:
      value - The weight to set.
      Returns:
      This builder for chaining.
    • clearWeight

      public WeightedBackendService.Builder clearWeight()
       Specifies the fraction of traffic sent to a backend service,
       computed asweight / (sum of all weightedBackendService weights in routeAction).
      
       The selection of a backend service is determined only for new traffic.
       Once a user's request has been directed to a backend service,
       subsequent requests are sent to the same backend service as
       determined by the backend service's session affinity policy.
       Don't configure session affinity if you're using weighted traffic
       splitting. If you do, the weighted traffic splitting configuration takes
       precedence.
      
       The value must be from 0 to 1000.
       
      optional uint32 weight = 282149496;
      Returns:
      This builder for chaining.