ff2608711ba56a2802151804fa34e64a662132ae
[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 = "sources", required = true)
40     lateinit var sources: MutableMap<String, NodeTemplate>
41 }
42
43 open class ResourceAssignment {
44
45     @JsonProperty(value = "name", required = true)
46     lateinit var name: String
47
48     @JsonProperty(value = "property")
49     var property: PropertyDefinition? = null
50
51     @JsonProperty("input-param")
52     var inputParameter: Boolean = false
53
54     @JsonProperty("dictionary-name")
55     var dictionaryName: String? = null
56
57     @JsonProperty("dictionary-source")
58     var dictionarySource: String? = null
59
60     @JsonProperty("dependencies")
61     var dependencies: MutableList<String>? = null
62
63     @JsonProperty("version")
64     var version: Int = 0
65
66     @JsonProperty("status")
67     var status: String? = null
68
69     @JsonProperty("message")
70     var message: String? = null
71
72     @JsonProperty("updated-date")
73     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
74     var updatedDate: Date? = null
75
76     @JsonProperty("updated-by")
77     var updatedBy: String? = null
78
79     override fun toString(): String {
80         return StringBuilder()
81                 .append("[")
82                 .append("name=", name)
83                 .append(", dictionaryName=", dictionaryName)
84                 .append(", dictionarySource=", dictionarySource)
85                 .append("]")
86                 .toString()
87     }
88 }
89
90 /**
91  * Interface for Source Definitions (ex Input Source,
92  * Default Source, Database Source, Rest Sources, etc)
93  */
94 interface ResourceSource : Serializable