Class RedirectingHttpClient

java.lang.Object
com.atlassian.httpclient.api.RedirectingHttpClient
All Implemented Interfaces:
HttpClient

public abstract class RedirectingHttpClient extends Object implements HttpClient
An HTTP Client which forwards all its method calls to another HTTP Client. Subclasses should override one or more methods to modify the behavior of the backing HTTP Client as desired per the decorator pattern.
  • Constructor Details

    • RedirectingHttpClient

      protected RedirectingHttpClient()
      Constructor for use by subclasses.
  • Method Details

    • delegate

      protected abstract HttpClient delegate()
    • newRequest

      public Request.Builder newRequest()
      Description copied from interface: HttpClient
      Constructs a new request. Sets the accept property to a default of "*/*".
      Specified by:
      newRequest in interface HttpClient
      Returns:
      The new request object
    • newRequest

      public Request.Builder newRequest(URI uri)
      Description copied from interface: HttpClient
      Constructs a new Request with the specified URI. Sets the accept property to a default of "*/*".
      Specified by:
      newRequest in interface HttpClient
      Parameters:
      uri - The endpoint URI for this request
      Returns:
      The new request object
    • newRequest

      public Request.Builder newRequest(String uri)
      Description copied from interface: HttpClient
      Constructs a new Request with the specified URI. Sets the accept property to a default of "*/*".
      Specified by:
      newRequest in interface HttpClient
      Parameters:
      uri - The endpoint URI for this request
      Returns:
      The new request object
    • newRequest

      public Request.Builder newRequest(URI uri, String contentType, String entity)
      Description copied from interface: HttpClient
      Constructs a new Request with the specified URI, contentType, and entity. Sets the accept property to a default of "*/*", and the content charset property to "UTF-8". This should only be used for sending textual content types, typically via the POST or PUT HTTP methods.
      Specified by:
      newRequest in interface HttpClient
      Parameters:
      uri - The endpoint URI for this request
      contentType - A textual IANA media type
      entity - A string entity to send as this request's message body
      Returns:
      The new request object
    • newRequest

      public Request.Builder newRequest(String uri, String contentType, String entity)
      Description copied from interface: HttpClient
      Constructs a new Request with the specified URI, contentType, and entity. Sets the accept property to a default of "*/*", and the content charset property to "UTF-8". This should only be used for sending textual content types, typically via the POST or PUT HTTP methods.
      Specified by:
      newRequest in interface HttpClient
      Parameters:
      uri - The endpoint URI for this request
      contentType - A textual IANA media type
      entity - A string entity to send as this request's message body
      Returns:
      The new request object
    • flushCacheByUriPattern

      public void flushCacheByUriPattern(Pattern uriPattern)
      Description copied from interface: HttpClient
      Flush the cache entries by matching the URI using a regular expression
      Specified by:
      flushCacheByUriPattern in interface HttpClient
      Parameters:
      uriPattern - The regular expression to match