2 * Copyright © 2018 IBM.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onap.ccsdk.apps.controllerblueprints.resource.dict
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
26 open class ResourceDefinition {
28 @JsonProperty(value = "name", required = true)
29 lateinit var name: String
31 @JsonProperty(value = "property", required = true)
32 lateinit var property: PropertyDefinition
34 var tags: String? = null
36 @JsonProperty(value = "updated-by")
37 lateinit var updatedBy: String
39 @JsonProperty(value = "sources", required = true)
40 lateinit var sources: MutableMap<String, NodeTemplate>
43 open class ResourceAssignment {
45 @JsonProperty(value = "name", required = true)
46 lateinit var name: String
48 @JsonProperty(value = "property")
49 var property: PropertyDefinition? = null
51 @JsonProperty("input-param")
52 var inputParameter: Boolean = false
54 @JsonProperty("dictionary-name")
55 var dictionaryName: String? = null
57 @JsonProperty("dictionary-source")
58 var dictionarySource: String? = null
60 @JsonProperty("dependencies")
61 var dependencies: MutableList<String>? = null
63 @JsonProperty("version")
66 @JsonProperty("status")
67 var status: String? = null
69 @JsonProperty("message")
70 var message: String? = null
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
76 @JsonProperty("updated-by")
77 var updatedBy: String? = null
79 override fun toString(): String {
80 return StringBuilder()
82 .append("name=", name)
83 .append(", dictionaryName=", dictionaryName)
84 .append(", dictionarySource=", dictionarySource)
91 * Interface for Source Definitions (ex Input Source,
92 * Default Source, Database Source, Rest Sources, etc)
94 interface ResourceSource : Serializable