From 1729633671102ff577342ade222b5160e16cf0fb Mon Sep 17 00:00:00 2001
From: Artem Dobrynin <Artem_Dobrynin@epam.com>
Date: Tue, 10 Nov 2020 20:06:37 +0400
Subject: [PATCH] GONRG-744: Move search.Config out of os-core-common. Search,
 Indexer, Indexer-Queue [publish]

https://jiraeu.epam.com/browse/GONRG-744

* Changed @Value usage to @ConfigurationProperties
* Added Indexer Config
* Updated os-core-common to the version without search config
---
 .../IndexerConfigurationProperties.java       |  1 -
 .../main/resources/application-dev.properties | 18 +++++------
 .../resources/application-kuber.properties    | 20 ++++++------
 .../resources/application-local.properties    | 18 +++++------
 .../resources/application-testing.properties  | 18 +++++------
 .../src/main/resources/application.properties | 32 +++++++++----------
 6 files changed, 53 insertions(+), 54 deletions(-)

diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/config/IndexerConfigurationProperties.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/config/IndexerConfigurationProperties.java
index 2b81ca8fc..e9c31a8a0 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/config/IndexerConfigurationProperties.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/config/IndexerConfigurationProperties.java
@@ -9,7 +9,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.annotation.Configuration;
 
 @Configuration
