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 = "resource-type", required = true)
40 lateinit var resourceType: String
42 @JsonProperty(value = "resource-path", required = true)
43 lateinit var resourcePath: String
45 @JsonProperty(value = "sources", required = true)
46 lateinit var sources: MutableMap<String, NodeTemplate>
49 open class ResourceAssignment {
51 @JsonProperty(value = "name", required = true)
52 lateinit var name: String
54 @JsonProperty(value = "property")
55 var property: PropertyDefinition? = null
57 @JsonProperty("input-param")
58 var inputParameter: Boolean = false
60 @JsonProperty("dictionary-name")
61 var dictionaryName: String? = null
63 @JsonProperty("dictionary-source")
64 var dictionarySource: String? = null
66 @JsonProperty("dependencies")
67 var dependencies: MutableList<String>? = null
69 @JsonProperty("version")
72 @JsonProperty("status")
73 var status: String? = null
75 @JsonProperty("message")
76 var message: String? = null
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
82 @JsonProperty("updated-by")
83 var updatedBy: String? = null
85 override fun toString(): String {
86 return StringBuilder()
88 .append("name=", name)
89 .append(", dictionaryName=", dictionaryName)
90 .append(", dictionarySource=", dictionarySource)
97 * Interface for Source Definitions (ex Input Source,
98 * Default Source, Database Source, Rest Sources, etc)
100 interface ResourceSource : Serializable