Package com.google.api.gax.rpc
Class ClientSettings.Builder<SettingsT extends ClientSettings<SettingsT>,B extends ClientSettings.Builder<SettingsT,B>>
java.lang.Object
com.google.api.gax.rpc.ClientSettings.Builder<SettingsT,B>
- Enclosing class:
- ClientSettings<SettingsT extends ClientSettings<SettingsT>>
public abstract static class ClientSettings.Builder<SettingsT extends ClientSettings<SettingsT>,B extends ClientSettings.Builder<SettingsT,B>>
extends Object
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()protectedBuilder(ClientSettings settings) Create a builder from a ClientSettings object.protectedBuilder(StubSettings.Builder stubSettings) 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 SettingsTbuild()Gets 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.protected StubSettings.BuilderGets the TransportProvider that was previously set on this Builder.org.threeten.bp.DurationThis method is obsolete.protected Bself()Sets the API key.setBackgroundExecutorProvider(ExecutorProvider executorProvider) Sets the ExecutorProvider to use for getting 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 GDC-H api audience.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.setQuotaProjectId(String quotaProjectId) setTransportChannelProvider(TransportChannelProvider transportChannelProvider) Sets the TransportProvider to use for getting the transport-specific context to make calls with.setUniverseDomain(String universeDomain) Sets the Universe Domain to configure the resolved endpointsetWatchdogCheckInterval(org.threeten.bp.Duration checkInterval) This method is obsolete.setWatchdogCheckIntervalDuration(Duration checkInterval) setWatchdogProvider(WatchdogProvider watchdogProvider) toString()
-
Constructor Details
-
Builder
Create a builder from a ClientSettings object. -
Builder
Create a builder from a StubSettings object. -
Builder
protected Builder()
-
-
Method Details
-
self
-
getStubSettings
-
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 ExecutorProvider to use for getting the executor to use for running scheduled API call logic (such as retries and long-running operations). This will not set the executor inTransportChannelProvider. To set executor forTransportChannelProvider, please useTransportChannelProvider.withExecutor(Executor). -
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. -
setClock
Sets the clock to use for retry logic.This will default to a system clock if it is not set.
-
setUniverseDomain
Sets the Universe Domain to configure the resolved endpoint -
setEndpoint
-
setQuotaProjectId
-
setWatchdogProvider
-
setWatchdogCheckInterval
@ObsoleteApi("Use setWatchdogCheckIntervalDuration(java.time.Duration) instead") public B setWatchdogCheckInterval(@Nullable org.threeten.bp.Duration checkInterval) This method is obsolete. UsesetWatchdogCheckIntervalDuration(java.time.Duration)instead. -
setWatchdogCheckIntervalDuration
-
setGdchApiAudience
Sets the GDC-H api audience. This is intended only to be used withGdchCredentialsIf this field is set and other type ofCredentialsis used then anIllegalArgumentExceptionwill be thrown. If the provided credentials already have an api audience, then it will be overriden by this audience -
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()for getting the executor provider that's used for running scheduled API call logic.Gets the ExecutorProvider that was previously set on this Builder. This ExecutorProvider is 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. -
getBackgroundExecutorProvider
Gets the ExecutorProvider that was previously set on this Builder. This ExecutorProvider is to use for running asynchronous API call logic (such as retries and long-running operations). This ExecutorProvider is not used to set the executor inTransportChannelProvider. -
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. -
getClock
Gets the ApiClock that was previously set on this Builder. -
getEndpoint
-
getQuotaProjectId
Gets the QuotaProjectId that was previously set on this Builder. -
getWatchdogProvider
-
getApiKey
Gets the API Key that was previously set on this Builder. -
getWatchdogCheckInterval
@Nullable @ObsoleteApi("Use getWatchdogCheckIntervalDuration() instead") public org.threeten.bp.Duration getWatchdogCheckInterval()This method is obsolete. UsegetWatchdogCheckIntervalDuration()instead -
getWatchdogCheckIntervalDuration
-
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()for getting the executor provider that's used for running scheduled API call logic.