Package 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
An HTTP transport factory, which is based on the Jakarta Commons
HTTP Client.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.xmlrpc.client.XmlRpcHttpTransport
XmlRpcHttpTransport.ByteArrayReqWriter
Nested classes/interfaces inherited from class org.apache.xmlrpc.client.XmlRpcStreamTransport
XmlRpcStreamTransport.GzipReqWriter, XmlRpcStreamTransport.ReqWriter, XmlRpcStreamTransport.ReqWriterImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.commons.httpclient.HttpClient
private XmlRpcHttpClientConfig
private int
private static final int
Maximum number of allowed redirects.protected org.apache.commons.httpclient.methods.PostMethod
private static final String
Fields inherited from class org.apache.xmlrpc.client.XmlRpcHttpTransport
USER_AGENT
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate 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 InputStream
Returns the input stream, from which the response is being read.protected void
initHttpHeaders
(XmlRpcRequest pRequest) protected boolean
protected boolean
protected boolean
Returns, whether the response is gzip compressed.protected org.apache.commons.httpclient.HttpClient
protected org.apache.commons.httpclient.methods.PostMethod
newPostMethod
(XmlRpcHttpClientConfig pConfig) protected void
protected void
setContentLength
(int pLength) protected void
setCredentials
(XmlRpcHttpClientConfig pConfig) protected void
setRequestHeader
(String pHeader, String pValue) protected void
Methods inherited from class org.apache.xmlrpc.client.XmlRpcHttpTransport
getUserAgent, isUsingByteArrayOutput, newReqWriter, sendRequest, setCompressionHeaders
Methods inherited from class org.apache.xmlrpc.client.XmlRpcStreamTransport
isCompressingRequest, newXMLReader, readResponse
Methods inherited from class org.apache.xmlrpc.client.XmlRpcTransportImpl
getClient
-
Field Details
-
MAX_REDIRECT_ATTEMPTS
private static final int MAX_REDIRECT_ATTEMPTSMaximum number of allowed redirects.- See Also:
-
client
protected final org.apache.commons.httpclient.HttpClient client -
userAgent
-
method
protected org.apache.commons.httpclient.methods.PostMethod method -
contentLength
private int contentLength -
config
-
-
Constructor Details
-
XmlRpcCommonsTransport
Creates a new instance.- Parameters:
pFactory
- The factory, which created this transport.
-
-
Method Details
-
setContentLength
protected void setContentLength(int pLength) - Overrides:
setContentLength
in classXmlRpcHttpTransport
-
newHttpClient
protected org.apache.commons.httpclient.HttpClient newHttpClient() -
initHttpHeaders
- Overrides:
initHttpHeaders
in classXmlRpcHttpTransport
- Throws:
XmlRpcClientException
-
newPostMethod
protected org.apache.commons.httpclient.methods.PostMethod newPostMethod(XmlRpcHttpClientConfig pConfig) -
setRequestHeader
- Specified by:
setRequestHeader
in classXmlRpcHttpTransport
-
isResponseGzipCompressed
protected boolean isResponseGzipCompressed() -
getInputStream
Description copied from class:XmlRpcStreamTransport
Returns the input stream, from which the response is being read.- Specified by:
getInputStream
in classXmlRpcStreamTransport
- Throws:
XmlRpcException
-
setCredentials
- Overrides:
setCredentials
in classXmlRpcHttpTransport
- Throws:
XmlRpcClientException
-
close
Description copied from class:XmlRpcStreamTransport
Closes the connection and ensures, that all resources are being released.- Specified by:
close
in classXmlRpcStreamTransport
- Throws:
XmlRpcClientException
-
isResponseGzipCompressed
Description copied from class:XmlRpcStreamTransport
Returns, whether the response is gzip compressed.- Specified by:
isResponseGzipCompressed
in classXmlRpcStreamTransport
- Parameters:
pConfig
- The clients configuration.- Returns:
- Whether the response stream is gzip compressed.
-
isRedirectRequired
protected boolean isRedirectRequired() -
resetClientForRedirect
- Throws:
XmlRpcException
-
writeRequest
- Specified by:
writeRequest
in classXmlRpcStreamTransport
- Throws:
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.
-