Package org.apache.http.impl.conn
Class CPoolProxy
java.lang.Object
org.apache.http.impl.conn.CPoolProxy
- All Implemented Interfaces:
Closeable,AutoCloseable,ManagedHttpClientConnection,org.apache.http.HttpClientConnection,org.apache.http.HttpConnection,org.apache.http.HttpInetConnection,org.apache.http.protocol.HttpContext
class CPoolProxy
extends Object
implements ManagedHttpClientConnection, org.apache.http.protocol.HttpContext
- Since:
- 4.3
-
Field Summary
FieldsFields inherited from interface org.apache.http.protocol.HttpContext
RESERVED_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBinds this connection to the given socket.voidclose()(package private) CPoolEntrydetach()static CPoolEntrydetach(org.apache.http.HttpClientConnection conn) voidflush()getAttribute(String id) (package private) ManagedHttpClientConnectiongetId()Returns connection ID which is expected to be unique for the life span of the connection manager.intorg.apache.http.HttpConnectionMetrics(package private) CPoolEntrystatic CPoolEntrygetPoolEntry(org.apache.http.HttpClientConnection proxy) private static CPoolProxygetProxy(org.apache.http.HttpClientConnection conn) intReturns the underlying socket.intObtains the SSL session of the underlying connection, if any.(package private) ManagedHttpClientConnectionbooleanisOpen()booleanisResponseAvailable(int timeout) booleanisStale()static org.apache.http.HttpClientConnectionnewProxy(CPoolEntry poolEntry) voidreceiveResponseEntity(org.apache.http.HttpResponse response) org.apache.http.HttpResponsevoidsendRequestEntity(org.apache.http.HttpEntityEnclosingRequest request) voidsendRequestHeader(org.apache.http.HttpRequest request) voidsetAttribute(String id, Object obj) voidsetSocketTimeout(int timeout) voidshutdown()toString()
-
Field Details
-
poolEntry
-
-
Constructor Details
-
CPoolProxy
CPoolProxy(CPoolEntry entry)
-
-
Method Details
-
getPoolEntry
CPoolEntry getPoolEntry() -
detach
CPoolEntry detach() -
getConnection
ManagedHttpClientConnection getConnection() -
getValidConnection
ManagedHttpClientConnection getValidConnection() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.apache.http.HttpConnection- Throws:
IOException
-
shutdown
- Specified by:
shutdownin interfaceorg.apache.http.HttpConnection- Throws:
IOException
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceorg.apache.http.HttpConnection
-
isStale
public boolean isStale()- Specified by:
isStalein interfaceorg.apache.http.HttpConnection
-
setSocketTimeout
public void setSocketTimeout(int timeout) - Specified by:
setSocketTimeoutin interfaceorg.apache.http.HttpConnection
-
getSocketTimeout
public int getSocketTimeout()- Specified by:
getSocketTimeoutin interfaceorg.apache.http.HttpConnection
-
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
-
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- Parameters:
socket- the socket to bind the connection to.- Throws:
IOException
-
getSocket
Description copied from interface:ManagedHttpClientConnectionReturns the underlying socket.- Specified by:
getSocketin interfaceManagedHttpClientConnection
-
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
-
isResponseAvailable
- Specified by:
isResponseAvailablein interfaceorg.apache.http.HttpClientConnection- Throws:
IOException
-
sendRequestHeader
public void sendRequestHeader(org.apache.http.HttpRequest request) throws org.apache.http.HttpException, IOException - Specified by:
sendRequestHeaderin interfaceorg.apache.http.HttpClientConnection- Throws:
org.apache.http.HttpExceptionIOException
-
sendRequestEntity
public void sendRequestEntity(org.apache.http.HttpEntityEnclosingRequest request) throws org.apache.http.HttpException, IOException - Specified by:
sendRequestEntityin interfaceorg.apache.http.HttpClientConnection- Throws:
org.apache.http.HttpExceptionIOException
-
receiveResponseHeader
public org.apache.http.HttpResponse receiveResponseHeader() throws org.apache.http.HttpException, IOException- Specified by:
receiveResponseHeaderin interfaceorg.apache.http.HttpClientConnection- Throws:
org.apache.http.HttpExceptionIOException
-
receiveResponseEntity
public void receiveResponseEntity(org.apache.http.HttpResponse response) throws org.apache.http.HttpException, IOException - Specified by:
receiveResponseEntityin interfaceorg.apache.http.HttpClientConnection- Throws:
org.apache.http.HttpExceptionIOException
-
flush
- Specified by:
flushin interfaceorg.apache.http.HttpClientConnection- Throws:
IOException
-
getMetrics
public org.apache.http.HttpConnectionMetrics getMetrics()- Specified by:
getMetricsin interfaceorg.apache.http.HttpConnection
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceorg.apache.http.HttpInetConnection
-
getLocalPort
public int getLocalPort()- Specified by:
getLocalPortin interfaceorg.apache.http.HttpInetConnection
-
getRemoteAddress
- Specified by:
getRemoteAddressin interfaceorg.apache.http.HttpInetConnection
-
getRemotePort
public int getRemotePort()- Specified by:
getRemotePortin interfaceorg.apache.http.HttpInetConnection
-
getAttribute
- Specified by:
getAttributein interfaceorg.apache.http.protocol.HttpContext
-
setAttribute
- Specified by:
setAttributein interfaceorg.apache.http.protocol.HttpContext
-
removeAttribute
- Specified by:
removeAttributein interfaceorg.apache.http.protocol.HttpContext
-
toString
-
newProxy
-
getProxy
-
getPoolEntry
-
detach
-