Coverity Scan issues fix
[portal.git] / portal-BE / src / main / java / org / onap / portal / domain / db / fn / FnQzFiredTriggers.java
1 /*
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  * Modifications Copyright (c) 2019 Samsung
8  * ===================================================================
9  *
10  * Unless otherwise specified, all software contained herein is licensed
11  * under the Apache License, Version 2.0 (the "License");
12  * you may not use this software except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  *             http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  *
23  * Unless otherwise specified, all documentation contained herein is licensed
24  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
25  * you may not use this documentation except in compliance with the License.
26  * You may obtain a copy of the License at
27  *
28  *             https://creativecommons.org/licenses/by/4.0/
29  *
30  * Unless required by applicable law or agreed to in writing, documentation
31  * distributed under the License is distributed on an "AS IS" BASIS,
32  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33  * See the License for the specific language governing permissions and
34  * limitations under the License.
35  *
36  * ============LICENSE_END============================================
37  *
38  *
39  */
40
41 package org.onap.portal.domain.db.fn;
42
43 import java.io.Serializable;
44 import java.math.BigInteger;
45 import javax.persistence.Column;
46 import javax.persistence.Entity;
47 import javax.persistence.Id;
48 import javax.persistence.IdClass;
49 import javax.persistence.Index;
50 import javax.persistence.Table;
51 import javax.validation.constraints.Digits;
52 import javax.validation.constraints.NotNull;
53 import javax.validation.constraints.Size;
54 import lombok.AllArgsConstructor;
55 import lombok.EqualsAndHashCode;
56 import lombok.Getter;
57 import lombok.NoArgsConstructor;
58 import lombok.Setter;
59 import org.hibernate.validator.constraints.SafeHtml;
60 import org.onap.portal.domain.db.fn.FnQzFiredTriggers.FnQzFiredTriggersID;
61
62 /*
63 CREATE TABLE `fn_qz_fired_triggers` (
64         `SCHED_NAME` varchar(120) NOT NULL,
65         `ENTRY_ID` varchar(95) NOT NULL,
66         `TRIGGER_NAME` varchar(200) NOT NULL,
67         `TRIGGER_GROUP` varchar(200) NOT NULL,
68         `INSTANCE_NAME` varchar(200) NOT NULL,
69         `FIRED_TIME` bigint(13) NOT NULL,
70         `SCHED_TIME` bigint(13) NOT NULL,
71         `PRIORITY` int(11) NOT NULL,
72         `STATE` varchar(16) NOT NULL,
73         `JOB_NAME` varchar(200) DEFAULT NULL,
74         `JOB_GROUP` varchar(200) DEFAULT NULL,
75         `IS_NONCONCURRENT` varchar(1) DEFAULT NULL,
76         `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL,
77         PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`),
78         KEY `idx_fn_qz_ft_trig_inst_name` (`SCHED_NAME`,`INSTANCE_NAME`),
79         KEY `idx_fn_qz_ft_inst_job_req_rcvry` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`),
80         KEY `idx_fn_qz_ft_j_g` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
81         KEY `idx_fn_qz_ft_jg` (`SCHED_NAME`,`JOB_GROUP`),
82         KEY `idx_fn_qz_ft_t_g` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
83         KEY `idx_fn_qz_ft_tg` (`SCHED_NAME`,`TRIGGER_GROUP`)
84         )
85 */
86
87 @Table(name = "fn_qz_fired_triggers", indexes = {
88         @Index(name = "idx_fn_qz_ft_trig_inst_name", columnList = "sched_name, instance_name"),
89         @Index(name = "idx_fn_qz_ft_inst_job_req_rcvry", columnList = "sched_name, instance_name, requests_recovery"),
90         @Index(name = "idx_fn_qz_ft_j_g", columnList = "sched_name, job_name, job_group"),
91         @Index(name = "idx_fn_qz_ft_jg", columnList = "sched_name, job_group"),
92         @Index(name = "idx_fn_qz_ft_t_g", columnList = "sched_name, trigger_name, trigger_group"),
93         @Index(name = "idx_fn_qz_ft_tg", columnList = "sched_name, trigger_group")
94
95 })
96 @NoArgsConstructor
97 @AllArgsConstructor
98
99 @Getter
100 @Setter
101 @Entity
102 @IdClass(FnQzFiredTriggersID.class)
103 public class FnQzFiredTriggers implements Serializable{
104        @Id
105        @Size(max = 120)
106        @SafeHtml
107        @Column(name = "SCHED_NAME", length = 120, nullable = false)
108        private String schedName;
109        @Id
110        @Size(max = 95)
111        @SafeHtml
112        @Column(name = "ENTRY_ID", length = 95, nullable = false)
113        private String entryId;
114        @Column(name = "TRIGGER_NAME", length = 200, nullable = false)
115        @Size(max = 200)
116        @SafeHtml
117        @NotNull
118        private String triggerName;
119        @Column(name = "TRIGGER_GROUP", length = 200, nullable = false)
120        @Size(max = 200)
121        @SafeHtml
122        @NotNull
123        private String triggerGroup;
124        @Column(name = "INSTANCE_NAME", length = 200, nullable = false)
125        @Size(max = 200)
126        @SafeHtml
127        @NotNull
128        private String instanceName;
129        @Column(name = "FIRED_TIME", length = 13, nullable = false)
130        @Digits(integer = 13, fraction = 0)
131        @NotNull
132        private BigInteger firedTime;
133        @Column(name = "SCHED_TIME", length = 13, nullable = false)
134        @Digits(integer = 13, fraction = 0)
135        @NotNull
136        private BigInteger schedTime;
137        @Column(name = "PRIORITY", nullable = false)
138        @NotNull
139        private Integer priority;
140        @Column(name = "STATE", length = 16, nullable = false)
141        @Size(max = 16)
142        @SafeHtml
143        @NotNull
144        private String state;
145        @Column(name = "JOB_NAME", length = 200, columnDefinition = "varchar(200) DEFAULT NULL")
146        @Size(max = 200)
147        @SafeHtml
148        private String jobName;
149        @Column(name = "JOB_GROUP", length = 200, columnDefinition = "varchar(200) DEFAULT NULL")
150        @Size(max = 200)
151        @SafeHtml
152        private String jobGroup;
153        @Column(name = "IS_NONCONCURRENT", length = 1, columnDefinition = "varchar(1) DEFAULT NULL")
154        @Size(max = 1)
155        @SafeHtml
156        private String isNonconcurrent;
157        @Column(name = "REQUESTS_RECOVERY", length = 1, columnDefinition = "varchar(1) DEFAULT NULL")
158        @Size(max = 1)
159        @SafeHtml
160        private String requestsRecovery;
161
162        @Getter
163        @Setter
164        @NoArgsConstructor
165        @EqualsAndHashCode
166        @AllArgsConstructor
167        public static class FnQzFiredTriggersID implements Serializable {
168               @Size(max = 120)
169               @SafeHtml
170               private String schedName;
171               @Size(max = 95)
172               @SafeHtml
173               private String entryId;
174        }
175 }