Class StubSettings.Builder<SettingsT,B> (2.20.1)

Stay organized with collections Save and categorize content based on your preferences.
public abstract static class StubSettings.Builder<SettingsT,B>

Inheritance

java.lang.Object > StubSettings.Builder<SettingsT,B>

Type Parameters

NameDescription
SettingsT
B

Static Methods

applyToAllUnaryMethods(Iterable<UnaryCallSettings.Builder<?,?>> methodSettingsBuilders, ApiFunction<UnaryCallSettings.Builder<?,?>,Void> settingsUpdater)

protected static void applyToAllUnaryMethods(Iterable<UnaryCallSettings.Builder<?,?>> methodSettingsBuilders, ApiFunction<UnaryCallSettings.Builder<?,?>,Void> settingsUpdater)

Applies the given settings updater function to the given method settings builders.

Parameters
NameDescription
methodSettingsBuildersIterable<Builder<?,?>>
settingsUpdatercom.google.api.core.ApiFunction<Builder<?,?>,Void>

Constructors

Builder()

protected Builder()

Builder(ClientContext clientContext)

protected Builder(ClientContext clientContext)
Parameter
NameDescription
clientContextClientContext

Builder(StubSettings settings)

protected Builder(StubSettings settings)

Create a builder from a StubSettings object.

Parameter
NameDescription
settingsStubSettings

Methods

<B>build()

public abstract StubSettings<B> <B>build()
Returns
TypeDescription
StubSettings<B>
Exceptions
TypeDescription
IOException

getBackgroundExecutorProvider()

public ExecutorProvider getBackgroundExecutorProvider()

Gets the ExecutorProvider that was previously set on this Builder.

Returns
TypeDescription
ExecutorProvider

getClock()

public ApiClock getClock()

Gets the ApiClock that was previously set on this Builder.

Returns
TypeDescription
com.google.api.core.ApiClock

getCredentialsProvider()

public CredentialsProvider getCredentialsProvider()

Gets the CredentialsProvider that was previously set on this Builder.

Returns
TypeDescription
CredentialsProvider

getEndpoint()

public String getEndpoint()
Returns
TypeDescription
String

getExecutorProvider() (deprecated)

public ExecutorProvider getExecutorProvider()

Deprecated. Please use #getBackgroundExecutorProvider().

Returns
TypeDescription
ExecutorProvider

getHeaderProvider()

public HeaderProvider getHeaderProvider()

Gets the custom HeaderProvider that was previously set on this Builder.

Returns
TypeDescription
HeaderProvider

getInternalHeaderProvider()

protected HeaderProvider getInternalHeaderProvider()

Gets the internal HeaderProvider that was previously set on this Builder.

Returns
TypeDescription
HeaderProvider

getMtlsEndpoint()

public String getMtlsEndpoint()
Returns
TypeDescription
String

getQuotaProjectId()

public String getQuotaProjectId()

Gets the QuotaProjectId that was previously set on this Builder.

Returns
TypeDescription
String

getStreamWatchdogCheckInterval()

public Duration getStreamWatchdogCheckInterval()
Returns
TypeDescription
org.threeten.bp.Duration

getStreamWatchdogProvider()

public WatchdogProvider getStreamWatchdogProvider()

Gets the WatchdogProviderthat was previously set on this Builder.

Returns
TypeDescription
WatchdogProvider

getTracerFactory()

public ApiTracerFactory getTracerFactory()
Returns
TypeDescription
ApiTracerFactory

getTransportChannelProvider()

public TransportChannelProvider getTransportChannelProvider()

Gets the TransportProvider that was previously set on this Builder.

Returns
TypeDescription
TransportChannelProvider

self()

protected B self()
Returns
TypeDescription
B

setBackgroundExecutorProvider(ExecutorProvider backgroundExecutorProvider)

public B setBackgroundExecutorProvider(ExecutorProvider backgroundExecutorProvider)

Sets the executor to use for running scheduled API call logic (such as retries and long-running operations).

Parameter
NameDescription
backgroundExecutorProviderExecutorProvider
Returns
TypeDescription
B

setClock(ApiClock clock)

public B setClock(ApiClock clock)

Sets the clock to use for retry logic.

This will default to a system clock if it is not set.

Parameter
NameDescription
clockcom.google.api.core.ApiClock
Returns
TypeDescription
B

setCredentialsProvider(CredentialsProvider credentialsProvider)

public B setCredentialsProvider(CredentialsProvider credentialsProvider)

Sets the CredentialsProvider to use for getting the credentials to make calls with.

Parameter
NameDescription
credentialsProviderCredentialsProvider
Returns
TypeDescription
B

setEndpoint(String endpoint)

public B setEndpoint(String endpoint)
Parameter
NameDescription
endpointString
Returns
TypeDescription
B

setExecutorProvider(ExecutorProvider executorProvider) (deprecated)

public B setExecutorProvider(ExecutorProvider executorProvider)

Deprecated. Please use #setBackgroundExecutorProvider(ExecutorProvider) for setting executor to use for running scheduled API call logic. To set executor for TransportChannelProvider, please use TransportChannelProvider#withExecutor(Executor) instead.

Sets the ExecutorProvider to use for getting the executor to use for running asynchronous API call logic (such as retries and long-running operations), and also to pass to the transport settings if an executor is needed for the transport and it doesn't have its own executor provider.

Parameter
NameDescription
executorProviderExecutorProvider
Returns
TypeDescription
B

setHeaderProvider(HeaderProvider headerProvider)

public B setHeaderProvider(HeaderProvider headerProvider)

Sets the HeaderProvider for getting custom static headers for http requests. The header provider will be called during client construction only once. The headers returned by the provider will be cached and supplied as is for each request issued by the constructed client. Some reserved headers can be overridden (e.g. Content-Type) or merged with the default value (e.g. User-Agent) by the underlying transport layer.

Parameter
NameDescription
headerProviderHeaderProvider
Returns
TypeDescription
B

setInternalHeaderProvider(HeaderProvider internalHeaderProvider)

protected B setInternalHeaderProvider(HeaderProvider internalHeaderProvider)

Sets the HeaderProvider for getting internal (library-defined) static headers for http requests. The header provider will be called during client construction only once. The headers returned by the provider will be cached and supplied as is for each request issued by the constructed client. Some reserved headers can be overridden (e.g. Content-Type) or merged with the default value (e.g. User-Agent) by the underlying transport layer.

Parameter
NameDescription
internalHeaderProviderHeaderProvider
Returns
TypeDescription
B

setMtlsEndpoint(String mtlsEndpoint)

public B setMtlsEndpoint(String mtlsEndpoint)
Parameter
NameDescription
mtlsEndpointString
Returns
TypeDescription
B

setQuotaProjectId(String quotaProjectId)

public B setQuotaProjectId(String quotaProjectId)
Parameter
NameDescription
quotaProjectIdString
Returns
TypeDescription
B

setStreamWatchdogCheckInterval(Duration checkInterval)

public B setStreamWatchdogCheckInterval(Duration checkInterval)

Sets how often the Watchdog will check ongoing streaming RPCs. Defaults to 10 secs. Use Duration#ZERO to disable.

Parameter
NameDescription
checkIntervalorg.threeten.bp.Duration
Returns
TypeDescription
B

setStreamWatchdogProvider(WatchdogProvider streamWatchdogProvider)

public B setStreamWatchdogProvider(WatchdogProvider streamWatchdogProvider)

Sets the WatchdogProvider to use for streaming RPC.

This will default to a InstantiatingWatchdogProvider if it is not set.

Parameter
NameDescription
streamWatchdogProviderWatchdogProvider
Returns
TypeDescription
B

setSwitchToMtlsEndpointAllowed(boolean switchToMtlsEndpointAllowed)

protected B setSwitchToMtlsEndpointAllowed(boolean switchToMtlsEndpointAllowed)
Parameter
NameDescription
switchToMtlsEndpointAllowedboolean
Returns
TypeDescription
B

setTracerFactory(ApiTracerFactory tracerFactory)

public B setTracerFactory(ApiTracerFactory tracerFactory)

Configures the ApiTracerFactory that will be used to generate traces.

Parameter
NameDescription
tracerFactoryApiTracerFactory

an instance of ApiTracerFactory to set.

Returns
TypeDescription
B

setTransportChannelProvider(TransportChannelProvider transportChannelProvider)

public B setTransportChannelProvider(TransportChannelProvider transportChannelProvider)

Sets the TransportProvider to use for getting the transport-specific context to make calls with.

Parameter
NameDescription
transportChannelProviderTransportChannelProvider
Returns
TypeDescription
B

toString()

public String toString()
Returns
TypeDescription
String
Overrides