Class HttpRoute.RetryPolicy.Builder

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

public static final class HttpRoute.RetryPolicy.Builder extends com.google.protobuf.GeneratedMessage.Builder<HttpRoute.RetryPolicy.Builder> implements HttpRoute.RetryPolicyOrBuilder
 The specifications for retries.
 
Protobuf type google.cloud.networkservices.v1.HttpRoute.RetryPolicy
  • 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<HttpRoute.RetryPolicy.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<HttpRoute.RetryPolicy.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<HttpRoute.RetryPolicy.Builder>
    • getDefaultInstanceForType

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

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

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

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

      public HttpRoute.RetryPolicy.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<HttpRoute.RetryPolicy.Builder>
      Throws:
      IOException
    • getRetryConditionsList

      public com.google.protobuf.ProtocolStringList getRetryConditionsList()
       Specifies one or more conditions when this retry policy applies. Valid
       values are:
       5xx: Proxy will attempt a retry if the destination service responds
       with any 5xx response code, of if the destination service does not
       respond at all, example: disconnect, reset, read timeout, connection
       failure and refused streams.
      
       gateway-error: Similar to 5xx, but only applies to response codes 502,
       503, 504.
      
       reset: Proxy will attempt a retry if the destination service does not
       respond at all (disconnect/reset/read timeout)
      
       connect-failure: Proxy will retry on failures connecting to destination
       for example due to connection timeouts.
      
       retriable-4xx: Proxy will retry fro retriable 4xx response codes.
       Currently the only retriable error supported is 409.
      
       refused-stream: Proxy will retry if the destination resets the stream
       with a REFUSED_STREAM error code. This reset type indicates that it
       is safe to retry.
       
      repeated string retry_conditions = 1;
      Specified by:
      getRetryConditionsList in interface HttpRoute.RetryPolicyOrBuilder
      Returns:
      A list containing the retryConditions.
    • getRetryConditionsCount

      public int getRetryConditionsCount()
       Specifies one or more conditions when this retry policy applies. Valid
       values are:
       5xx: Proxy will attempt a retry if the destination service responds
       with any 5xx response code, of if the destination service does not
       respond at all, example: disconnect, reset, read timeout, connection
       failure and refused streams.
      
       gateway-error: Similar to 5xx, but only applies to response codes 502,
       503, 504.
      
       reset: Proxy will attempt a retry if the destination service does not
       respond at all (disconnect/reset/read timeout)
      
       connect-failure: Proxy will retry on failures connecting to destination
       for example due to connection timeouts.
      
       retriable-4xx: Proxy will retry fro retriable 4xx response codes.
       Currently the only retriable error supported is 409.
      
       refused-stream: Proxy will retry if the destination resets the stream
       with a REFUSED_STREAM error code. This reset type indicates that it
       is safe to retry.
       
      repeated string retry_conditions = 1;
      Specified by:
      getRetryConditionsCount in interface HttpRoute.RetryPolicyOrBuilder
      Returns:
      The count of retryConditions.
    • getRetryConditions

      public String getRetryConditions(int index)
       Specifies one or more conditions when this retry policy applies. Valid
       values are:
       5xx: Proxy will attempt a retry if the destination service responds
       with any 5xx response code, of if the destination service does not
       respond at all, example: disconnect, reset, read timeout, connection
       failure and refused streams.
      
       gateway-error: Similar to 5xx, but only applies to response codes 502,
       503, 504.
      
       reset: Proxy will attempt a retry if the destination service does not
       respond at all (disconnect/reset/read timeout)
      
       connect-failure: Proxy will retry on failures connecting to destination
       for example due to connection timeouts.
      
       retriable-4xx: Proxy will retry fro retriable 4xx response codes.
       Currently the only retriable error supported is 409.
      
       refused-stream: Proxy will retry if the destination resets the stream
       with a REFUSED_STREAM error code. This reset type indicates that it
       is safe to retry.
       
      repeated string retry_conditions = 1;
      Specified by:
      getRetryConditions in interface HttpRoute.RetryPolicyOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The retryConditions at the given index.
    • getRetryConditionsBytes

      public com.google.protobuf.ByteString getRetryConditionsBytes(int index)
       Specifies one or more conditions when this retry policy applies. Valid
       values are:
       5xx: Proxy will attempt a retry if the destination service responds
       with any 5xx response code, of if the destination service does not
       respond at all, example: disconnect, reset, read timeout, connection
       failure and refused streams.
      
       gateway-error: Similar to 5xx, but only applies to response codes 502,
       503, 504.
      
       reset: Proxy will attempt a retry if the destination service does not
       respond at all (disconnect/reset/read timeout)
      
       connect-failure: Proxy will retry on failures connecting to destination
       for example due to connection timeouts.
      
       retriable-4xx: Proxy will retry fro retriable 4xx response codes.
       Currently the only retriable error supported is 409.
      
       refused-stream: Proxy will retry if the destination resets the stream
       with a REFUSED_STREAM error code. This reset type indicates that it
       is safe to retry.
       
      repeated string retry_conditions = 1;
      Specified by:
      getRetryConditionsBytes in interface HttpRoute.RetryPolicyOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the retryConditions at the given index.
    • setRetryConditions

      public HttpRoute.RetryPolicy.Builder setRetryConditions(int index, String value)
       Specifies one or more conditions when this retry policy applies. Valid
       values are:
       5xx: Proxy will attempt a retry if the destination service responds
       with any 5xx response code, of if the destination service does not
       respond at all, example: disconnect, reset, read timeout, connection
       failure and refused streams.
      
       gateway-error: Similar to 5xx, but only applies to response codes 502,
       503, 504.
      
       reset: Proxy will attempt a retry if the destination service does not
       respond at all (disconnect/reset/read timeout)
      
       connect-failure: Proxy will retry on failures connecting to destination
       for example due to connection timeouts.
      
       retriable-4xx: Proxy will retry fro retriable 4xx response codes.
       Currently the only retriable error supported is 409.
      
       refused-stream: Proxy will retry if the destination resets the stream
       with a REFUSED_STREAM error code. This reset type indicates that it
       is safe to retry.
       
      repeated string retry_conditions = 1;
      Parameters:
      index - The index to set the value at.
      value - The retryConditions to set.
      Returns:
      This builder for chaining.
    • addRetryConditions

      public HttpRoute.RetryPolicy.Builder addRetryConditions(String value)
       Specifies one or more conditions when this retry policy applies. Valid
       values are:
       5xx: Proxy will attempt a retry if the destination service responds
       with any 5xx response code, of if the destination service does not
       respond at all, example: disconnect, reset, read timeout, connection
       failure and refused streams.
      
       gateway-error: Similar to 5xx, but only applies to response codes 502,
       503, 504.
      
       reset: Proxy will attempt a retry if the destination service does not
       respond at all (disconnect/reset/read timeout)
      
       connect-failure: Proxy will retry on failures connecting to destination
       for example due to connection timeouts.
      
       retriable-4xx: Proxy will retry fro retriable 4xx response codes.
       Currently the only retriable error supported is 409.
      
       refused-stream: Proxy will retry if the destination resets the stream
       with a REFUSED_STREAM error code. This reset type indicates that it
       is safe to retry.
       
      repeated string retry_conditions = 1;
      Parameters:
      value - The retryConditions to add.
      Returns:
      This builder for chaining.
    • addAllRetryConditions

      public HttpRoute.RetryPolicy.Builder addAllRetryConditions(Iterable<String> values)
       Specifies one or more conditions when this retry policy applies. Valid
       values are:
       5xx: Proxy will attempt a retry if the destination service responds
       with any 5xx response code, of if the destination service does not
       respond at all, example: disconnect, reset, read timeout, connection
       failure and refused streams.
      
       gateway-error: Similar to 5xx, but only applies to response codes 502,
       503, 504.
      
       reset: Proxy will attempt a retry if the destination service does not
       respond at all (disconnect/reset/read timeout)
      
       connect-failure: Proxy will retry on failures connecting to destination
       for example due to connection timeouts.
      
       retriable-4xx: Proxy will retry fro retriable 4xx response codes.
       Currently the only retriable error supported is 409.
      
       refused-stream: Proxy will retry if the destination resets the stream
       with a REFUSED_STREAM error code. This reset type indicates that it
       is safe to retry.
       
      repeated string retry_conditions = 1;
      Parameters:
      values - The retryConditions to add.
      Returns:
      This builder for chaining.
    • clearRetryConditions

      public HttpRoute.RetryPolicy.Builder clearRetryConditions()
       Specifies one or more conditions when this retry policy applies. Valid
       values are:
       5xx: Proxy will attempt a retry if the destination service responds
       with any 5xx response code, of if the destination service does not
       respond at all, example: disconnect, reset, read timeout, connection
       failure and refused streams.
      
       gateway-error: Similar to 5xx, but only applies to response codes 502,
       503, 504.
      
       reset: Proxy will attempt a retry if the destination service does not
       respond at all (disconnect/reset/read timeout)
      
       connect-failure: Proxy will retry on failures connecting to destination
       for example due to connection timeouts.
      
       retriable-4xx: Proxy will retry fro retriable 4xx response codes.
       Currently the only retriable error supported is 409.
      
       refused-stream: Proxy will retry if the destination resets the stream
       with a REFUSED_STREAM error code. This reset type indicates that it
       is safe to retry.
       
      repeated string retry_conditions = 1;
      Returns:
      This builder for chaining.
    • addRetryConditionsBytes

      public HttpRoute.RetryPolicy.Builder addRetryConditionsBytes(com.google.protobuf.ByteString value)
       Specifies one or more conditions when this retry policy applies. Valid
       values are:
       5xx: Proxy will attempt a retry if the destination service responds
       with any 5xx response code, of if the destination service does not
       respond at all, example: disconnect, reset, read timeout, connection
       failure and refused streams.
      
       gateway-error: Similar to 5xx, but only applies to response codes 502,
       503, 504.
      
       reset: Proxy will attempt a retry if the destination service does not
       respond at all (disconnect/reset/read timeout)
      
       connect-failure: Proxy will retry on failures connecting to destination
       for example due to connection timeouts.
      
       retriable-4xx: Proxy will retry fro retriable 4xx response codes.
       Currently the only retriable error supported is 409.
      
       refused-stream: Proxy will retry if the destination resets the stream
       with a REFUSED_STREAM error code. This reset type indicates that it
       is safe to retry.
       
      repeated string retry_conditions = 1;
      Parameters:
      value - The bytes of the retryConditions to add.
      Returns:
      This builder for chaining.
    • getNumRetries

      public int getNumRetries()
       Specifies the allowed number of retries. This number must be > 0. If not
       specified, default to 1.
       
      int32 num_retries = 2;
      Specified by:
      getNumRetries in interface HttpRoute.RetryPolicyOrBuilder
      Returns:
      The numRetries.
    • setNumRetries

      public HttpRoute.RetryPolicy.Builder setNumRetries(int value)
       Specifies the allowed number of retries. This number must be > 0. If not
       specified, default to 1.
       
      int32 num_retries = 2;
      Parameters:
      value - The numRetries to set.
      Returns:
      This builder for chaining.
    • clearNumRetries

      public HttpRoute.RetryPolicy.Builder clearNumRetries()
       Specifies the allowed number of retries. This number must be > 0. If not
       specified, default to 1.
       
      int32 num_retries = 2;
      Returns:
      This builder for chaining.
    • hasPerTryTimeout

      public boolean hasPerTryTimeout()
       Specifies a non-zero timeout per retry attempt.
       
      .google.protobuf.Duration per_try_timeout = 3;
      Specified by:
      hasPerTryTimeout in interface HttpRoute.RetryPolicyOrBuilder
      Returns:
      Whether the perTryTimeout field is set.
    • getPerTryTimeout

      public com.google.protobuf.Duration getPerTryTimeout()
       Specifies a non-zero timeout per retry attempt.
       
      .google.protobuf.Duration per_try_timeout = 3;
      Specified by:
      getPerTryTimeout in interface HttpRoute.RetryPolicyOrBuilder
      Returns:
      The perTryTimeout.
    • setPerTryTimeout

      public HttpRoute.RetryPolicy.Builder setPerTryTimeout(com.google.protobuf.Duration value)
       Specifies a non-zero timeout per retry attempt.
       
      .google.protobuf.Duration per_try_timeout = 3;
    • setPerTryTimeout

      public HttpRoute.RetryPolicy.Builder setPerTryTimeout(com.google.protobuf.Duration.Builder builderForValue)
       Specifies a non-zero timeout per retry attempt.
       
      .google.protobuf.Duration per_try_timeout = 3;
    • mergePerTryTimeout

      public HttpRoute.RetryPolicy.Builder mergePerTryTimeout(com.google.protobuf.Duration value)
       Specifies a non-zero timeout per retry attempt.
       
      .google.protobuf.Duration per_try_timeout = 3;
    • clearPerTryTimeout

      public HttpRoute.RetryPolicy.Builder clearPerTryTimeout()
       Specifies a non-zero timeout per retry attempt.
       
      .google.protobuf.Duration per_try_timeout = 3;
    • getPerTryTimeoutBuilder

      public com.google.protobuf.Duration.Builder getPerTryTimeoutBuilder()
       Specifies a non-zero timeout per retry attempt.
       
      .google.protobuf.Duration per_try_timeout = 3;
    • getPerTryTimeoutOrBuilder

      public com.google.protobuf.DurationOrBuilder getPerTryTimeoutOrBuilder()
       Specifies a non-zero timeout per retry attempt.
       
      .google.protobuf.Duration per_try_timeout = 3;
      Specified by:
      getPerTryTimeoutOrBuilder in interface HttpRoute.RetryPolicyOrBuilder