public class XmlRpcCommonsTransport extends XmlRpcHttpTransport
XmlRpcHttpTransport.ByteArrayReqWriter
XmlRpcStreamTransport.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, setCompressionHeaders
isCompressingRequest, newXMLReader, readResponse
getClient
private 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 XmlRpcHttpTransport
protected org.apache.commons.httpclient.HttpClient newHttpClient()
protected void initHttpHeaders(XmlRpcRequest pRequest) throws XmlRpcClientException
initHttpHeaders
in class XmlRpcHttpTransport
XmlRpcClientException
protected org.apache.commons.httpclient.methods.PostMethod newPostMethod(XmlRpcHttpClientConfig pConfig)
protected void setRequestHeader(java.lang.String pHeader, java.lang.String pValue)
setRequestHeader
in class XmlRpcHttpTransport
protected boolean isResponseGzipCompressed()
protected java.io.InputStream getInputStream() throws XmlRpcException
XmlRpcStreamTransport
getInputStream
in class XmlRpcStreamTransport
XmlRpcException
protected void setCredentials(XmlRpcHttpClientConfig pConfig) throws XmlRpcClientException
setCredentials
in class XmlRpcHttpTransport
XmlRpcClientException
protected void close() throws XmlRpcClientException
XmlRpcStreamTransport
close
in class XmlRpcStreamTransport
XmlRpcClientException
protected boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig)
XmlRpcStreamTransport
isResponseGzipCompressed
in class XmlRpcStreamTransport
pConfig
- The clients configuration.protected boolean isRedirectRequired()
protected void resetClientForRedirect() throws XmlRpcException
XmlRpcException
protected void writeRequest(XmlRpcStreamTransport.ReqWriter pWriter) throws XmlRpcException
writeRequest
in class XmlRpcStreamTransport
XmlRpcException
private 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.