|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.impl.AbstractHttpClientConnection
org.apache.http.impl.SocketHttpClientConnection
org.apache.http.impl.conn.DefaultClientConnection
public class DefaultClientConnection
Default implementation of an operated client connection.
| Constructor Summary | |
|---|---|
DefaultClientConnection()
|
|
| Method Summary | |
|---|---|
void |
close()
|
protected org.apache.http.io.HttpMessageParser |
createResponseParser(org.apache.http.io.SessionInputBuffer buffer,
org.apache.http.HttpResponseFactory responseFactory,
org.apache.http.params.HttpParams params)
|
protected org.apache.http.io.SessionInputBuffer |
createSessionInputBuffer(java.net.Socket socket,
int buffersize,
org.apache.http.params.HttpParams params)
|
protected org.apache.http.io.SessionOutputBuffer |
createSessionOutputBuffer(java.net.Socket socket,
int buffersize,
org.apache.http.params.HttpParams params)
|
java.net.Socket |
getSocket()
Obtains the socket for this connection. |
org.apache.http.HttpHost |
getTargetHost()
Obtains the target host for this connection. |
boolean |
isSecure()
Indicates whether this connection is secure. |
void |
openCompleted(boolean secure,
org.apache.http.params.HttpParams params)
Signals that the connection has been successfully open. |
void |
opening(java.net.Socket sock,
org.apache.http.HttpHost target)
Signals that this connection is in the process of being open. |
org.apache.http.HttpResponse |
receiveResponseHeader()
|
void |
sendRequestHeader(org.apache.http.HttpRequest request)
|
void |
shutdown()
Force-closes this connection. |
void |
update(java.net.Socket sock,
org.apache.http.HttpHost target,
boolean secure,
org.apache.http.params.HttpParams params)
Updates this connection. |
| Methods inherited from class org.apache.http.impl.SocketHttpClientConnection |
|---|
assertNotOpen, assertOpen, bind, getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, getSocketTimeout, isOpen, setSocketTimeout |
| Methods inherited from class org.apache.http.impl.AbstractHttpClientConnection |
|---|
createEntityDeserializer, createEntitySerializer, createHttpResponseFactory, createRequestWriter, doFlush, flush, getMetrics, init, isEof, isResponseAvailable, isStale, receiveResponseEntity, sendRequestEntity |
| 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.HttpClientConnection |
|---|
flush, isResponseAvailable, receiveResponseEntity, sendRequestEntity |
| Methods inherited from interface org.apache.http.HttpInetConnection |
|---|
getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort |
| Methods inherited from interface org.apache.http.HttpConnection |
|---|
getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout |
| Constructor Detail |
|---|
public DefaultClientConnection()
| Method Detail |
|---|
public final org.apache.http.HttpHost getTargetHost()
OperatedClientConnectionupdate.
getTargetHost in interface OperatedClientConnectionpublic final boolean isSecure()
OperatedClientConnectionupdate.
isSecure in interface OperatedClientConnectiontrue if this connection is secure,
false otherwisepublic final java.net.Socket getSocket()
OperatedClientConnectionupdate.
getSocket in interface OperatedClientConnectiongetSocket in class org.apache.http.impl.SocketHttpClientConnectiontarget host
public void opening(java.net.Socket sock,
org.apache.http.HttpHost target)
throws java.io.IOException
OperatedClientConnectionOperatedClientConnection.openCompleted(boolean, org.apache.http.params.HttpParams) is called. This allows
the connection to close that socket if
shutdown
is called before it is open. Closing the unconnected socket
will interrupt a thread that is blocked on the connect.
Otherwise, that thread will either time out on the connect,
or it returns successfully and then opens this connection
which was just shut down.
OperatedClientConnection.openCompleted(boolean, org.apache.http.params.HttpParams) in order to complete
the process
opening in interface OperatedClientConnectionsock - the unconnected socket which is about to
be connected.target - the target host of this connection
java.io.IOException
public void openCompleted(boolean secure,
org.apache.http.params.HttpParams params)
throws java.io.IOException
OperatedClientConnection
openCompleted in interface OperatedClientConnectionsecure - true if this connection is secure, for
example if an SSLSocket is used, or
false if it is not secureparams - parameters for this connection. The parameters will
be used when creating dependent objects, for example
to determine buffer sizes.
java.io.IOException
public void shutdown()
throws java.io.IOException
opening was already called but
openCompleted was not), the associated
socket that is being connected to a remote address will be closed.
That will interrupt a thread that is blocked on connecting
the socket.
If the connection is not yet open, this will prevent the connection
from being opened.
shutdown in interface org.apache.http.HttpConnectionshutdown in class org.apache.http.impl.SocketHttpClientConnectionjava.io.IOException - in case of a problem
public void close()
throws java.io.IOException
close in interface org.apache.http.HttpConnectionclose in class org.apache.http.impl.SocketHttpClientConnectionjava.io.IOException
protected org.apache.http.io.SessionInputBuffer createSessionInputBuffer(java.net.Socket socket,
int buffersize,
org.apache.http.params.HttpParams params)
throws java.io.IOException
createSessionInputBuffer in class org.apache.http.impl.SocketHttpClientConnectionjava.io.IOException
protected org.apache.http.io.SessionOutputBuffer createSessionOutputBuffer(java.net.Socket socket,
int buffersize,
org.apache.http.params.HttpParams params)
throws java.io.IOException
createSessionOutputBuffer in class org.apache.http.impl.SocketHttpClientConnectionjava.io.IOException
protected org.apache.http.io.HttpMessageParser createResponseParser(org.apache.http.io.SessionInputBuffer buffer,
org.apache.http.HttpResponseFactory responseFactory,
org.apache.http.params.HttpParams params)
createResponseParser in class org.apache.http.impl.AbstractHttpClientConnection
public void update(java.net.Socket sock,
org.apache.http.HttpHost target,
boolean secure,
org.apache.http.params.HttpParams params)
throws java.io.IOException
OperatedClientConnection
update in interface OperatedClientConnectionsock - the new socket for communicating with the target host,
or null to continue using the old socket.
If null is passed, helper objects that
depend on the socket should be re-used. In that case,
some changes in the parameters will not take effect.target - the new target host of this connectionsecure - true if this connection is now secure,
false if it is not secureparams - new parameters for this connection
java.io.IOException
public org.apache.http.HttpResponse receiveResponseHeader()
throws org.apache.http.HttpException,
java.io.IOException
receiveResponseHeader in interface org.apache.http.HttpClientConnectionreceiveResponseHeader in class org.apache.http.impl.AbstractHttpClientConnectionorg.apache.http.HttpException
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.HttpClientConnectionsendRequestHeader in class org.apache.http.impl.AbstractHttpClientConnectionorg.apache.http.HttpException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||