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

pack-priv Class CPoolProxy

extends Object
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
Imports
java.io.IOException, java.net.InetAddress, .Socket, javax.net.ssl.SSLSession, org.apache.http.HttpClientConnection, .HttpConnectionMetrics, .HttpEntityEnclosingRequest, .HttpException, .HttpRequest, .HttpResponse, org.apache.http.conn.ManagedHttpClientConnection, org.apache.http.protocol.HttpContext

Since
4.3

Field Summary

Modifier and TypeField and Description
private volatile CPoolEntry

Constructor Summary

AccessConstructor and Description
pack-priv
CPoolProxy(final CPoolEntry entry)

Method Summary

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

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

Binds this connection to the given socket.
public void
close()

Implements org.apache.http.HttpConnection.close.

Closes this connection gracefully.
pack-priv CPoolEntry
public static CPoolEntry
public void
flush()

Implements org.apache.http.HttpClientConnection.flush.

Writes out all pending buffered data over the open connection.
public Object
getAttribute(final String
the attribute name.
id
)

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

Obtains attribute with the given name.
pack-priv ManagedHttpClientConnection
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 InetAddress
public int
public HttpConnectionMetrics
getMetrics()

Implements org.apache.http.HttpConnection.getMetrics.

Returns a collection of connection metrics.
pack-priv CPoolEntry
public static CPoolEntry
private static CPoolProxy
public InetAddress
public int
public Socket
getSocket()

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

Returns the underlying socket.
public int
getSocketTimeout()

Implements org.apache.http.HttpConnection.getSocketTimeout.

Returns the socket timeout value.
public SSLSession
getSSLSession()

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

Obtains the SSL session of the underlying connection, if any.
pack-priv ManagedHttpClientConnection
public boolean
isOpen()

Implements org.apache.http.HttpConnection.isOpen.

Checks if this connection is open.
public boolean
isResponseAvailable(final int
the maximum time in milliseconds to wait for data
timeout
)

Implements org.apache.http.HttpClientConnection.isResponseAvailable.

Checks if response data is available from the connection.
public boolean
isStale()

Implements org.apache.http.HttpConnection.isStale.

Checks whether this connection has gone down.
public static HttpClientConnection
newProxy(final CPoolEntry poolEntry)

public void
receiveResponseEntity(final HttpResponse
the response to attach the entity to
response
)

Implements org.apache.http.HttpClientConnection.receiveResponseEntity.

Receives the next response entity available from this connection and attaches it to an existing HttpResponse object.
public HttpResponse
receiveResponseHeader()

Implements org.apache.http.HttpClientConnection.receiveResponseHeader.

Receives the request line and headers of the next response available from this connection.
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
sendRequestEntity(final HttpEntityEnclosingRequest
the request whose entity to send.
request
)

Implements org.apache.http.HttpClientConnection.sendRequestEntity.

Sends the request entity over the connection.
public void
sendRequestHeader(final HttpRequest
the request whose headers to send.
request
)

Implements org.apache.http.HttpClientConnection.sendRequestHeader.

Sends the request line and all headers over the connection.
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
setSocketTimeout(final int
timeout value in milliseconds
timeout
)

Implements org.apache.http.HttpConnection.setSocketTimeout.

Sets the socket timeout value.
public void
shutdown()

Implements org.apache.http.HttpConnection.shutdown.

Force-closes this connection.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

poolEntryback to summary
private volatile CPoolEntry poolEntry

Constructor Detail

CPoolProxyback to summary
pack-priv CPoolProxy(final CPoolEntry entry)

Method Detail

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

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
closeback to summary
public void close() throws IOException

Implements org.apache.http.HttpConnection.close.

Doc from org.apache.http.HttpConnection.close.

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 shutdown instead.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.Closeable.close.

if an I/O error occurs

detachback to summary
pack-priv CPoolEntry detach()
detachback to summary
public static CPoolEntry detach(final HttpClientConnection conn)
flushback to summary
public void flush() throws IOException

Implements org.apache.http.HttpClientConnection.flush.

Doc from org.apache.http.HttpClientConnection.flush.

Writes out all pending buffered data over the open connection.

Annotations
@Override
Exceptions
IOException:
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
getConnectionback to summary
pack-priv ManagedHttpClientConnection getConnection()
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
getLocalAddressback to summary
public InetAddress getLocalAddress()

Implements org.apache.http.HttpInetConnection.getLocalAddress.

Annotations
@Override
getLocalPortback to summary
public int getLocalPort()

Implements org.apache.http.HttpInetConnection.getLocalPort.

Annotations
@Override
getMetricsback to summary
public HttpConnectionMetrics getMetrics()

Implements org.apache.http.HttpConnection.getMetrics.

Doc from org.apache.http.HttpConnection.getMetrics.

Returns a collection of connection metrics.

Returns:HttpConnectionMetrics

HttpConnectionMetrics

