final class HttpComponentsStreamingClientHttpRequest extends AbstractClientHttpRequest implements StreamingHttpOutputMessage
ClientHttpRequest
implementation based on
Apache HttpComponents HttpClient in streaming mode.
Created via the HttpComponentsClientHttpRequestFactory
.
HttpComponentsClientHttpRequestFactory.createRequest(java.net.URI, org.springframework.http.HttpMethod)
Modifier and Type | Class and Description |
---|---|
private static class |
HttpComponentsStreamingClientHttpRequest.StreamingHttpEntity |
StreamingHttpOutputMessage.Body
Modifier and Type | Field and Description |
---|---|
private StreamingHttpOutputMessage.Body |
body |
private HttpClient |
httpClient |
private HttpContext |
httpContext |
private HttpUriRequest |
httpRequest |
Constructor and Description |
---|
HttpComponentsStreamingClientHttpRequest(HttpClient client,
HttpUriRequest request,
HttpContext context) |
Modifier and Type | Method and Description |
---|---|
protected ClientHttpResponse |
executeInternal(HttpHeaders headers)
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.
|
java.lang.String |
getMethodValue()
Return the HTTP method of the request as a String value.
|
java.net.URI |
getURI()
Return the URI of the request (including a query string if any,
but only if it is well-formed for a URI representation).
|
void |
setBody(StreamingHttpOutputMessage.Body body)
Set the streaming body callback for this message.
|
assertNotExecuted, execute, getBody, getHeaders
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBody
getHeaders
getMethod
private final HttpClient httpClient
private final HttpUriRequest httpRequest
private final HttpContext httpContext
@Nullable private StreamingHttpOutputMessage.Body body
HttpComponentsStreamingClientHttpRequest(HttpClient client, HttpUriRequest request, HttpContext context)
public java.lang.String getMethodValue()
HttpRequest
getMethodValue
in interface HttpRequest
HttpRequest.getMethod()
public java.net.URI getURI()
HttpRequest
getURI
in interface HttpRequest
null
)public void setBody(StreamingHttpOutputMessage.Body body)
StreamingHttpOutputMessage
setBody
in interface StreamingHttpOutputMessage
body
- the streaming body callbackprotected java.io.OutputStream getBodyInternal(HttpHeaders headers) throws java.io.IOException
AbstractClientHttpRequest
getBodyInternal
in class AbstractClientHttpRequest
headers
- the HTTP headersjava.io.IOException
protected ClientHttpResponse executeInternal(HttpHeaders headers) throws java.io.IOException
AbstractClientHttpRequest
executeInternal
in class AbstractClientHttpRequest
headers
- the HTTP headersjava.io.IOException