Package com.google.api.gax.rpc
Class UnaryCallSettings.Builder<RequestT,ResponseT>
- java.lang.Object
-
- com.google.api.gax.rpc.UnaryCallSettings.Builder<RequestT,ResponseT>
-
- Direct Known Subclasses:
BatchingCallSettings.Builder,BatchingCallSettings.Builder,PagedCallSettings.Builder
- Enclosing class:
- UnaryCallSettings<RequestT,ResponseT>
public static class UnaryCallSettings.Builder<RequestT,ResponseT> extends java.lang.ObjectA base builder class forUnaryCallSettings. This class should not be used to create an instance of the base class UnaryCallSettings. See the class documentation ofUnaryCallSettingsfor 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.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()protectedBuilder(UnaryCallSettings<RequestT,ResponseT> unaryCallSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnaryCallSettings<RequestT,ResponseT>build()Builds an instance of the containing class.java.util.Set<StatusCode.Code>getRetryableCodes()See the class documentation ofUnaryCallSettingsfor a description of what retryable codes do.RetrySettingsgetRetrySettings()Returns an immutableRetrySettingscurrently set in this Builder.RetrySettings.BuilderretrySettings()Returns the underlyingRetrySettings.Builder, which allows callers to augment the existingRetrySettings.UnaryCallSettings.Builder<RequestT,ResponseT>setRetryableCodes(StatusCode.Code... codes)See the class documentation ofUnaryCallSettingsfor a description of what retryable codes do.UnaryCallSettings.Builder<RequestT,ResponseT>setRetryableCodes(java.util.Set<StatusCode.Code> retryableCodes)See the class documentation ofUnaryCallSettingsfor a description of what retryable codes do.UnaryCallSettings.Builder<RequestT,ResponseT>setRetrySettings(RetrySettings retrySettings)Replaces theRetrySettingsfor the associatedUnaryCallable.UnaryCallSettings.Builder<RequestT,ResponseT>setSimpleTimeoutNoRetries(org.threeten.bp.Duration timeout)Disables retries and sets the RPC timeout.
-
-
-
Constructor Detail
-
Builder
protected Builder()
-
Builder
protected Builder(UnaryCallSettings<RequestT,ResponseT> unaryCallSettings)
-
-
Method Detail
-
setRetryableCodes
public UnaryCallSettings.Builder<RequestT,ResponseT> setRetryableCodes(java.util.Set<StatusCode.Code> retryableCodes)
See the class documentation ofUnaryCallSettingsfor a description of what retryable codes do.
-
setRetryableCodes
public UnaryCallSettings.Builder<RequestT,ResponseT> setRetryableCodes(StatusCode.Code... codes)
See the class documentation ofUnaryCallSettingsfor a description of what retryable codes do.
-
retrySettings
public RetrySettings.Builder retrySettings()
Returns the underlyingRetrySettings.Builder, which allows callers to augment the existingRetrySettings.
-
setRetrySettings
public UnaryCallSettings.Builder<RequestT,ResponseT> setRetrySettings(RetrySettings retrySettings)
Replaces theRetrySettingsfor the associatedUnaryCallable.When using the method, make sure that the
RetrySettingsare complete. For example, the following code will disable retries because the retry delay is not set:stubSettings.setRetrySettings( RetrySettings.newBuilder() .setTotalTimeout(Duration.ofSeconds(10) );- See Also:
retrySettings()
-
setSimpleTimeoutNoRetries
public UnaryCallSettings.Builder<RequestT,ResponseT> setSimpleTimeoutNoRetries(org.threeten.bp.Duration timeout)
Disables retries and sets the RPC timeout.
-
getRetryableCodes
public java.util.Set<StatusCode.Code> getRetryableCodes()
See the class documentation ofUnaryCallSettingsfor a description of what retryable codes do.
-
getRetrySettings
public RetrySettings getRetrySettings()
Returns an immutableRetrySettingscurrently set in this Builder.Unlike
retrySettings(), objects returned by this method are frozen in time.
-
build
public UnaryCallSettings<RequestT,ResponseT> build()
Builds an instance of the containing class. This operation is unsupported on the abstract base class UnaryCallSettings, but is valid on concrete derived classes.
-
-