aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2022-11-21 08:59:13 +0000
committerFiachra Corcoran <fiachra.corcoran@est.tech>2022-11-28 14:52:39 +0000
commit4212cd7107cb4ace4e06b95888601f9d770f4369 (patch)
tree7004247bc4c63fc2c7022f8c57221ca43e0751af /src
parent6ac552be8027c26b3f949f5889e0586d32764864 (diff)
[SDC-DISTRO] Upgrade sdc-distr-clinet to 2.0.01.3.0
onap-gerrit-review: -current-copyright-not-in-all-files Signed-off-by: efiacor <fiachra.corcoran@est.tech> Change-Id: I4d06d588af872d0d82df92352b9e18c4b7de71e2 Issue-ID: DMAAP-1809
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/ves/openapi/manager/Main.java8
-rw-r--r--src/main/java/org/onap/ves/openapi/manager/config/DistributionClientConfig.java37
-rw-r--r--src/main/resources/application.yml6
-rw-r--r--src/test/java/org/onap/ves/openapi/manager/config/DistributionClientConfigTest.java12
4 files changed, 35 insertions, 28 deletions
diff --git a/src/main/java/org/onap/ves/openapi/manager/Main.java b/src/main/java/org/onap/ves/openapi/manager/Main.java
index 209c05b..735c8e0 100644
--- a/src/main/java/org/onap/ves/openapi/manager/Main.java
+++ b/src/main/java/org/onap/ves/openapi/manager/Main.java
@@ -3,6 +3,7 @@
* VES-OPENAPI-MANAGER
* ================================================================================
* Copyright (C) 2021 Nokia. All rights reserved.
+ * Copyright © 2022 Nordix Foundation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,11 +21,12 @@
package org.onap.ves.openapi.manager;
+import java.util.List;
import lombok.extern.log4j.Log4j2;
import org.onap.sdc.api.results.IDistributionClientResult;
-import org.onap.sdc.http.HttpAsdcClient;
import org.onap.sdc.http.HttpClientFactory;
import org.onap.sdc.http.HttpRequestFactory;
+import org.onap.sdc.http.HttpSdcClient;
import org.onap.sdc.http.SdcConnectorClient;
import org.onap.sdc.impl.DistributionClientImpl;
import org.onap.ves.openapi.manager.config.DistributionClientConfig;
@@ -39,8 +41,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
-import java.util.List;
-
@Log4j2
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class Main {
@@ -58,7 +58,7 @@ public class Main {
public SdcConnectorClient getSdcConnectorClient(DistributionClientConfig clientConfig) {
HttpRequestFactory requestFactory = new HttpRequestFactory(clientConfig.getUser(), clientConfig.getPassword());
HttpClientFactory clientFactory = new HttpClientFactory(clientConfig);
- return new SdcConnectorClient(clientConfig, new HttpAsdcClient(clientConfig.getAsdcAddress(), clientFactory, requestFactory));
+ return new SdcConnectorClient(clientConfig, new HttpSdcClient(clientConfig.getSdcAddress(), clientFactory, requestFactory));
}
/**
diff --git a/src/main/java/org/onap/ves/openapi/manager/config/DistributionClientConfig.java b/src/main/java/org/onap/ves/openapi/manager/config/DistributionClientConfig.java
index 188cced..bc51801 100644
--- a/src/main/java/org/onap/ves/openapi/manager/config/DistributionClientConfig.java
+++ b/src/main/java/org/onap/ves/openapi/manager/config/DistributionClientConfig.java
@@ -3,6 +3,7 @@
* VES-OPENAPI-MANAGER
* ================================================================================
* Copyright (C) 2021 Nokia. All rights reserved.
+ * Copyright © 2022 Nordix Foundation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,8 +41,7 @@ public class DistributionClientConfig implements IConfiguration {
public static final String VES_EVENTS_ARTIFACT_TYPE = "VES_EVENTS";
- private String asdcAddress;
- private String msgBusAddress;
+ private String sdcAddress;
private String user;
private String password;
private Integer pollingInterval;
@@ -51,16 +51,14 @@ public class DistributionClientConfig implements IConfiguration {
private String consumerID;
private Boolean activateServerTLSAuth;
private Boolean isFilterInEmptyResources;
- private Boolean isUseHttpsWithDmaap;
+ private String httpProxyHost;
+ private int httpProxyPort;
+ private String httpsProxyHost;
+ private int httpsProxyPort;
@Override
- public String getAsdcAddress() {
- return asdcAddress;
- }
-
- @Override
- public List<String> getMsgBusAddress() {
- return Collections.singletonList(msgBusAddress);
+ public String getSdcAddress() {
+ return sdcAddress;
}
@Override
@@ -124,7 +122,22 @@ public class DistributionClientConfig implements IConfiguration {
}
@Override
- public Boolean isUseHttpsWithDmaap() {
- return isUseHttpsWithDmaap;
+ public String getHttpProxyHost() {
+ return httpProxyHost;
+ }
+
+ @Override
+ public int getHttpProxyPort() {
+ return httpProxyPort;
+ }
+
+ @Override
+ public String getHttpsProxyHost() {
+ return httpsProxyHost;
+ }
+
+ @Override
+ public int getHttpsProxyPort() {
+ return httpsProxyPort;
}
}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index f179544..0ff3f4e 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -4,17 +4,15 @@ vesopenapimanager:
eventDomainPath: /event/structure/commonEventHeader/structure/domain/value
eventSchemaReferencePath: /event/structure/stndDefinedFields/structure/schemaReference/value
distribution:
- asdcAddress: ${ASDC_ADDRESS:sdc-be.onap:30204}
- msgBusAddress: message-router.onap
+ sdcAddress: ${SDC_ADDRESS:sdc-be.onap:30204}
user: dcae
password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
pollingInterval: 20
pollingTimeout: 20
- consumerGroup: ves-openapi-manager
+ consumerGroup: dcaegen2
environmentName: AUTO
consumerID: ves-openapi-manager
activateServerTLSAuth: false
isFilterInEmptyResources: false
- isUseHttpsWithDmaap: false
diff --git a/src/test/java/org/onap/ves/openapi/manager/config/DistributionClientConfigTest.java b/src/test/java/org/onap/ves/openapi/manager/config/DistributionClientConfigTest.java
index bb2a2e5..1bb4063 100644
--- a/src/test/java/org/onap/ves/openapi/manager/config/DistributionClientConfigTest.java
+++ b/src/test/java/org/onap/ves/openapi/manager/config/DistributionClientConfigTest.java
@@ -3,6 +3,7 @@
* VES-OPENAPI-MANAGER
* ================================================================================
* Copyright (C) 2021 Nokia. All rights reserved.
+ * Copyright © 2022 Nordix Foundation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,8 +39,7 @@ class DistributionClientConfigTest {
@Test
void shouldCreateDistributionClientConfig() {
//given
- String asdcAddress = "sdc-be.onap:8443";
- String msgBusAddress = "message-router.onap";
+ String sdcAddress = "sdc-be.onap:8443";
String user = "dcae";
String password = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U";
Integer pollingInterval = 20;
@@ -48,8 +48,7 @@ class DistributionClientConfigTest {
String environmentName = "AUTO";
String consumerID = "ves-openapi-manager";
Map<String, Object> properties = new HashMap<>();
- properties.put("vesopenapimanager.distribution.asdcAddress", asdcAddress);
- properties.put("vesopenapimanager.distribution.msgBusAddress", msgBusAddress);
+ properties.put("vesopenapimanager.distribution.sdcAddress", sdcAddress);
properties.put("vesopenapimanager.distribution.user", user);
properties.put("vesopenapimanager.distribution.password", password);
properties.put("vesopenapimanager.distribution.pollingInterval", pollingInterval);
@@ -59,7 +58,6 @@ class DistributionClientConfigTest {
properties.put("vesopenapimanager.distribution.consumerID", consumerID);
properties.put("vesopenapimanager.distribution.activateServerTLSAuth", false);
properties.put("vesopenapimanager.distribution.isFilterInEmptyResources", false);
- properties.put("vesopenapimanager.distribution.isUseHttpsWithDmaap", false);
ConfigurationPropertySource source = new MapConfigurationPropertySource(properties);
Binder binder = new Binder(source);
@@ -69,8 +67,7 @@ class DistributionClientConfigTest {
//then
assertThat(result.isBound()).isTrue();
DistributionClientConfig config = result.get();
- assertThat(config.getAsdcAddress()).isEqualTo(asdcAddress);
- assertThat(config.getMsgBusAddress()).isEqualTo(List.of(msgBusAddress));
+ assertThat(config.getSdcAddress()).isEqualTo(sdcAddress);
assertThat(config.getUser()).isEqualTo(user);
assertThat(config.getPassword()).isEqualTo(password);
assertThat(config.getPollingInterval()).isEqualTo(pollingInterval);
@@ -84,6 +81,5 @@ class DistributionClientConfigTest {
assertThat(config.activateServerTLSAuth()).isFalse();
assertThat(config.isFilterInEmptyResources()).isFalse();
assertThat(config.activateServerTLSAuth()).isFalse();
- assertThat(config.isUseHttpsWithDmaap()).isFalse();
}
}