diff options
author | Adam Wudzinski <adam.wudzinski@nokia.com> | 2020-09-24 16:26:32 +0200 |
---|---|---|
committer | Adam Wudzinski <adam.wudzinski@nokia.com> | 2020-09-24 16:40:38 +0200 |
commit | 033f66b29c24b8819acefcdb38a9d9376bc0a2ba (patch) | |
tree | 98fb3075862f06a86240b2c09334dec3d98aa9a7 /src/main | |
parent | d02143c0c616a32dcc095877fea5c87c05e4adab (diff) |
Fix VES problem with subsequent fetching from CBS1.7.6
Issue-ID: DCAEGEN2-2453
Signed-off-by: Adam Wudzinski <adam.wudzinski@nokia.com>
Change-Id: If6aa6bc79b460d06908022fb4eb6cfbf096a8eb8
Diffstat (limited to 'src/main')
3 files changed, 5 insertions, 9 deletions
diff --git a/src/main/java/org/onap/dcae/configuration/cbs/CbsClientConfigurationResolver.java b/src/main/java/org/onap/dcae/configuration/cbs/CbsClientConfigurationResolver.java index 360e0a8f..dc02131e 100644 --- a/src/main/java/org/onap/dcae/configuration/cbs/CbsClientConfigurationResolver.java +++ b/src/main/java/org/onap/dcae/configuration/cbs/CbsClientConfigurationResolver.java @@ -19,7 +19,6 @@ */ package org.onap.dcae.configuration.cbs; -import io.vavr.control.Option; import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.model.CbsClientConfiguration; import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.model.ImmutableCbsClientConfiguration; import org.slf4j.Logger; diff --git a/src/main/java/org/onap/dcae/configuration/cbs/CbsConfigResolver.java b/src/main/java/org/onap/dcae/configuration/cbs/CbsConfigResolver.java index 5a66c294..09a96985 100644 --- a/src/main/java/org/onap/dcae/configuration/cbs/CbsConfigResolver.java +++ b/src/main/java/org/onap/dcae/configuration/cbs/CbsConfigResolver.java @@ -21,7 +21,6 @@ package org.onap.dcae.configuration.cbs; import com.google.gson.JsonObject; import io.vavr.control.Option; -import java.util.function.Consumer; import org.json.JSONObject; import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.api.CbsClientFactory; import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.api.CbsRequests; @@ -37,16 +36,17 @@ public class CbsConfigResolver { private static final Logger log = LoggerFactory.getLogger(CbsConfigResolver.class); - private final CbsClientConfiguration cbsClientConfiguration; + private final CbsClientConfigurationResolver cbsClientConfigurationResolver; private final RequestDiagnosticContext diagnosticContext = RequestDiagnosticContext.create(); private final CbsRequest cbsConfigurationRequest = CbsRequests.getConfiguration(diagnosticContext); - CbsConfigResolver(CbsClientConfiguration cbsClientConfiguration) { - this.cbsClientConfiguration = cbsClientConfiguration; + CbsConfigResolver(CbsClientConfigurationResolver cbsClientConfigurationResolver) { + this.cbsClientConfigurationResolver = cbsClientConfigurationResolver; } public Option<JSONObject> getAppConfig() { JsonObject emptyJson = new JsonObject(); + CbsClientConfiguration cbsClientConfiguration = cbsClientConfigurationResolver.resolveCbsClientConfiguration(); JsonObject jsonObject = CbsClientFactory.createCbsClient(cbsClientConfiguration) .flatMap(cbsClient -> cbsClient.get(cbsConfigurationRequest)) .doOnError(error -> log.warn("Failed to fetch configuration from CBS " + error.getMessage())) diff --git a/src/main/java/org/onap/dcae/configuration/cbs/CbsConfigResolverFactory.java b/src/main/java/org/onap/dcae/configuration/cbs/CbsConfigResolverFactory.java index aa3ee00f..5e42d9ec 100644 --- a/src/main/java/org/onap/dcae/configuration/cbs/CbsConfigResolverFactory.java +++ b/src/main/java/org/onap/dcae/configuration/cbs/CbsConfigResolverFactory.java @@ -19,13 +19,10 @@ */ package org.onap.dcae.configuration.cbs; -import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.model.CbsClientConfiguration; - public class CbsConfigResolverFactory { public CbsConfigResolver create() { CbsClientConfigurationResolver resolver = new CbsClientConfigurationResolver(); - CbsClientConfiguration cbsClientConfiguration = resolver.resolveCbsClientConfiguration(); - return new CbsConfigResolver(cbsClientConfiguration); + return new CbsConfigResolver(resolver); } }
\ No newline at end of file |