2 * Copyright © 2019 Bell Canada
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.cds.blueprintsprocessor.functions.resource.resolution.db
19 import com.fasterxml.jackson.annotation.JsonFormat
20 import io.swagger.annotations.ApiModelProperty
21 import org.hibernate.annotations.Proxy
22 import org.springframework.data.annotation.LastModifiedDate
23 import org.springframework.data.jpa.domain.support.AuditingEntityListener
24 import java.io.Serializable
26 import javax.persistence.Column
27 import javax.persistence.ElementCollection
28 import javax.persistence.Entity
29 import javax.persistence.EntityListeners
30 import javax.persistence.Id
31 import javax.persistence.Lob
32 import javax.persistence.Table
33 import javax.persistence.Temporal
34 import javax.persistence.TemporalType
36 @EntityListeners(AuditingEntityListener::class)
38 @Table(name = "RESOURCE_RESOLUTION")
40 class ResourceResolution : Serializable {
42 @get:ApiModelProperty(value = "Name of the CBA.", required = true)
43 @Column(name = "blueprint_name", nullable = false)
44 var blueprintName: String? = null
46 @get:ApiModelProperty(value = "Version of the CBA.", required = true)
47 @Column(name = "blueprint_version", nullable = false)
48 var blueprintVersion: String? = null
50 @get:ApiModelProperty(value = "Artifact name for which to retrieve a resolved resource.", required = true)
51 @Column(name = "artifact_name", nullable = false)
52 var artifactName: String? = null
54 @get:ApiModelProperty(value = "Name of the resource.", required = true)
55 @Column(name = "name", nullable = false)
56 var name: String? = null
58 @get:ApiModelProperty(value = "Value of the resolution.", required = true)
60 @Column(name = "value", nullable = false)
61 var value: String? = null
63 @get:ApiModelProperty(value = "Whether success of failure.", required = true)
64 @Column(name = "status", nullable = false)
65 var status: String? = null
67 @get:ApiModelProperty(value = "Resolution Key uniquely identifying the resolution of a given artifact within a CBA.",
69 @Column(name = "resolution_key", nullable = false)
70 var resolutionKey: String? = null
72 @get:ApiModelProperty(value = "Resolution type.", required = true, example = "ServiceInstance, VfModule, VNF")
73 @Column(name = "resource_type", nullable = false)
74 var resourceType: String? = null
76 @get:ApiModelProperty(value = "ID associated with the resolution type in the inventory system.", required = true)
77 @Column(name = "resource_id", nullable = false)
78 var resourceId: String? = null
80 @get:ApiModelProperty(value = "If resolution occurred multiple time, this field provides the index.",
82 @Column(name = "occurrence", nullable = false)
83 var occurrence: Int = 0
85 @get:ApiModelProperty(value = "Name of the data dictionary used for the resolution.", required = true)
86 @Column(name = "dictionary_name", nullable = false)
87 var dictionaryName: String? = null
89 @get:ApiModelProperty(value = "Source associated with the data dictionary used for the resolution.",
91 @Column(name = "dictionary_status", nullable = false)
92 var dictionarySource: String? = null
94 @get:ApiModelProperty(value = "Version of the data dictionary used for the resolution.", required = true)
95 @Column(name = "dictionary_version", nullable = false)
96 var dictionaryVersion: Int = 0
99 @Column(name = "resource_resolution_id")
100 var id: String? = null
102 @get:ApiModelProperty(value = "Creation date of the resolution.", required = true)
103 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
105 @Temporal(TemporalType.TIMESTAMP)
106 @Column(name = "creation_date")
107 var createdDate = Date()
110 private const val serialVersionUID = 1L