class HttpConnection
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
HttpConnection.ConnectionFilter |
(package private) static class |
HttpConnection.State |
(package private) static interface |
HttpConnection.StateChangeListener |
Modifier and Type | Field and Description |
---|---|
private ConnectorConfiguration |
configuration |
private java.util.concurrent.Future<?> |
connectTimeout |
private java.net.CookieManager |
cookieManager |
private java.lang.Throwable |
error |
private Filter<HttpRequest,HttpResponse,HttpRequest,HttpResponse> |
filterChain |
private HttpRequest |
httpRequest |
private HttpResponse |
httResponse |
private java.util.concurrent.Future<?> |
idleTimeout |
private static int |
INPUT_BUFFER_SIZE
Input buffer that is used by
TransportFilter when SSL is not turned on. |
private static java.util.logging.Logger |
LOGGER |
private boolean |
persistentConnection |
private java.util.concurrent.Future<?> |
responseTimeout |
private java.util.concurrent.ScheduledExecutorService |
scheduler |
private static int |
SSL_INPUT_BUFFER_SIZE
Input buffer that is used by
TransportFilter when SSL is turned on. |
(package private) HttpConnection.State |
state |
private HttpConnection.StateChangeListener |
stateListener |
private java.net.URI |
uri |
Constructor and Description |
---|
HttpConnection(java.net.URI uri,
java.net.CookieManager cookieManager,
ConnectorConfiguration configuration,
java.util.concurrent.ScheduledExecutorService scheduler,
HttpConnection.StateChangeListener stateListener) |
Modifier and Type | Method and Description |
---|---|
private void |
addRequestHeaders() |
private void |
cancelAllTimeouts() |
private void |
cancelConnectTimeout() |
private void |
cancelIdleTimeout() |
private void |
cancelResponseTimeout() |
private void |
changeState(HttpConnection.State newState) |
private void |
changeStateToIdle() |
(package private) void |
close() |
(package private) void |
connect() |
protected Filter<HttpRequest,HttpResponse,HttpRequest,HttpResponse> |
createFilterChain(java.net.URI uri,
ConnectorConfiguration configuration) |
(package private) java.lang.Throwable |
getError() |
(package private) HttpResponse |
getHttResponse() |
private void |
handleError(java.lang.Throwable t) |
private void |
handleHeaderSent() |
private void |
handleResponseRead() |
private void |
processResponseHeaders(HttpResponse response) |
private void |
scheduleConnectTimeout() |
private void |
scheduleIdleTimeout() |
private void |
scheduleResponseTimeout() |
(package private) void |
send(HttpRequest httpRequest) |
private static final int SSL_INPUT_BUFFER_SIZE
TransportFilter
when SSL is turned on.
The size cannot be smaller than a maximal size of a SSL packet, which is 16kB for payload + header, because
SslFilter
does not have its own buffer for buffering incoming
data and therefore the entire SSL packet must fit into SslFilter
input buffer.
private static final int INPUT_BUFFER_SIZE
TransportFilter
when SSL is not turned on.private static final java.util.logging.Logger LOGGER
private final Filter<HttpRequest,HttpResponse,HttpRequest,HttpResponse> filterChain
private final java.net.CookieManager cookieManager
private final java.net.URI uri
private final HttpConnection.StateChangeListener stateListener
private final java.util.concurrent.ScheduledExecutorService scheduler
private final ConnectorConfiguration configuration
private HttpRequest httpRequest
private HttpResponse httResponse
private java.lang.Throwable error
volatile HttpConnection.State state
private boolean persistentConnection
private java.util.concurrent.Future<?> responseTimeout
private java.util.concurrent.Future<?> idleTimeout
private java.util.concurrent.Future<?> connectTimeout
HttpConnection(java.net.URI uri, java.net.CookieManager cookieManager, ConnectorConfiguration configuration, java.util.concurrent.ScheduledExecutorService scheduler, HttpConnection.StateChangeListener stateListener)
void connect()
void send(HttpRequest httpRequest)
void close()
private void handleHeaderSent()
private void addRequestHeaders()
private void processResponseHeaders(HttpResponse response) throws java.io.IOException
java.io.IOException
protected Filter<HttpRequest,HttpResponse,HttpRequest,HttpResponse> createFilterChain(java.net.URI uri, ConnectorConfiguration configuration)
private void changeState(HttpConnection.State newState)
private void scheduleResponseTimeout()
private void cancelResponseTimeout()
private void scheduleConnectTimeout()
private void cancelConnectTimeout()
private void scheduleIdleTimeout()
private void cancelIdleTimeout()
private void cancelAllTimeouts()
private void handleError(java.lang.Throwable t)
private void changeStateToIdle()
java.lang.Throwable getError()
HttpResponse getHttResponse()
private void handleResponseRead()