org.springframework.http.client
Class InterceptingClientHttpRequest

java.lang.Object
  extended by org.springframework.http.client.AbstractClientHttpRequest
      extended by org.springframework.http.client.AbstractBufferingClientHttpRequest
          extended by org.springframework.http.client.InterceptingClientHttpRequest
All Implemented Interfaces:
ClientHttpRequest, HttpMessage, HttpOutputMessage, HttpRequest

 class InterceptingClientHttpRequest
extends AbstractBufferingClientHttpRequest

Wrapper for a ClientHttpRequest that has support for ClientHttpRequestInterceptors.

Since:
3.1
Author:
Arjen Poutsma

Nested Class Summary
private  class InterceptingClientHttpRequest.RequestExecution
           
 
Field Summary
private  java.util.List<ClientHttpRequestInterceptor> interceptors
           
private  HttpMethod method
           
private  ClientHttpRequestFactory requestFactory
           
private  java.net.URI uri
           
 
Constructor Summary
protected InterceptingClientHttpRequest(ClientHttpRequestFactory requestFactory, java.util.List<ClientHttpRequestInterceptor> interceptors, java.net.URI uri, HttpMethod method)
           
 
Method Summary
protected  ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput)
          Abstract template method that writes the given headers and content to the HTTP request.
 HttpMethod getMethod()
          Return the HTTP method of the request.
 java.net.URI getURI()
          Return the URI of the request.
 
Methods inherited from class org.springframework.http.client.AbstractBufferingClientHttpRequest
executeInternal, getBodyInternal
 
Methods inherited from class org.springframework.http.client.AbstractClientHttpRequest
execute, getBody, getHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requestFactory

private final ClientHttpRequestFactory requestFactory

interceptors

private final java.util.List<ClientHttpRequestInterceptor> interceptors

method

private HttpMethod method

uri

private java.net.URI uri
Constructor Detail

InterceptingClientHttpRequest

protected InterceptingClientHttpRequest(ClientHttpRequestFactory requestFactory,
                                        java.util.List<ClientHttpRequestInterceptor> interceptors,
                                        java.net.URI uri,
                                        HttpMethod method)
Method Detail

getMethod

public HttpMethod getMethod()
Description copied from interface: HttpRequest
Return the HTTP method of the request.

Returns:
the HTTP method as an HttpMethod enum value

getURI

public java.net.URI getURI()
Description copied from interface: HttpRequest
Return the URI of the request.

Returns:
the URI of the request

executeInternal

protected final ClientHttpResponse executeInternal(HttpHeaders headers,
                                                   byte[] bufferedOutput)
                                            throws java.io.IOException
Description copied from class: AbstractBufferingClientHttpRequest
Abstract template method that writes the given headers and content to the HTTP request.

Specified by:
executeInternal in class AbstractBufferingClientHttpRequest
Parameters:
headers - the HTTP headers
bufferedOutput - the body content
Returns:
the response object for the executed request
Throws:
java.io.IOException