class Netty4ClientHttpRequest extends AbstractAsyncClientHttpRequest implements ClientHttpRequest
ClientHttpRequest implementation
that uses Netty 4 to execute requests.
Created via the Netty4ClientHttpRequestFactory.
| Modifier and Type | Class and Description |
|---|---|
private static class |
Netty4ClientHttpRequest.RequestExecuteHandler
A SimpleChannelInboundHandler to update the given SettableListenableFuture.
|
| Modifier and Type | Field and Description |
|---|---|
private ByteBufOutputStream |
body |
private Bootstrap |
bootstrap |
private HttpMethod |
method |
private java.net.URI |
uri |
| Constructor and Description |
|---|
Netty4ClientHttpRequest(Bootstrap bootstrap,
java.net.URI uri,
HttpMethod method) |
| Modifier and Type | Method and Description |
|---|---|
private FullHttpRequest |
createFullHttpRequest(HttpHeaders headers) |
ClientHttpResponse |
execute()
Execute this request, resulting in a
ClientHttpResponse that can be read. |
protected ListenableFuture<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.
|
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
private static int |
getPort(java.net.URI uri) |
java.net.URI |
getURI()
Return the URI of the request.
|
assertNotExecuted, executeAsync, getBody, getHeadersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBodygetHeadersprivate final Bootstrap bootstrap
private final java.net.URI uri
private final HttpMethod method
private final ByteBufOutputStream body
public Netty4ClientHttpRequest(Bootstrap bootstrap,
java.net.URI uri,
HttpMethod method)
public HttpMethod getMethod()
HttpRequestgetMethod in interface HttpRequestnull
if not resolvable (e.g. in case of a non-standard HTTP method)public java.net.URI getURI()
HttpRequestgetURI in interface HttpRequestnull)protected java.io.OutputStream getBodyInternal(HttpHeaders headers) throws java.io.IOException
AbstractAsyncClientHttpRequestgetBodyInternal in class AbstractAsyncClientHttpRequestheaders - the HTTP headersjava.io.IOExceptionprotected ListenableFuture<ClientHttpResponse> executeInternal(HttpHeaders headers) throws java.io.IOException
AbstractAsyncClientHttpRequestexecuteInternal in class AbstractAsyncClientHttpRequestheaders - the HTTP headersjava.io.IOExceptionpublic ClientHttpResponse execute() throws java.io.IOException
ClientHttpRequestClientHttpResponse that can be read.execute in interface ClientHttpRequestjava.io.IOException - in case of I/O errorsprivate static int getPort(java.net.URI uri)
private FullHttpRequest createFullHttpRequest(HttpHeaders headers)