Class UserAgentPolicy

    • Constructor Summary

      Constructors 
      Constructor Description
      UserAgentPolicy()
      Creates a UserAgentPolicy with a default user agent string i.e.
      UserAgentPolicy​(java.lang.String applicationId, java.lang.String sdkName, java.lang.String sdkVersion)
      Creates a UserAgentPolicy with the sdkName and sdkVersion in the User-Agent header value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void process​(HttpPipelinePolicyChain chain)
      Updates the "User-Agent" header with the value supplied at the time of creating policy.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UserAgentPolicy

        public UserAgentPolicy()
        Creates a UserAgentPolicy with a default user agent string i.e. "azsdk-android".
      • UserAgentPolicy

        public UserAgentPolicy​(java.lang.String applicationId,
                               java.lang.String sdkName,
                               java.lang.String sdkVersion)
        Creates a UserAgentPolicy with the sdkName and sdkVersion in the User-Agent header value.
        Parameters:
        applicationId - User specified application Id.
        sdkName - Name of the client library.
        sdkVersion - Version of the client library.
        Throws:
        java.lang.IllegalArgumentException - If the given applicationId is longer than 24 characters or contains spaces.
    • Method Detail

      • process

        public void process​(HttpPipelinePolicyChain chain)
        Updates the "User-Agent" header with the value supplied at the time of creating policy.
        Specified by:
        process in interface HttpPipelinePolicy
        Parameters:
        chain - The chain for the policy to access the request and response.