diff options
author | 2023-03-10 10:07:19 +0000 | |
---|---|---|
committer | 2023-03-10 10:07:26 +0000 | |
commit | 692f1ceff7934bb60ee9604d70b249c174081a4a (patch) | |
tree | 8ffea61ae1fdffd7d86a15b414203366e1c41fd7 /cps-ncmp-service/src/main | |
parent | ade5a6ecdb8faf1796584810a596725211ea2149 (diff) |
Introduce control switch
- introduced a control switch and keeping it as false due to init issues
Issue-ID: CPS-1537
Change-Id: I8455a5ff6fea09527c6f810ffbc620b4e38c488c
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/main')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java index 17413ba34..0d82bb5c1 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java @@ -30,6 +30,7 @@ import org.onap.cps.api.CpsAdminService; import org.onap.cps.api.CpsModuleService; import org.onap.cps.ncmp.api.impl.exception.NcmpStartUpException; import org.onap.cps.spi.exceptions.AlreadyDefinedException; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.stereotype.Component; @@ -45,6 +46,9 @@ public class SubscriptionModelLoader implements ModelLoader { private static final String SUBSCRIPTION_ANCHOR_NAME = "AVC-Subscriptions"; private static final String SUBSCRIPTION_SCHEMASET_NAME = "subscriptions"; + @Value("${ncmp.model-loader.subscription:false}") + private boolean subscriptionModelLoaderEnabled; + /** * Method calls boarding subscription model when Application is ready. * @@ -53,7 +57,11 @@ public class SubscriptionModelLoader implements ModelLoader { @Override public void onApplicationEvent(@NonNull final ApplicationReadyEvent applicationReadyEvent) { try { - onboardSubscriptionModel(); + if (subscriptionModelLoaderEnabled) { + onboardSubscriptionModel(); + } else { + log.info("Subscription Model Loader is disabled"); + } } catch (final NcmpStartUpException ncmpStartUpException) { log.debug("Onboarding model for NCMP failed: {} ", ncmpStartUpException.getMessage()); SpringApplication.exit(applicationReadyEvent.getApplicationContext(), () -> 1); |