diff options
author | Niranjana <niranjana.y60@wipro.com> | 2021-06-11 08:58:11 +0000 |
---|---|---|
committer | Niranjana Y <niranjana.y60@wipro.com> | 2021-06-21 06:03:52 +0000 |
commit | eac1d9bb4ac15877270bb811a8d06019c932c669 (patch) | |
tree | 7ef7e1a4d774e8789dfb67f0a1c26063a1c3777b /src | |
parent | a8fed1048ba64313dcd8554ebbea53d2981d51ff (diff) |
Update sdk version to load policies from a file mounted by policy sidecar container
Issue-ID: DCAEGEN2-2711
Signed-off-by: Niranjana <niranjana.y60@wipro.com>
Change-Id: Id8be505c941d17cd62f981978a0e4111c362dbe8
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/onap/dcaegen2/services/sonhms/controller/ConfigFetchFromCbs.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/controller/ConfigFetchFromCbs.java b/src/main/java/org/onap/dcaegen2/services/sonhms/controller/ConfigFetchFromCbs.java index 448ac27..afd5092 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/controller/ConfigFetchFromCbs.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/controller/ConfigFetchFromCbs.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * son-handler * ================================================================================ - * Copyright (C) 2019-2020 Wipro Limited. + * Copyright (C) 2019-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.dcaegen2.services.sonhms.ConfigPolicy; import org.onap.dcaegen2.services.sonhms.Configuration; @@ -65,8 +66,8 @@ 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 @@ -75,7 +76,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"); @@ -120,4 +121,4 @@ public class ConfigFetchFromCbs implements Runnable { } } -}
\ No newline at end of file +} |