Class ClientContext (2.42.0)

  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.

Inheritance

java.lang.Object > ClientContext

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
Name
Description
settings
Returns
Type
Description
Exceptions
Type
Description

create(StubSettings settings)

  public 
  
 static 
  
 ClientContext 
  
 create 
 ( 
 StubSettings 
  
 settings 
 ) 
 

Instantiates the executor, credentials, and transport context based on the given client settings.

Parameter
Name
Description
settings
Returns
Type
Description
Exceptions
Type
Description

newBuilder()

  public 
  
 static 
  
 ClientContext 
 . 
 Builder 
  
 newBuilder 
 () 
 
Returns
Type
Description

Constructors

ClientContext()

  public 
  
 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
Type
Description

getClock()

  public 
  
 abstract 
  
 ApiClock 
  
 getClock 
 () 
 
Returns
Type
Description

getCredentials()

  public 
  
 abstract 
  
 Credentials 
  
 getCredentials 
 () 
 
Returns
Type
Description
com.google.auth.Credentials

getDefaultCallContext()

  public 
  
 abstract 
  
 ApiCallContext 
  
 getDefaultCallContext 
 () 
 
Returns
Type
Description

getEndpoint()

  public 
  
 abstract 
  
 String 
  
 getEndpoint 
 () 
 
Returns
Type
Description

getExecutor()

  public 
  
 abstract 
  
 ScheduledExecutorService 
  
 getExecutor 
 () 
 

Gets the executor to use for running scheduled API call logic (such as retries and long-running operations).

Returns
Type
Description

getGdchApiAudience()

  public 
  
 abstract 
  
 String 
  
 getGdchApiAudience 
 () 
 

Gets the API audience used when creating a Client that uses com.google.auth.oauth2.GdchCredentials

Returns
Type
Description

getHeaders()

  public 
  
 abstract 
  
 Map<String 
 , 
 String 
>  
 getHeaders 
 () 
 
Returns
Type
Description
Map < String , String >

getInternalHeaders()

  protected 
  
 abstract 
  
 Map<String 
 , 
 String 
>  
 getInternalHeaders 
 () 
 
Returns
Type
Description
Map < String , String >

getQuotaProjectId()

  public 
  
 abstract 
  
 String 
  
 getQuotaProjectId 
 () 
 
Returns
Type
Description

getStreamWatchdog()

  public 
  
 abstract 
  
 Watchdog 
  
 getStreamWatchdog 
 () 
 
Returns
Type
Description

getStreamWatchdogCheckInterval()

  public 
  
 abstract 
  
 Duration 
  
 getStreamWatchdogCheckInterval 
 () 
 
Returns
Type
Description
org.threeten.bp.Duration

getTracerFactory()

  public 
  
 abstract 
  
 ApiTracerFactory 
  
 getTracerFactory 
 () 
 

Gets the ApiTracerFactory that will be used to generate traces for operations.

Returns
Type
Description

getTransportChannel()

  public 
  
 abstract 
  
 TransportChannel 
  
 getTransportChannel 
 () 
 
Returns
Type
Description

getUniverseDomain()

  public 
  
 abstract 
  
 String 
  
 getUniverseDomain 
 () 
 
Returns
Type
Description

toBuilder()

  public 
  
 abstract 
  
 ClientContext 
 . 
 Builder 
  
 toBuilder 
 () 
 
Returns
Type
Description
Create a Mobile Website
View Site in Mobile | Classic
Share by: