com.google.api.gax.rpc.HeaderProvider Java Examples

The following examples show how to use com.google.api.gax.rpc.HeaderProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BigQueryConnectorModule.java    From presto with Apache License 2.0 5 votes vote down vote up
@Provides
@Singleton
public BigQueryClient provideBigQueryClient(BigQueryConfig config, HeaderProvider headerProvider, BigQueryCredentialsSupplier bigQueryCredentialsSupplier)
{
    String billingProjectId = calculateBillingProjectId(config.getParentProjectId(), bigQueryCredentialsSupplier.getCredentials());
    BigQueryOptions.Builder options = BigQueryOptions.newBuilder()
            .setHeaderProvider(headerProvider)
            .setProjectId(billingProjectId);
    // set credentials of provided
    bigQueryCredentialsSupplier.getCredentials().ifPresent(options::setCredentials);
    return new BigQueryClient(options.build().getService(), config);
}
 
Example #2
Source File: BigQueryStorageClientFactory.java    From presto with Apache License 2.0 4 votes vote down vote up
@Inject
public BigQueryStorageClientFactory(BigQueryCredentialsSupplier bigQueryCredentialsSupplier, HeaderProvider headerProvider)
{
    this.credentials = bigQueryCredentialsSupplier.getCredentials();
    this.headerProvider = headerProvider;
}
 
Example #3
Source File: BigQueryConnectorModule.java    From presto with Apache License 2.0 4 votes vote down vote up
@Provides
@Singleton
public static HeaderProvider createHeaderProvider(NodeManager nodeManager)
{
    return FixedHeaderProvider.create("user-agent", "prestosql/" + nodeManager.getCurrentNode().getVersion());
}
 
Example #4
Source File: PhotosLibrarySettings.java    From java-photoslibrary with Apache License 2.0 4 votes vote down vote up
@Override
public Builder setHeaderProvider(HeaderProvider headerProvider) {
  super.setHeaderProvider(headerProvider);
  return this;
}
 
Example #5
Source File: PhotosLibrarySettings.java    From java-photoslibrary with Apache License 2.0 4 votes vote down vote up
@Override
protected Builder setInternalHeaderProvider(HeaderProvider internalHeaderProvider) {
  super.setInternalHeaderProvider(internalHeaderProvider);
  return this;
}
 
Example #6
Source File: DefaultPublisherFactory.java    From spring-cloud-gcp with Apache License 2.0 2 votes vote down vote up
/**
 * Set the provider for the HTTP headers to be used in the Pub/Sub REST API requests.
 * @param headerProvider the header provider to set
 */
public void setHeaderProvider(HeaderProvider headerProvider) {
	this.headerProvider = headerProvider;
}
 
Example #7
Source File: DefaultSubscriberFactory.java    From spring-cloud-gcp with Apache License 2.0 2 votes vote down vote up
/**
 * Set the provider for the HTTP headers to be added to the subscribers' REST API calls.
 * @param headerProvider the header provider to set
 */
public void setHeaderProvider(HeaderProvider headerProvider) {
	this.headerProvider = headerProvider;
}