class CPoolProxy extends java.lang.Object implements ManagedHttpClientConnection, org.apache.http.protocol.HttpContext
Modifier and Type | Field and Description |
---|---|
private CPoolEntry |
poolEntry |
Constructor and Description |
---|
CPoolProxy(CPoolEntry entry) |
Modifier and Type | Method and Description |
---|---|
void |
bind(java.net.Socket socket)
Binds this connection to the given socket.
|
void |
close() |
(package private) CPoolEntry |
detach() |
static CPoolEntry |
detach(org.apache.http.HttpClientConnection conn) |
void |
flush() |
java.lang.Object |
getAttribute(java.lang.String id) |
(package private) ManagedHttpClientConnection |
getConnection() |
java.lang.String |
getId()
Returns connection ID which is expected to be unique
for the life span of the connection manager.
|
java.net.InetAddress |
getLocalAddress() |
int |
getLocalPort() |
org.apache.http.HttpConnectionMetrics |
getMetrics() |
(package private) CPoolEntry |
getPoolEntry() |
static CPoolEntry |
getPoolEntry(org.apache.http.HttpClientConnection proxy) |
private static CPoolProxy |
getProxy(org.apache.http.HttpClientConnection conn) |
java.net.InetAddress |
getRemoteAddress() |
int |
getRemotePort() |
java.net.Socket |
getSocket()
Returns the underlying socket.
|
int |
getSocketTimeout() |
javax.net.ssl.SSLSession |
getSSLSession()
Obtains the SSL session of the underlying connection, if any.
|
(package private) ManagedHttpClientConnection |
getValidConnection() |
boolean |
isOpen() |
boolean |
isResponseAvailable(int timeout) |
boolean |
isStale() |
static org.apache.http.HttpClientConnection |
newProxy(CPoolEntry poolEntry) |
void |
receiveResponseEntity(org.apache.http.HttpResponse response) |
org.apache.http.HttpResponse |
receiveResponseHeader() |
java.lang.Object |
removeAttribute(java.lang.String id) |
void |
sendRequestEntity(org.apache.http.HttpEntityEnclosingRequest request) |
void |
sendRequestHeader(org.apache.http.HttpRequest request) |
void |
setAttribute(java.lang.String id,
java.lang.Object obj) |
void |
setSocketTimeout(int timeout) |
void |
shutdown() |
java.lang.String |
toString() |
private volatile CPoolEntry poolEntry
CPoolProxy(CPoolEntry entry)
CPoolEntry getPoolEntry()
CPoolEntry detach()
ManagedHttpClientConnection getConnection()
ManagedHttpClientConnection getValidConnection()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface org.apache.http.HttpConnection
java.io.IOException
public void shutdown() throws java.io.IOException
shutdown
in interface org.apache.http.HttpConnection
java.io.IOException
public boolean isOpen()
isOpen
in interface org.apache.http.HttpConnection
public boolean isStale()
isStale
in interface org.apache.http.HttpConnection
public void setSocketTimeout(int timeout)
setSocketTimeout
in interface org.apache.http.HttpConnection
public int getSocketTimeout()
getSocketTimeout
in interface org.apache.http.HttpConnection
public java.lang.String getId()
ManagedHttpClientConnection
getId
in interface ManagedHttpClientConnection
public void bind(java.net.Socket socket) throws java.io.IOException
ManagedHttpClientConnection
bind
in interface ManagedHttpClientConnection
socket
- the socket to bind the connection to.java.io.IOException
public java.net.Socket getSocket()
ManagedHttpClientConnection
getSocket
in interface ManagedHttpClientConnection
public javax.net.ssl.SSLSession getSSLSession()
ManagedHttpClientConnection
SSLSocket
, the SSL session of
that socket is obtained. This is a potentially blocking operation.getSSLSession
in interface ManagedHttpClientConnection
null
otherwisepublic boolean isResponseAvailable(int timeout) throws java.io.IOException
isResponseAvailable
in interface org.apache.http.HttpClientConnection
java.io.IOException
public void sendRequestHeader(org.apache.http.HttpRequest request) throws org.apache.http.HttpException, java.io.IOException
sendRequestHeader
in interface org.apache.http.HttpClientConnection
org.apache.http.HttpException
java.io.IOException
public void sendRequestEntity(org.apache.http.HttpEntityEnclosingRequest request) throws org.apache.http.HttpException, java.io.IOException
sendRequestEntity
in interface org.apache.http.HttpClientConnection
org.apache.http.HttpException
java.io.IOException
public org.apache.http.HttpResponse receiveResponseHeader() throws org.apache.http.HttpException, java.io.IOException
receiveResponseHeader
in interface org.apache.http.HttpClientConnection
org.apache.http.HttpException
java.io.IOException
public void receiveResponseEntity(org.apache.http.HttpResponse response) throws org.apache.http.HttpException, java.io.IOException
receiveResponseEntity
in interface org.apache.http.HttpClientConnection
org.apache.http.HttpException
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface org.apache.http.HttpClientConnection
java.io.IOException
public org.apache.http.HttpConnectionMetrics getMetrics()
getMetrics
in interface org.apache.http.HttpConnection
public java.net.InetAddress getLocalAddress()
getLocalAddress
in interface org.apache.http.HttpInetConnection
public int getLocalPort()
getLocalPort
in interface org.apache.http.HttpInetConnection
public java.net.InetAddress getRemoteAddress()
getRemoteAddress
in interface org.apache.http.HttpInetConnection
public int getRemotePort()
getRemotePort
in interface org.apache.http.HttpInetConnection
public java.lang.Object getAttribute(java.lang.String id)
getAttribute
in interface org.apache.http.protocol.HttpContext
public void setAttribute(java.lang.String id, java.lang.Object obj)
setAttribute
in interface org.apache.http.protocol.HttpContext
public java.lang.Object removeAttribute(java.lang.String id)
removeAttribute
in interface org.apache.http.protocol.HttpContext
public java.lang.String toString()
toString
in class java.lang.Object
public static org.apache.http.HttpClientConnection newProxy(CPoolEntry poolEntry)
private static CPoolProxy getProxy(org.apache.http.HttpClientConnection conn)
public static CPoolEntry getPoolEntry(org.apache.http.HttpClientConnection proxy)
public static CPoolEntry detach(org.apache.http.HttpClientConnection conn)