Package org.springframework.http.client

# Class AbstractClientHttpRequestFactoryWrapper

java.lang.Object
org.springframework.http.client.AbstractClientHttpRequestFactoryWrapper

All Implemented Interfaces:
  `ClientHttpRequestFactory`

Direct Known Subclasses:
  `BufferingClientHttpRequestFactory`, `InterceptingClientHttpRequestFactory`

public abstract class AbstractClientHttpRequestFactoryWrapper extends Object implements ClientHttpRequestFactory
Abstract base class for `ClientHttpRequestFactory` implementations that decorate another delegate request factory.

Since:
  3.1
Author:
  Arjen Poutsma

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`AbstractClientHttpRequestFactoryWrapper(ClientHttpRequestFactory requestFactory)`
Create a `AbstractClientHttpRequestFactoryWrapper` wrapping the given request factory.

## Method Summary

Modifier and Type
Method
Description
`final ClientHttpRequest`
`createRequest(URI uri, HttpMethod httpMethod)`
This implementation simply calls `createRequest(URI, HttpMethod, ClientHttpRequestFactory)` with the wrapped request factory provided to the constructor.
`protected abstract ClientHttpRequest`
`createRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory)`
Create a new `ClientHttpRequest` for the specified URI and HTTP method by using the passed-on request factory.
`ClientHttpRequestFactory`
`getDelegate()`
Return the delegate request factory.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AbstractClientHttpRequestFactoryWrapper

protected AbstractClientHttpRequestFactoryWrapper(ClientHttpRequestFactory requestFactory)
Create a `AbstractClientHttpRequestFactoryWrapper` wrapping the given request factory.

Parameters:
  `requestFactory` - the request factory to be wrapped

## Method Details

### createRequest

public final ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException
This implementation simply calls `createRequest(URI, HttpMethod, ClientHttpRequestFactory)` with the wrapped request factory provided to the constructor.

Specified by:
  `createRequest` in interface `ClientHttpRequestFactory`
Parameters:
  `uri` - the URI to create a request for
  `httpMethod` - the HTTP method to execute
Returns:
  the created request
Throws:
  `IOException` - in case of I/O errors

### getDelegate

public ClientHttpRequestFactory getDelegate()
Return the delegate request factory.

Since:
  6.1.4

### createRequest

protected abstract ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory) throws IOException
Create a new `ClientHttpRequest` for the specified URI and HTTP method by using the passed-on request factory.

Called from `createRequest(URI, HttpMethod)`.

Parameters:
  `uri` - the URI to create a request for
  `httpMethod` - the HTTP method to execute
  `requestFactory` - the wrapped request factory
Returns:
  the created request
Throws:
  `IOException` - in case of I/O errors