734bf3689007297f50e76d02b9972954a6ac850d
[ccsdk/cds.git] /
1 /*
2  *  Copyright © 2019 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.cds.blueprintsprocessor.db.primary.domain
18
19 import com.fasterxml.jackson.annotation.JsonFormat
20 import com.fasterxml.jackson.annotation.JsonTypeInfo
21 import com.fasterxml.jackson.annotation.JsonTypeName
22 import com.fasterxml.jackson.databind.annotation.JsonSerialize
23 import io.swagger.annotations.ApiModel
24 import io.swagger.annotations.ApiModelProperty
25 import org.springframework.data.annotation.LastModifiedDate
26 import java.io.Serializable
27 import java.util.Date
28 import javax.persistence.Column
29 import javax.persistence.Entity
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
35
36 /**
37  * Provide Blueprint Model Search Entity
38  *
39  * @author Brinda Santh
40  * @version 1.0
41  */
42
43 @Entity
44 @Table(name = "BLUEPRINT_MODEL")
45 @JsonTypeName("blueprintModel")
46 @JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
47 @ApiModel
48 class BlueprintModelSearch : Serializable {
49
50     @ApiModelProperty(
51         value = "ID of Blueprint model, is automatically created by CDS",
52         example = "\"658f9a48-7f54-41ba-ae18-c69f26f3dc94\"",
53         required = true
54     )
55     @Id
56     @Column(name = "blueprint_model_id")
57     var id: String? = null
58
59     @ApiModelProperty(value = "Artifact UUID, usually null", example = "null", required = false)
60     @Column(name = "artifact_uuid")
61     var artifactUUId: String? = null
62
63     @JsonSerialize
64     @ApiModelProperty(value = "Artifact Type, usually null", example = "\"SDNC_MODEL\"", required = false)
65     @Column(name = "artifact_type")
66     var artifactType: String? = null
67
68     @ApiModelProperty(value = "Artifact Version, usually 1.0.0", example = "\"1.0.0\"", required = true)
69     @Column(name = "artifact_version", nullable = false)
70     var artifactVersion: String? = null
71
72     @ApiModelProperty(value = "Artifact Description, usually empty", example = "\"\"", required = false)
73     @Lob
74     @Column(name = "artifact_description")
75     var artifactDescription: String? = null
76
77     @ApiModelProperty(value = "Internal Version of CBA, usually null", example = "null", required = false)
78     @Column(name = "internal_version")
79     var internalVersion: Int? = null
80
81     @ApiModelProperty(value = "Datetime of the creation of CBA in CDS", example = "\"2020-11-19T10:34:56.000Z\"", required = true)
82     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
83     @LastModifiedDate
84     @Temporal(TemporalType.TIMESTAMP)
85     @Column(name = "creation_date")
86     var createdDate = Date()
87
88     @ApiModelProperty(value = "Artifact Name, defined in Metadata", example = "\"pnf_netconf\"", required = true)
89     @Column(name = "artifact_name", nullable = false)
90     var artifactName: String? = null
91
92     @ApiModelProperty(value = "Artifact Name, defined in Metadata", example = "\"pnf_netconf\"", required = true)
93     @Column(name = "published", nullable = false)
94     var published: String? = null
95
96     @ApiModelProperty(value = "Name of publisher, defined in Metadata", example = "\"Deutsche Telekom AG\"", required = true)
97     @Column(name = "updated_by", nullable = false)
98     var updatedBy: String? = null
99
100     @ApiModelProperty(value = "Tags to identify the CBA, defined in Metadata", example = "\"test\"", required = true)
101     @Lob
102     @Column(name = "tags", nullable = false)
103     var tags: String? = null
104
105     companion object {
106
107         const val serialversionuid = 1L
108     }
109 }