Skip to content
Snippets Groups Projects
Commit c3528f2e authored by Rustam Lotsmanenko (EPAM)'s avatar Rustam Lotsmanenko (EPAM)
Browse files

Merge branch 'master' into upgrade-log4j-2.17.1

parents b3bd5cad 240cadec
No related branches found
No related tags found
2 merge requests!346Merge branch 'aws-integration' into 'master',!270Upgrade Log4J version
Pipeline #90815 failed
......@@ -527,9 +527,9 @@ The following software have components provided under the terms of this license:
- Spring Boot Reactor Netty Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-reactor-netty, https://spring.io/projects/spring-boot)
- Spring Boot Security Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot)
- Spring Boot Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot)
- Spring Boot Test (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot)
- Spring Boot Test Auto-Configure (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot)
- Spring Boot Test Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot)
- Spring Boot Test (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-test, https://spring.io/projects/spring-boot)
- Spring Boot Test Auto-Configure (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-test-autoconfigure, https://spring.io/projects/spring-boot)
- Spring Boot Test Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-test, https://spring.io/projects/spring-boot)
- Spring Boot Tomcat Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-tomcat, https://spring.io/projects/spring-boot)
- Spring Boot Validation Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot)
- Spring Boot Web Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot)
......
......@@ -17,8 +17,10 @@
package org.opengroup.osdu.util;
import com.google.api.client.util.Strings;
import com.google.gson.Gson;
import java.net.URI;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
......@@ -411,14 +413,22 @@ public class ElasticUtils {
restHighLevelClient = new RestHighLevelClient(builder);
} catch (Exception e) {
throw new AssertionError("Setup elastic error");
throw new AssertionError("Setup elastic error: %s" + e.getMessage());
}
return restHighLevelClient;
}
public RestClientBuilder createClientBuilder(String host, String usernameAndPassword, int port) {
public RestClientBuilder createClientBuilder(String url, String usernameAndPassword, int port) throws Exception {
String scheme = this.sslEnabled ? "https" : "http";
RestClientBuilder builder = RestClient.builder(new HttpHost(host, port, scheme));
url = url.trim().replaceAll("^(?i)(https?)://","");
URI uri = new URI(scheme + "://" + url);
RestClientBuilder builder = RestClient.builder(new HttpHost(uri.getHost(), port, uri.getScheme()));
if (!Strings.isNullOrEmpty(uri.getPath())) {
builder.setPathPrefix(uri.getPath());
}
builder.setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(REST_CLIENT_CONNECT_TIMEOUT)
.setSocketTimeout(REST_CLIENT_SOCKET_TIMEOUT));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment