aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2019-01-10 12:50:06 -0500
committerSingal, Kapil (ks220y) <ks220y@att.com>2019-01-11 10:08:58 -0500
commit5916e79bab772cc79765b0d8fedbc2de38e4ff4b (patch)
treefacf49d89b2be30f2800c59404e9da2d8e00de00 /ms/controllerblueprints/modules
parent6213aad62019a361126ee218b6b550e539e3582f (diff)
Resource Resoulution Service
Implement Input Resource Resolution Processor Service along with Resource Resolution Utilities Change-Id: Ibb4899e415f4b79cd6cd1b190b0f4969b09c3fe4 Issue-ID: CCSDK-936 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Diffstat (limited to 'ms/controllerblueprints/modules')
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/SchemaGeneratorService.java2
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaJsonNodeConverter.java4
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaResourceDefinitionConverter.java4
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidator.java6
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/ModelTypeServiceTest.java4
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java4
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepositoryTest.java2
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java4
8 files changed, 15 insertions, 15 deletions
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/SchemaGeneratorService.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/SchemaGeneratorService.java
index 89af9e9a..3a1535ac 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/SchemaGeneratorService.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/SchemaGeneratorService.java
@@ -59,7 +59,7 @@ public class SchemaGeneratorService {
*/
public String generateSchema(String serviceTemplateContent) throws BluePrintException {
if (StringUtils.isNotBlank(serviceTemplateContent)) {
- ServiceTemplate serviceTemplate = JacksonUtils.readValue(serviceTemplateContent,
+ ServiceTemplate serviceTemplate = JacksonUtils.Companion.readValue(serviceTemplateContent,
ServiceTemplate.class);
return generateSchema(serviceTemplate);
} else {
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaJsonNodeConverter.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaJsonNodeConverter.java
index 23d3a977..074483a7 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaJsonNodeConverter.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaJsonNodeConverter.java
@@ -30,11 +30,11 @@ public class JpaJsonNodeConverter implements
@Override
public String convertToDatabaseColumn(JsonNode node) {
- return JacksonUtils.getJson(node, true);
+ return JacksonUtils.Companion.getJson(node, true);
}
@Override
public JsonNode convertToEntityAttribute(String dbData) {
- return JacksonUtils.jsonNode(dbData);
+ return JacksonUtils.Companion.jsonNode(dbData);
}
} \ No newline at end of file
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaResourceDefinitionConverter.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaResourceDefinitionConverter.java
index 18672f1c..e28cdcd5 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaResourceDefinitionConverter.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/domain/JpaResourceDefinitionConverter.java
@@ -29,11 +29,11 @@ public class JpaResourceDefinitionConverter implements
AttributeConverter<ResourceDefinition, String> {
@Override
public String convertToDatabaseColumn(ResourceDefinition resourceDefinition) {
- return JacksonUtils.getJson(resourceDefinition);
+ return JacksonUtils.Companion.getJson(resourceDefinition);
}
@Override
public ResourceDefinition convertToEntityAttribute(String content) {
- return JacksonUtils.readValue(content, ResourceDefinition.class);
+ return JacksonUtils.Companion.readValue(content, ResourceDefinition.class);
}
}
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidator.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidator.java
index 6d02544e..5d15e087 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidator.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ServiceTemplateValidator.java
@@ -58,7 +58,7 @@ public class ServiceTemplateValidator extends BluePrintValidatorDefaultService {
public boolean validateServiceTemplate(String serviceTemplateContent) throws BluePrintException {
if (StringUtils.isNotBlank(serviceTemplateContent)) {
ServiceTemplate serviceTemplate =
- JacksonUtils.readValue(serviceTemplateContent, ServiceTemplate.class);
+ JacksonUtils.Companion.readValue(serviceTemplateContent, ServiceTemplate.class);
return validateServiceTemplate(serviceTemplate);
} else {
throw new BluePrintException(
@@ -131,11 +131,11 @@ public class ServiceTemplateValidator extends BluePrintValidatorDefaultService {
Object mappingObject =
capabilityAssignment.getProperties().get(ConfigModelConstant.CAPABILITY_PROPERTY_MAPPING);
if (mappingObject != null) {
- String mappingContent = JacksonUtils.getJson(mappingObject);
+ String mappingContent = JacksonUtils.Companion.getJson(mappingObject);
Preconditions.checkArgument(StringUtils.isNotBlank(mappingContent),
String.format("Failed to get capability mapping property (%s) ", ConfigModelConstant.CAPABILITY_PROPERTY_MAPPING));
- resourceAssignment = JacksonUtils.getListFromJson(mappingContent, ResourceAssignment.class);
+ resourceAssignment = JacksonUtils.Companion.getListFromJson(mappingContent, ResourceAssignment.class);
Preconditions.checkNotNull(resourceAssignment,
String.format("Failed to get resource assignment info from the content (%s) ", mappingContent));
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/ModelTypeServiceTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/ModelTypeServiceTest.java
index 412e9606..42c6365a 100644
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/ModelTypeServiceTest.java
+++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/ModelTypeServiceTest.java
@@ -56,12 +56,12 @@ public class ModelTypeServiceTest {
public void test01SaveModelType() throws Exception {
log.info("**************** test01SaveModelType ********************");
- String content = JacksonUtils.getClassPathFileContent("model_type/data_type/datatype-property.json");
+ String content = JacksonUtils.Companion.getClassPathFileContent("model_type/data_type/datatype-property.json");
ModelType modelType = new ModelType();
modelType.setDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE);
modelType.setDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT);
modelType.setDescription("Definition for Sample Datatype ");
- modelType.setDefinition(JacksonUtils.jsonNode(content));
+ modelType.setDefinition(JacksonUtils.Companion.jsonNode(content));
modelType.setModelName(modelName);
modelType.setVersion("1.0.0");
modelType.setTags("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + ","
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java
index 7549b780..739ce51b 100644
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java
+++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ModelTypeReactRepositoryTest.java
@@ -54,12 +54,12 @@ public class ModelTypeReactRepositoryTest {
@Test
@Commit
public void test01Save() {
- String content = JacksonUtils.getClassPathFileContent("model_type/data_type/datatype-property.json");
+ String content = JacksonUtils.Companion.getClassPathFileContent("model_type/data_type/datatype-property.json");
ModelType modelType = new ModelType();
modelType.setDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE);
modelType.setDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT);
modelType.setDescription("Definition for Sample Datatype ");
- modelType.setDefinition(JacksonUtils.jsonNode(content));
+ modelType.setDefinition(JacksonUtils.Companion.jsonNode(content));
modelType.setModelName(modelName);
modelType.setVersion("1.0.0");
modelType.setTags("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + ","
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepositoryTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepositoryTest.java
index 2a636831..fb11c39f 100644
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepositoryTest.java
+++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/repository/ResourceDictionaryReactRepositoryTest.java
@@ -55,7 +55,7 @@ public class ResourceDictionaryReactRepositoryTest {
@Test
@Commit
public void test01Save() {
- ResourceDefinition resourceDefinition = JacksonUtils.readValueFromFile("./../../../../components/model-catalog/resource-dictionary/starter-dictionary/sample-db-source.json", ResourceDefinition.class);
+ ResourceDefinition resourceDefinition = JacksonUtils.Companion.readValueFromFile("./../../../../components/model-catalog/resource-dictionary/starter-dictionary/sample-db-source.json", ResourceDefinition.class);
Assert.assertNotNull("Failed to get resourceDefinition from content", resourceDefinition);
resourceDefinition.setName(sourceName);
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java
index bf5db340..64c87e06 100644
--- a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java
+++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/rs/ModelTypeRestTest.java
@@ -53,12 +53,12 @@ public class ModelTypeRestTest {
public void test01SaveModelType() throws Exception {
log.info("**************** test01SaveModelType ********************");
- String content = JacksonUtils.getClassPathFileContent("model_type/data_type/datatype-property.json");
+ String content = JacksonUtils.Companion.getClassPathFileContent("model_type/data_type/datatype-property.json");
ModelType modelType = new ModelType();
modelType.setDefinitionType(BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE);
modelType.setDerivedFrom(BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT);
modelType.setDescription("Definition for Sample Datatype ");
- modelType.setDefinition(JacksonUtils.jsonNode(content));
+ modelType.setDefinition(JacksonUtils.Companion.jsonNode(content));
modelType.setModelName(modelName);
modelType.setVersion("1.0.0");
modelType.setTags("test-datatype ," + BluePrintConstants.MODEL_TYPE_DATATYPES_ROOT + ","