|
|
@ -20,6 +20,7 @@ import com.google.gson.Gson;
|
|
|
|
import io.searchbox.client.JestClient;
|
|
|
|
import io.searchbox.client.JestClient;
|
|
|
|
import io.searchbox.client.JestClientFactory;
|
|
|
|
import io.searchbox.client.JestClientFactory;
|
|
|
|
import io.searchbox.client.config.HttpClientConfig;
|
|
|
|
import io.searchbox.client.config.HttpClientConfig;
|
|
|
|
|
|
|
|
import org.apache.http.HttpHost;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.ObjectProvider;
|
|
|
|
import org.springframework.beans.factory.ObjectProvider;
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
|
|
@ -30,6 +31,7 @@ import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -69,6 +71,12 @@ public class JestAutoConfiguration {
|
|
|
|
builder.defaultCredentials(this.properties.getUsername(),
|
|
|
|
builder.defaultCredentials(this.properties.getUsername(),
|
|
|
|
this.properties.getPassword());
|
|
|
|
this.properties.getPassword());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String proxyHost = this.properties.getProxy().getHost();
|
|
|
|
|
|
|
|
if (StringUtils.hasText(proxyHost)) {
|
|
|
|
|
|
|
|
Integer proxyPort = this.properties.getProxy().getPort();
|
|
|
|
|
|
|
|
Assert.notNull(proxyPort, "Proxy port must not be null");
|
|
|
|
|
|
|
|
builder.proxy(new HttpHost(proxyHost, proxyPort));
|
|
|
|
|
|
|
|
}
|
|
|
|
Gson gson = this.gsonProvider.getIfUnique();
|
|
|
|
Gson gson = this.gsonProvider.getIfUnique();
|
|
|
|
if (gson != null) {
|
|
|
|
if (gson != null) {
|
|
|
|
builder.gson(gson);
|
|
|
|
builder.gson(gson);
|
|
|
|