2 * Copyright © 2018-2019 AT&T Intellectual Property.
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.message.prioritization.db
19 import com.fasterxml.jackson.annotation.JsonFormat
20 import org.hibernate.annotations.Proxy
21 import org.springframework.data.annotation.LastModifiedDate
22 import org.springframework.data.jpa.domain.support.AuditingEntityListener
23 import org.springframework.data.jpa.repository.config.EnableJpaAuditing
25 import javax.persistence.Column
26 import javax.persistence.Entity
27 import javax.persistence.EntityListeners
28 import javax.persistence.Id
29 import javax.persistence.Lob
30 import javax.persistence.Table
31 import javax.persistence.Temporal
32 import javax.persistence.TemporalType
35 @EntityListeners(AuditingEntityListener::class)
37 @Table(name = "MESSAGE_PRIORITIZATION")
39 open class MessagePrioritization {
42 @Column(name = "message_id", length = 50)
43 lateinit var id: String
45 @Column(name = "message_group", length = 50, nullable = false)
46 lateinit var group: String
48 @Column(name = "message_type", length = 50, nullable = false)
49 lateinit var type: String
51 /** States Defined by MessageState */
52 @Column(name = "message_state", length = 20, nullable = false)
53 lateinit var state: String
55 @Column(name = "priority", nullable = false)
59 @Column(name = "message", nullable = false)
60 var message: String? = null
63 @Column(name = "error", nullable = true)
64 var error: String? = null
67 @Column(name = "aggregated_message_ids", nullable = true)
68 var aggregatedMessageIds: String? = null
71 @Column(name = "correlation_id", nullable = true)
72 var correlationId: String? = null
74 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
75 @Temporal(TemporalType.TIMESTAMP)
76 @Column(name = "created_date", nullable = false)
77 var createdDate = Date()
79 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
81 @Temporal(TemporalType.TIMESTAMP)
82 @Column(name = "updated_date", nullable = false)
83 var updatedDate: Date? = null
85 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
86 @Temporal(TemporalType.TIMESTAMP)
87 @Column(name = "expiry_date", nullable = false)
88 var expiryDate: Date? = null