0808073f8a0c3b81e51fb707ebc69e461ddfd2ba
[ccsdk/cds.git] /
1 /*
2  *  Copyright © 2018 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.apps.controllerblueprints.resource.dict
18
19 import com.fasterxml.jackson.annotation.JsonFormat
20 import com.fasterxml.jackson.annotation.JsonProperty
21 import org.onap.ccsdk.apps.controllerblueprints.core.data.NodeTemplate
22 import org.onap.ccsdk.apps.controllerblueprints.core.data.PropertyDefinition
23 import java.io.Serializable
24 import java.util.*
25
26 open class ResourceDefinition {
27
28     @JsonProperty(value = "name", required = true)
29     lateinit var name: String
30
31     @JsonProperty(value = "property", required = true)
32     lateinit var property: PropertyDefinition
33
34     var tags: String? = null
35
36     @JsonProperty(value = "updated-by")
37     lateinit var updatedBy: String
38
39     @JsonProperty(value = "resource-type", required = true)
40     lateinit var resourceType: String
41
42     @JsonProperty(value = "resource-path", required = true)
43     lateinit var resourcePath: String
44
45     @JsonProperty(value = "sources", required = true)
46     lateinit var sources: MutableMap<String, NodeTemplate>
47 }
48
49 open class ResourceAssignment {
50
51     @JsonProperty(value = "name", required = true)
52     lateinit var name: String
53
54     @JsonProperty(value = "property")
55     var property: PropertyDefinition? = null
56
57     @JsonProperty("input-param")
58     var inputParameter: Boolean = false
59
60     @JsonProperty("dictionary-name")
61     var dictionaryName: String? = null
62
63     @JsonProperty("dictionary-source")
64     var dictionarySource: String? = null
65
66     @JsonProperty("dependencies")
67     var dependencies: MutableList<String>? = null
68
69     @JsonProperty("version")
70     var version: Int = 0
71
72     @JsonProperty("status")
73     var status: String? = null
74
75     @JsonProperty("message")
76     var message: String? = null
77
78     @JsonProperty("updated-date")
79     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
80     var updatedDate: Date? = null
81
82     @JsonProperty("updated-by")
83     var updatedBy: String? = null
84
85     override fun toString(): String {
86         return StringBuilder()
87                 .append("[")
88                 .append("name=", name)
89                 .append(", dictionaryName=", dictionaryName)
90                 .append(", dictionarySource=", dictionarySource)
91                 .append("]")
92                 .toString()
93     }
94 }
95
96 /**
97  * Interface for Source Definitions (ex Input Source,
98  * Default Source, Database Source, Rest Sources, etc)
99  */
100 interface ResourceSource : Serializable