From 825e00a29f1ebd4f28cdd4f4fd1ace0a47e2292c Mon Sep 17 00:00:00 2001 From: efiacor Date: Wed, 19 Oct 2022 13:10:43 +0100 Subject: [SDC-DIST] Upgrade asdc-controller to use client version 2.0.0 Signed-off-by: efiacor Issue-ID: DMAAP-1789 Change-Id: Icd08dcc39dd86eb2d0efdbdfd583b16d26a41627 --- .../org/onap/so/asdc/client/ASDCConfiguration.java | 51 +++++++++++----------- .../org/onap/so/asdc/client/ASDCController.java | 2 +- 2 files changed, 27 insertions(+), 26 deletions(-) (limited to 'asdc-controller/src/main') diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java index c2b3ffddca..8351552223 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java @@ -24,7 +24,6 @@ package org.onap.so.asdc.client; import java.security.GeneralSecurityException; import java.util.Arrays; -import java.util.Collections; import java.util.List; import org.onap.sdc.api.consumer.IConfiguration; import org.onap.so.utils.CryptoUtils; @@ -42,7 +41,7 @@ public class ASDCConfiguration implements IConfiguration { // echo -n "This is a test string" | openssl aes-128-ecb -e -K 546573746F736973546573746F736973 // -nosalt | xxd - private static Logger logger = LoggerFactory.getLogger(ASDCConfiguration.class); + private static final Logger logger = LoggerFactory.getLogger(ASDCConfiguration.class); private String asdcControllerName; @@ -64,8 +63,7 @@ public class ASDCConfiguration implements IConfiguration { HEAT_VOL, OTHER, TOSCA_CSAR, VF_MODULES_METADATA, WORKFLOW, CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT, HELM}; - public static final List SUPPORTED_ARTIFACT_TYPES_LIST = - Collections.unmodifiableList(Arrays.asList(SUPPORTED_ARTIFACT_TYPES)); + public static final List SUPPORTED_ARTIFACT_TYPES_LIST = List.of(SUPPORTED_ARTIFACT_TYPES); @Autowired private Environment env; @@ -73,20 +71,12 @@ public class ASDCConfiguration implements IConfiguration { @Value("${mso.asdc.config.key}") private String configKey; - @Value("${mso.asdc-connections.asdc-controller1.messageBusAddress}") - private String[] messageBusAddress; - public void setAsdcControllerName(String asdcControllerName) { this.asdcControllerName = asdcControllerName; } @Override - public java.lang.Boolean isUseHttpsWithDmaap() { - return getBooleanPropertyWithDefault("mso.asdc-connections.asdc-controller1.useHttpsWithDmaap", true); - } - - @Override - public java.lang.Boolean isUseHttpsWithSDC() { + public Boolean isUseHttpsWithSDC() { return getBooleanPropertyWithDefault("mso.asdc-connections.asdc-controller1.useHttpsWithSdc", true); } @@ -95,15 +85,6 @@ public class ASDCConfiguration implements IConfiguration { return true; } - @Override - public List getMsgBusAddress() { - if (messageBusAddress.length > 0) { - return Arrays.asList(messageBusAddress); - } else { - return Collections.emptyList(); - } - } - public String getAsdcControllerName() { return asdcControllerName; } @@ -173,7 +154,7 @@ public class ASDCConfiguration implements IConfiguration { return defaultValue; } else { try { - return Boolean.valueOf(config); + return Boolean.parseBoolean(config); } catch (Exception e) { logger.warn("Exception while getting boolean property with default property", e); return defaultValue; @@ -209,8 +190,8 @@ public class ASDCConfiguration implements IConfiguration { } @Override - public String getAsdcAddress() { - return getPropertyOrNull("mso.asdc-connections.asdc-controller1.asdcAddress"); + public String getSdcAddress() { + return getPropertyOrNull("mso.asdc-connections.asdc-controller1.sdcAddress"); } @Override @@ -242,4 +223,24 @@ public class ASDCConfiguration implements IConfiguration { return getBooleanPropertyWithDefault("mso.asdc-connections.asdc-controller1.isFilterInEmptyResources", true); } + @Override + public String getHttpProxyHost() { + return getPropertyOrNull("mso.asdc-connections.asdc-controller1.httpProxyHost"); + } + + @Override + public int getHttpProxyPort() { + return getIntegerPropertyOrZero("mso.asdc-connections.asdc-controller1.httpProxyPort"); + } + + @Override + public String getHttpsProxyHost() { + return getPropertyOrNull("mso.asdc-connections.asdc-controller1.httpsProxyHost"); + } + + @Override + public int getHttpsProxyPort() { + return getIntegerPropertyOrZero("mso.asdc-connections.asdc-controller1.httpsProxyPort"); + } + } diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java index bb792f9fd1..8e3c5f4b7d 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java @@ -957,7 +957,7 @@ public class ASDCController { */ public String getAddress() { if (asdcConfig != null) { - return asdcConfig.getAsdcAddress(); + return asdcConfig.getSdcAddress(); } return UNKNOWN; } -- cgit 1.2.3-korg