Top Description Fields Constructors Methods
org.apache.http.impl.conn

public Class DefaultManagedHttpClientConnection

extends DefaultBHttpClientConnection
implements ManagedHttpClientConnection, HttpContext
Class Inheritance
All Implemented Interfaces
org.apache.http.protocol.HttpContext, org.apache.http.conn.ManagedHttpClientConnection, org.apache.http.HttpInetConnection, org.apache.http.HttpConnection, java.io.Closeable, java.lang.AutoCloseable, org.apache.http.HttpClientConnection
Known Direct Subclasses
org.apache.http.impl.conn.LoggingManagedHttpClientConnection
Imports
java.io.IOException, .InterruptedIOException, java.net.Socket, java.nio.charset.CharsetDecoder, .CharsetEncoder, java.util.Map, java.util.concurrent.ConcurrentHashMap, javax.net.ssl.SSLSession, .SSLSocket, org.apache.http.HttpRequest, .HttpResponse, org.apache.http.config.MessageConstraints, org.apache.http.conn.ManagedHttpClientConnection, org.apache.http.entity.ContentLengthStrategy, org.apache.http.impl.DefaultBHttpClientConnection, org.apache.http.io.HttpMessageParserFactory, .HttpMessageWriterFactory, org.apache.http.protocol.HttpContext

Default ManagedHttpClientConnection implementation.
Since
4.3

Field Summary

Modifier and TypeField and Description
private final Map<String, Object>
private final String
private volatile boolean

Constructor Summary

AccessConstructor and Description
public
DefaultManagedHttpClientConnection(final String id, final int bufferSize, final int fragmentSizeHint, final CharsetDecoder charDecoder, final CharsetEncoder charEncoder, final MessageConstraints constraints, final ContentLengthStrategy incomingContentStrategy, final ContentLengthStrategy outgoingContentStrategy, final HttpMessageWriterFactory<HttpRequest> requestWriterFactory, final HttpMessageParserFactory<HttpResponse> responseParserFactory)

public
DefaultManagedHttpClientConnection(final String id, final int bufferSize)

Method Summary

Modifier and TypeMethod and Description
public void
bind(final Socket
the socket to bind the connection to.
socket
)

Overrides org.apache.http.impl.DefaultBHttpClientConnection.bind.

Implements org.apache.http.conn.ManagedHttpClientConnection.bind.

Binds this connection to the given socket.
public Object
getAttribute(final String
the attribute name.
id
)

Implements org.apache.http.protocol.HttpContext.getAttribute.

Obtains attribute with the given name.
public String
getId()

Implements org.apache.http.conn.ManagedHttpClientConnection.getId.

Returns connection ID which is expected to be unique for the life span of the connection manager.
public Socket
public SSLSession
getSSLSession()

Implements org.apache.http.conn.ManagedHttpClientConnection.getSSLSession.

Obtains the SSL session of the underlying connection, if any.
public Object
removeAttribute(final String
the attribute name.
id
)

Implements org.apache.http.protocol.HttpContext.removeAttribute.

Removes attribute with the given name from the context.
public void
setAttribute(final String
the attribute name.
id
,
final Object
the attribute value.
obj
)

Implements org.apache.http.protocol.HttpContext.setAttribute.

Sets value of the attribute with the given name.
public void
Inherited from org.apache.http.impl.DefaultBHttpClientConnection:
flushisResponseAvailableonRequestSubmittedonResponseReceivedreceiveResponseEntityreceiveResponseHeadersendRequestEntitysendRequestHeader

Field Detail

attributesback to summary
private final Map<String, Object> attributes
idback to summary
private final String id
shutdownback to summary
private volatile boolean shutdown

Constructor Detail

DefaultManagedHttpClientConnectionback to summary
public DefaultManagedHttpClientConnection(final String id, final int bufferSize, final int fragmentSizeHint, final CharsetDecoder charDecoder, final CharsetEncoder charEncoder, final MessageConstraints constraints, final ContentLengthStrategy incomingContentStrategy, final ContentLengthStrategy outgoingContentStrategy, final HttpMessageWriterFactory<HttpRequest> requestWriterFactory, final HttpMessageParserFactory<HttpResponse> responseParserFactory)
DefaultManagedHttpClientConnectionback to summary
public DefaultManagedHttpClientConnection(final String id, final int bufferSize)

Method Detail

bindback to summary
public void bind(final Socket socket) throws IOException

Overrides org.apache.http.impl.DefaultBHttpClientConnection.bind.

Implements org.apache.http.conn.ManagedHttpClientConnection.bind.

Doc from org.apache.http.conn.ManagedHttpClientConnection.bind.

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.

Parameters
socket:Socket

the socket to bind the connection to.

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.http.impl.BHttpConnectionBase.bind.

in case of an I/O error.

getAttributeback to summary
public Object getAttribute(final String id)

Implements org.apache.http.protocol.HttpContext.getAttribute.

Doc from org.apache.http.protocol.HttpContext.getAttribute.

Obtains attribute with the given name.

Parameters
id:String

the attribute name.

Returns:Object

attribute value, or null if not set.

Annotations
@Override
getIdback to summary
public String getId()

Implements org.apache.http.conn.ManagedHttpClientConnection.getId.

Doc from org.apache.http.conn.ManagedHttpClientConnection.getId.

Returns connection ID which is expected to be unique for the life span of the connection manager.

Annotations
@Override
getSocketback to summary
public Socket getSocket()

Overrides org.apache.http.impl.BHttpConnectionBase.getSocket.

Implements org.apache.http.conn.ManagedHttpClientConnection.getSocket.

Doc from org.apache.http.conn.ManagedHttpClientConnection.getSocket.

Returns the underlying socket.

Annotations
@Override
getSSLSessionback to summary
public SSLSession getSSLSession()

Implements org.apache.http.conn.ManagedHttpClientConnection.getSSLSession.

Doc from org.apache.http.conn.ManagedHttpClientConnection.getSSLSession.

Obtains the SSL session of the underlying connection, if any. If this connection is open, and the underlying socket is an SSLSocket, the SSL session of that socket is obtained. This is a potentially blocking operation.

Returns:SSLSession

the underlying SSL session if available, null otherwise

Annotations
@Override
removeAttributeback to summary
public Object removeAttribute(final String id)

Implements org.apache.http.protocol.HttpContext.removeAttribute.

Doc from org.apache.http.protocol.HttpContext.removeAttribute.

Removes attribute with the given name from the context.

Parameters
id:String

the attribute name.

Returns:Object

attribute value, or null if not set.

Annotations
@Override
setAttributeback to summary
public void setAttribute(final String id, final Object obj)

Implements org.apache.http.protocol.HttpContext.setAttribute.

Doc from org.apache.http.protocol.HttpContext.setAttribute.

Sets value of the attribute with the given name.

Parameters
id:String

the attribute name.

obj:Object

the attribute value.

Annotations
@Override
shutdownback to summary
public void shutdown() throws IOException

Overrides org.apache.http.impl.BHttpConnectionBase.shutdown.

Implements org.apache.http.HttpConnection.shutdown.

Doc from org.apache.http.HttpConnection.shutdown.

Force-closes this connection. This is the only method of a connection which may be called from a different thread to terminate the connection. This method will not attempt to flush the transmitter's internal buffer prior to closing the underlying socket.

Annotations
@Override