Class HttpHeaderUtil


  • public class HttpHeaderUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpHeaderUtil()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.http.HttpHeaders addBatchHeaders​(java.lang.String uri)
      Adds basic batch headers like
      java.lang.String createBasicAuthHeader​(java.lang.String username, java.lang.String password)
      Encoding for username/password headers.
      org.springframework.http.HttpHeaders enrichHeaders​(org.springframework.http.HttpHeaders headers, java.lang.String siteId)
      Make a request to a c4c system to get a special token for the other requests.
      org.springframework.http.HttpHeaders getDefaultHeaders​(java.lang.String siteId)
      Makes some default http headers for communication with c4c
      org.springframework.http.HttpHeaders getEnrichedHeaders()
      Make a request to a c4c system to get a special token for the other requests.
      protected org.springframework.web.client.RestTemplate getRestTemplate()  
      protected SitePropsHolder getSitePropsHolder()  
      void setRestTemplate​(org.springframework.web.client.RestTemplate restTemplate)  
      void setSitePropsHolder​(SitePropsHolder sitePropsHolder)  
      • Methods inherited from class java.lang.Object

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

      • HttpHeaderUtil

        public HttpHeaderUtil()
    • Method Detail

      • addBatchHeaders

        public org.springframework.http.HttpHeaders addBatchHeaders​(java.lang.String uri)
        Adds basic batch headers like
        Parameters:
        uri -
        Returns:
        HttpHeaders
      • getEnrichedHeaders

        public org.springframework.http.HttpHeaders getEnrichedHeaders()
        Make a request to a c4c system to get a special token for the other requests. wrapper for enrichHeaders(final HttpHeaders headers, final String siteId)
        Returns:
        enriched HttpHeaders
      • enrichHeaders

        public org.springframework.http.HttpHeaders enrichHeaders​(org.springframework.http.HttpHeaders headers,
                                                                  java.lang.String siteId)
        Make a request to a c4c system to get a special token for the other requests.
        Parameters:
        headers -
        siteId -
        Returns:
        headers with special token
      • createBasicAuthHeader

        public java.lang.String createBasicAuthHeader​(java.lang.String username,
                                                      java.lang.String password)
        Encoding for username/password headers. Makes BasicAuthHeader
        Parameters:
        username -
        password -
        Returns:
        basic authentication string header
      • getDefaultHeaders

        public org.springframework.http.HttpHeaders getDefaultHeaders​(java.lang.String siteId)
        Makes some default http headers for communication with c4c
        Parameters:
        siteId -
        Returns:
        default headers
      • setSitePropsHolder

        public void setSitePropsHolder​(SitePropsHolder sitePropsHolder)
      • getRestTemplate

        protected org.springframework.web.client.RestTemplate getRestTemplate()
      • setRestTemplate

        public void setRestTemplate​(org.springframework.web.client.RestTemplate restTemplate)