* @param url Application URL.
* @param appConfig Application composite configuration.
* @return XML-RPC client configuration.
*/
private XmlRpcClientConfigImpl createXmlRpcClientConfiguration(URL url, CompositeConfiguration appConfig) {
final XmlRpcClientConfigImpl xmlRpcClientConfig = new XmlRpcClientConfigImpl();
xmlRpcClientConfig.setServerURL(url);
xmlRpcClientConfig.setEnabledForExtensions(true);
xmlRpcClientConfig.setBasicEncoding(appConfig.getString(XMLRPC_BASIC_ENCODING));
xmlRpcClientConfig.setBasicPassword(appConfig.getString(XMLRPC_BASIC_PASSWORD));
xmlRpcClientConfig.setBasicUserName(appConfig.getString(XMLRPC_BASIC_USERNAME));
try {
xmlRpcClientConfig.setConnectionTimeout(appConfig.getInt(XMLRPC_CONNECTION_TIMEOUT));
} catch (ConversionException ce) {
this.debug(ce);
} catch (NoSuchElementException nsee) {
this.debug(nsee);
}
try {
xmlRpcClientConfig.setContentLengthOptional(appConfig.getBoolean(XMLRPC_CONTENT_LENGTH_OPTIONAL));
} catch (ConversionException ce) {
this.debug(ce);
} catch (NoSuchElementException nsee) {
this.debug(nsee);
}
try {
xmlRpcClientConfig.setEnabledForExceptions(appConfig.getBoolean(XMLRPC_ENABLED_FOR_EXCEPTIONS));
} catch (ConversionException ce) {
this.debug(ce);
} catch (NoSuchElementException nsee) {
this.debug(nsee);
}
xmlRpcClientConfig.setEncoding(appConfig.getString(XMLRPC_ENCODING));
try {
xmlRpcClientConfig.setGzipCompressing(appConfig.getBoolean(XMLRPC_GZIP_COMPRESSION));
} catch (ConversionException ce) {
this.debug(ce);
} catch (NoSuchElementException nsee) {
this.debug(nsee);
}
try {
xmlRpcClientConfig.setGzipRequesting(appConfig.getBoolean(XMLRPC_GZIP_REQUESTING));
} catch (ConversionException ce) {
this.debug(ce);
} catch (NoSuchElementException nsee) {
this.debug(nsee);
}
try {
xmlRpcClientConfig.setReplyTimeout(appConfig.getInt(XMLRPC_REPLY_TIMEOUT));
} catch (ConversionException ce) {
this.debug(ce);
} catch (NoSuchElementException nsee) {
this.debug(nsee);
}
xmlRpcClientConfig.setUserAgent(appConfig.getString(XMLRPC_USER_AGENT));
return xmlRpcClientConfig;
}