public class CommonsXmlRpcTransport extends java.lang.Object implements XmlRpcTransport
Modifier and Type | Field and Description |
---|---|
private HttpClient |
client |
private Credentials |
creds |
private boolean |
gzip |
private boolean |
http11 |
protected PostMethod |
method |
private boolean |
rgzip |
private java.net.URL |
url |
private Header |
userAgentHeader |
Constructor and Description |
---|
CommonsXmlRpcTransport(java.net.URL url) |
CommonsXmlRpcTransport(java.net.URL url,
HttpClient client)
Creates a new instance of CommonsXmlRpcTransport
|
Modifier and Type | Method and Description |
---|---|
void |
endClientRequest()
Releases connection resources.
|
java.io.InputStream |
sendXmlRpc(byte[] request)
Send an XML-RPC message.
|
void |
setBasicAuthentication(java.lang.String auth)
Sets Authentication for this client.
|
void |
setBasicAuthentication(java.lang.String user,
java.lang.String password)
Sets Authentication for this client, very basic for now user/password
|
void |
setConnectionTimeout(int ctimeout)
Sets the timeout until a connection is etablished.
|
void |
setGzip(boolean gzip)
Transport make use of the 'Accept-Encoding: gzip', so compliant HTTP servers
could return HTTP reply compressed with gzip
|
void |
setHttp11(boolean http11)
Make use of HTTP 1.1
|
void |
setRGzip(boolean gzip)
Transport make use of the 'Content-Encoding: gzip' and send HTTP request
compressed with gzip : works only with some compliant HTTP servers like Apache 2.x
using SetInputFilter DEFLATE.
|
void |
setTimeout(int timeout)
Sets the socket timeout (SO_TIMEOUT) in milliseconds which is the
timeout for waiting for data.
|
void |
setUserAgent(java.lang.String userAgent)
Set the UserAgent for this client
|
private java.net.URL url
private HttpClient client
private final Header userAgentHeader
private boolean http11
private boolean gzip
private boolean rgzip
private Credentials creds
protected PostMethod method
public CommonsXmlRpcTransport(java.net.URL url, HttpClient client)
public CommonsXmlRpcTransport(java.net.URL url)
public java.io.InputStream sendXmlRpc(byte[] request) throws java.io.IOException, XmlRpcClientException
XmlRpcTransport
sendXmlRpc
in interface XmlRpcTransport
request
- the request in network encoding.java.io.IOException
- if an IOException occurs in the IO level of the transport.XmlRpcClientException
- if an exception occurs in the transport.public void setHttp11(boolean http11)
http11
- HTTP 1.1 will be used if http11 is truepublic void setGzip(boolean gzip)
gzip
- Gzip compression will be used if gzip is truepublic void setRGzip(boolean gzip)
gzip
- Compress request with gzip if gzip is truepublic void setUserAgent(java.lang.String userAgent)
userAgent
- public void setTimeout(int timeout)
newTimeoutInMilliseconds
- Timeout in millisecondspublic void setConnectionTimeout(int ctimeout)
newTimeoutInMilliseconds
- Timeout in milliseconds.HttpConnection#setConnectionTimeout(int)
public void setBasicAuthentication(java.lang.String user, java.lang.String password)
user
- password
- public void setBasicAuthentication(java.lang.String auth)
auth
- the public void endClientRequest() throws XmlRpcClientException
endClientRequest
in interface XmlRpcTransport
XmlRpcClientException
Copyright ? 1999-2002 Apache Software Foundation. All Rights Reserved.