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 XmlRpcHttpTransport
XmlRpcHttpTransport.ByteArrayReqWriterNested classes/interfaces inherited from class XmlRpcStreamTransport
XmlRpcStreamTransport.GzipReqWriter, XmlRpcStreamTransport.ReqWriter, XmlRpcStreamTransport.ReqWriterImpl -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.commons.httpclient.HttpClientprivate XmlRpcHttpClientConfigprivate intprivate static final intMaximum number of allowed redirects.protected org.apache.commons.httpclient.methods.PostMethodprivate static final StringFields inherited from class XmlRpcHttpTransport
USER_AGENT -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckStatus(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 voidclose()Closes the connection and ensures, that all resources are being released.protected InputStreamReturns the input stream, from which the response is being read.protected voidinitHttpHeaders(XmlRpcRequest pRequest) protected booleanprotected booleanprotected booleanReturns, whether the response is gzip compressed.protected org.apache.commons.httpclient.HttpClientprotected org.apache.commons.httpclient.methods.PostMethodnewPostMethod(XmlRpcHttpClientConfig pConfig) protected voidprotected voidsetContentLength(int pLength) protected voidsetCredentials(XmlRpcHttpClientConfig pConfig) protected voidsetRequestHeader(String pHeader, String pValue) protected voidMethods inherited from class XmlRpcHttpTransport
getUserAgent, isUsingByteArrayOutput, newReqWriter, sendRequest, setCompressionHeadersMethods inherited from class XmlRpcStreamTransport
isCompressingRequest, newXMLReader, readResponseMethods inherited from class 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:
setContentLengthin classXmlRpcHttpTransport
-
newHttpClient
protected org.apache.commons.httpclient.HttpClient newHttpClient() -
initHttpHeaders
- Overrides:
initHttpHeadersin classXmlRpcHttpTransport- Throws:
XmlRpcClientException
-
newPostMethod
protected org.apache.commons.httpclient.methods.PostMethod newPostMethod(XmlRpcHttpClientConfig pConfig) -
setRequestHeader
- Specified by:
setRequestHeaderin classXmlRpcHttpTransport
-
isResponseGzipCompressed
protected boolean isResponseGzipCompressed() -
getInputStream
Description copied from class:XmlRpcStreamTransportReturns the input stream, from which the response is being read.- Specified by:
getInputStreamin classXmlRpcStreamTransport- Throws:
XmlRpcException
-
setCredentials
- Overrides:
setCredentialsin classXmlRpcHttpTransport- Throws:
XmlRpcClientException
-
close
Description copied from class:XmlRpcStreamTransportCloses the connection and ensures, that all resources are being released.- Specified by:
closein classXmlRpcStreamTransport- Throws:
XmlRpcClientException
-
isResponseGzipCompressed
Description copied from class:XmlRpcStreamTransportReturns, whether the response is gzip compressed.- Specified by:
isResponseGzipCompressedin classXmlRpcStreamTransport- Parameters:
pConfig- The clients configuration.- Returns:
- Whether the response stream is gzip compressed.
-
isRedirectRequired
protected boolean isRedirectRequired() -
resetClientForRedirect
- Throws:
XmlRpcException
-
writeRequest
- Specified by:
writeRequestin 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.
-