diff options
author | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2022-07-01 09:04:36 +0000 |
---|---|---|
committer | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2022-07-19 06:59:13 +0000 |
commit | 3395dfa1f31111bb4dd03e89a7e493a2850901f2 (patch) | |
tree | a63b65c204ca88dfc349adefaef2a448d4baa39b /ms/blueprintsprocessor/functions/resource-resolution/src/main | |
parent | ea1c8b477e615f4dd45204b221fe7eacfe5474af (diff) |
[Blueprintsprocessor] Use all source-db resources instead of only processor-db
In DatabaseResourceAssignmentProcessor class filter resourceSourceMappings to get all source-db resources instead of using only one: processor-db
Issue-ID: CCSDK-3699
Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl>
Change-Id: I616ca6fe1336427b0b603a0386878ba4c8ea5828
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/main')
-rw-r--r-- | ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt | 10 |
1 files changed, 6 insertions, 4 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 98df3f1cf..785f47772 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 @@ -32,7 +32,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.KeyIdentifier import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment -import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceDictionaryConstants +import org.onap.ccsdk.cds.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory import org.slf4j.LoggerFactory import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope @@ -135,13 +135,15 @@ open class DatabaseResourceAssignmentProcessor( "resource assignment dictionary name is not defined for template key (${resourceAssignment.name})" } check(resourceAssignment.dictionarySource in getListOfDBSources()) { - "resource assignment source is not ${ResourceDictionaryConstants.PROCESSOR_DB} but it is ${resourceAssignment.dictionarySource}" + "resource assignment source ${resourceAssignment.dictionarySource} is not registered in \"resourceSourceMappings\"" } } // placeholder to get the list of DB sources. - // TODO: This will be replaced with a DB - private fun getListOfDBSources(): Array<String> = arrayOf(ResourceDictionaryConstants.PROCESSOR_DB) + private fun getListOfDBSources(): Array<String> { + return ResourceSourceMappingFactory.getRegisterSourceMapping() + .resourceSourceMappings.filterValues { it == "source-db" }.keys.toTypedArray() + } private fun populateNamedParameter(inputKeyMapping: Map<String, String>): Map<String, Any> { val namedParameters = HashMap<String, Any>() |