Annotations
@Override
getPoolEntryback to summary
pack-priv CPoolEntry getPoolEntry()
getPoolEntryback to summary
public static CPoolEntry getPoolEntry(final HttpClientConnection proxy)
getProxyback to summary
private static CPoolProxy getProxy(final HttpClientConnection conn)
getRemoteAddressback to summary
public InetAddress getRemoteAddress()

Implements org.apache.http.HttpInetConnection.getRemoteAddress.

Annotations
@Override
getRemotePortback to summary
public int getRemotePort()

Implements org.apache.http.HttpInetConnection.getRemotePort.

Annotations
@Override
getSocketback to summary
public Socket getSocket()

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

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

Returns the underlying socket.

Annotations
@Override
getSocketTimeoutback to summary
public int getSocketTimeout()

Implements org.apache.http.HttpConnection.getSocketTimeout.

Doc from org.apache.http.HttpConnection.getSocketTimeout.

Returns the socket timeout value.

Returns:int

positive value in milliseconds if a timeout is set, 0 if timeout is disabled or -1 if timeout is undefined.

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
getValidConnectionback to summary
pack-priv ManagedHttpClientConnection getValidConnection()
isOpenback to summary
public boolean isOpen()

Implements org.apache.http.HttpConnection.isOpen.

Doc from org.apache.http.HttpConnection.isOpen.

Checks if this connection is open.

Returns:boolean

true if it is open, false if it is closed.

Annotations
@Override
isResponseAvailableback to summary
public boolean isResponseAvailable(final int timeout) throws IOException

Implements org.apache.http.HttpClientConnection.isResponseAvailable.

Doc from org.apache.http.HttpClientConnection.isResponseAvailable.

Checks if response data is available from the connection. May wait for the specified time until some data becomes available. Note that some implementations may completely ignore the timeout parameter.

Parameters
timeout:int

the maximum time in milliseconds to wait for data

Returns:boolean

true if data is available; false if there was no data available even after waiting for timeout milliseconds.

Annotations
@Override
Exceptions
IOException:
if an error happens on the connection
isStaleback to summary
public boolean isStale()

Implements org.apache.http.HttpConnection.isStale.

Doc from org.apache.http.HttpConnection.isStale.

Checks whether this connection has gone down. Network connections may get closed during some time of inactivity for several reasons. The next time a read is attempted on such a connection it will throw an IOException. This method tries to alleviate this inconvenience by trying to find out if a connection is still usable. Implementations may do that by attempting a read with a very small timeout. Thus this method may block for a small amount of time before returning a result. It is therefore an expensive operation.

Returns:boolean

true if attempts to use this connection are likely to succeed, or false if they are likely to fail and this connection should be closed

Annotations
@Override
newProxyback to summary
public static HttpClientConnection newProxy(final CPoolEntry poolEntry)
receiveResponseEntityback to summary
public void receiveResponseEntity(final HttpResponse response) throws HttpException, IOException

Implements org.apache.http.HttpClientConnection.receiveResponseEntity.

Doc from org.apache.http.HttpClientConnection.receiveResponseEntity.

Receives the next response entity available from this connection and attaches it to an existing HttpResponse object.

Parameters
response:HttpResponse

the response to attach the entity to

Annotations
@Override
Exceptions
HttpException:
in case of HTTP protocol violation
IOException:
in case of an I/O error
receiveResponseHeaderback to summary
public HttpResponse receiveResponseHeader() throws HttpException, IOException

Implements org.apache.http.HttpClientConnection.receiveResponseHeader.

Doc from org.apache.http.HttpClientConnection.receiveResponseHeader.

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.

Returns:HttpResponse

a new HttpResponse object with status line and headers initialized.

Annotations
@Override
Exceptions
HttpException:
in case of HTTP protocol violation
IOException:
in case of an I/O error
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
sendRequestEntityback to summary
public void sendRequestEntity(final HttpEntityEnclosingRequest request) throws HttpException, IOException

Implements org.apache.http.HttpClientConnection.sendRequestEntity.

Doc from org.apache.http.HttpClientConnection.sendRequestEntity.

Sends the request entity over the connection.

Parameters
request:HttpEntityEnclosingRequest

the request whose entity to send.

Annotations
@Override
Exceptions
HttpException:
in case of HTTP protocol violation
IOException:
in case of an I/O error
sendRequestHeaderback to summary
public void sendRequestHeader(final HttpRequest request) throws HttpException, IOException

Implements org.apache.http.HttpClientConnection.sendRequestHeader.

Doc from org.apache.http.HttpClientConnection.sendRequestHeader.

Sends the request line and all headers over the connection.

Parameters
request:HttpRequest

the request whose headers to send.

Annotations
@Override
Exceptions
HttpException:
in case of HTTP protocol violation
IOException:
in case of an I/O error
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
setSocketTimeoutback to summary
public void setSocketTimeout(final int timeout)

Implements org.apache.http.HttpConnection.setSocketTimeout.

Doc from org.apache.http.HttpConnection.setSocketTimeout.

Sets the socket timeout value.

Parameters
timeout:int

timeout value in milliseconds

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

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
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override