public class XmlRpcCommonsTransport extends XmlRpcHttpTransport
XmlRpcHttpTransport.ByteArrayReqWriterXmlRpcStreamTransport.GzipReqWriter, XmlRpcStreamTransport.ReqWriter, XmlRpcStreamTransport.ReqWriterImpl| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.httpclient.HttpClient |
client |
private XmlRpcHttpClientConfig |
config |
private int |
contentLength |
private static int |
MAX_REDIRECT_ATTEMPTS
Maximum number of allowed redirects.
|
protected org.apache.commons.httpclient.methods.PostMethod |
method |
private static java.lang.String |
userAgent |
USER_AGENT| Constructor and Description |
|---|
XmlRpcCommonsTransport(XmlRpcCommonsTransportFactory pFactory)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkStatus(org.apache.commons.httpclient.HttpMethod pMethod)
Check the status of the HTTP request and throw an XmlRpcHttpTransportException if it
indicates that there is an error.
|
protected void |
close()
Closes the connection and ensures, that all resources are being
released.
|
protected java.io.InputStream |
getInputStream()
Returns the input stream, from which the response is
being read.
|
protected void |
initHttpHeaders(XmlRpcRequest pRequest) |
protected boolean |
isRedirectRequired() |
protected boolean |
isResponseGzipCompressed() |
protected boolean |
isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig)
Returns, whether the response is gzip compressed.
|
protected org.apache.commons.httpclient.HttpClient |
newHttpClient() |
protected org.apache.commons.httpclient.methods.PostMethod |
newPostMethod(XmlRpcHttpClientConfig pConfig) |
protected void |
resetClientForRedirect() |
protected void |
setContentLength(int pLength) |
protected void |
setCredentials(XmlRpcHttpClientConfig pConfig) |
protected void |
setRequestHeader(java.lang.String pHeader,
java.lang.String pValue) |
protected void |
writeRequest(XmlRpcStreamTransport.ReqWriter pWriter) |
getUserAgent, isUsingByteArrayOutput, newReqWriter, sendRequest, setCompressionHeadersisCompressingRequest, newXMLReader, readResponsegetClientprivate static final int MAX_REDIRECT_ATTEMPTS
protected final org.apache.commons.httpclient.HttpClient client
private static final java.lang.String userAgent
protected org.apache.commons.httpclient.methods.PostMethod method
private int contentLength
private XmlRpcHttpClientConfig config
public XmlRpcCommonsTransport(XmlRpcCommonsTransportFactory pFactory)
pFactory - The factory, which created this transport.protected void setContentLength(int pLength)
setContentLength in class XmlRpcHttpTransportprotected org.apache.commons.httpclient.HttpClient newHttpClient()
protected void initHttpHeaders(XmlRpcRequest pRequest) throws XmlRpcClientException
initHttpHeaders in class XmlRpcHttpTransportXmlRpcClientExceptionprotected org.apache.commons.httpclient.methods.PostMethod newPostMethod(XmlRpcHttpClientConfig pConfig)
protected void setRequestHeader(java.lang.String pHeader,
java.lang.String pValue)
setRequestHeader in class XmlRpcHttpTransportprotected boolean isResponseGzipCompressed()
protected java.io.InputStream getInputStream()
throws XmlRpcException
XmlRpcStreamTransportgetInputStream in class XmlRpcStreamTransportXmlRpcExceptionprotected void setCredentials(XmlRpcHttpClientConfig pConfig) throws XmlRpcClientException
setCredentials in class XmlRpcHttpTransportXmlRpcClientExceptionprotected void close()
throws XmlRpcClientException
XmlRpcStreamTransportclose in class XmlRpcStreamTransportXmlRpcClientExceptionprotected boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig)
XmlRpcStreamTransportisResponseGzipCompressed in class XmlRpcStreamTransportpConfig - The clients configuration.protected boolean isRedirectRequired()
protected void resetClientForRedirect()
throws XmlRpcException
XmlRpcExceptionprotected void writeRequest(XmlRpcStreamTransport.ReqWriter pWriter) throws XmlRpcException
writeRequest in class XmlRpcStreamTransportXmlRpcExceptionprivate void checkStatus(org.apache.commons.httpclient.HttpMethod pMethod)
throws XmlRpcHttpTransportException
pMethod - the method that has been executedXmlRpcHttpTransportException - if the status of the method indicates that there is an error.