org.apache.xmlrpc.client
Class XmlRpcCommonsTransport
java.lang.Object
org.apache.xmlrpc.client.XmlRpcTransportImpl
org.apache.xmlrpc.client.XmlRpcStreamTransport
org.apache.xmlrpc.client.XmlRpcHttpTransport
org.apache.xmlrpc.client.XmlRpcCommonsTransport
- All Implemented Interfaces:
- XmlRpcTransport
public class XmlRpcCommonsTransport
- extends XmlRpcHttpTransport
An HTTP transport factory, which is based on the Jakarta Commons
HTTP Client.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_REDIRECT_ATTEMPTS
private static final int MAX_REDIRECT_ATTEMPTS
- Maximum number of allowed redirects.
- See Also:
- Constant Field Values
client
protected final org.apache.commons.httpclient.HttpClient client
userAgent
private static final java.lang.String userAgent
method
protected org.apache.commons.httpclient.methods.PostMethod method
contentLength
private int contentLength
config
private XmlRpcHttpClientConfig config
XmlRpcCommonsTransport
public XmlRpcCommonsTransport(XmlRpcCommonsTransportFactory pFactory)
- Creates a new instance.
- Parameters:
pFactory
- The factory, which created this transport.
setContentLength
protected void setContentLength(int pLength)
- Overrides:
setContentLength
in class XmlRpcHttpTransport
newHttpClient
protected org.apache.commons.httpclient.HttpClient newHttpClient()
initHttpHeaders
protected void initHttpHeaders(org.apache.xmlrpc.XmlRpcRequest pRequest)
throws XmlRpcClientException
- Overrides:
initHttpHeaders
in class XmlRpcHttpTransport
- Throws:
XmlRpcClientException
newPostMethod
protected org.apache.commons.httpclient.methods.PostMethod newPostMethod(XmlRpcHttpClientConfig pConfig)
setRequestHeader
protected void setRequestHeader(java.lang.String pHeader,
java.lang.String pValue)
- Specified by:
setRequestHeader
in class XmlRpcHttpTransport
isResponseGzipCompressed
protected boolean isResponseGzipCompressed()
getInputStream
protected java.io.InputStream getInputStream()
throws org.apache.xmlrpc.XmlRpcException
- Description copied from class:
XmlRpcStreamTransport
- Returns the input stream, from which the response is
being read.
- Specified by:
getInputStream
in class XmlRpcStreamTransport
- Throws:
org.apache.xmlrpc.XmlRpcException
setCredentials
protected void setCredentials(XmlRpcHttpClientConfig pConfig)
throws XmlRpcClientException
- Overrides:
setCredentials
in class XmlRpcHttpTransport
- Throws:
XmlRpcClientException
close
protected void close()
throws XmlRpcClientException
- Description copied from class:
XmlRpcStreamTransport
- Closes the connection and ensures, that all resources are being
released.
- Specified by:
close
in class XmlRpcStreamTransport
- Throws:
XmlRpcClientException
isResponseGzipCompressed
protected boolean isResponseGzipCompressed(org.apache.xmlrpc.common.XmlRpcStreamRequestConfig pConfig)
- Description copied from class:
XmlRpcStreamTransport
- Returns, whether the response is gzip compressed.
- Specified by:
isResponseGzipCompressed
in class XmlRpcStreamTransport
- Parameters:
pConfig
- The clients configuration.
- Returns:
- Whether the response stream is gzip compressed.
isRedirectRequired
protected boolean isRedirectRequired()
resetClientForRedirect
protected void resetClientForRedirect()
throws org.apache.xmlrpc.XmlRpcException
- Throws:
org.apache.xmlrpc.XmlRpcException
writeRequest
protected void writeRequest(XmlRpcStreamTransport.ReqWriter pWriter)
throws org.apache.xmlrpc.XmlRpcException
- Specified by:
writeRequest
in class XmlRpcStreamTransport
- Throws:
org.apache.xmlrpc.XmlRpcException
checkStatus
private void checkStatus(org.apache.commons.httpclient.HttpMethod pMethod)
throws XmlRpcHttpTransportException
- Check the status of the HTTP request and throw an XmlRpcHttpTransportException if it
indicates that there is an error.
- Parameters:
pMethod
- the method that has been executed
- Throws:
XmlRpcHttpTransportException
- if the status of the method indicates that there is an error.