aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-service/src/main')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/init/SubscriptionModelLoader.java10
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 17413ba34b..0d82bb5c1c 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);