Merge "Resource resolution should return a string"
[ccsdk/cds.git] / ms / controllerblueprints / modules / blueprint-core / src / main / kotlin / org / onap / ccsdk / cds / controllerblueprints / core / annotations / BluePrintsAnnotations.kt
1 /*
2  *  Copyright © 2019 IBM.
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.core.annotations
18
19
20 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
21 import kotlin.reflect.KClass
22
23 @Target(AnnotationTarget.CLASS)
24 annotation class BluePrintsDataType(
25         val name: String,
26         val version: String = BluePrintConstants.DEFAULT_VERSION_NUMBER,
27         val description: String,
28         val derivedFrom: String = "tosca.datatypes.root"
29 )
30
31 @Target(AnnotationTarget.CLASS)
32 annotation class BluePrintsWorkflowInput
33
34 @Target(AnnotationTarget.CLASS)
35 annotation class BluePrintsWorkflowOutput
36
37 @Target(AnnotationTarget.CLASS)
38 annotation class BluePrintsNodeType(val propertiesType: KClass<*>, val attributesType: KClass<*>,
39                                     val inputsType: KClass<*>, val outputsType: KClass<*>)
40
41 @Target(AnnotationTarget.FIELD, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY)
42 annotation class BluePrintsProperty(
43         val name: String = "",
44         val description: String = ""
45 )
46
47 @Target(AnnotationTarget.FIELD, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY)
48 @Repeatable
49 annotation class BluePrintsConstrain()
50
51 @Target(AnnotationTarget.FIELD, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY)
52 annotation class PropertyDefaultValue(val value: String)
53
54 annotation class PropertyValidValue(val value: String)
55
56 @Target(AnnotationTarget.FIELD, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY)
57 annotation class InputExpression(
58         val propertyName: String
59 )
60
61 @Target(AnnotationTarget.FIELD, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY)
62 annotation class PropertyExpression(
63         val modelableEntityName: String = "SELF",
64         val reqOrCapEntityName: String = "",
65         val propertyName: String,
66         val subPropertyName: String = ""
67 )
68
69 @Target(AnnotationTarget.FIELD, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY)
70 annotation class AttributeExpression(
71         val modelableEntityName: String = "SELF",
72         val reqOrCapEntityName: String = "",
73         val attributeName: String,
74         val subAttributeName: String = ""
75 )
76
77 @Target(AnnotationTarget.FIELD, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY)
78 annotation class ArtifactExpression(
79         val modelableEntityName: String = "SELF",
80         val artifactName: String,
81         val location: String = "LOCAL_FILE",
82         val remove: Boolean = false
83 )
84
85 @Target(AnnotationTarget.FIELD, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY)
86 annotation class OperationOutputExpression(
87         val modelableEntityName: String = "SELF",
88         val interfaceName: String,
89         val operationName: String,
90         val propertyName: String,
91         val subPropertyName: String = ""
92 )
93
94 @Target(AnnotationTarget.FIELD, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY)
95 annotation class DSLExpression(
96         val propertyName: String
97 )