From 54426584a02e6fbfec5f7685c92e1a3fde62309f Mon Sep 17 00:00:00 2001 From: Oleg Mitsura Date: Thu, 15 Aug 2019 16:41:17 -0400 Subject: Make source-db consistent across samples Issue-Id: CCSDK-1623 Signed-off-by: Oleg Mitsura Change-Id: Iec7c6909c39c34894be11bfdac45f6394010d9cf --- .../processor/DatabaseResourceAssignmentProcessor.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin') 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 f8193b7f9..6645a631a 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 @@ -123,12 +123,16 @@ open class DatabaseResourceAssignmentProcessor(private val bluePrintDBLibPropert checkNotEmpty(resourceAssignment.dictionaryName) { "resource assignment dictionary name is not defined for template key (${resourceAssignment.name})" } - check(resourceAssignment.dictionarySource in arrayOf(ResourceDictionaryConstants.SOURCE_PROCESSOR_DB, ResourceDictionaryConstants.SOURCE_PRIMARY_DB)) + check(resourceAssignment.dictionarySource in getListOfDBSources()) { - "resource assignment source is not ${ResourceDictionaryConstants.SOURCE_PROCESSOR_DB} but it is ${resourceAssignment.dictionarySource}" + "resource assignment source is not ${ResourceDictionaryConstants.PROCESSOR_DB} but it is ${resourceAssignment.dictionarySource}" } } + //placeholder to get the list of DB sources. + //TODO: This will be replaced with a DB + private fun getListOfDBSources(): Array = arrayOf(ResourceDictionaryConstants.PROCESSOR_DB) + private fun populateNamedParameter(inputKeyMapping: Map): Map { val namedParameters = HashMap() inputKeyMapping.forEach { @@ -163,4 +167,4 @@ open class DatabaseResourceAssignmentProcessor(private val bluePrintDBLibPropert override suspend fun recoverNB(runtimeException: RuntimeException, resourceAssignment: ResourceAssignment) { raRuntimeService.getBluePrintError().addError(runtimeException.message!!) } -} \ No newline at end of file +} -- cgit 1.2.3-korg