summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvinal patel <vinal.narendrabhai.patel@ibm.com>2019-03-05 15:41:24 -0500
committerVinal Patel <vinal.narendrabhai.patel@ibm.com>2019-03-06 18:30:16 +0000
commit71f072fe0759de0dedc3cfcdfeb245d25a08dc22 (patch)
tree99590f8c4af43dfc08700e0070ef7de9a0e4b407
parent349d286d41a60d88827b9e312c21ce56bf1d37cb (diff)
Resource resolution using REST
-bug fix Change-Id: I47c9b3738bbca84e1d3a734e16c4ea6ae7e93a23 Issue-ID: CCSDK-1131 Signed-off-by: vinal patel <vinal.narendrabhai.patel@ibm.com>
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt9
1 files changed, 3 insertions, 6 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt
index 4daa46e52..d8472ede4 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt
@@ -17,10 +17,7 @@
package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.processor
-import com.fasterxml.jackson.databind.node.ArrayNode
-import com.fasterxml.jackson.databind.node.JsonNodeFactory
-import com.fasterxml.jackson.databind.node.NullNode
-import com.fasterxml.jackson.databind.node.ObjectNode
+import com.fasterxml.jackson.databind.node.*
import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.RestResourceSource
import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.apps.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
@@ -56,7 +53,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS
// Check if It has Input
val value = raRuntimeService.getInputValue(resourceAssignment.name)
- if (value != null && value !is NullNode) {
+ if (value !is MissingNode && value !is NullNode) {
logger.info("primary-db source template key (${resourceAssignment.name}) found from input and value is ($value)")
ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, value)
} else {
@@ -77,7 +74,7 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS
// Get the Rest Client Service
val restClientService = blueprintWebClientService(resourceAssignment, sourceProperties)
val response = restClientService.getResource(urlPath, String::class.java)
- if (response.isNotBlank()) {
+ if (response.isBlank()) {
logger.warn("Failed to get $dSource result for dictionary name ($dName) using urlPath ($urlPath)")
} else {
populateResource(resourceAssignment, sourceProperties, response, path)