Class StubSettings.Builder<SettingsT extends StubSettings<SettingsT>,​B extends StubSettings.Builder<SettingsT,​B>>

    • Constructor Detail

      • Builder

        protected Builder​(StubSettings settings)
        Create a builder from a StubSettings object.
      • Builder

        protected Builder()
    • Method Detail

      • self

        protected B self()
      • setBackgroundExecutorProvider

        public B setBackgroundExecutorProvider​(ExecutorProvider backgroundExecutorProvider)
        Sets the executor to use for running scheduled API call logic (such as retries and long-running operations).
      • setCredentialsProvider

        public B setCredentialsProvider​(CredentialsProvider credentialsProvider)
        Sets the CredentialsProvider to use for getting the credentials to make calls with.
      • setHeaderProvider

        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.
      • setInternalHeaderProvider

        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.
      • setTransportChannelProvider

        public B setTransportChannelProvider​(TransportChannelProvider transportChannelProvider)
        Sets the TransportProvider to use for getting the transport-specific context to make calls with.
      • setClock

        public B setClock​(com.google.api.core.ApiClock clock)
        Sets the clock to use for retry logic.

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

      • setEndpoint

        public B setEndpoint​(String endpoint)
      • setSwitchToMtlsEndpointAllowed

        protected B setSwitchToMtlsEndpointAllowed​(boolean switchToMtlsEndpointAllowed)
      • setMtlsEndpoint

        public B setMtlsEndpoint​(String mtlsEndpoint)
      • setQuotaProjectId

        public B setQuotaProjectId​(String quotaProjectId)
      • setStreamWatchdogCheckInterval

        public B setStreamWatchdogCheckInterval​(@Nonnull
                                                org.threeten.bp.Duration checkInterval)
        Sets how often the Watchdog will check ongoing streaming RPCs. Defaults to 10 secs. Use Duration.ZERO to disable.
      • setTracerFactory

        @BetaApi("The surface for tracing is not stable yet and may change in the future.")
        public B setTracerFactory​(@Nonnull
                                  ApiTracerFactory tracerFactory)
        Configures the ApiTracerFactory that will be used to generate traces.
        Parameters:
        tracerFactory - an instance of ApiTracerFactory to set.
      • getBackgroundExecutorProvider

        public ExecutorProvider getBackgroundExecutorProvider()
        Gets the ExecutorProvider that was previously set on this Builder.
      • getTransportChannelProvider

        public TransportChannelProvider getTransportChannelProvider()
        Gets the TransportProvider that was previously set on this Builder.
      • getCredentialsProvider

        public CredentialsProvider getCredentialsProvider()
        Gets the CredentialsProvider that was previously set on this Builder.
      • getHeaderProvider

        public HeaderProvider getHeaderProvider()
        Gets the custom HeaderProvider that was previously set on this Builder.
      • getInternalHeaderProvider

        protected HeaderProvider getInternalHeaderProvider()
        Gets the internal HeaderProvider that was previously set on this Builder.
      • getClock

        public com.google.api.core.ApiClock getClock()
        Gets the ApiClock that was previously set on this Builder.
      • getEndpoint

        public String getEndpoint()
      • getMtlsEndpoint

        public String getMtlsEndpoint()
      • getQuotaProjectId

        public String getQuotaProjectId()
        Gets the QuotaProjectId that was previously set on this Builder.
      • getStreamWatchdogCheckInterval

        @Nonnull
        public org.threeten.bp.Duration getStreamWatchdogCheckInterval()
      • getTracerFactory

        @BetaApi("The surface for tracing is not stable yet and may change in the future.")
        @Nonnull
        public ApiTracerFactory getTracerFactory()
      • applyToAllUnaryMethods

        protected static void applyToAllUnaryMethods​(Iterable<UnaryCallSettings.Builder<?,​?>> methodSettingsBuilders,
                                                     com.google.api.core.ApiFunction<UnaryCallSettings.Builder<?,​?>,​Void> settingsUpdater)
        Applies the given settings updater function to the given method settings builders.