com.atlassian.httpclient.api
Class ForwardingHttpClient

java.lang.Object
  extended by com.google.common.collect.ForwardingObject
      extended by com.atlassian.httpclient.api.ForwardingHttpClient
All Implemented Interfaces:
HttpClient

public abstract class ForwardingHttpClient
extends com.google.common.collect.ForwardingObject
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 Summary
protected ForwardingHttpClient()
          Constructor for use by subclasses.
 
Method Summary
protected abstract  HttpClient delegate()
           
 void flushCacheByUriPattern(java.util.regex.Pattern uriPattern)
          Flush the cache entries by matching the URI using a regular expression
 Request newRequest()
          Constructs a new request.
 Request newRequest(java.lang.String uri)
          Constructs a new Request with the specified URI.
 Request newRequest(java.lang.String uri, java.lang.String contentType, java.lang.String entity)
          Constructs a new Request with the specified URI, contentType, and entity.
 Request newRequest(java.net.URI uri)
          Constructs a new Request with the specified URI.
 Request newRequest(java.net.URI uri, java.lang.String contentType, java.lang.String entity)
          Constructs a new Request with the specified URI, contentType, and entity.
 
Methods inherited from class com.google.common.collect.ForwardingObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ForwardingHttpClient

protected ForwardingHttpClient()
Constructor for use by subclasses.

Method Detail

delegate

protected abstract HttpClient delegate()
Specified by:
delegate in class com.google.common.collect.ForwardingObject

newRequest

public Request 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 newRequest(java.net.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 newRequest(java.lang.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 newRequest(java.net.URI uri,
                          java.lang.String contentType,
                          java.lang.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 newRequest(java.lang.String uri,
                          java.lang.String contentType,
                          java.lang.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(java.util.regex.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


Copyright © 2012 Atlassian. All Rights Reserved.