From cb9bd650a1ba6c1c2f5c7dd410f640b9b6f876c7 Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Fri, 20 Oct 2023 13:23:33 +0530 Subject: Extend user settings API Extend user settings API Issue-ID: CCSDK-3947 Change-Id: Ic0e7783abb2b084142c5bc2d36dc31810f6ca9cf Signed-off-by: Ravi Pendurty --- .../sdnr/wt/dataprovider/setup/data/DatabaseInfo7.java | 13 +++++++++++++ .../setup/istanbul/IstanbulReleaseInformation.java | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'sdnr/wt/data-provider/setup/src/main/java/org') diff --git a/sdnr/wt/data-provider/setup/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/data/DatabaseInfo7.java b/sdnr/wt/data-provider/setup/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/data/DatabaseInfo7.java index 87fc07ef9..8a7f03040 100644 --- a/sdnr/wt/data-provider/setup/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/data/DatabaseInfo7.java +++ b/sdnr/wt/data-provider/setup/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/data/DatabaseInfo7.java @@ -27,20 +27,33 @@ package org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data; */ public class DatabaseInfo7 extends DatabaseInfo { + private boolean disableMapping; + public DatabaseInfo7(String alias, String doctype, String mapping) { super(alias, alias, doctype, mapping); + this.disableMapping = false; } public DatabaseInfo7(String alias, String doctype, String mapping, String settingsformat) { super(alias, alias, doctype, mapping, settingsformat); + this.disableMapping = false; } public DatabaseInfo7(String index, String alias, String doctype, String mapping, String settingsformat) { super(index, alias, doctype, mapping, settingsformat); + this.disableMapping = false; } @Override public String getMapping(boolean useStrict) { + if(this.disableMapping){ + return "{\"enabled\": false}"; + } return this.mapping == null ? null : String.format("{%s\"properties\":%s}", useStrict ? "\"dynamic\": false," : "\"dynamic\": true,", this.mapping); } + + public DatabaseInfo disableMapping() { + this.disableMapping = true; + return this; + } } diff --git a/sdnr/wt/data-provider/setup/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/istanbul/IstanbulReleaseInformation.java b/sdnr/wt/data-provider/setup/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/istanbul/IstanbulReleaseInformation.java index 6148e21d5..ba39a81b3 100644 --- a/sdnr/wt/data-provider/setup/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/istanbul/IstanbulReleaseInformation.java +++ b/sdnr/wt/data-provider/setup/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/setup/istanbul/IstanbulReleaseInformation.java @@ -170,7 +170,7 @@ public class IstanbulReleaseInformation extends ReleaseInformation { public static Map createDBMap() { Map map = HonoluluReleaseInformation.createDBMap(); - map.put(ComponentName.USERDATA, new DatabaseInfo7("userdata", "userdata", "{}")); + map.put(ComponentName.USERDATA, new DatabaseInfo7("userdata", "userdata", "").disableMapping()); map.put(ComponentName.REQUIRED_NETWORKELEMENT, new DatabaseInfo7("networkelement-connection", "networkelement-connection", "{\"node-id\": {\"type\": \"keyword\"},\"host\": {\"type\": \"keyword\"},\"port\": " -- cgit 1.2.3-korg