From aecbb49acfb4dfb3ee5abd0b96a46f38a4b2f568 Mon Sep 17 00:00:00 2001 From: Sylvain Desbureaux Date: Mon, 1 Feb 2021 16:09:23 +0100 Subject: [PATCH] Allow HTTP with SDC New version of SDC client allows to either use https or http. Default version is set to https. We allow here to configure this. Issue-ID: OOM-2670 Signed-off-by: Sylvain Desbureaux Change-Id: I22c21573d99ac4e6eecc9ca78215635e52e98449 --- pom.xml | 28 +++++++++++----------- .../aai/modelloader/config/ModelLoaderConfig.java | 13 +++++++++- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 1a89a54..4f02dd0 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 1.3 1.6.2 1.2.1 - 1.3.0 + 1.4.1 1.2.3 0.28.0 @@ -72,7 +72,7 @@ - + 0.75 0.8.5 3.2 @@ -436,7 +436,7 @@ - @@ -444,7 +444,7 @@ jacoco-maven-plugin ${jacoco.version} - **/gen/** @@ -454,7 +454,7 @@ - pre-unit-test @@ -462,15 +462,15 @@ prepare-agent - ${project.build.directory}/code-coverage/jacoco-ut.exec - surefireArgLine - post-unit-test @@ -479,7 +479,7 @@ report - ${project.build.directory}/code-coverage/jacoco-ut.exec @@ -493,15 +493,15 @@ prepare-agent - ${project.build.directory}/code-coverage/jacoco-it.exec - failsafeArgLine - post-integration-test @@ -510,7 +510,7 @@ report - ${project.build.directory}/code-coverage/jacoco-it.exec @@ -558,7 +558,7 @@ maven-failsafe-plugin 3.0.0-M4 - integration-tests diff --git a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java index 7523fce..88735d4 100644 --- a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java +++ b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java @@ -56,6 +56,7 @@ public class ModelLoaderConfig implements IConfiguration { protected static final String PROP_ML_DISTRIBUTION_ASDC_CONNECTION_DISABLED = PREFIX_DISTRIBUTION_CLIENT + "ASDC_CONNECTION_DISABLE"; protected static final String PROP_ML_DISTRIBUTION_ASDC_ADDRESS = PREFIX_DISTRIBUTION_CLIENT + "ASDC_ADDRESS"; + protected static final String PROP_ML_DISTRIBUTION_ASDC_USE_HTTPS = PREFIX_DISTRIBUTION_CLIENT + "ASDC_USE_HTTPS"; protected static final String PROP_ML_DISTRIBUTION_CONSUMER_GROUP = PREFIX_DISTRIBUTION_CLIENT + "CONSUMER_GROUP"; protected static final String PROP_ML_DISTRIBUTION_CONSUMER_ID = PREFIX_DISTRIBUTION_CLIENT + "CONSUMER_ID"; protected static final String PROP_ML_DISTRIBUTION_ENVIRONMENT_NAME = @@ -155,6 +156,16 @@ public class ModelLoaderConfig implements IConfiguration { return get(PROP_ML_DISTRIBUTION_ASDC_ADDRESS); } + @Override + public Boolean isUseHttpsWithSDC() { + /* if PROP_ML_DISTRIBUTION_ASDC_USE_HTTPS is null, https will be used, as before */ + String value = get(PROP_ML_DISTRIBUTION_ASDC_USE_HTTPS); + if (value == null) { + return true; + } + return Boolean.parseBoolean(value); + } + @Override public String getConsumerGroup() { return get(PROP_ML_DISTRIBUTION_CONSUMER_GROUP); @@ -320,7 +331,7 @@ public class ModelLoaderConfig implements IConfiguration { /** * Read the value of the property and replace any wildcard OXM version "v*" with the supplied default OXM version - * + * * @param propertyName * the name of the property storing the OXM version (possibly containing v*) * @param version -- 2.16.6