Send feedback
Class ClientContext (2.19.2)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.19.2 keyboard_arrow_down
public abstract class 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.
Static Methods
create(ClientSettings settings)
public static ClientContext create ( ClientSettings settings )
Instantiates the executor, credentials, and transport context based on the given client
settings.
Parameter
Returns
Exceptions
create(StubSettings settings)
public static ClientContext create ( StubSettings settings )
Instantiates the executor, credentials, and transport context based on the given client
settings.
Parameter
Returns
Exceptions
newBuilder()
public static ClientContext . Builder newBuilder ()
Returns
Constructors
ClientContext()
Methods
getBackgroundResources()
public abstract List<BackgroundResource> 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.
Returns
getClock()
public abstract ApiClock getClock ()
Returns
Type Description com.google.api.core.ApiClock
getCredentials()
public abstract Credentials getCredentials ()
Returns
Type Description com.google.auth.Credentials
getDefaultCallContext()
public abstract ApiCallContext getDefaultCallContext ()
Returns
getEndpoint()
public abstract String getEndpoint ()
Returns
getExecutor()
public abstract ScheduledExecutorService getExecutor ()
Gets the executor to use for running scheduled API call logic (such as retries and long-running
operations).
Returns
public abstract Map<String , String> getHeaders ()
Returns
protected abstract Map<String , String> getInternalHeaders ()
Returns
getQuotaProjectId()
public abstract String getQuotaProjectId ()
Returns
getStreamWatchdog()
public abstract Watchdog getStreamWatchdog ()
Returns
getStreamWatchdogCheckInterval()
public abstract Duration getStreamWatchdogCheckInterval ()
Returns
Type Description org.threeten.bp.Duration
getTracerFactory()
public abstract ApiTracerFactory getTracerFactory ()
Returns
getTransportChannel()
public abstract TransportChannel getTransportChannel ()
Returns
toBuilder()
public abstract ClientContext . Builder toBuilder ()
Returns
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-05 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-09-05 UTC."}