aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions
diff options
context:
space:
mode:
authorJozsef Csongvai <jozsef.csongvai@bell.ca>2020-04-16 08:33:36 -0400
committerJozsef Csongvai <jozsef.csongvai@bell.ca>2020-04-16 08:33:36 -0400
commit87bf1928aa4772c3b953a0a5800bec99f23b6e9c (patch)
tree5aabbe00a74577f7eb119b1a94c8de4e903ce263 /ms/blueprintsprocessor/functions
parent3a27f2fee05ef874181ea818f28329c2567e52c5 (diff)
Fix default behavior for DatabaseResourceAssignmentProcessor
If a data-dictionary did not declare an endpoint-selector, it would default to primary cds-db instead of using data-dictionary source to look up database configuration. Processor-db configurations were not used because of this. Also improved error messages and some refactoring. Issue-ID: CCSDK-2315 Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca> Change-Id: I7122e1334951db4eec5b9ae8b01c1f66596636f6
Diffstat (limited to 'ms/blueprintsprocessor/functions')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt
index a0fa97b6d..2640b5b85 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt
@@ -107,7 +107,7 @@ open class DatabaseResourceAssignmentProcessor(
"DatabaseResource ($dSource) dictionary information: " +
"Query:($sql), input-key-mapping:($inputKeyMapping), output-key-mapping:(${sourceProperties.outputKeyMapping})"
)
- val jdbcTemplate = blueprintDBLibService(sourceProperties)
+ val jdbcTemplate = blueprintDBLibService(sourceProperties, dSource)
val rows = jdbcTemplate.query(sql, populateNamedParameter(inputKeyMapping))
if (rows.isNullOrEmpty()) {
@@ -117,12 +117,12 @@ open class DatabaseResourceAssignmentProcessor(
}
}
- private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource): BluePrintDBLibGenericService {
+ private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource, selector: String): BluePrintDBLibGenericService {
return if (isNotEmpty(sourceProperties.endpointSelector)) {
val dbPropertiesJson = raRuntimeService.resolveDSLExpression(sourceProperties.endpointSelector!!)
bluePrintDBLibPropertyService.JdbcTemplate(dbPropertiesJson)
} else {
- primaryDBLibGenericService
+ bluePrintDBLibPropertyService.JdbcTemplate(selector)
}
}