diff options
author | Muthuramalingam, Brinda Santh <brindasanth@in.ibm.com> | 2019-03-25 17:01:08 -0400 |
---|---|---|
committer | Muthuramalingam, Brinda Santh <brindasanth@in.ibm.com> | 2019-03-27 13:23:06 -0400 |
commit | c3811effed948926f8d94615df7530c99d490092 (patch) | |
tree | dff68af7c67bc9db332fa43b7a882d1a1b05b4db /ms/blueprintsprocessor/modules/commons/processor-core | |
parent | 10164a7ab851859bfd548e32b4fe3c0610f3d614 (diff) |
Improve blueprint save
Change-Id: Ibac2ef9cd7e217db809a6a695ea0ee39a6bd2e21
Issue-ID: CCSDK-1137
Signed-off-by: Muthuramalingam, Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/processor-core')
-rw-r--r-- | ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt | 25 |
1 files changed, 19 insertions, 6 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 03b847e51..5f1ae7d37 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 @@ -16,23 +16,29 @@ package org.onap.ccsdk.cds.blueprintsprocessor.core +import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintPathConfiguration import org.springframework.beans.factory.annotation.Autowired -import org.springframework.beans.factory.annotation.Value +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.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.core.env.Environment +import org.springframework.stereotype.Service @Configuration -open class BluePrintCoreConfiguration { +open class BluePrintCoreConfiguration(private val bluePrintProperties: BlueprintProcessorProperties) { - @Value("\${blueprintsprocessor.blueprintDeployPath}") - lateinit var deployPath: String + companion object { + const val PREFIX_BLUEPRINT_PROCESSOR = "blueprintsprocessor" + } - @Value("\${blueprintsprocessor.blueprintArchivePath}") - lateinit var archivePath: String + @Bean + open fun bluePrintPathConfiguration(): BluePrintPathConfiguration { + return bluePrintProperties + .propertyBeanType(PREFIX_BLUEPRINT_PROCESSOR, BluePrintPathConfiguration::class.java) + } } @@ -46,4 +52,11 @@ open class BlueprintPropertyConfiguration { val configurationPropertySource = ConfigurationPropertySources.get(environment) return Binder(configurationPropertySource) } +} + +@Service +open class BlueprintProcessorProperties(private var bluePrintPropertyBinder: Binder) { + fun <T> propertyBeanType(prefix: String, type: Class<T>): T { + return bluePrintPropertyBinder.bind(prefix, Bindable.of(type)).get() + } }
\ No newline at end of file |