diff options
author | Alexis de Talhouët <adetalhouet89@gmail.com> | 2019-02-28 09:00:18 -0500 |
---|---|---|
committer | Alexis de Talhouët <adetalhouet89@gmail.com> | 2019-03-04 14:59:47 -0500 |
commit | 91d70ee68301f0e004d5d417e8f0c5b0558c0b7e (patch) | |
tree | 2fa6551059956c98523fb09e6c7df75c3f581978 /ms/blueprintsprocessor/functions | |
parent | be12de4448e8e565efa9323ac1a4e559ecf970e4 (diff) |
Use protobuf JsonFormat
Instead of manually parsing Struct to ObjectNode, uses
JsonFormat
Change-Id: I5a457f10e3d106f189f9636fbcc166b12e3915fd
Issue-ID: CCSDK-947
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions')
-rw-r--r-- | ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt index 93b93fec..1c9a905f 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt @@ -23,7 +23,13 @@ import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.node.NullNode import com.fasterxml.jackson.databind.node.ObjectNode import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService -import org.onap.ccsdk.apps.controllerblueprints.core.* +import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.apps.controllerblueprints.core.checkNotEmpty +import org.onap.ccsdk.apps.controllerblueprints.core.checkNotEmptyOrThrow +import org.onap.ccsdk.apps.controllerblueprints.core.nullToEmpty +import org.onap.ccsdk.apps.controllerblueprints.core.returnNotEmptyOrThrow import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment @@ -41,13 +47,13 @@ class ResourceAssignmentUtils { val resourceProp = checkNotNull(resourceAssignment.property) { "Failed in setting resource value for resource mapping $resourceAssignment" } checkNotEmptyOrThrow(resourceAssignment.name, "Failed in setting resource value for resource mapping $resourceAssignment") - if (checkNotEmpty(resourceAssignment.dictionaryName)) { + if (resourceAssignment.dictionaryName.isNullOrEmpty()) { resourceAssignment.dictionaryName = resourceAssignment.name logger.warn("Missing dictionary key, setting with template key (${resourceAssignment.name}) as dictionary key (${resourceAssignment.dictionaryName})") } try { - if (checkNotEmpty(resourceProp.type)) { + if (resourceProp.type.isNotEmpty()) { val convertedValue = convertResourceValue(resourceProp.type, value) logger.info("Setting Resource Value ($convertedValue) for Resource Name (${resourceAssignment.dictionaryName}) of type (${resourceProp.type})") setResourceValue(resourceAssignment, raRuntimeService, convertedValue) |