2 * Copyright © 2018 IBM.
3 * Modifications Copyright © 2017-2018 AT&T Intellectual Property.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 package org.onap.ccsdk.apps.controllerblueprints.resource.dict
20 import com.fasterxml.jackson.annotation.JsonFormat
21 import com.fasterxml.jackson.annotation.JsonProperty
22 import org.onap.ccsdk.apps.controllerblueprints.core.data.NodeTemplate
23 import org.onap.ccsdk.apps.controllerblueprints.core.data.PropertyDefinition
24 import java.io.Serializable
27 open class ResourceDefinition {
29 @JsonProperty(value = "name", required = true)
30 lateinit var name: String
32 @JsonProperty(value = "property", required = true)
33 lateinit var property: PropertyDefinition
35 var tags: String? = null
37 @JsonProperty(value = "updated-by")
38 lateinit var updatedBy: String
40 @JsonProperty(value = "sources", required = true)
41 lateinit var sources: MutableMap<String, NodeTemplate>
44 open class ResourceAssignment {
46 @JsonProperty(value = "name", required = true)
47 lateinit var name: String
49 @JsonProperty(value = "property")
50 var property: PropertyDefinition? = null
52 @JsonProperty("input-param")
53 var inputParameter: Boolean = false
55 @JsonProperty("dictionary-name")
56 var dictionaryName: String? = null
58 @JsonProperty("dictionary-source")
59 var dictionarySource: String? = null
61 @JsonProperty("dependencies")
62 var dependencies: MutableList<String>? = null
64 @JsonProperty("version")
67 @JsonProperty("status")
68 var status: String? = null
70 @JsonProperty("message")
71 var message: String? = null
73 @JsonProperty("updated-date")
74 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
75 var updatedDate: Date? = null
77 @JsonProperty("updated-by")
78 var updatedBy: String? = null
80 override fun toString(): String {
81 return StringBuilder()
83 .append("name=", name)
84 .append(", dictionaryName=", dictionaryName)
85 .append(", dictionarySource=", dictionarySource)
92 * Interface for Source Definitions (ex Input Source,
93 * Default Source, Database Source, Rest Sources, etc)
95 interface ResourceSource : Serializable
98 open class ResourceSourceMapping {
99 lateinit var resourceSourceMappings: MutableMap<String, String>