From b1843e450c2d799caa69f14f1e123dfb3fa35890 Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Wed, 5 Sep 2018 23:18:19 -0400 Subject: Controller Blueprints Microservice Add configuration property to load model types and Remove duplicate model type test case files Change-Id: I6a34539cae7377bd133727fde77ff8fefaadf023 Issue-ID: CCSDK-484 Signed-off-by: Brinda Santh --- .../controllerblueprints/service/DataBaseInitService.java | 14 +++++--------- .../repository/ResourceDictionaryReactRepository.kt | 5 +++++ 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'ms/controllerblueprints/modules/service/src/main') diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java index 88680929..c6d80cfb 100644 --- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java +++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java @@ -60,16 +60,19 @@ import java.util.List; public class DataBaseInitService { private static EELFLogger log = EELFManager.getInstance().getLogger(DataBaseInitService.class); - @Value("${blueprints.load.path}") - private String modelLoadPath; private ModelTypeService modelTypeService; private ResourceDictionaryService resourceDictionaryService; private ConfigModelService configModelService; + @Value("${load.dataTypePath}") private String dataTypePath; + @Value("${load.nodeTypePath}") private String nodeTypePath; + @Value("${load.artifactTypePath}") private String artifactTypePath; + @Value("${load.resourceDictionaryPath}") private String resourceDictionaryPath; + @Value("${load.blueprintsPath}") private String bluePrintsPath; @Autowired @@ -94,13 +97,6 @@ public class DataBaseInitService { @PostConstruct @SuppressWarnings("unused") private void initDatabase() { - log.info("loading Blueprints from DIR : {}", modelLoadPath); - dataTypePath = modelLoadPath + "/model_type/data_type"; - nodeTypePath = modelLoadPath + "/model_type/node_type"; - artifactTypePath = modelLoadPath + "/model_type/artifact_type"; - resourceDictionaryPath = modelLoadPath + "/resource_dictionary"; - bluePrintsPath = modelLoadPath + "/blueprints"; - log.info("loading dataTypePath from DIR : {}", dataTypePath); log.info("loading nodeTypePath from DIR : {}", nodeTypePath); log.info("loading artifactTypePath from DIR : {}", artifactTypePath); diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepository.kt b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepository.kt index 92172a2e..064b5c38 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepository.kt +++ b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepository.kt @@ -22,6 +22,7 @@ import org.springframework.stereotype.Service import reactor.core.publisher.Flux import reactor.core.publisher.Mono import reactor.core.scheduler.Schedulers + /** * ResourceDictionaryReactRepository. * @@ -30,6 +31,10 @@ import reactor.core.scheduler.Schedulers @Service open class ResourceDictionaryReactRepository(private val resourceDictionaryRepository: ResourceDictionaryRepository) { + fun save(resourceDictionary: ResourceDictionary): Mono { + return Mono.justOrEmpty(resourceDictionaryRepository.save(resourceDictionary)) + } + fun findByName(name: String): Mono { return Mono.justOrEmpty(resourceDictionaryRepository.findByName(name)) } -- cgit 1.2.3-korg