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 ClientContextcreate(ClientSettings settings) Instantiates the executor, credentials, and transport context based on the given client settings.static ClientContextcreate(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 ApiClockgetClock()abstract com.google.auth.Credentialsabstract ApiCallContextabstract Stringabstract ScheduledExecutorServiceGets the executor to use for running scheduled API call logic (such as retries and long-running operations).abstract StringGets the API audience used when creating a Client that usesGdchCredentialsabstract Stringabstract Watchdogfinal org.threeten.bp.DurationThis method is obsolete.abstract Durationabstract ApiTracerFactoryGets theApiTracerFactorythat will be used to generate traces for operations.abstract TransportChannelabstract Stringstatic ClientContext.BuilderCreate 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 theApiTracerFactorythat 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
-