org.springframework.http.client
Class AbstractBufferingClientHttpRequest

java.lang.Object
  extended by org.springframework.http.client.AbstractClientHttpRequest
      extended by org.springframework.http.client.AbstractBufferingClientHttpRequest
All Implemented Interfaces:
ClientHttpRequest, HttpMessage, HttpOutputMessage, HttpRequest
Direct Known Subclasses:
BufferingClientHttpRequestWrapper, CommonsClientHttpRequest, HttpComponentsClientHttpRequest, InterceptingClientHttpRequest, SimpleBufferingClientHttpRequest

abstract class AbstractBufferingClientHttpRequest
extends AbstractClientHttpRequest

Abstract base for ClientHttpRequest that buffers output in a byte array before sending it over the wire.

Since:
3.0.6
Author:
Arjen Poutsma

Field Summary
private  java.io.ByteArrayOutputStream bufferedOutput
           
 
Constructor Summary
AbstractBufferingClientHttpRequest()
           
 
Method Summary
protected  ClientHttpResponse executeInternal(HttpHeaders headers)
          Abstract template method that writes the given headers and content to the HTTP request.
protected abstract  ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput)
          Abstract template method that writes the given headers and content to the HTTP request.
protected  java.io.OutputStream getBodyInternal(HttpHeaders headers)
          Abstract template method that returns the body.
 
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
 
Methods inherited from interface org.springframework.http.HttpRequest
getMethod, getURI
 

Field Detail

bufferedOutput

private java.io.ByteArrayOutputStream bufferedOutput
Constructor Detail

AbstractBufferingClientHttpRequest

AbstractBufferingClientHttpRequest()
Method Detail

getBodyInternal

protected java.io.OutputStream getBodyInternal(HttpHeaders headers)
                                        throws java.io.IOException
Description copied from class: AbstractClientHttpRequest
Abstract template method that returns the body.

Specified by:
getBodyInternal in class AbstractClientHttpRequest
Parameters:
headers - the HTTP headers
Returns:
the body output stream
Throws:
java.io.IOException

executeInternal

protected ClientHttpResponse executeInternal(HttpHeaders headers)
                                      throws java.io.IOException
Description copied from class: AbstractClientHttpRequest
Abstract template method that writes the given headers and content to the HTTP request.

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

executeInternal

protected abstract ClientHttpResponse executeInternal(HttpHeaders headers,
                                                      byte[] bufferedOutput)
                                               throws java.io.IOException
Abstract template method that writes the given headers and content to the HTTP request.

Parameters:
headers - the HTTP headers
bufferedOutput - the body content
Returns:
the response object for the executed request
Throws:
java.io.IOException