Deprecated
(4.3) use ManagedHttpClientConnectionFactory.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | attributes
connection specific attributes |
| private boolean | connSecure
Whether this connection is secure. |
| private final Log | |
| private final Log | |
| private volatile boolean | shutdown
True if this connection was shutdown. |
| private volatile Socket | socket
Hides org. |
| private HttpHost | targetHost
The target host of this connection. |
| private final Log |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | bind(final Socket
the socket to bind the connection to. socket)Implements org. |
| public void | close()
Overrides org. Implements org. |
| protected HttpMessageParser | createResponseParser(final SessionInputBuffer
the session input buffer. buffer, final HttpResponseFactory the HTTP response factory. responseFactory, final HttpParams HTTP parameters. params)Overrides org.
Deprecated
as a consequence of
Creates an instance of HttpParams being deprecated.
HttpMessageParser to be used for parsing
HTTP responses received over this connection.
|
| protected SessionInputBuffer | createSessionInputBuffer(final Socket
the socket. socket, final int the buffer size. bufferSize, final HttpParams HTTP parameters. params)Overrides org.
Deprecated
as a consequence of
Creates an instance of HttpParams being deprecated.
SocketInputBuffer to be used for
receiving data from the given Socket.
|
| protected SessionOutputBuffer | createSessionOutputBuffer(final Socket
the socket. socket, final int the buffer size. bufferSize, final HttpParams HTTP parameters. params)Overrides org.
Deprecated
as a consequence of
Creates an instance of HttpParams being deprecated.
SessionOutputBuffer to be used for
sending data to the given Socket.
|
| public Object | getAttribute(final String
the attribute name. id)Implements org. |
| public String | getId()
Implements org. |
| public final Socket | getSocket()
Overrides org. Implements org. |
| public SSLSession | getSSLSession()
Implements org. |
| public final HttpHost | getTargetHost()
Implements org. |
| public final boolean | isSecure()
Implements org. |
| public void | openCompleted(final boolean
true if this connection is secure, for
example if an SSLSocket is used, or
false if it is not secureparameters for this connection. The parameters will
be used when creating dependent objects, for example
to determine buffer sizes. params)Implements org.
Deprecated
as a consequence of
Signals that the connection has been successfully open.
HttpParams being deprecated.
|
| public void | opening(final Socket
the unconnected socket which is about to
be connected. sock, final HttpHost the target host of this connection target)Implements org. |
| public HttpResponse | receiveResponseHeader()
Overrides org. Implements org. |
| public Object | removeAttribute(final String
the attribute name. id)Implements org. |
| public void | sendRequestHeader(final HttpRequest
the request whose headers to send. request)Overrides org. Implements org. |
| public void | setAttribute(final String
the attribute name. id, final Object the attribute value. obj)Implements org. |
| public void | shutdown()
Overrides org. Implements org. |
| public void | update(final Socket
the new socket for communicating with the target host,
or sock, final HttpHost null to continue using the old socket.
If null is passed, helper objects that
depend on the socket should be re-used. In that case,
some changes in the parameters will not take effect.the new target host of this connection target, final boolean true if this connection is now secure,
false if it is not securenew parameters for this connection params)Implements org.
Deprecated
as a consequence of
Updates this connection.
HttpParams being deprecated.
|
| attributes | back to summary |
|---|---|
| private final Map<String, Object> attributes connection specific attributes | |
| connSecure | back to summary |
|---|---|
| private boolean connSecure Whether this connection is secure. | |
| headerLog | back to summary |
|---|---|
| private final Log headerLog | |
| log | back to summary |
|---|---|
| private final Log log | |
| shutdown | back to summary |
|---|---|
| private volatile boolean shutdown True if this connection was shutdown. | |
| socket | back to summary |
|---|---|
| private volatile Socket socket Hides org. The unconnected socket | |
| targetHost | back to summary |
|---|---|
| private HttpHost targetHost The target host of this connection. | |
| wireLog | back to summary |
|---|---|
| private final Log wireLog | |
| DefaultClientConnection | back to summary |
|---|---|
| public DefaultClientConnection() | |
| bind | back to summary |
|---|---|
| public void bind(final Socket socket) throws IOException Implements org. Doc from org. Binds this connection to the given socket. The connection is considered open if it is bound and the underlying socket is connection to a remote host. | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides org. Implements org. Doc from org. Closes this connection gracefully.
This method will attempt to flush the internal output
buffer prior to closing the underlying socket.
This method MUST NOT be called from a different thread to force
shutdown of the connection. Use
| |
| createResponseParser | back to summary |
|---|---|
| protected HttpMessageParser Overrides org. Doc from org. Deprecated as a consequence of Creates an instance of
This method can be overridden in a super class in order to provide
a different implementation of the
| |
| createSessionInputBuffer | back to summary |
|---|---|
| protected SessionInputBuffer createSessionInputBuffer(final Socket socket, final int bufferSize, final HttpParams params) throws IOException Overrides org. Doc from org. Deprecated as a consequence of Creates an instance of
This method can be overridden in a super class in order to provide
a custom implementation of
| |
| createSessionOutputBuffer | back to summary |
|---|---|
| protected SessionOutputBuffer createSessionOutputBuffer(final Socket socket, final int bufferSize, final HttpParams params) throws IOException Overrides org. Doc from org. Deprecated as a consequence of Creates an instance of
This method can be overridden in a super class in order to provide
a custom implementation of
| |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(final String id) Implements org. Doc from org. Obtains attribute with the given name. | |
| getId | back to summary |
|---|---|
| public String getId() Implements org. Doc from org. Returns connection ID which is expected to be unique for the life span of the connection manager.
| |
| getSocket | back to summary |
|---|---|
| public final Socket getSocket() Overrides org. Implements org. Doc from org. Obtains the socket for this connection.
The return value is well-defined only while the connection is open.
It may change even while the connection is open,
because of an
| |
| getSSLSession | back to summary |
|---|---|
| public SSLSession getSSLSession() Implements org. Doc from org. Obtains the SSL session of the underlying connection, if any.
If this connection is open, and the underlying socket is an
| |
| getTargetHost | back to summary |
|---|---|
| public final HttpHost getTargetHost() Implements org. Doc from org. Obtains the target host for this connection. If the connection is to a proxy but not tunnelled, this is the proxy. If the connection is tunnelled through a proxy, this is the target of the tunnel.
The return value is well-defined only while the connection is open.
It may change even while the connection is open,
because of an | |
| isSecure | back to summary |
|---|---|
| public final boolean isSecure() Implements org. Doc from org. Indicates whether this connection is secure.
The return value is well-defined only while the connection is open.
It may change even while the connection is open,
because of an
| |
| openCompleted | back to summary |
|---|---|
| public void openCompleted(final boolean secure, final HttpParams params) throws IOException Implements org. Doc from org. Deprecated as a consequence of Signals that the connection has been successfully open. An attempt to call this method on an open connection will cause an exception.
| |
| opening | back to summary |
|---|---|
| public void opening(final Socket sock, final HttpHost target) throws IOException Implements org. Doc from org. Signals that this connection is in the process of being open.
By calling this method, the connection can be re-initialized
with a new Socket instance before This method can be called multiple times if the connection is layered over another protocol Note This method will not close the previously used socket. It is the caller's responsibility to close that socket if it is no longer required.
The caller must invoke | |
| receiveResponseHeader | back to summary |
|---|---|
| public HttpResponse receiveResponseHeader() throws HttpException, IOException Overrides org. Implements org. Doc from org. Receives the request line and headers of the next response available from this connection. The caller should examine the HttpResponse object to find out if it should try to receive a response entity as well.
| |
| removeAttribute | back to summary |
|---|---|
| public Object removeAttribute(final String id) Implements org. Doc from org. Removes attribute with the given name from the context. | |
| sendRequestHeader | back to summary |
|---|---|
| public void sendRequestHeader(final HttpRequest request) throws HttpException, IOException Overrides org. Implements org. Doc from org. Sends the request line and all headers over the connection.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final String id, final Object obj) Implements org. Doc from org. Sets value of the attribute with the given name. | |
| shutdown | back to summary |
|---|---|
| public void shutdown() throws IOException Overrides org. Implements org. Force-closes this connection.
If the connection is still in the process of being open (the method
| |
| update | back to summary |
|---|---|
| public void update(final Socket sock, final HttpHost target, final boolean secure, final HttpParams params) throws IOException Implements org. Doc from org. Deprecated as a consequence of Updates this connection. A connection can be updated only while it is open. Updates are used for example when a tunnel has been established, or when a TLS/SSL connection has been layered on top of a plain socket connection. Note Updating the connection will not close the previously used socket. It is the caller's responsibility to close that socket if it is no longer required.
| |