public class XmlRpcLiteHttpTransport extends XmlRpcHttpTransport
XmlRpcHttpTransport.ByteArrayReqWriter
XmlRpcStreamTransport.GzipReqWriter, XmlRpcStreamTransport.ReqWriter, XmlRpcStreamTransport.ReqWriterImpl
Modifier and Type | Field and Description |
---|---|
private XmlRpcHttpClientConfig |
config |
private java.util.Map |
headers |
private java.lang.String |
host |
private java.lang.String |
hostname |
private java.io.InputStream |
input |
private java.io.OutputStream |
output |
private int |
port |
private boolean |
responseGzipCompressed |
private java.net.Socket |
socket |
private boolean |
ssl |
private java.lang.String |
uri |
private static java.lang.String |
userAgent |
USER_AGENT
Constructor and Description |
---|
XmlRpcLiteHttpTransport(XmlRpcClient pClient)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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.
|
private java.io.OutputStream |
getOutputStream() |
protected boolean |
isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig)
Returns, whether the response is gzip compressed.
|
protected boolean |
isUsingByteArrayOutput(XmlRpcHttpClientConfig pConfig) |
protected java.net.Socket |
newSocket(boolean pSSL,
java.lang.String pHostName,
int pPort) |
private void |
sendHeader(java.io.OutputStream pOut,
java.lang.String pKey,
java.lang.String pValue) |
java.lang.Object |
sendRequest(XmlRpcRequest pRequest)
Send an XML-RPC message.
|
private void |
sendRequestHeaders(java.io.OutputStream pOut) |
protected void |
setRequestHeader(java.lang.String pHeader,
java.lang.String pValue) |
private byte[] |
toHTTPBytes(java.lang.String pValue) |
protected void |
writeRequest(XmlRpcStreamTransport.ReqWriter pWriter) |
getUserAgent, initHttpHeaders, newReqWriter, setCompressionHeaders, setContentLength, setCredentials
isCompressingRequest, newXMLReader, readResponse
getClient
private static final java.lang.String userAgent
private boolean ssl
private java.lang.String hostname
private java.lang.String host
private int port
private java.lang.String uri
private java.net.Socket socket
private java.io.OutputStream output
private java.io.InputStream input
private final java.util.Map headers
private boolean responseGzipCompressed
private XmlRpcHttpClientConfig config
public XmlRpcLiteHttpTransport(XmlRpcClient pClient)
pClient
- The client controlling this instance.public java.lang.Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException
XmlRpcTransport
sendRequest
in interface XmlRpcTransport
sendRequest
in class XmlRpcHttpTransport
pRequest
- The request being performed.XmlRpcException
- Performing the request failed.protected void setRequestHeader(java.lang.String pHeader, java.lang.String pValue)
setRequestHeader
in class XmlRpcHttpTransport
protected void close() throws XmlRpcClientException
XmlRpcStreamTransport
close
in class XmlRpcStreamTransport
XmlRpcClientException
private java.io.OutputStream getOutputStream() throws XmlRpcException
XmlRpcException
protected java.net.Socket newSocket(boolean pSSL, java.lang.String pHostName, int pPort) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
private byte[] toHTTPBytes(java.lang.String pValue) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
private void sendHeader(java.io.OutputStream pOut, java.lang.String pKey, java.lang.String pValue) throws java.io.IOException
java.io.IOException
private void sendRequestHeaders(java.io.OutputStream pOut) throws java.io.IOException
java.io.IOException
protected boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig)
XmlRpcStreamTransport
isResponseGzipCompressed
in class XmlRpcStreamTransport
pConfig
- The clients configuration.protected java.io.InputStream getInputStream() throws XmlRpcException
XmlRpcStreamTransport
getInputStream
in class XmlRpcStreamTransport
XmlRpcException
protected boolean isUsingByteArrayOutput(XmlRpcHttpClientConfig pConfig)
isUsingByteArrayOutput
in class XmlRpcHttpTransport
protected void writeRequest(XmlRpcStreamTransport.ReqWriter pWriter) throws XmlRpcException, java.io.IOException, org.xml.sax.SAXException
writeRequest
in class XmlRpcStreamTransport
XmlRpcException
java.io.IOException
org.xml.sax.SAXException