Package org.apache.http.impl.conn
Class DefaultManagedHttpClientConnection
java.lang.Object
org.apache.http.impl.BHttpConnectionBase
org.apache.http.impl.DefaultBHttpClientConnection
org.apache.http.impl.conn.DefaultManagedHttpClientConnection
- All Implemented Interfaces:
Closeable,AutoCloseable,ManagedHttpClientConnection,org.apache.http.HttpClientConnection,org.apache.http.HttpConnection,org.apache.http.HttpInetConnection,org.apache.http.protocol.HttpContext
- Direct Known Subclasses:
LoggingManagedHttpClientConnection
public class DefaultManagedHttpClientConnection
extends org.apache.http.impl.DefaultBHttpClientConnection
implements ManagedHttpClientConnection, org.apache.http.protocol.HttpContext
Default
ManagedHttpClientConnection implementation.- Since:
- 4.3
-
Field Summary
FieldsFields inherited from interface org.apache.http.protocol.HttpContext
RESERVED_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionDefaultManagedHttpClientConnection(String id, int bufferSize) DefaultManagedHttpClientConnection(String id, int bufferSize, int fragmentSizeHint, CharsetDecoder charDecoder, CharsetEncoder charEncoder, org.apache.http.config.MessageConstraints constraints, org.apache.http.entity.ContentLengthStrategy incomingContentStrategy, org.apache.http.entity.ContentLengthStrategy outgoingContentStrategy, org.apache.http.io.HttpMessageWriterFactory<org.apache.http.HttpRequest> requestWriterFactory, org.apache.http.io.HttpMessageParserFactory<org.apache.http.HttpResponse> responseParserFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidBinds this connection to the given socket.getAttribute(String id) getId()Returns connection ID which is expected to be unique for the life span of the connection manager.Returns the underlying socket.Obtains the SSL session of the underlying connection, if any.voidsetAttribute(String id, Object obj) voidshutdown()Methods inherited from class org.apache.http.impl.DefaultBHttpClientConnection
flush, isResponseAvailable, onRequestSubmitted, onResponseReceived, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeaderMethods inherited from class org.apache.http.impl.BHttpConnectionBase
awaitInput, close, createInputStream, createOutputStream, doFlush, ensureOpen, getLocalAddress, getLocalPort, getMetrics, getRemoteAddress, getRemotePort, getSessionInputBuffer, getSessionOutputBuffer, getSocketInputStream, getSocketOutputStream, getSocketTimeout, incrementRequestCount, incrementResponseCount, isOpen, isStale, prepareInput, prepareOutput, setSocketTimeout, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.http.HttpClientConnection
flush, isResponseAvailable, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeaderMethods inherited from interface org.apache.http.HttpConnection
close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeoutMethods inherited from interface org.apache.http.HttpInetConnection
getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort
-
Field Details
-
id
-
attributes
-
shutdown
private volatile boolean shutdown
-
-
Constructor Details
-
DefaultManagedHttpClientConnection
public DefaultManagedHttpClientConnection(String id, int bufferSize, int fragmentSizeHint, CharsetDecoder charDecoder, CharsetEncoder charEncoder, org.apache.http.config.MessageConstraints constraints, org.apache.http.entity.ContentLengthStrategy incomingContentStrategy, org.apache.http.entity.ContentLengthStrategy outgoingContentStrategy, org.apache.http.io.HttpMessageWriterFactory<org.apache.http.HttpRequest> requestWriterFactory, org.apache.http.io.HttpMessageParserFactory<org.apache.http.HttpResponse> responseParserFactory) -
DefaultManagedHttpClientConnection
-
-
Method Details
-
getId
Description copied from interface:ManagedHttpClientConnectionReturns connection ID which is expected to be unique for the life span of the connection manager.- Specified by:
getIdin interfaceManagedHttpClientConnection
-
shutdown
- Specified by:
shutdownin interfaceorg.apache.http.HttpConnection- Overrides:
shutdownin classorg.apache.http.impl.BHttpConnectionBase- Throws:
IOException
-
getAttribute
- Specified by:
getAttributein interfaceorg.apache.http.protocol.HttpContext
-
removeAttribute
- Specified by:
removeAttributein interfaceorg.apache.http.protocol.HttpContext
-
setAttribute
- Specified by:
setAttributein interfaceorg.apache.http.protocol.HttpContext
-
bind
Description copied from interface:ManagedHttpClientConnectionBinds 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.- Specified by:
bindin interfaceManagedHttpClientConnection- Overrides:
bindin classorg.apache.http.impl.DefaultBHttpClientConnection- Parameters:
socket- the socket to bind the connection to.- Throws:
IOException
-
getSocket
Description copied from interface:ManagedHttpClientConnectionReturns the underlying socket.- Specified by:
getSocketin interfaceManagedHttpClientConnection- Overrides:
getSocketin classorg.apache.http.impl.BHttpConnectionBase
-
getSSLSession
Description copied from interface:ManagedHttpClientConnectionObtains the SSL session of the underlying connection, if any. If this connection is open, and the underlying socket is anSSLSocket, the SSL session of that socket is obtained. This is a potentially blocking operation.- Specified by:
getSSLSessionin interfaceManagedHttpClientConnection- Returns:
- the underlying SSL session if available,
nullotherwise
-