public class WebConnectionWrapper extends Object implements WebConnection
WebConnection
interface that can be subclassed by developers
wishing to adapt a particular WebConnection.
This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped
web connection object.Constructor and Description |
---|
WebConnectionWrapper(WebClient webClient)
Constructs a WebConnection object wrapping the connection of the WebClient and places itself as
connection of the WebClient.
|
WebConnectionWrapper(WebConnection webConnection)
Constructs a WebConnection object wrapping provided WebConnection.
|
Modifier and Type | Method and Description |
---|---|
WebResponse |
getResponse(WebRequestSettings webRequestSettings)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Submits a request and retrieves a response. |
org.apache.commons.httpclient.HttpState |
getState()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Return the HttpState that is being used. |
WebClient |
getWebClient()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Return the web client. |
public WebConnectionWrapper(WebConnection webConnection) throws IllegalArgumentException
webConnection
- the webConnection that does the real workIllegalArgumentException
- if the connection is null
public WebConnectionWrapper(WebClient webClient) throws IllegalArgumentException
webClient
- the WebClient which WebConnection should be wrappedIllegalArgumentException
- if the WebClient is null
public WebResponse getResponse(WebRequestSettings webRequestSettings) throws IOException
getResponse
in interface WebConnection
webRequestSettings
- Settings to make the request with.IOException
- If an IO error occurs.public org.apache.commons.httpclient.HttpState getState()
HttpState
that is being used.
The default behavior of this method is to return getState() on the wrapped connection object.getState
in interface WebConnection
public WebClient getWebClient()
getWebClient
in interface WebConnection
Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.