diff options
author | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-12-06 10:30:59 -0500 |
---|---|---|
committer | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-12-06 10:30:59 -0500 |
commit | 399d095989a019d3d172a3deb3e25f100a48510a (patch) | |
tree | 721e6ce0a1706754761e3c0d72c75b4315daa531 /ms/blueprintsprocessor/modules/commons/core | |
parent | 3365c01de8515e0ea7a0c26fbdfb296661bf6b92 (diff) |
Add Generic Rest Configuration
Change-Id: I3865eac84765ac2cbc5dd0db7a1ed0065bcaa7c5
Issue-ID: CCSDK-699
Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/core')
3 files changed, 50 insertions, 9 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/core/pom.xml b/ms/blueprintsprocessor/modules/commons/core/pom.xml index 626a27a3..5e0c966d 100644 --- a/ms/blueprintsprocessor/modules/commons/core/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/core/pom.xml @@ -29,15 +29,10 @@ <packaging>jar</packaging> <name>Blueprints Processor Core</name> <description>Blueprints Processor Core</description> - <dependencies> <dependency> - <groupId>org.onap.ccsdk.apps.blueprintsprocessor</groupId> - <artifactId>db-lib</artifactId> - </dependency> - <dependency> - <groupId>org.onap.ccsdk.apps.blueprintsprocessor</groupId> - <artifactId>rest-lib</artifactId> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-webflux</artifactId> </dependency> </dependencies> </project> diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt index 3b5722d5..07e494a1 100644 --- a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt @@ -16,17 +16,34 @@ package org.onap.ccsdk.apps.blueprintsprocessor.core +import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.annotation.Value +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 @Configuration open class BluePrintCoreConfiguration { - @Value("\${blueprintsprocessor.blueprint-deploy-path}") + @Value("\${blueprintsprocessor.blueprintDeployPath}") lateinit var deployPath: String - @Value("\${blueprintsprocessor.blueprint-archive-path}") + @Value("\${blueprintsprocessor.blueprintArchivePath}") lateinit var archivePath: String +} + +@Configuration +open class BlueprintPropertyConfiguration { + @Autowired + lateinit var environment: Environment + + @Bean + open fun bluePrintPropertyBinder(): Binder { + val configurationPropertySource = ConfigurationPropertySources.get(environment) + return Binder(configurationPropertySource) + } }
\ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintProperties.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintProperties.kt new file mode 100644 index 00000000..10b8ceb5 --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintProperties.kt @@ -0,0 +1,29 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.core + +import org.springframework.boot.context.properties.bind.Bindable +import org.springframework.boot.context.properties.bind.Binder +import org.springframework.stereotype.Service + +@Service +open class BluePrintProperties(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 |