Package org.apache.xmlrpc.client
Class XmlRpcSunHttpTransport
- java.lang.Object
-
- org.apache.xmlrpc.client.XmlRpcTransportImpl
-
- org.apache.xmlrpc.client.XmlRpcStreamTransport
-
- org.apache.xmlrpc.client.XmlRpcHttpTransport
-
- org.apache.xmlrpc.client.XmlRpcSunHttpTransport
-
- All Implemented Interfaces:
XmlRpcTransport
- Direct Known Subclasses:
XmlRpcSun14HttpTransport
public class XmlRpcSunHttpTransport extends XmlRpcHttpTransport
Default implementation of an HTTP transport, based on theHttpURLConnectionclass.
-
-
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
Fields Modifier and Type Field Description private java.net.URLConnectionconnprivate static java.lang.StringuserAgent-
Fields inherited from class org.apache.xmlrpc.client.XmlRpcHttpTransport
USER_AGENT
-
-
Constructor Summary
Constructors Constructor Description XmlRpcSunHttpTransport(XmlRpcClient pClient)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclose()Closes the connection and ensures, that all resources are being released.protected java.io.InputStreamgetInputStream()Returns the input stream, from which the response is being read.protected java.net.URLConnectiongetURLConnection()For use by subclasses.protected booleanisResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig)Returns, whether the response is gzip compressed.protected java.net.URLConnectionnewURLConnection(java.net.URL pURL)java.lang.ObjectsendRequest(XmlRpcRequest pRequest)Send an XML-RPC message.protected voidsetRequestHeader(java.lang.String pHeader, java.lang.String pValue)protected voidwriteRequest(XmlRpcStreamTransport.ReqWriter pWriter)-
Methods inherited from class org.apache.xmlrpc.client.XmlRpcHttpTransport
getUserAgent, initHttpHeaders, isUsingByteArrayOutput, newReqWriter, setCompressionHeaders, setContentLength, setCredentials
-
Methods inherited from class org.apache.xmlrpc.client.XmlRpcStreamTransport
isCompressingRequest, newXMLReader, readResponse
-
Methods inherited from class org.apache.xmlrpc.client.XmlRpcTransportImpl
getClient
-
-
-
-
Constructor Detail
-
XmlRpcSunHttpTransport
public XmlRpcSunHttpTransport(XmlRpcClient pClient)
Creates a new instance.- Parameters:
pClient- The client controlling this instance.
-
-
Method Detail
-
newURLConnection
protected java.net.URLConnection newURLConnection(java.net.URL pURL) throws java.io.IOException- Throws:
java.io.IOException
-
getURLConnection
protected java.net.URLConnection getURLConnection()
For use by subclasses.
-
sendRequest
public java.lang.Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException
Description copied from interface:XmlRpcTransportSend an XML-RPC message. This method is called to send a message to the other party.- Specified by:
sendRequestin interfaceXmlRpcTransport- Overrides:
sendRequestin classXmlRpcHttpTransport- Parameters:
pRequest- The request being performed.- Returns:
- Result object, if invoking the remote method was successfull.
- Throws:
XmlRpcException- Performing the request failed.
-
setRequestHeader
protected void setRequestHeader(java.lang.String pHeader, java.lang.String pValue)- Specified by:
setRequestHeaderin classXmlRpcHttpTransport
-
close
protected void close() throws XmlRpcClientExceptionDescription copied from class:XmlRpcStreamTransportCloses the connection and ensures, that all resources are being released.- Specified by:
closein classXmlRpcStreamTransport- Throws:
XmlRpcClientException
-
isResponseGzipCompressed
protected boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig)
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.
-
getInputStream
protected java.io.InputStream getInputStream() throws XmlRpcExceptionDescription copied from class:XmlRpcStreamTransportReturns the input stream, from which the response is being read.- Specified by:
getInputStreamin classXmlRpcStreamTransport- Throws:
XmlRpcException
-
writeRequest
protected void writeRequest(XmlRpcStreamTransport.ReqWriter pWriter) throws java.io.IOException, XmlRpcException, org.xml.sax.SAXException
- Specified by:
writeRequestin classXmlRpcStreamTransport- Throws:
java.io.IOExceptionXmlRpcExceptionorg.xml.sax.SAXException
-
-