Package com.google.api.gax.rpc
Class ClientContext
java.lang.Object
com.google.api.gax.rpc.ClientContext
Encapsulates client state, including executor, credentials, and transport channel.
Unlike ClientSettings
which allows users to configure the client,
ClientContext
is intended to be used in generated code. Most users will not need to use it.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientContext
create
(ClientSettings settings) Instantiates the executor, credentials, and transport context based on the given client settings.static ClientContext
create
(StubSettings settings) Instantiates the executor, credentials, and transport context based on the given client settings.abstract List<BackgroundResource>
The objects that need to be closed in order to clean up the resources created in the process of creating this ClientContext.abstract ApiClock
getClock()
abstract com.google.auth.Credentials
abstract ApiCallContext
abstract String
abstract ScheduledExecutorService
Gets the executor to use for running scheduled API call logic (such as retries and long-running operations).abstract String
Gets the API audience used when creating a Client that usesGdchCredentials
abstract String
abstract Watchdog
final org.threeten.bp.Duration
This method is obsolete.abstract Duration
abstract ApiTracerFactory
Gets theApiTracerFactory
that will be used to generate traces for operations.abstract TransportChannel
abstract String
static ClientContext.Builder
Create a new ClientContext with default valuesabstract ClientContext.Builder
-
Constructor Details
-
ClientContext
public ClientContext()
-
-
Method Details
-
getBackgroundResources
The objects that need to be closed in order to clean up the resources created in the process of creating this ClientContext. This will include the closeables from the transport context. -
getExecutor
Gets the executor to use for running scheduled API call logic (such as retries and long-running operations). -
getCredentials
-
getTransportChannel
-
getHeaders
-
getInternalHeaders
-
getClock
-
getDefaultCallContext
-
getStreamWatchdog
-
getStreamWatchdogCheckInterval
@Nonnull @ObsoleteApi("Use getStreamWatchdogCheckIntervalDuration() instead") public final org.threeten.bp.Duration getStreamWatchdogCheckInterval()This method is obsolete. UsegetStreamWatchdogCheckIntervalDuration()
instead. -
getStreamWatchdogCheckIntervalDuration
-
getUniverseDomain
-
getEndpoint
-
getQuotaProjectId
-
getTracerFactory
@BetaApi("The surface for tracing is not stable yet and may change in the future.") @Nonnull public abstract ApiTracerFactory getTracerFactory()Gets theApiTracerFactory
that will be used to generate traces for operations. -
getGdchApiAudience
Gets the API audience used when creating a Client that usesGdchCredentials
-
newBuilder
Create a new ClientContext with default values -
toBuilder
-
create
Instantiates the executor, credentials, and transport context based on the given client settings.- Throws:
IOException
-
create
Instantiates the executor, credentials, and transport context based on the given client settings.- Throws:
IOException
-