|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.AbstractHttpConnection
org.apache.http.impl.DefaultHttpClientConnection
public class DefaultHttpClientConnection
Default implementation of a client-side HTTP connection.
Field Summary |
---|
Fields inherited from class org.apache.http.impl.AbstractHttpConnection |
---|
datareceiver, datatransmitter, open, socket |
Constructor Summary | |
---|---|
DefaultHttpClientConnection()
|
|
DefaultHttpClientConnection(HttpHost targethost)
|
|
DefaultHttpClientConnection(HttpHost targethost,
java.net.InetAddress localAddress)
|
Method Summary | |
---|---|
void |
flush()
Writes out all pending buffered data over the open connection. |
java.net.InetAddress |
getLocalAddress()
The local address the connection is or will be bound to as set by |
HttpHost |
getTargetHost()
Returns the current target host as set by @link #setTargetHost(HttpHost). |
boolean |
isResponseAvailable(int timeout)
Checks if response data is available from the connection. |
void |
open(HttpParams params)
Opens the connection. |
protected void |
readResponseHeaders(HttpResponse response)
|
protected HttpResponse |
readResponseStatusLine(HttpParams params)
|
void |
receiveResponseEntity(HttpResponse response)
Receives the next response entity available from this connection and attaches it to an existing HttpResponse object. |
HttpResponse |
receiveResponseHeader(HttpParams params)
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. |
protected void |
sendRequestHeaders(HttpRequest request)
|
protected void |
sendRequestLine(HttpRequest request)
|
void |
setEntityDeserializer(EntityDeserializer entitydeserializer)
|
void |
setEntitySerializer(EntitySerializer entityserializer)
|
void |
setLocalAddress(java.net.InetAddress localAddress)
Sets the local address the connection will be bound to upon opening. |
void |
setResponseFactory(HttpResponseFactory responsefactory)
|
void |
setTargetHost(HttpHost targethost)
Provides the implementation with the host it is supposed to connect to. |
Methods inherited from class org.apache.http.impl.AbstractHttpConnection |
---|
assertNotOpen, assertOpen, bind, close, isOpen, isStale, setReceiverFactory, setTransmitterFactory, shutdown |
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, isOpen, isStale, shutdown |
Constructor Detail |
---|
public DefaultHttpClientConnection(HttpHost targethost, java.net.InetAddress localAddress)
public DefaultHttpClientConnection(HttpHost targethost)
public DefaultHttpClientConnection()
Method Detail |
---|
public void setResponseFactory(HttpResponseFactory responsefactory)
public void setEntityDeserializer(EntityDeserializer entitydeserializer)
public void setEntitySerializer(EntitySerializer entityserializer)
public void open(HttpParams params) throws java.io.IOException
HttpClientConnection
open
in interface HttpClientConnection
params
- the parameters in effect for this connection.
java.io.IOException
public HttpHost getTargetHost()
HttpClientConnection
getTargetHost
in interface HttpClientConnection
public java.net.InetAddress getLocalAddress()
HttpClientConnection
getLocalAddress
in interface HttpClientConnection
public void setTargetHost(HttpHost targethost)
HttpClientConnection
setTargetHost
in interface HttpClientConnection
targethost
- the host to connect topublic void setLocalAddress(java.net.InetAddress localAddress)
HttpClientConnection
setLocalAddress
in interface HttpClientConnection
localAddress
- the local bind address or null
.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
public void flush() throws java.io.IOException
HttpClientConnection
flush
in interface HttpClientConnection
java.io.IOException
protected void sendRequestLine(HttpRequest request) throws HttpException, java.io.IOException
HttpException
java.io.IOException
protected void sendRequestHeaders(HttpRequest request) throws HttpException, java.io.IOException
HttpException
java.io.IOException
public HttpResponse receiveResponseHeader(HttpParams params) throws HttpException, java.io.IOException
HttpClientConnection
receiveResponseHeader
in interface HttpClientConnection
params
- the parameters in effect
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
protected HttpResponse readResponseStatusLine(HttpParams params) throws HttpException, java.io.IOException
HttpException
java.io.IOException
protected void readResponseHeaders(HttpResponse response) throws HttpException, java.io.IOException
HttpException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |