Class UserAgentHeaderProvider

java.lang.Object
io.micronaut.gcp.UserAgentHeaderProvider
All Implemented Interfaces:
com.google.api.gax.rpc.HeaderProvider

public class UserAgentHeaderProvider extends Object implements com.google.api.gax.rpc.HeaderProvider
Provides the User-Agent header to signal to the Google Cloud Client Libraries that requests originate from a Micronaut Integration.
Author:
João André Martins, Chengyuan Zhao, Mike Eltsufin, Ray Tsang
  • Constructor Details

    • UserAgentHeaderProvider

      public UserAgentHeaderProvider(String component)
      Default constructor.
      Parameters:
      component - The component
  • Method Details

    • getHeaders

      public Map<String,String> getHeaders()
      Returns the "User-Agent" header whose value should be added to the google-cloud-java REST API calls. e.g., User-Agent: Micronaut/1.0.0.RELEASE micronaut-gcp-trace/1.0.0.RELEASE.
      Specified by:
      getHeaders in interface com.google.api.gax.rpc.HeaderProvider
    • getUserAgent

      public String getUserAgent()
      Returns the "User-Agent" header value which should be added to the google-cloud-java REST API calls. e.g., Micronaut/1.0.0.RELEASE micronaut-gcp-trace/1.0.0.RELEASE.
      Returns:
      the user agent string.