|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.AbstractHttpClientConnection
public abstract class AbstractHttpClientConnection
Abstract client-side HTTP connection capable of transmitting and receiving data
using arbitrary SessionInputBuffer
and SessionOutputBuffer
Constructor Summary | |
---|---|
AbstractHttpClientConnection()
|
Method Summary | |
---|---|
protected abstract void |
assertOpen()
|
protected EntityDeserializer |
createEntityDeserializer()
|
protected EntitySerializer |
createEntitySerializer()
|
protected HttpResponseFactory |
createHttpResponseFactory()
|
protected HttpMessageWriter |
createRequestWriter(SessionOutputBuffer buffer,
HttpParams params)
|
protected HttpMessageParser |
createResponseParser(SessionInputBuffer buffer,
HttpResponseFactory responseFactory,
HttpParams params)
|
protected void |
doFlush()
|
void |
flush()
Writes out all pending buffered data over the open connection. |
HttpConnectionMetrics |
getMetrics()
Returns a collection of connection metrcis |
protected void |
init(SessionInputBuffer inbuffer,
SessionOutputBuffer outbuffer,
HttpParams params)
|
boolean |
isResponseAvailable(int timeout)
Checks if response data is available from the connection. |
boolean |
isStale()
Checks whether this connection has gone down. |
void |
receiveResponseEntity(HttpResponse response)
Receives the next response entity available from this connection and attaches it to an existing HttpResponse object. |
HttpResponse |
receiveResponseHeader()
Receives the request line and headers of the next response available from this connection. |
void |
sendRequestEntity(HttpEntityEnclosingRequest request)
Sends the request entity over the connection. |
void |
sendRequestHeader(HttpRequest request)
Sends the request line and all headers over the connection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.http.HttpConnection |
---|
close, getSocketTimeout, isOpen, setSocketTimeout, shutdown |
Constructor Detail |
---|
public AbstractHttpClientConnection()
Method Detail |
---|
protected abstract void assertOpen() throws java.lang.IllegalStateException
java.lang.IllegalStateException
protected EntityDeserializer createEntityDeserializer()
protected EntitySerializer createEntitySerializer()
protected HttpResponseFactory createHttpResponseFactory()
protected HttpMessageParser createResponseParser(SessionInputBuffer buffer, HttpResponseFactory responseFactory, HttpParams params)
protected HttpMessageWriter createRequestWriter(SessionOutputBuffer buffer, HttpParams params)
protected void init(SessionInputBuffer inbuffer, SessionOutputBuffer outbuffer, HttpParams params)
public boolean isResponseAvailable(int timeout) throws java.io.IOException
HttpClientConnection
isResponseAvailable
in interface HttpClientConnection
timeout
- the maximum time in milliseconds to wait for data
timeout
milliseconds.
java.io.IOException
- if an error happens on the connectionpublic void sendRequestHeader(HttpRequest request) throws HttpException, java.io.IOException
HttpClientConnection
sendRequestHeader
in interface HttpClientConnection
request
- the request whose headers to send.
HttpException
java.io.IOException
public void sendRequestEntity(HttpEntityEnclosingRequest request) throws HttpException, java.io.IOException
HttpClientConnection
sendRequestEntity
in interface HttpClientConnection
request
- the request whose entity to send.
HttpException
java.io.IOException
protected void doFlush() throws java.io.IOException
java.io.IOException
public void flush() throws java.io.IOException
HttpClientConnection
flush
in interface HttpClientConnection
java.io.IOException
public HttpResponse receiveResponseHeader() throws HttpException, java.io.IOException
HttpClientConnection
receiveResponseHeader
in interface HttpClientConnection
HttpException
java.io.IOException
public void receiveResponseEntity(HttpResponse response) throws HttpException, java.io.IOException
HttpClientConnection
receiveResponseEntity
in interface HttpClientConnection
response
- the response to attach the entity to
HttpException
java.io.IOException
public boolean isStale()
HttpConnection
isStale
in interface HttpConnection
true
if attempts to use this connection are
likely to succeed, or false
if they are likely
to fail and this connection should be closedpublic HttpConnectionMetrics getMetrics()
HttpConnection
getMetrics
in interface HttpConnection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |