|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.httpclient.HttpMethodBase
com.microsoft.tfs.core.httpclient.ConnectMethod
public class ConnectMethod
Establishes a tunneled HTTP connection via the CONNECT method.
Field Summary | |
---|---|
static java.lang.String |
NAME
the name of this method |
Fields inherited from class com.microsoft.tfs.core.httpclient.HttpMethodBase |
---|
effectiveVersion, statusLine |
Constructor Summary | |
---|---|
ConnectMethod()
Deprecated. use #ConnectMethod(HttpHost); Create a connect method. |
|
ConnectMethod(HostConfiguration targethost)
Create a connect method. |
|
ConnectMethod(HttpMethod method)
Deprecated. the wrapped method is no longer used Create a connect method wrapping the existing method |
Method Summary | |
---|---|
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 and create a tunneled HttpConnection. |
java.lang.String |
getName()
Provide the name of this method. |
java.lang.String |
getPath()
Gets the path of this HTTP method. |
URI |
getURI()
Returns the URI of the HTTP 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 java.lang.String NAME
"CONNECT"
Constructor Detail |
---|
@Deprecated public ConnectMethod()
@Deprecated public ConnectMethod(HttpMethod method)
method
- the method
to execute after connecting to the
serverpublic ConnectMethod(HostConfiguration targethost)
Method Detail |
---|
public java.lang.String getName()
name
of this method.
getName
in interface HttpMethod
getName
in class HttpMethodBase
public java.lang.String getPath()
HttpMethodBase
getPath
in interface HttpMethod
getPath
in class HttpMethodBase
public URI getURI() throws URIException
HttpMethodBase
getURI
in interface HttpMethod
getURI
in class HttpMethodBase
HttpMethod.getURI()
URIException
- If the URI cannot be created.protected void addCookieRequestHeader(HttpState state, HttpConnection conn) throws java.io.IOException, HttpException
addCookieRequestHeader
in class HttpMethodBase
state
- current state of http requestsconn
- the connection to use for I/OHttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)
java.io.IOException
- when errors occur reading or writing to/from the connection
HttpException
- when a recoverable error occursprotected void addRequestHeaders(HttpState state, HttpConnection conn) throws java.io.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
toHttpMethodBase.writeRequestHeaders(com.microsoft.tfs.core.httpclient.HttpState, com.microsoft.tfs.core.httpclient.HttpConnection)
java.io.IOException
- when an error occurs writing the request
HttpException
- when a HTTP protocol error occurspublic int execute(HttpState state, HttpConnection conn) throws java.io.IOException, HttpException
execute
in interface HttpMethod
execute
in class HttpMethodBase
state
- the current http stateconn
- the connection to write to
HttpConnection.tunnelCreated()
HttpException
- when an error occurs writing the headers
java.io.IOException
- when an error occurs writing the headersprotected void writeRequestLine(HttpState state, HttpConnection conn) throws java.io.IOException, HttpException
writeRequestLine
in class HttpMethodBase
state
- the current http stateconn
- the connection to write toHttpMethodBase.generateRequestLine(com.microsoft.tfs.core.httpclient.HttpConnection, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
java.io.IOException
- when an error occurs writing the request
HttpException
- 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 in question
true
if the connection should be closedHttpMethodBase.shouldCloseConnection(HttpConnection)
,
HttpStatus.SC_OK
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |