Package com.google.api.gax.rpc
Class StubSettings.Builder<SettingsT extends StubSettings<SettingsT>,B extends StubSettings.Builder<SettingsT,B>>
java.lang.Object
com.google.api.gax.rpc.StubSettings.Builder<SettingsT,B>
- Enclosing class:
- StubSettings<SettingsT extends StubSettings<SettingsT>>
public abstract static class StubSettings.Builder<SettingsT extends StubSettings<SettingsT>,B extends StubSettings.Builder<SettingsT,B>>
extends Object
-
Constructor Summary
ModifierConstructorDescriptionprotected
Builder()
protected
Builder
(ClientContext clientContext) protected
Builder
(StubSettings settings) Create a builder from a StubSettings object. -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
applyToAllUnaryMethods
(Iterable<UnaryCallSettings.Builder<?, ?>> methodSettingsBuilders, ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) Applies the given settings updater function to the given method settings builders.abstract <B extends StubSettings<B>>
StubSettings<B>build()
Gets the ExecutorProvider that was previously set on this Builder.getClock()
Gets the ApiClock that was previously set on this Builder.Gets the CredentialsProvider that was previously set on this Builder.Deprecated.Gets the GDCH API audience that was previously set in this BuilderGets the custom HeaderProvider that was previously set on this Builder.protected HeaderProvider
Gets the internal HeaderProvider that was previously set on this Builder.Gets the QuotaProjectId that was previously set on this Builder.org.threeten.bp.Duration
Gets theWatchdogProvider
that was previously set on this Builder.Gets the TransportProvider that was previously set on this Builder.protected B
self()
setBackgroundExecutorProvider
(ExecutorProvider backgroundExecutorProvider) Sets the executor to use for running scheduled API call logic (such as retries and long-running operations).Sets the clock to use for retry logic.setCredentialsProvider
(CredentialsProvider credentialsProvider) Sets the CredentialsProvider to use for getting the credentials to make calls with.setEndpoint
(String endpoint) setExecutorProvider
(ExecutorProvider executorProvider) Deprecated.Please usesetBackgroundExecutorProvider(ExecutorProvider)
for setting executor to use for running scheduled API call logic.setGdchApiAudience
(String gdchApiAudience) Sets the API audience used byGdchCredentials
It cannot be used if other type ofCredentials
is used.setHeaderProvider
(HeaderProvider headerProvider) Sets the HeaderProvider for getting custom static headers for http requests.protected B
setInternalHeaderProvider
(HeaderProvider internalHeaderProvider) Sets the HeaderProvider for getting internal (library-defined) static headers for http requests.setMtlsEndpoint
(String mtlsEndpoint) setQuotaProjectId
(String quotaProjectId) setStreamWatchdogCheckInterval
(org.threeten.bp.Duration checkInterval) Sets how often theWatchdog
will check ongoing streaming RPCs.setStreamWatchdogProvider
(WatchdogProvider streamWatchdogProvider) Sets theWatchdogProvider
to use for streaming RPC.protected B
setSwitchToMtlsEndpointAllowed
(boolean switchToMtlsEndpointAllowed) setTracerFactory
(ApiTracerFactory tracerFactory) Configures theApiTracerFactory
that will be used to generate traces.setTransportChannelProvider
(TransportChannelProvider transportChannelProvider) Sets the TransportProvider to use for getting the transport-specific context to make calls with.setUniverseDomain
(String universeDomain) toString()
-
Constructor Details
-
Builder
Create a builder from a StubSettings object. -
Builder
-
Builder
protected Builder()
-
-
Method Details
-
self
-
setExecutorProvider
Deprecated.Please usesetBackgroundExecutorProvider(ExecutorProvider)
for setting executor to use for running scheduled API call logic. To set executor forTransportChannelProvider
, please useTransportChannelProvider.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. -
setBackgroundExecutorProvider
Sets the executor to use for running scheduled API call logic (such as retries and long-running operations). -
setCredentialsProvider
Sets the CredentialsProvider to use for getting the credentials to make calls with. -
setHeaderProvider
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. -
setInternalHeaderProvider
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. -
setTransportChannelProvider
Sets the TransportProvider to use for getting the transport-specific context to make calls with. -
setStreamWatchdogProvider
Sets theWatchdogProvider
to use for streaming RPC.This will default to a
InstantiatingWatchdogProvider
if it is not set. -
setClock
Sets the clock to use for retry logic.This will default to a system clock if it is not set.
-
setUniverseDomain
-
setEndpoint
-
setSwitchToMtlsEndpointAllowed
-
setMtlsEndpoint
-
setQuotaProjectId
-
setStreamWatchdogCheckInterval
Sets how often theWatchdog
will check ongoing streaming RPCs. Defaults to 10 secs. UseDuration.ZERO
to disable. -
setGdchApiAudience
Sets the API audience used byGdchCredentials
It cannot be used if other type ofCredentials
is used. If the provided credentials already have an api audience set, then it will be overriden by this audience- Parameters:
gdchApiAudience
- the audience to be used - must be a valid URI string
-
setTracerFactory
@BetaApi("The surface for tracing is not stable yet and may change in the future.") public B setTracerFactory(@Nonnull ApiTracerFactory tracerFactory) Configures theApiTracerFactory
that will be used to generate traces.- Parameters:
tracerFactory
- an instance ofApiTracerFactory
to set.
-
getExecutorProvider
Deprecated.Please usegetBackgroundExecutorProvider()
. -
getBackgroundExecutorProvider
Gets the ExecutorProvider that was previously set on this Builder. -
getTransportChannelProvider
Gets the TransportProvider that was previously set on this Builder. -
getCredentialsProvider
Gets the CredentialsProvider that was previously set on this Builder. -
getHeaderProvider
Gets the custom HeaderProvider that was previously set on this Builder. -
getInternalHeaderProvider
Gets the internal HeaderProvider that was previously set on this Builder. -
getStreamWatchdogProvider
Gets theWatchdogProvider
that was previously set on this Builder. -
getClock
Gets the ApiClock that was previously set on this Builder. -
getEndpoint
-
getMtlsEndpoint
-
getQuotaProjectId
Gets the QuotaProjectId that was previously set on this Builder. -
getStreamWatchdogCheckInterval
-
getTracerFactory
@BetaApi("The surface for tracing is not stable yet and may change in the future.") @Nonnull public ApiTracerFactory getTracerFactory() -
getGdchApiAudience
Gets the GDCH API audience that was previously set in this Builder -
applyToAllUnaryMethods
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. -
build
- Throws:
IOException
-
toString
-
getBackgroundExecutorProvider()
.