From 4758f085b0fefd7031fc1fa2f19b43172c494d0e Mon Sep 17 00:00:00 2001 From: Hema Vishnu Pola Date: Wed, 15 Jul 2020 16:38:13 +0530 Subject: [PATCH 1/8] updated to use new azure core lib, updated tests to support for http connection to search through configuration parameter. --- .gitignore | 1 + provider/search-azure/pom.xml | 2 +- .../provider/azure/provider/impl/QueryServiceImpl.java | 2 +- .../src/main/java/org/opengroup/osdu/util/Config.java | 5 +++++ .../src/main/java/org/opengroup/osdu/util/ElasticUtils.java | 5 ++++- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2fdf2a1f..78079a17 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ hs_err_pid* .idea/ +*.iml target/ bin/ diff --git a/provider/search-azure/pom.xml b/provider/search-azure/pom.xml index 058ec932..5a0f804c 100644 --- a/provider/search-azure/pom.xml +++ b/provider/search-azure/pom.xml @@ -58,7 +58,7 @@ org.opengroup.osdu core-lib-azure - 0.0.9 + 0.0.10 org.powermock diff --git a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/provider/impl/QueryServiceImpl.java b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/provider/impl/QueryServiceImpl.java index 9c2e8b77..5e2f32f2 100644 --- a/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/provider/impl/QueryServiceImpl.java +++ b/provider/search-azure/src/main/java/org/opengroup/osdu/search/provider/azure/provider/impl/QueryServiceImpl.java @@ -57,7 +57,7 @@ public class QueryServiceImpl extends QueryBase implements IQueryService { @Override public QueryResponse queryIndex(QueryRequest searchRequest, ClusterSettings clusterSettings) throws Exception { try (RestHighLevelClient client = elasticClientHandler.createRestClient(clusterSettings)) { - QueryResponse queryResponse = executeQuery(searchRequest, client); + QueryResponse queryResponse = this.executeQuery(searchRequest, client); return queryResponse; } } diff --git a/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/Config.java b/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/Config.java index b023a8ab..b608ccf6 100644 --- a/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/Config.java +++ b/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/Config.java @@ -6,6 +6,7 @@ public class Config { private static final String DEFAULT_ELASTIC_USER_NAME = ""; private static final String DEFAULT_ELASTIC_PASSWORD = ""; private static final String DEFAULT_ELASTIC_PORT = "9243"; + private static final String DEFAULT_ELASTIC_SSL_ENABLED = "true"; private static final String DEFAULT_INDEXER_HOST = ""; private static final String DEFAULT_SEARCH_HOST = ""; @@ -59,6 +60,10 @@ public class Config { return getEnvironmentVariableOrDefaultValue("ELASTIC_HOST", DEFAULT_ELASTIC_HOST); } + public static boolean isElasticSslEnabled() { + return Boolean.parseBoolean(getEnvironmentVariableOrDefaultValue("ELASTIC_SSL_ENABLED", DEFAULT_ELASTIC_SSL_ENABLED)); + } + public static int getElasticPort() { return Integer.parseInt(getEnvironmentVariableOrDefaultValue("ELASTIC_PORT", DEFAULT_ELASTIC_PORT)); } diff --git a/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java b/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java index 5208867d..9eee1819 100644 --- a/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java +++ b/testing/integration-tests/search-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java @@ -55,11 +55,13 @@ public class ElasticUtils { private final String username; private final String password; private final String host; + private final boolean sslEnabled; public ElasticUtils() { this.username = Config.getUserName(); this.password = Config.getPassword(); this.host = Config.getElasticHost(); + this.sslEnabled = Config.isElasticSslEnabled(); } public void createIndex(String index, String mapping) { @@ -274,7 +276,8 @@ public class ElasticUtils { } public RestClientBuilder createClientBuilder(String host, String usernameAndPassword, int port) { - RestClientBuilder builder = RestClient.builder(new HttpHost(host, port, "https")); + String scheme = this.sslEnabled ? "https" : "http"; + RestClientBuilder builder = RestClient.builder(new HttpHost(host, port, scheme)); builder.setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(REST_CLIENT_CONNECT_TIMEOUT) .setSocketTimeout(REST_CLIENT_SOCKET_TIMEOUT)); builder.setMaxRetryTimeoutMillis(REST_CLIENT_RETRY_TIMEOUT); -- GitLab From 3fc545c2e69bd2c62344f7642ee9ddbf2a48413d Mon Sep 17 00:00:00 2001 From: Hema Vishnu Pola Date: Thu, 23 Jul 2020 08:40:05 +0530 Subject: [PATCH 2/8] using updated version of azure core lib. --- provider/search-azure/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/search-azure/pom.xml b/provider/search-azure/pom.xml index 5a0f804c..b43a051c 100644 --- a/provider/search-azure/pom.xml +++ b/provider/search-azure/pom.xml @@ -58,7 +58,7 @@ org.opengroup.osdu core-lib-azure - 0.0.10 + 0.0.11 org.powermock -- GitLab From 2b9f0d5e739566e283e967a6e15f689c527bc6a0 Mon Sep 17 00:00:00 2001 From: Hema Vishnu Pola Date: Tue, 28 Jul 2020 19:26:49 +0530 Subject: [PATCH 3/8] updated the lib version. --- provider/search-azure/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider/search-azure/pom.xml b/provider/search-azure/pom.xml index b43a051c..4a24f8cd 100644 --- a/provider/search-azure/pom.xml +++ b/provider/search-azure/pom.xml @@ -58,7 +58,7 @@ org.opengroup.osdu core-lib-azure - 0.0.11 + 0.0.12 org.powermock -- GitLab From abae24e89abfd46f95b6f1a56e687fa03b424ba8 Mon Sep 17 00:00:00 2001 From: Hema Vishnu Pola Date: Wed, 29 Jul 2020 10:34:48 +0530 Subject: [PATCH 4/8] updated core in search service. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1a382fd6..f0cb7460 100644 --- a/pom.xml +++ b/pom.xml @@ -261,7 +261,7 @@ org.opengroup.osdu os-core-common - 0.0.18 + 0.3.4 -- GitLab From d8973eadfd54717568b2b938220c59ea7b747eb4 Mon Sep 17 00:00:00 2001 From: Hema Vishnu Pola Date: Wed, 29 Jul 2020 22:00:14 +0530 Subject: [PATCH 5/8] reverting back the updated common package version. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f0cb7460..1a382fd6 100644 --- a/pom.xml +++ b/pom.xml @@ -261,7 +261,7 @@ org.opengroup.osdu os-core-common - 0.3.4 + 0.0.18 -- GitLab From 3ee0633973b617da2f822bf447421e2d973a8700 Mon Sep 17 00:00:00 2001 From: Hema Vishnu Pola Date: Fri, 31 Jul 2020 07:41:24 +0530 Subject: [PATCH 6/8] updated NOTICE file. --- NOTICE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index 231c7243..5939def6 100644 --- a/NOTICE +++ b/NOTICE @@ -223,7 +223,7 @@ The following software have components provided under the terms of this license: - Apache Log4j API (from ) - Apache Log4j Core (from ) - Apache Log4j JUL Adapter (from ) -- Apache Log4j to SLF4J Adapter (from ) +- Apache Log4j SLF4J Adapter (from ) - AssertJ fluent assertions (from ) - Asynchronous Http Client (from ) - Asynchronous Http Client Netty Utils (from ) -- GitLab From 5aa37fe162bf006ab9f2c96495b4323f9485da4f Mon Sep 17 00:00:00 2001 From: Hema Vishnu Pola Date: Fri, 31 Jul 2020 07:46:14 +0530 Subject: [PATCH 7/8] updated the NOTICE. --- NOTICE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index 5939def6..d01e6283 100644 --- a/NOTICE +++ b/NOTICE @@ -223,7 +223,7 @@ The following software have components provided under the terms of this license: - Apache Log4j API (from ) - Apache Log4j Core (from ) - Apache Log4j JUL Adapter (from ) -- Apache Log4j SLF4J Adapter (from ) +- Apache Log4j SLF4J Binding (from ) - AssertJ fluent assertions (from ) - Asynchronous Http Client (from ) - Asynchronous Http Client Netty Utils (from ) -- GitLab From dd3bcef9eab7bbb48b844752d1b05b0534f8832c Mon Sep 17 00:00:00 2001 From: Hema Vishnu Pola Date: Fri, 31 Jul 2020 18:24:08 +0530 Subject: [PATCH 8/8] updated NOTICE file. --- NOTICE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index d01e6283..c936cb14 100644 --- a/NOTICE +++ b/NOTICE @@ -224,6 +224,7 @@ The following software have components provided under the terms of this license: - Apache Log4j Core (from ) - Apache Log4j JUL Adapter (from ) - Apache Log4j SLF4J Binding (from ) +- Apache Log4j to SLF4J Adapter (from ) - AssertJ fluent assertions (from ) - Asynchronous Http Client (from ) - Asynchronous Http Client Netty Utils (from ) @@ -338,9 +339,9 @@ The following software have components provided under the terms of this license: - Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) -- Mockito (from http://www.mockito.org) - Mockito (from http://mockito.org) - Mockito (from http://www.mockito.org) +- Mockito (from http://www.mockito.org) - Mockito (from http://mockito.org) - Netty Reactive Streams Implementation (from ) - Netty/Buffer (from http://netty.io/) -- GitLab