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
ConstructorsModifierConstructorDescriptionprotectedBuilder()protectedBuilder(ClientContext clientContext) protectedBuilder(StubSettings settings) Create a builder from a StubSettings object. -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidapplyToAllUnaryMethods(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()final StringGets the API Key that was previously set on this Builder.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 HeaderProviderGets the internal HeaderProvider that was previously set on this Builder.Gets the QuotaProjectId that was previously set on this Builder.org.threeten.bp.DurationThis method is obsolete.Gets theWatchdogProviderthat was previously set on this Builder.Gets the TransportProvider that was previously set on this Builder.protected Bself()Sets the API key.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 byGdchCredentialsIt cannot be used if other type ofCredentialsis used.setHeaderProvider(HeaderProvider headerProvider) Sets the HeaderProvider for getting custom static headers for http requests.protected BsetInternalHeaderProvider(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) This method is obsolete.setStreamWatchdogCheckIntervalDuration(Duration checkInterval) Sets how often theWatchdogwill check ongoing streaming RPCs.setStreamWatchdogProvider(WatchdogProvider streamWatchdogProvider) Sets theWatchdogProviderto use for streaming RPC.protected BsetSwitchToMtlsEndpointAllowed(boolean switchToMtlsEndpointAllowed) setTracerFactory(ApiTracerFactory tracerFactory) Configures theApiTracerFactorythat 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 theWatchdogProviderto use for streaming RPC.This will default to a
InstantiatingWatchdogProviderif 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
@ObsoleteApi("Use setStreamWatchdogCheckIntervalDuration(java.time.Duration) instead") public B setStreamWatchdogCheckInterval(@Nonnull org.threeten.bp.Duration checkInterval) This method is obsolete. UsesetStreamWatchdogCheckIntervalDuration(java.time.Duration)instead. -
setStreamWatchdogCheckIntervalDuration
Sets how often theWatchdogwill check ongoing streaming RPCs. Defaults to 10 secs. UseDuration.ZEROto disable. -
setGdchApiAudience
Sets the API audience used byGdchCredentialsIt cannot be used if other type ofCredentialsis 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 theApiTracerFactorythat will be used to generate traces.- Parameters:
tracerFactory- an instance ofApiTracerFactoryto set.
-
setApiKey
Sets the API key. The API key will get translated to anApiKeyCredentialsand stored inClientContext.API Key authorization is not supported for every product. Please check the documentation for each product to confirm if it is supported.
Note: If you set an API key and
CredentialsProviderin the same ClientSettings the API key will override any credentials provided. -
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 theWatchdogProviderthat was previously set on this Builder. -
getClock
Gets the ApiClock that was previously set on this Builder. -
getApiKey
Gets the API Key that was previously set on this Builder. -
getEndpoint
- Returns:
- the resolved endpoint when the Builder was created. If invoked after `StubSettings.newBuilder()` is called, it will return the clientSettingsEndpoint value. If other parameters are then set in the builder, the resolved endpoint is not automatically updated. The resolved endpoint will only be recomputed when the StubSettings is built again.
-
getMtlsEndpoint
-
getQuotaProjectId
Gets the QuotaProjectId that was previously set on this Builder. -
getStreamWatchdogCheckInterval
@ObsoleteApi("Use getStreamWatchdogCheckIntervalDuration() instead") public org.threeten.bp.Duration getStreamWatchdogCheckInterval()This method is obsolete. UsegetStreamWatchdogCheckIntervalDuration()instead -
getStreamWatchdogCheckIntervalDuration
-
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().