e9bfc613039405019b451e87c05da1a03d60a679
[ccsdk/cds.git] /
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.apps.controllerblueprints.validation
18
19 import org.onap.ccsdk.apps.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 class BluePrintTypeValidatorServiceImpl : BluePrintTypeValidatorService {
26
27     @Autowired
28     private lateinit var context: ApplicationContext
29
30     override fun getServiceTemplateValidators(): List<BluePrintServiceTemplateValidator> {
31         return context.getBeansOfType(BluePrintServiceTemplateValidator::class.java).mapNotNull { it.value }
32     }
33
34     override fun getDataTypeValidators(): List<BluePrintDataTypeValidator> {
35         return context.getBeansOfType(BluePrintDataTypeValidator::class.java).mapNotNull { it.value }
36     }
37
38     override fun getArtifactTypeValidators(): List<BluePrintArtifactTypeValidator> {
39         return context.getBeansOfType(BluePrintArtifactTypeValidator::class.java).mapNotNull { it.value }
40     }
41
42     override fun getNodeTypeValidators(): List<BluePrintNodeTypeValidator> {
43         return context.getBeansOfType(BluePrintNodeTypeValidator::class.java).mapNotNull { it.value }
44     }
45
46     override fun getTopologyTemplateValidators(): List<BluePrintTopologyTemplateValidator> {
47         return context.getBeansOfType(BluePrintTopologyTemplateValidator::class.java).mapNotNull { it.value }
48     }
49
50     override fun getNodeTemplateValidators(): List<BluePrintNodeTemplateValidator> {
51         return context.getBeansOfType(BluePrintNodeTemplateValidator::class.java).mapNotNull { it.value }
52     }
53
54     override fun getWorkflowValidators(): List<BluePrintWorkflowValidator> {
55         return context.getBeansOfType(BluePrintWorkflowValidator::class.java).mapNotNull { it.value }
56     }
57
58     override fun getPropertyDefinitionValidators(): List<BluePrintPropertyDefinitionValidator> {
59         return context.getBeansOfType(BluePrintPropertyDefinitionValidator::class.java).mapNotNull { it.value }
60     }
61
62     override fun getAttributeDefinitionValidators(): List<BluePrintAttributeDefinitionValidator> {
63         return context.getBeansOfType(BluePrintAttributeDefinitionValidator::class.java).mapNotNull { it.value }
64     }
65 }
66