d9f0269f13d3ea5516038b0275cb1ed4db95ace1
[ccsdk/cds.git] /
1 /*
2  * Copyright © 2021 Aarna Networks, Inc.
3  *           All rights reserved.
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.functions.workflow.audit.db
18
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 java.io.Serializable
24 import java.util.Date
25 import javax.persistence.Column
26 import javax.persistence.Entity
27 import javax.persistence.GenerationType
28 import javax.persistence.GeneratedValue
29 import javax.persistence.Id
30 import javax.persistence.Lob
31 import javax.persistence.Table
32 import javax.persistence.Temporal
33 import javax.persistence.TemporalType
34
35 /**
36  * BlueprintWorkflowAuditStatus Model.
37  * Records stored and retrieved in table BLUEPRINT_WORKFLOW_AUDIT_STATUS is
38  * done through this entity.
39  */
40 @Entity
41 @Table(name = "BLUEPRINT_WORKFLOW_AUDIT_STATUS")
42 @Proxy(lazy = false)
43 class BlueprintWorkflowAuditStatus : Serializable {
44
45     @Id
46     @GeneratedValue(strategy = GenerationType.IDENTITY)
47     @Column(name = "workflow_audit_id")
48     var id: Long = 0
49
50     @get:ApiModelProperty(value = "Workflow payload.", required = true)
51     @Lob
52     @Column(name = "workflow_task_content", nullable = false)
53     @ApiModelProperty(required = true)
54     lateinit var workflowTaskContent: String
55
56     @get:ApiModelProperty(value = "request originator Id", required = true)
57     @Column(name = "originator_Id", nullable = false)
58     @ApiModelProperty(required = true)
59     lateinit var originatorId: String
60
61     @get:ApiModelProperty(value = "request Id", required = true)
62     @Column(name = "request_Id", nullable = false)
63     @ApiModelProperty(required = true)
64     lateinit var requestId: String
65
66     @get:ApiModelProperty(value = "sub request Id", required = true)
67     @Column(name = "subRequest_Id", nullable = false)
68     @ApiModelProperty(required = true)
69     lateinit var subRequestId: String
70
71     @get:ApiModelProperty(value = "workflow name", required = true)
72     @Column(name = "workflow_name", nullable = false)
73     @ApiModelProperty(required = true)
74     lateinit var workflowName: String
75
76     @get:ApiModelProperty(value = "status", required = true)
77     @Column(name = "status", nullable = true)
78     @ApiModelProperty(required = true)
79     lateinit var status: String
80
81     @get:ApiModelProperty(
82         value = "start time when request process started", required = true
83     )
84     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
85     @LastModifiedDate
86     @Temporal(TemporalType.TIMESTAMP)
87     @Column(name = "start_time")
88     var startDate: Date = Date()
89
90     @get:ApiModelProperty(
91         value = "end time when request process completed", required = true
92     )
93     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
94     @LastModifiedDate
95     @Temporal(TemporalType.TIMESTAMP)
96     @Column(name = "end_time")
97     var endDate: Date = Date()
98
99     @get:ApiModelProperty(value = "current date time", required = true)
100     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
101     @LastModifiedDate
102     @Temporal(TemporalType.TIMESTAMP)
103     @Column(name = "updated_date")
104     var updatedDate: Date = Date()
105
106     @get:ApiModelProperty(value = "updated by", required = true)
107     @Column(name = "updated_by", nullable = true)
108     @ApiModelProperty(required = true)
109     lateinit var updatedBy: String
110
111     @get:ApiModelProperty(value = "blueprint version", required = true)
112     @Column(name = "blueprint_version", nullable = false)
113     @ApiModelProperty(required = true)
114     lateinit var blueprintVersion: String
115
116     @get:ApiModelProperty(value = "blueprint name", required = true)
117     @Column(name = "blueprint_name", nullable = false)
118     @ApiModelProperty(required = true)
119     lateinit var blueprintName: String
120
121     @get:ApiModelProperty(value = "request mode", required = true)
122     @Column(name = "request_mode", nullable = true)
123     @ApiModelProperty(required = true)
124     lateinit var requestMode: String
125
126     @get:ApiModelProperty(value = "workflow response content", required = false)
127     @Lob
128     @Column(name = "workflow_response_content", nullable = true)
129     @ApiModelProperty(required = false)
130     lateinit var workflowResponseContent: String
131
132     @get:ApiModelProperty(value = "bluprint model uuid", required = true)
133     @Column(name = "blueprint_uuid", nullable = true)
134     @ApiModelProperty(required = false)
135     var blueprintUuid: String = ""
136 }