From 977287b586e27e2f835a5d24950abf1f2adae8be Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Mon, 5 Aug 2019 09:50:15 -0400 Subject: Add resource definition resolution service. Change-Id: Ife75d290540e3ed0e0dfd0a82785a498607a2d25 Issue-ID: CCSDK-1577 Signed-off-by: Brinda Santh --- .../blueprintsprocessor/db/BluePrintDBLibConfiguration.kt | 13 ++++++------- .../db/primary/BluePrintDBLibPropertyService.kt | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'ms/blueprintsprocessor/modules') diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BluePrintDBLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BluePrintDBLibConfiguration.kt index efefe0290..fd889bfbf 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BluePrintDBLibConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/BluePrintDBLibConfiguration.kt @@ -16,9 +16,10 @@ package org.onap.ccsdk.cds.blueprintsprocessor.db -import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BluePrintDBLibPropertySevice +import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.PrimaryDBLibGenericService +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan @@ -39,15 +40,15 @@ open class BluePrintDBLibConfiguration(private var bluePrintProperties: BluePrin /** * Exposed Dependency Service by this SSH Lib Module */ -//TODO("right now not wired with name ") fun BluePrintDependencyService.dbLibPropertyService(): BluePrintDBLibPropertySevice = - instance(DBLibConstants.SERVICE_BLUEPRINT_DB_LIB_PROPERTY) + instance(BluePrintDBLibPropertySevice::class) + +fun BluePrintDependencyService.primaryDBLibGenericService(): BluePrintDBLibGenericService = + instance(PrimaryDBLibGenericService::class) class DBLibConstants { companion object { - //TODO("right now not wired with name ") - const val SERVICE_BLUEPRINT_DB_LIB_PROPERTY = "blueprint-db-lib-property-service" const val PREFIX_DB_PRIMARY: String = "blueprintsprocessor.db.primary" //list of database @@ -62,7 +63,5 @@ class DBLibConstants { const val DRIVER_MYSQL_DB = "com.mysql.jdbc.Driver" const val DRIVER_ORACLE_DB = "oracle.jdbc.driver.OracleDriver" const val DRIVER_POSTGRES_DB = "org.postgresql.Driver" - - } } \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/BluePrintDBLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/BluePrintDBLibPropertyService.kt index cf2ca550e..2ae50424f 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/BluePrintDBLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/BluePrintDBLibPropertyService.kt @@ -32,7 +32,7 @@ class BluePrintDBLibPropertySevice(private var bluePrintProperties: BluePrintPro } fun JdbcTemplate(selector: String): BluePrintDBLibGenericService { - val prefix = "blueprintsprocessor.database.$selector" + val prefix = "blueprintsprocessor.db.$selector" val dBConnetionProperties = dBDataSourceProperties(prefix) return blueprintDBDataSourceService(dBConnetionProperties) } -- cgit 1.2.3-korg