class InterceptingAsyncClientHttpRequest extends AbstractBufferingAsyncClientHttpRequest
AsyncClientHttpRequest
wrapper that enriches it proceeds the actual
request execution with calling the registered interceptors.InterceptingAsyncClientHttpRequestFactory
Modifier and Type | Class and Description |
---|---|
private class |
InterceptingAsyncClientHttpRequest.AsyncRequestExecution |
Modifier and Type | Field and Description |
---|---|
private HttpMethod |
httpMethod |
private java.util.List<AsyncClientHttpRequestInterceptor> |
interceptors |
private AsyncClientHttpRequestFactory |
requestFactory |
private java.net.URI |
uri |
Constructor and Description |
---|
InterceptingAsyncClientHttpRequest(AsyncClientHttpRequestFactory requestFactory,
java.util.List<AsyncClientHttpRequestInterceptor> interceptors,
java.net.URI uri,
HttpMethod httpMethod)
Creates new instance of
InterceptingAsyncClientHttpRequest . |
Modifier and Type | Method and Description |
---|---|
protected ListenableFuture<ClientHttpResponse> |
executeInternal(HttpHeaders headers,
byte[] body)
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.
|
executeInternal, getBodyInternal
assertNotExecuted, executeAsync, getBody, getHeaders
private AsyncClientHttpRequestFactory requestFactory
private java.util.List<AsyncClientHttpRequestInterceptor> interceptors
private java.net.URI uri
private HttpMethod httpMethod
public InterceptingAsyncClientHttpRequest(AsyncClientHttpRequestFactory requestFactory, java.util.List<AsyncClientHttpRequestInterceptor> interceptors, java.net.URI uri, HttpMethod httpMethod)
InterceptingAsyncClientHttpRequest
.requestFactory
- the async request factoryinterceptors
- the list of interceptorsuri
- the request URIhttpMethod
- the HTTP methodprotected ListenableFuture<ClientHttpResponse> executeInternal(HttpHeaders headers, byte[] body) throws java.io.IOException
AbstractBufferingAsyncClientHttpRequest
executeInternal
in class AbstractBufferingAsyncClientHttpRequest
headers
- the HTTP headersbody
- the body contentjava.io.IOException
public HttpMethod getMethod()
HttpRequest
null
if not resolvable (e.g. in case of a non-standard HTTP method)public java.net.URI getURI()
HttpRequest
null
)