Migrate "ms/controllerblueprints" from ccsdk/apps
[ccsdk/cds.git] / ms / controllerblueprints / modules / service / src / main / kotlin / org / onap / ccsdk / cds / controllerblueprints / service / enhancer / BluePrintTypeEnhancerServiceImpl.kt
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.ccsdk.cds.controllerblueprints.service.enhancer
18
19 import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.*
20 import org.springframework.beans.factory.annotation.Autowired
21 import org.springframework.context.ApplicationContext
22 import org.springframework.stereotype.Service
23
24 @Service
25 open class BluePrintTypeEnhancerServiceImpl : BluePrintTypeEnhancerService {
26
27     @Autowired
28     private lateinit var context: ApplicationContext
29
30     override fun getServiceTemplateEnhancers(): List<BluePrintServiceTemplateEnhancer> {
31         return context.getBeansOfType(BluePrintServiceTemplateEnhancer::class.java).map { it.value }
32     }
33
34     override fun getTopologyTemplateEnhancers(): List<BluePrintTopologyTemplateEnhancer> {
35         return context.getBeansOfType(BluePrintTopologyTemplateEnhancer::class.java).map { it.value }
36     }
37
38     override fun getWorkflowEnhancers(): List<BluePrintWorkflowEnhancer> {
39         return context.getBeansOfType(BluePrintWorkflowEnhancer::class.java).map { it.value }
40     }
41
42     override fun getNodeTemplateEnhancers(): List<BluePrintNodeTemplateEnhancer> {
43         return context.getBeansOfType(BluePrintNodeTemplateEnhancer::class.java).map { it.value }
44     }
45
46     override fun getNodeTypeEnhancers(): List<BluePrintNodeTypeEnhancer> {
47         return context.getBeansOfType(BluePrintNodeTypeEnhancer::class.java).map { it.value }
48     }
49
50     override fun getArtifactDefinitionEnhancers(): List<BluePrintArtifactDefinitionEnhancer> {
51         return context.getBeansOfType(BluePrintArtifactDefinitionEnhancer::class.java).map { it.value }
52     }
53
54     override fun getPolicyTypeEnhancers(): List<BluePrintPolicyTypeEnhancer> {
55         return context.getBeansOfType(BluePrintPolicyTypeEnhancer::class.java).map { it.value }
56     }
57
58     override fun getPropertyDefinitionEnhancers(): List<BluePrintPropertyDefinitionEnhancer> {
59         return context.getBeansOfType(BluePrintPropertyDefinitionEnhancer::class.java).map { it.value }
60     }
61
62     override fun getAttributeDefinitionEnhancers(): List<BluePrintAttributeDefinitionEnhancer> {
63         return context.getBeansOfType(BluePrintAttributeDefinitionEnhancer::class.java).map { it.value }
64     }
65 }