Class UserAgentHeaderProvider

java.lang.Object
com.google.cloud.spring.core.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 Spring Integration.
  • Constructor Details

    • UserAgentHeaderProvider

      public UserAgentHeaderProvider(Class<?> clazz)
  • 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: Spring/1.0.0.RELEASE spring-cloud-gcp-pubsub/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., Spring/1.0.0.RELEASE spring-cloud-gcp-pubsub/1.0.0.RELEASE.
      Returns:
      the user agent string.