|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.HttpMethodBase | +--org.apache.commons.httpclient.ConnectMethod
Wraps another method to tunnel through a proxy.
Field Summary | |
static String |
NAME
the name of this method |
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase |
USER_AGENT |
Constructor Summary | |
ConnectMethod(HttpMethod method)
Create a connect method wrapping the existing method |
Method Summary | |
protected void |
addAuthorizationRequestHeader(HttpState state,
HttpConnection conn)
This method does nothing. |
protected void |
addContentLengthRequestHeader(HttpState state,
HttpConnection conn)
This method does nothing. |
protected void |
addCookieRequestHeader(HttpState state,
HttpConnection conn)
This method does nothing. |
protected void |
addRequestHeaders(HttpState state,
HttpConnection conn)
Populates the request headers map to with additional headers to be submitted to the given HttpConnection . |
int |
execute(HttpState state,
HttpConnection conn)
Execute this method by tunnelling and then executing the wrapped method. |
String |
getName()
Provide the name of this method. |
protected boolean |
shouldCloseConnection(HttpConnection conn)
Returns true if the status code is anything other than
SC_OK, false otherwise. |
protected void |
writeRequestLine(HttpState state,
HttpConnection conn)
Special Connect request. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String NAME
Constructor Detail |
public ConnectMethod(HttpMethod method)
method
- the method
to execute after connecting
to the serverMethod Detail |
public String getName()
name
of this method.getName
in class HttpMethodBase
protected void addAuthorizationRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException
addAuthorizationRequestHeader
in class HttpMethodBase
state
- current state of http requestsconn
- the connection to use for I/OIOException
- when errors occur reading or writing to/from the
connectionHttpException
- when a recoverable error occursHttpMethodBase.addAuthorizationRequestHeader(HttpState, HttpConnection)
protected void addContentLengthRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException
addContentLengthRequestHeader
in class HttpMethodBase
state
- current state of http requestsconn
- the connection to use for I/OIOException
- when errors occur reading or writing to/from the
connectionHttpException
- when a recoverable error occursHttpMethodBase.addContentLengthRequestHeader(HttpState, HttpConnection)
protected void addCookieRequestHeader(HttpState state, HttpConnection conn) throws IOException, HttpException
addCookieRequestHeader
in class HttpMethodBase
state
- current state of http requestsconn
- the connection to use for I/OIOException
- when errors occur reading or writing to/from the
connectionHttpException
- when a recoverable error occursHttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)
protected void addRequestHeaders(HttpState state, HttpConnection conn) throws IOException, HttpException
headers
to be submitted to the given HttpConnection
.
This implementation adds User-Agent, Host, and Proxy-Authorization headers, when appropriate.
addRequestHeaders
in class HttpMethodBase
state
- the client stateconn
- the HttpConnection
the headers will eventually be
written toIOException
- when an error occurs writing the requestHttpException
- when a HTTP protocol error occursHttpMethodBase.writeRequestHeaders(org.apache.commons.httpclient.HttpState, org.apache.commons.httpclient.HttpConnection)
public int execute(HttpState state, HttpConnection conn) throws IOException, HttpException
execute
in class HttpMethodBase
state
- the current http stateconn
- the connection to write toHttpException
- when an error occurs writing the headersIOException
- when an error occurs writing the headersprotected void writeRequestLine(HttpState state, HttpConnection conn) throws IOException, HttpException
writeRequestLine
in class HttpMethodBase
state
- the current http stateconn
- the connection to write toIOException
- when an error occurs writing the requestHttpException
- when an error occurs writing the requestprotected boolean shouldCloseConnection(HttpConnection conn)
true
if the status code is anything other than
SC_OK, false
otherwise.shouldCloseConnection
in class HttpMethodBase
conn
- the connection to testtrue
if the connection should be closedHttpMethodBase.shouldCloseConnection(HttpConnection)
,
HttpStatus.SC_OK
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |