private ClientConfig createClientConfig(final DNSAPIClientConfig config,
final JacksonJsonProvider jacksonJsonProvider,
final HttpParams httpParams,
final PoolingClientConnectionManager clientConnectionManager) {
final ClientConfig clientConfig = new ClientConfig();
clientConfig.register(jacksonJsonProvider);
clientConfig.property(
ClientProperties.BUFFER_RESPONSE_ENTITY_ON_EXCEPTION, true);
clientConfig.property(ClientProperties.CONNECT_TIMEOUT,
config.getTimeout());
clientConfig.property(ClientProperties.FEATURE_AUTO_DISCOVERY_DISABLE,
true);
clientConfig.property(ClientProperties.FOLLOW_REDIRECTS, false);
clientConfig.property(ClientProperties.JSON_PROCESSING_FEATURE_DISABLE,
false);
clientConfig.property(ClientProperties.METAINF_SERVICES_LOOKUP_DISABLE,
true);
clientConfig.property(ClientProperties.MOXY_JSON_FEATURE_DISABLE, true);
clientConfig.property(ApacheClientProperties.CONNECTION_MANAGER,
clientConnectionManager);
clientConfig.property(ApacheClientProperties.DISABLE_COOKIES, true);
clientConfig.property(ApacheClientProperties.HTTP_PARAMS, httpParams);
clientConfig.property(
ApacheClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, false);
return clientConfig;
}