public static class UnaryCallSettings.Builder<RequestT,ResponseT>
extends java.lang.Object
UnaryCallSettings
. This class should not be used to create an
instance of the base class UnaryCallSettings. See the class documentation of UnaryCallSettings
for a description of the different values that can be set, and for a
description of when this builder may be used. Builders for concrete derived classes can be used
to create instances of those classes.Modifier | Constructor and Description |
---|---|
protected |
Builder() |
protected |
Builder(UnaryCallSettings<RequestT,ResponseT> unaryCallSettings) |
Modifier and Type | Method and Description |
---|---|
UnaryCallSettings<RequestT,ResponseT> |
build()
Builds an instance of the containing class.
|
java.util.Set<StatusCode.Code> |
getRetryableCodes()
See the class documentation of
UnaryCallSettings for a description of what retryable
codes do. |
RetrySettings |
getRetrySettings()
Returns an immutable
RetrySettings currently set in this Builder. |
RetrySettings.Builder |
retrySettings()
Returns the underlying
RetrySettings.Builder , which allows callers to augment the
existing RetrySettings . |
UnaryCallSettings.Builder<RequestT,ResponseT> |
setRetryableCodes(java.util.Set<StatusCode.Code> retryableCodes)
See the class documentation of
UnaryCallSettings for a description of what retryable
codes do. |
UnaryCallSettings.Builder<RequestT,ResponseT> |
setRetryableCodes(StatusCode.Code... codes)
See the class documentation of
UnaryCallSettings for a description of what retryable
codes do. |
UnaryCallSettings.Builder<RequestT,ResponseT> |
setRetrySettings(RetrySettings retrySettings)
Replaces the
RetrySettings for the associated UnaryCallable . |
UnaryCallSettings.Builder<RequestT,ResponseT> |
setSimpleTimeoutNoRetries(org.threeten.bp.Duration timeout)
Disables retries and sets the RPC timeout.
|
protected Builder()
protected Builder(UnaryCallSettings<RequestT,ResponseT> unaryCallSettings)
public UnaryCallSettings.Builder<RequestT,ResponseT> setRetryableCodes(java.util.Set<StatusCode.Code> retryableCodes)
UnaryCallSettings
for a description of what retryable
codes do.public UnaryCallSettings.Builder<RequestT,ResponseT> setRetryableCodes(StatusCode.Code... codes)
UnaryCallSettings
for a description of what retryable
codes do.public RetrySettings.Builder retrySettings()
RetrySettings.Builder
, which allows callers to augment the
existing RetrySettings
.public UnaryCallSettings.Builder<RequestT,ResponseT> setRetrySettings(RetrySettings retrySettings)
RetrySettings
for the associated UnaryCallable
.
When using the method, make sure that the RetrySettings
are complete. For example,
the following code will disable retries because the retry delay is not set:
stubSettings.setRetrySettings(
RetrySettings.newBuilder()
.setTotalTimeout(Duration.ofSeconds(10)
);
retrySettings()
public UnaryCallSettings.Builder<RequestT,ResponseT> setSimpleTimeoutNoRetries(org.threeten.bp.Duration timeout)
public java.util.Set<StatusCode.Code> getRetryableCodes()
UnaryCallSettings
for a description of what retryable
codes do.public RetrySettings getRetrySettings()
RetrySettings
currently set in this Builder.
Unlike retrySettings()
, objects returned by this method are frozen in time.
public UnaryCallSettings<RequestT,ResponseT> build()