public class HttpWebConnection extends WebConnectionImpl
Constructor and Description |
---|
HttpWebConnection(WebClient webClient)
Create a new HTTP web connection instance.
|
Modifier and Type | Method and Description |
---|---|
protected org.apache.commons.httpclient.HttpClient |
createHttpClient()
Creates the httpClient that will be used by this WebConnection.
|
protected org.apache.commons.httpclient.HttpClient |
getHttpClient()
Lazily initialize the httpClient
|
protected org.apache.commons.logging.Log |
getLog()
Return the log object for this class
|
WebResponse |
getResponse(WebRequestSettings webRequestSettings)
Submit a request and retrieve a response
|
org.apache.commons.httpclient.HttpState |
getState()
Return the
HttpState that is being used. |
protected int |
getTimeout()
Return the timeout to use for socket and connection timeouts for HttpConnectionManager.
|
String |
getVirtualHost()
Get the virtual host
|
protected WebResponseData |
newWebResponseDataInstance(String statusMessage,
List headers,
int statusCode,
org.apache.commons.httpclient.HttpMethodBase method)
Construct an appropriate WebResponseData.
|
protected WebResponse |
newWebResponseInstance(String charset,
WebResponseData responseData,
long loadTime,
SubmitMethod requestMethod,
URL originatingURL)
Construct an appropriate WebResponse.
|
protected void |
onResponseGenerated(org.apache.commons.httpclient.HttpMethodBase httpMethod)
Called when the response has been generated.
|
void |
setVirtualHost(String virtualHost)
set the virtual host
|
getWebClient
public HttpWebConnection(WebClient webClient)
webClient
- The WebClient that is using this connectionpublic WebResponse getResponse(WebRequestSettings webRequestSettings) throws IOException
getResponse
in interface WebConnection
getResponse
in class WebConnectionImpl
webRequestSettings
- Settings to make the request withIOException
- If an IO error occursprotected void onResponseGenerated(org.apache.commons.httpclient.HttpMethodBase httpMethod)
httpMethod
- the httpMethod used.protected org.apache.commons.httpclient.HttpClient getHttpClient()
protected int getTimeout()
protected org.apache.commons.httpclient.HttpClient createHttpClient()
HttpConnectionManager
to perform some tracking
(see feature request 1438216).protected final org.apache.commons.logging.Log getLog()
public void setVirtualHost(String virtualHost)
virtualHost
- The virtualHost to set.public String getVirtualHost()
public org.apache.commons.httpclient.HttpState getState()
HttpState
that is being used.getState
in interface WebConnection
getState
in class WebConnectionImpl
protected WebResponseData newWebResponseDataInstance(String statusMessage, List headers, int statusCode, org.apache.commons.httpclient.HttpMethodBase method) throws IOException
statusMessage
- StatusMessage from the responseheaders
- response headersstatusCode
- response status codemethod
- request methodIOException
- if there is a problem reading the response body.protected WebResponse newWebResponseInstance(String charset, WebResponseData responseData, long loadTime, SubmitMethod requestMethod, URL originatingURL)
responseData
- Data that was send backcharset
- Charset used if not returned in the response.originatingURL
- Where this response came fromrequestMethod
- The method used to get this responseloadTime
- How long the response took to be sentCopyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.