summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor
diff options
context:
space:
mode:
authorKAPIL SINGAL <ks220y@att.com>2020-02-20 14:27:21 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-20 14:27:21 +0000
commit843bf742f4cf25a424161be152a1bd5265adefd7 (patch)
tree8cd280d1995d4e3e1f53028076f3ca863162d08c /ms/blueprintsprocessor
parent369ede4108a770ceb9639c6009f732ebce9be836 (diff)
parentde0a668d580f5d00db09bc4e0836b8ee2c98d9bf (diff)
Merge "Add ability to resolve environment variables when reading PrimaryDatabaseConfiguration"
Diffstat (limited to 'ms/blueprintsprocessor')
-rw-r--r--ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt8
1 files changed, 3 insertions, 5 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt
index 95b2c0154..a86dcc40f 100644
--- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt
+++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt
@@ -25,7 +25,6 @@ import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.context.properties.bind.Bindable
import org.springframework.boot.context.properties.bind.Binder
-import org.springframework.boot.context.properties.source.ConfigurationPropertySources
import org.springframework.context.ApplicationContext
import org.springframework.context.ApplicationContextAware
import org.springframework.context.annotation.Bean
@@ -55,18 +54,17 @@ open class BluePrintPropertyConfiguration {
@Bean
open fun bluePrintPropertyBinder(): Binder {
- val configurationPropertySource = ConfigurationPropertySources.get(environment)
- return Binder(configurationPropertySource)
+ return Binder.get(environment)
}
}
@Service
-open class BluePrintPropertiesService(private var bluePrintPropertyBinder: Binder) {
+open class BluePrintPropertiesService(private var bluePrintPropertyConfig: BluePrintPropertyConfiguration) {
private val log = logger(BluePrintPropertiesService::class)
fun <T> propertyBeanType(prefix: String, type: Class<T>): T {
return try {
- bluePrintPropertyBinder.bind(prefix, Bindable.of(type)).get()
+ bluePrintPropertyConfig.bluePrintPropertyBinder().bind(prefix, Bindable.of(type)).get()
} catch (e: NoSuchElementException) {
val errMsg = "Error: missing property \"$prefix\"... Check the application.properties file."
log.error(errMsg)