-@ConfigurationProperties(prefix = "indexer")
 @Getter
 @Setter
 public class IndexerConfigurationProperties {
diff --git a/provider/indexer-gcp/src/main/resources/application-dev.properties b/provider/indexer-gcp/src/main/resources/application-dev.properties
index 06cddb5e1..7ec1744f0 100644
--- a/provider/indexer-gcp/src/main/resources/application-dev.properties
+++ b/provider/indexer-gcp/src/main/resources/application-dev.properties
@@ -1,14 +1,14 @@
-indexer.google-cloud-project=opendes
+google-cloud-project=opendes
 
-indexer.indexer-host=os-indexer-dot-opendes.appspot.com
+indexer-host=os-indexer-dot-opendes.appspot.com
 STORAGE_HOSTNAME=os-storage-dot-opendes.appspot.com
 
-indexer.storage-schema-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/schemas
-indexer.storage-query-record-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/query/records
-indexer.storage-query-record-for-conversion-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/query/records:batch
-indexer.storage-records-batch-size=20
+storage-schema-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/schemas
+storage-query-record-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/query/records
+storage-query-record-for-conversion-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/query/records:batch
+storage-records-batch-size=20
 
-indexer.indexer-queue-host=https://os-indexer-queue-dot-opendes.appspot.com/_dps/task-handlers/enqueue
+indexer-queue-host=https://os-indexer-queue-dot-opendes.appspot.com/_dps/task-handlers/enqueue
 
 AUTHORIZE_API=https://entitlements-dot-opendes.appspot.com/entitlements/v1
 LEGALTAG_API=https://os-legal-dot-opendes.appspot.com/api/legal/v1
@@ -16,6 +16,6 @@ CRS_API=https://crs-converter-gae-dot-opendes.appspot.com/api/crs/v1
 
 ## use below values for gcp: opendes
 REDIS_GROUP_HOST=10.0.16.28
-indexer.redis-search-host=10.0.16.20
+redis-search-host=10.0.16.20
 
-indexer.google-audiences=245464679631-ktfdfpl147m1mjpbutl00b3cmffissgq.apps.googleusercontent.com
\ No newline at end of file
+google-audiences=245464679631-ktfdfpl147m1mjpbutl00b3cmffissgq.apps.googleusercontent.com
\ No newline at end of file
diff --git a/provider/indexer-gcp/src/main/resources/application-kuber.properties b/provider/indexer-gcp/src/main/resources/application-kuber.properties
index 92980272a..22d3ba025 100644
--- a/provider/indexer-gcp/src/main/resources/application-kuber.properties
+++ b/provider/indexer-gcp/src/main/resources/application-kuber.properties
@@ -1,14 +1,14 @@
-indexer.google-cloud-project=${GOOGLE_CLOUD_PROJECT}
+google-cloud-project=${GOOGLE_CLOUD_PROJECT}
 
-indexer.indexer-host=os-indexer-service
+indexer-host=os-indexer-service
 STORAGE_HOSTNAME=os-storage-service
 
-indexer.storage-schema-host=http://os-storage-service/api/storage/v2/schemas
-indexer.storage-query-record-host=http://os-storage-service/api/storage/v2/query/records
-indexer.storage-query-record-for-conversion-host=http://os-storage-service/api/storage/v2/query/records:batch
-indexer.storage-records-batch-size=20
+storage-schema-host=http://os-storage-service/api/storage/v2/schemas
+storage-query-record-host=http://os-storage-service/api/storage/v2/query/records
+storage-query-record-for-conversion-host=http://os-storage-service/api/storage/v2/query/records:batch
+storage-records-batch-size=20
 
-indexer.indexer-queue-host=http://os-storage-service/_dps/task-handlers/enqueue
+indexer-queue-host=http://os-storage-service/_dps/task-handlers/enqueue
 
 AUTHORIZE_API=http://os-entitlement-service/entitlements/v1
 LEGALTAG_API=http://os-legal-service/api/legal/v1
@@ -16,9 +16,9 @@ CRS_API=${CRS_API}
 
 ## use below values for gcp: opendes
 REDIS_GROUP_HOST=${REDIS_GROUP_HOST}
-indexer.redis-search-host=${REDIS_SEARCH_HOST}
+redis-search-host=${REDIS_SEARCH_HOST}
 
-indexer.google-audiences=${GOOGLE_AUDIENCES}
+google-audiences=${GOOGLE_AUDIENCES}
 
-indexer.deployment-environment=cloud
+deployment-environment=cloud
 disable.appengine.log.factory=true
\ No newline at end of file
diff --git a/provider/indexer-gcp/src/main/resources/application-local.properties b/provider/indexer-gcp/src/main/resources/application-local.properties
index bb8f65538..a5511b15c 100644
--- a/provider/indexer-gcp/src/main/resources/application-local.properties
+++ b/provider/indexer-gcp/src/main/resources/application-local.properties
@@ -1,14 +1,14 @@
-indexer.google-cloud-project=osdu
+google-cloud-project=osdu
 
-indexer.indexer-host=os-indexer-dot-opendes.appspot.com
+indexer-host=os-indexer-dot-opendes.appspot.com
 STORAGE_HOSTNAME=os-storage-dot-opendes.appspot.com
 
-indexer.storage-schema-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/schemas
-indexer.storage-query-record-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/query/records
-indexer.storage-query-record-for-conversion-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/query/records:batch
-indexer.storage-records-batch-size=20
+storage-schema-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/schemas
+storage-query-record-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/query/records
+storage-query-record-for-conversion-host=https://os-storage-dot-opendes.appspot.com/api/storage/v2/query/records:batch
+storage-records-batch-size=20
 
-indexer.indexer-queue-host=https://os-indexer-queue-dot-opendes.appspot.com/_dps/task-handlers/enqueue
+indexer-queue-host=https://os-indexer-queue-dot-opendes.appspot.com/_dps/task-handlers/enqueue
 
 AUTHORIZE_API=https://entitlements-dot-opendes.appspot.com/entitlements/v1
 LEGALTAG_API=https://os-legal-dot-opendes.appspot.com/api/legal/v1
@@ -16,6 +16,6 @@ CRS_API=https://crs-converter-gae-dot-opendes.appspot.com/api/crs/v1
 
 ## use below values for gcp: opendes
 REDIS_GROUP_HOST=127.0.0.1
-indexer.redis-search-host=127.0.0.1
+redis-search-host=127.0.0.1
 
-indexer.google-audiences=245464679631-ktfdfpl147m1mjpbutl00b3cmffissgq.apps.googleusercontent.com
+google-audiences=245464679631-ktfdfpl147m1mjpbutl00b3cmffissgq.apps.googleusercontent.com
diff --git a/provider/indexer-gcp/src/main/resources/application-testing.properties b/provider/indexer-gcp/src/main/resources/application-testing.properties
index 41f1f8347..67941ce47 100644
--- a/provider/indexer-gcp/src/main/resources/application-testing.properties
+++ b/provider/indexer-gcp/src/main/resources/application-testing.properties
@@ -1,14 +1,14 @@
-indexer.google-cloud-project=opendes-evt
+google-cloud-project=opendes-evt
 
-indexer.indexer-host=os-indexer-dot-opendes-evt.appspot.com
+indexer-host=os-indexer-dot-opendes-evt.appspot.com
 STORAGE_HOSTNAME=os-storage-dot-opendes-evt.appspot.com
 
-indexer.storage-schema-host=https://os-storage-dot-opendes-evt.appspot.com/api/storage/v2/schemas
-indexer.storage-query-record-host=https://os-storage-dot-opendes-evt.appspot.com/api/storage/v2/query/records
-indexer.storage-query-record-for-conversion-host=https://os-storage-dot-opendes-evt.appspot.com/api/storage/v2/query/records:batch
-indexer.storage-records-batch-size=20
+storage-schema-host=https://os-storage-dot-opendes-evt.appspot.com/api/storage/v2/schemas
+storage-query-record-host=https://os-storage-dot-opendes-evt.appspot.com/api/storage/v2/query/records
+storage-query-record-for-conversion-host=https://os-storage-dot-opendes-evt.appspot.com/api/storage/v2/query/records:batch
+storage-records-batch-size=20
 
-indexer.indexer-queue-host=https://os-indexer-queue-dot-opendes-evt.appspot.com/_dps/task-handlers/enqueue
+indexer-queue-host=https://os-indexer-queue-dot-opendes-evt.appspot.com/_dps/task-handlers/enqueue
 
 AUTHORIZE_API=https://entitlements-dot-opendes-evt.appspot.com/entitlements/v1
 LEGALTAG_API=https://os-legal-dot-opendes-evt.appspot.com/api/legal/v1
@@ -16,6 +16,6 @@ CRS_API=https://crs-converter-gae-dot-opendes-evt.appspot.com/api/crs/v1
 
 ## use below values for gcp: opendes
 REDIS_GROUP_HOST=10.253.209.196
-indexer.redis-search-host=10.118.2.140
+redis-search-host=10.118.2.140
 
-indexer.google-audiences=833591776864-oobhqvmtdg9rpreubjvn44m5f8revglk.apps.googleusercontent.com
\ No newline at end of file
+google-audiences=833591776864-oobhqvmtdg9rpreubjvn44m5f8revglk.apps.googleusercontent.com
\ No newline at end of file
diff --git a/provider/indexer-gcp/src/main/resources/application.properties b/provider/indexer-gcp/src/main/resources/application.properties
index 8a85f1280..6bf281720 100644
--- a/provider/indexer-gcp/src/main/resources/application.properties
+++ b/provider/indexer-gcp/src/main/resources/application.properties
@@ -6,33 +6,33 @@ server.port=8080
 JAVA_OPTS=-Xms3072m -Xmx3072m
 JAVA_GC_OPTS=-XX:+UseG1GC -XX:+UseStringDeduplication -XX:InitiatingHeapOccupancyPercent=45
 
-indexer.deployment-environment=CLOUD
+deployment-environment=CLOUD
 
 REDIS_GROUP_PORT=6379
 DEFAULT_DATA_COUNTRY=US
 
-indexer.redis-search-port=6379
+redis-search-port=6379
 
 #Default Cache Settings
-indexer.schema-cache-expiration=60
-indexer.index-cache-expiration=60
-indexer.elastic-cache-expiration=1440
-indexer.cursor-cache-expiration=60
+schema-cache-expiration=60
+index-cache-expiration=60
+elastic-cache-expiration=1440
+cursor-cache-expiration=60
 # Kinds Cache expiration 2*24*60
-indexer.kinds-cache-expiration=2880
+kinds-cache-expiration=2880
 # Attributes Cache expiration 2*24*60
-indexer.attributes-cache-expiration=2880
+attributes-cache-expiration=2880
 
-indexer.kinds-redis-database=1
-indexer.cron-index-cleanup-threshold-days=3
-indexer.cron-empty-index-cleanup-threshold-days=7
+kinds-redis-database=1
+cron-index-cleanup-threshold-days=3
+cron-empty-index-cleanup-threshold-days=7
 
-indexer.gae-service=indexer
-indexer.key-ring=csqp
-indexer.kms-key=searchService
+gae-service=indexer
+key-ring=csqp
+kms-key=searchService
 
-indexer.elastic-datastore-kind=SearchSettings
-indexer.elastic-datastore-id=indexer-service
+elastic-datastore-kind=SearchSettings
+elastic-datastore-id=indexer-service
 
 security.https.certificate.trust=false
 indexer.que.service.mail=default@iam.gserviceaccount.com
-- 
GitLab