From a53de8c65b55b5b02db634137858a9a8210e7183 Mon Sep 17 00:00:00 2001 From: efiacor Date: Mon, 5 Dec 2022 12:58:29 +0000 Subject: [SDC-DIST] Upgrade sdc-distr-client to 2.0.0 Signed-off-by: efiacor Change-Id: Iec9b7cda2d7eb498511c0c86523655af7749a74e Issue-ID: DMAAP-1803 --- northbound/daexim-offsite-backup/.gitignore | 1 + northbound/ueb-listener/pom.xml | 2 - .../northbound/uebclient/SdncUebConfiguration.java | 74 ++++++++++------------ .../src/test/resources/ueb-listener.properties | 2 +- 4 files changed, 34 insertions(+), 45 deletions(-) diff --git a/northbound/daexim-offsite-backup/.gitignore b/northbound/daexim-offsite-backup/.gitignore index a01e90efe..0e6f7b758 100755 --- a/northbound/daexim-offsite-backup/.gitignore +++ b/northbound/daexim-offsite-backup/.gitignore @@ -16,6 +16,7 @@ workspace target target-ide MANIFEST.MF +fileToZip* ## Misc Ignores (OS specific etc) ## bin/ diff --git a/northbound/ueb-listener/pom.xml b/northbound/ueb-listener/pom.xml index 2b1ab8664..712182c13 100755 --- a/northbound/ueb-listener/pom.xml +++ b/northbound/ueb-listener/pom.xml @@ -22,7 +22,6 @@ yyyyMMdd'T'HHmmss'Z' ${maven.build.timestamp} ${project.version}-${build.number} - 1.4.1 1.6.5 @@ -42,7 +41,6 @@ org.onap.sdc.sdc-distribution-client sdc-distribution-client - ${sdc.client.version} compile diff --git a/northbound/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java b/northbound/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java index 82b86e217..63c63ced0 100644 --- a/northbound/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java +++ b/northbound/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java @@ -5,6 +5,7 @@ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. * Modifications Copyright © 2018 IBM. + * Modifications Copyright © 2022 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +27,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; +import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Properties; @@ -35,13 +37,13 @@ import org.onap.sdc.api.consumer.IConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class SdncUebConfiguration implements IConfiguration{ +public class SdncUebConfiguration implements IConfiguration { private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; private static final Logger LOG = LoggerFactory - .getLogger(SdncUebConfiguration.class); + .getLogger(SdncUebConfiguration.class); - private String asdcAddress = null; + private String sdcAddress = null; private String consumerGroup = null; private String consumerID = null; private String environmentName = null; @@ -57,9 +59,8 @@ public class SdncUebConfiguration implements IConfiguration{ private String asdcApiBaseUrl = null; private String asdcApiNamespace = null; private String asdcUseHttps = null; - private List msgBusAddress = null; - private SdncArtifactMap artifactMap = SdncArtifactMap.getInstance(); + private final SdncArtifactMap artifactMap = SdncArtifactMap.getInstance(); private String incomingDir = null; @@ -117,14 +118,14 @@ public class SdncUebConfiguration implements IConfiguration{ if (!propFile.exists()) { throw new FileNotFoundException( - "Missing configuration properties file : " - + propFile); + "Missing configuration properties file : " + + propFile); } Properties props = new EnvProperties(); props.load(new FileInputStream(propFile)); - asdcAddress = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.asdc-address"); + sdcAddress = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.sdc-address"); consumerGroup = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.consumer-group"); consumerID = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.consumer-id"); environmentName = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.environment-name"); @@ -132,7 +133,6 @@ public class SdncUebConfiguration implements IConfiguration{ user = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.user"); asdcUseHttps = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.use-https", "true"); - sdncUser = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.sdnc-user"); sdncPasswd = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.sdnc-passwd"); asdcApiBaseUrl = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.asdc-api-base-url"); @@ -168,18 +168,12 @@ public class SdncUebConfiguration implements IConfiguration{ LOG.warn("Illegal value for org.onap.ccsdk.sli.northbound.uebclient.polling-timeout ({}) ", curval, e); } } + curval = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.relevant-artifact-types"); if ((curval != null) && (curval.length() > 0)) { String[] artifactTypes = curval.split(","); - relevantArtifactTypes = new LinkedList<>(); - - for (String artifactType : artifactTypes) { - - relevantArtifactTypes.add(artifactType); - - } - + Collections.addAll(relevantArtifactTypes, artifactTypes); } curval = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.activate-server-tls-auth", "false"); @@ -188,7 +182,6 @@ public class SdncUebConfiguration implements IConfiguration{ keyStorePassword = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.keystore-password"); xsltPathList = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.xslt-path-list"); - String artifactMapFile = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.artifact-map"); if (artifactMapFile != null) { LOG.info("Loading artifactMapFile {}", artifactMapFile); @@ -196,22 +189,11 @@ public class SdncUebConfiguration implements IConfiguration{ } else { LOG.warn("artifact-map is unset"); } - - msgBusAddress = new LinkedList<>(); - String msgBusAddressStr = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.msg-bus-address"); - if (msgBusAddressStr != null) { - String[] msgBusAddressArray = msgBusAddressStr.split(","); - for (int i = 0 ; i < msgBusAddressArray.length ; i++) { - msgBusAddress.add(msgBusAddressArray[i]); - } - } - - } @Override - public String getAsdcAddress() { - return asdcAddress; + public String getSdcAddress() { + return sdcAddress; } @Override @@ -258,7 +240,6 @@ public class SdncUebConfiguration implements IConfiguration{ return user; } - public String getSdncUser() { return sdncUser; } @@ -308,19 +289,28 @@ public class SdncUebConfiguration implements IConfiguration{ } @Override - public Boolean isUseHttpsWithDmaap() { - return false; + public String getHttpProxyHost() { + return null; } @Override - public Boolean isUseHttpsWithSDC() { - return Boolean.parseBoolean(asdcUseHttps); - } + public int getHttpProxyPort() { + return 0; + } - @Override - public List getMsgBusAddress() { - return msgBusAddress; - } + @Override + public String getHttpsProxyHost() { + return null; + } + @Override + public int getHttpsProxyPort() { + return 0; + } + + @Override + public Boolean isUseHttpsWithSDC() { + return Boolean.parseBoolean(asdcUseHttps); + } -} +} \ No newline at end of file diff --git a/northbound/ueb-listener/src/test/resources/ueb-listener.properties b/northbound/ueb-listener/src/test/resources/ueb-listener.properties index 9cce1a7ba..41f92e767 100755 --- a/northbound/ueb-listener/src/test/resources/ueb-listener.properties +++ b/northbound/ueb-listener/src/test/resources/ueb-listener.properties @@ -1,4 +1,4 @@ -org.onap.ccsdk.sli.northbound.uebclient.asdc-address=localhost:1234 +org.onap.ccsdk.sli.northbound.uebclient.sdc-address=localhost:1234 org.onap.ccsdk.sli.northbound.uebclient.consumer-group=ccsdk1 org.onap.ccsdk.sli.northbound.uebclient.consumer-id=localhost_ccsdk1 org.onap.ccsdk.sli.northbound.uebclient.environment-name=UNITTEST -- cgit 1.2.3-korg