summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2019-01-28 14:17:48 -0500
committerKAPIL SINGAL <ks220y@att.com>2019-01-29 20:05:35 +0000
commitd691b6317360f00232ac0bb0cc198b63f80e0e2d (patch)
treedd7f72e97a2f27f09fd6fcb5fd3383df7cf1964a /ms/blueprintsprocessor/modules
parent4a1b821984005bd253cc923260aa0db890e82fec (diff)
Resource Resolution Service: Rest and DB
Emhancement to Primary-Data and Rest Resource Assignment Processor and respective services Change-Id: I9cc125f9e6396d9c26f72ebd05d2f0422a301f1c Issue-ID: CCSDK-699 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules')
-rw-r--r--ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BluePrintDBLibGenericService.kt16
-rw-r--r--ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDBLibGenericService.kt (renamed from ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/service/PrimaryDBLibGenericService.kt)18
2 files changed, 20 insertions, 14 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BluePrintDBLibGenericService.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BluePrintDBLibGenericService.kt
index 86420f9a..aee74d3f 100644
--- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BluePrintDBLibGenericService.kt
+++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BluePrintDBLibGenericService.kt
@@ -25,4 +25,20 @@ interface BluePrintDBLibGenericService {
fun query(sql: String, params: Map<String, Any>): List<Map<String, Any>>
fun update(sql: String, params: Map<String, Any>): Int
+}
+
+abstract class AbstractDBLibGenericService(private val namedParameterJdbcTemplate: NamedParameterJdbcTemplate)
+ : BluePrintDBLibGenericService {
+
+ override fun namedParameterJdbcTemplate(): NamedParameterJdbcTemplate {
+ return namedParameterJdbcTemplate
+ }
+
+ override fun query(sql: String, params: Map<String, Any>): List<Map<String, Any>> {
+ return namedParameterJdbcTemplate.queryForList(sql, params)
+ }
+
+ override fun update(sql: String, params: Map<String, Any>): Int {
+ return namedParameterJdbcTemplate.update(sql, params)
+ }
} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/service/PrimaryDBLibGenericService.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDBLibGenericService.kt
index 87f32ef2..0e0f1e9c 100644
--- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/service/PrimaryDBLibGenericService.kt
+++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDBLibGenericService.kt
@@ -14,25 +14,15 @@
* limitations under the License.
*/
-package org.onap.ccsdk.apps.blueprintsprocessor.db.primary.service
+package org.onap.ccsdk.apps.blueprintsprocessor.db.primary
+import org.onap.ccsdk.apps.blueprintsprocessor.db.AbstractDBLibGenericService
import org.onap.ccsdk.apps.blueprintsprocessor.db.BluePrintDBLibGenericService
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
import org.springframework.stereotype.Service
@Service
-class PrimaryDBLibGenericService(private val primaryNamedParameterJdbcTemplate: NamedParameterJdbcTemplate)
- : BluePrintDBLibGenericService {
+open class PrimaryDBLibGenericService(private val primaryNamedParameterJdbcTemplate: NamedParameterJdbcTemplate)
+ : AbstractDBLibGenericService(primaryNamedParameterJdbcTemplate) {
- override fun namedParameterJdbcTemplate(): NamedParameterJdbcTemplate {
- return primaryNamedParameterJdbcTemplate
- }
-
- override fun query(sql: String, params: Map<String, Any>): List<Map<String, Any>> {
- return primaryNamedParameterJdbcTemplate.queryForList(sql, params)
- }
-
- override fun update(sql: String, params: Map<String, Any>): Int {
- return primaryNamedParameterJdbcTemplate.update(sql, params)
- }
} \ No newline at end of file