Class HttpConnection
- java.lang.Object
-
- org.glassfish.jersey.jdk.connector.internal.HttpConnection
-
class HttpConnection extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
HttpConnection.ConnectionFilter
(package private) static class
HttpConnection.State
(package private) static interface
HttpConnection.StateChangeListener
-
Field Summary
Fields Modifier and Type Field 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 byTransportFilter
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 byTransportFilter
when SSL is turned on.(package private) HttpConnection.State
state
private HttpConnection.StateChangeListener
stateListener
private java.net.URI
uri
-
Constructor Summary
Constructors Constructor Description HttpConnection(java.net.URI uri, java.net.CookieManager cookieManager, ConnectorConfiguration configuration, java.util.concurrent.ScheduledExecutorService scheduler, HttpConnection.StateChangeListener stateListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Field Detail
-
SSL_INPUT_BUFFER_SIZE
private static final int SSL_INPUT_BUFFER_SIZE
Input buffer that is used byTransportFilter
when SSL is turned on. The size cannot be smaller than a maximal size of a SSL packet, which is 16kB for payload + header, becauseSslFilter
does not have its own buffer for buffering incoming data and therefore the entire SSL packet must fit intoSslFilter
input buffer.- See Also:
- Constant Field Values
-
INPUT_BUFFER_SIZE
private static final int INPUT_BUFFER_SIZE
Input buffer that is used byTransportFilter
when SSL is not turned on.- See Also:
- Constant Field Values
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
filterChain
private final Filter<HttpRequest,HttpResponse,HttpRequest,HttpResponse> filterChain
-
cookieManager
private final java.net.CookieManager cookieManager
-
uri
private final java.net.URI uri
-
stateListener
private final HttpConnection.StateChangeListener stateListener
-
scheduler
private final java.util.concurrent.ScheduledExecutorService scheduler
-
configuration
private final ConnectorConfiguration configuration
-
httpRequest
private HttpRequest httpRequest
-
httResponse
private HttpResponse httResponse
-
error
private java.lang.Throwable error
-
state
volatile HttpConnection.State state
-
persistentConnection
private boolean persistentConnection
-
responseTimeout
private java.util.concurrent.Future<?> responseTimeout
-
idleTimeout
private java.util.concurrent.Future<?> idleTimeout
-
connectTimeout
private java.util.concurrent.Future<?> connectTimeout
-
-
Constructor Detail
-
HttpConnection
HttpConnection(java.net.URI uri, java.net.CookieManager cookieManager, ConnectorConfiguration configuration, java.util.concurrent.ScheduledExecutorService scheduler, HttpConnection.StateChangeListener stateListener)
-
-
Method Detail
-
connect
void connect()
-
send
void send(HttpRequest httpRequest)
-
close
void close()
-
handleHeaderSent
private void handleHeaderSent()
-
addRequestHeaders
private void addRequestHeaders()
-
processResponseHeaders
private void processResponseHeaders(HttpResponse response) throws java.io.IOException
- Throws:
java.io.IOException
-
createFilterChain
protected Filter<HttpRequest,HttpResponse,HttpRequest,HttpResponse> createFilterChain(java.net.URI uri, ConnectorConfiguration configuration)
-
changeState
private void changeState(HttpConnection.State newState)
-
scheduleResponseTimeout
private void scheduleResponseTimeout()
-
cancelResponseTimeout
private void cancelResponseTimeout()
-
scheduleConnectTimeout
private void scheduleConnectTimeout()
-
cancelConnectTimeout
private void cancelConnectTimeout()
-
scheduleIdleTimeout
private void scheduleIdleTimeout()
-
cancelIdleTimeout
private void cancelIdleTimeout()
-
cancelAllTimeouts
private void cancelAllTimeouts()
-
handleError
private void handleError(java.lang.Throwable t)
-
changeStateToIdle
private void changeStateToIdle()
-
getError
java.lang.Throwable getError()
-
getHttResponse
HttpResponse getHttResponse()
-
handleResponseRead
private void handleResponseRead()
-
-