aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/service/src/main
diff options
context:
space:
mode:
authorBrinda Santh <brindasanth@in.ibm.com>2018-09-05 23:18:19 -0400
committerBrinda Santh <brindasanth@in.ibm.com>2018-09-05 23:18:19 -0400
commit2c91cf47dcfc3014dd669627e214b2e8ec34ce4a (patch)
tree7e660d5dd75621b7af529001da2c87339a83faf1 /ms/controllerblueprints/modules/service/src/main
parent674ff8788638a375226ab9b36c9552ca9918194f (diff)
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 <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints/modules/service/src/main')
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/DataBaseInitService.java14
-rw-r--r--ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepository.kt5
2 files changed, 10 insertions, 9 deletions
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 886809297..c6d80cfb6 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 92172a2e4..064b5c382 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<ResourceDictionary> {
+ return Mono.justOrEmpty(resourceDictionaryRepository.save(resourceDictionary))
+ }
+
fun findByName(name: String): Mono<ResourceDictionary> {
return Mono.justOrEmpty(resourceDictionaryRepository.findByName(name))
}