diff options
author | 2021-12-17 14:46:22 +0000 | |
---|---|---|
committer | 2021-12-17 16:04:08 +0000 | |
commit | 1e4d359d458493cf615f151e4fa4a8f300490067 (patch) | |
tree | 2eb337fcbae366bd742361558473c5055d88434c /components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/controller/ConfigFetchFromCbs.java | |
parent | 7d089b31e7b8b1aecb4bcef5d9039f4d3614ea46 (diff) |
[DCAEGEN2] Switch CBS client library to 1.8.7 and fix null pointer exception while fetching slice-config
Issue-ID: DCAEGEN2-2966
Issue-ID: DCAEGEN2-3025
Signed-off-by: Niranjana <niranjana.y60@wipro.com>
Change-Id: I2fb459d461676243e2648be129e71ee51af30d0d
Diffstat (limited to 'components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/controller/ConfigFetchFromCbs.java')
-rw-r--r-- | components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/controller/ConfigFetchFromCbs.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/controller/ConfigFetchFromCbs.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/controller/ConfigFetchFromCbs.java index 01fa91d0..fbb47e32 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/controller/ConfigFetchFromCbs.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/controller/ConfigFetchFromCbs.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * slice-analysis-ms * ================================================================================ - * Copyright (C) 2020 Wipro Limited. + * Copyright (C) 2020-2021 Wipro Limited. * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,8 @@ import java.util.Map; import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.api.CbsClientFactory; import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.api.CbsRequests; import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.model.CbsRequest; -import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.model.EnvProperties; +import org.onap.dcaegen2.services.sdk.rest.services.cbs.client.model.CbsClientConfiguration; +import org.onap.dcaegen2.services.sdk.rest.services.model.logging.ImmutableRequestDiagnosticContext; import org.onap.dcaegen2.services.sdk.rest.services.model.logging.RequestDiagnosticContext; import org.onap.slice.analysis.ms.models.ConfigPolicy; import org.onap.slice.analysis.ms.models.Configuration; @@ -69,8 +70,9 @@ public class ConfigFetchFromCbs implements Runnable { log.info("getAppconfig start .."); RequestDiagnosticContext diagnosticContext = RequestDiagnosticContext.create(); // Read necessary properties from the environment - final EnvProperties env = EnvProperties.fromEnvironment(); - log.debug("environments {}", env); + final CbsClientConfiguration cbsClientConfiguration = CbsClientConfiguration.fromEnvironment(); + + log.debug("environments {}", cbsClientConfiguration); ConfigPolicy configPolicy = ConfigPolicy.getInstance(); // Polling properties @@ -79,7 +81,7 @@ public class ConfigFetchFromCbs implements Runnable { // Create the client and use it to get the configuration final CbsRequest request = CbsRequests.getAll(diagnosticContext); - return CbsClientFactory.createCbsClient(env) + return CbsClientFactory.createCbsClient(cbsClientConfiguration) .flatMapMany(cbsClient -> cbsClient.updates(request, initialDelay, period)).subscribe(jsonObject -> { log.info("configuration and policy from CBS {}", jsonObject); JsonObject config = jsonObject.getAsJsonObject("config"); |