Replace ecomp references
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / transport / EpNotificationItemVO.java
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the "License");
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * 
37  */
38 package org.onap.portalapp.portal.transport;
39
40 import java.util.Date;
41
42 import javax.persistence.Entity;
43 import javax.persistence.Id;
44
45 import org.onap.portalsdk.core.domain.support.DomainVo;
46
47 /**
48  * This is to handle notifications in user notifications and in notification history
49  */
50
51 /**
52  * POJO that models a single notification with the org user ID (not integer
53  * user_id).
54  */
55 @Entity
56 public class EpNotificationItemVO extends DomainVo {
57
58         private static final long serialVersionUID = 9095479701352339201L;
59
60         @Id
61         private Integer notificationId;
62
63         private Character isForOnlineUsers;
64
65         private Character isForAllRoles;
66
67         private Character activeYn;
68
69         private String msgHeader;
70
71         private String msgDescription;
72         
73         private String msgSource;
74
75         private Date startTime;
76
77         private Date endTime;
78
79         private Integer priority;
80
81         private Integer creatorId;
82
83         private Date createdDate;
84
85         private String loginId;
86         
87         private String notificationHyperlink;
88
89         
90         /**
91          * Answers whether the notification is expired.
92          * 
93          * @return true if the end time is past the current time, else false.
94          */
95         public boolean isExpired() {
96                 boolean result = false;
97                 if (endTime != null) {
98                         int expired = endTime.compareTo(new Date());
99                         result = (expired == -1) ? true : false;
100                 }
101                 return result;
102         }
103
104         public String getLoginId() {
105                 return loginId;
106         }
107
108         public void setLoginId(String loginId) {
109                 this.loginId = loginId;
110         }
111
112         public Integer getNotificationId() {
113                 return notificationId;
114         }
115
116         public void setNotificationId(Integer notificationId) {
117                 this.notificationId = notificationId;
118         }
119
120         public Character getIsForOnlineUsers() {
121                 return isForOnlineUsers;
122         }
123
124         public void setIsForOnlineUsers(Character isForOnlineUsers) {
125                 this.isForOnlineUsers = isForOnlineUsers;
126         }
127
128         public Character getIsForAllRoles() {
129                 return isForAllRoles;
130         }
131
132         public void setIsForAllRoles(Character isForAllRoles) {
133                 this.isForAllRoles = isForAllRoles;
134         }
135
136         public Character getActiveYn() {
137                 return activeYn;
138         }
139
140         public void setActiveYn(Character activeYn) {
141                 this.activeYn = activeYn;
142         }
143
144         public String getMsgHeader() {
145                 return msgHeader;
146         }
147
148         public void setMsgHeader(String msgHeader) {
149                 this.msgHeader = msgHeader;
150         }
151
152         public String getMsgDescription() {
153                 return msgDescription;
154         }
155
156         public void setMsgDescription(String msgDescription) {
157                 this.msgDescription = msgDescription;
158         }
159
160         public Date getStartTime() {
161                 return startTime;
162         }
163
164         public void setStartTime(Date startTime) {
165                 this.startTime = startTime;
166         }
167
168         public Date getEndTime() {
169                 return endTime;
170         }
171
172         public void setEndTime(Date endTime) {
173                 this.endTime = endTime;
174         }
175
176         public Integer getPriority() {
177                 return priority;
178         }
179
180         public void setPriority(Integer priority) {
181                 this.priority = priority;
182         }
183
184         public Integer getCreatorId() {
185                 return creatorId;
186         }
187
188         public void setCreatorId(Integer creatorId) {
189                 this.creatorId = creatorId;
190         }
191
192         public Date getCreatedDate() {
193                 return createdDate;
194         }
195
196         public void setCreatedDate(Date createdDate) {
197                 this.createdDate = createdDate;
198         }
199
200         public static long getSerialversionuid() {
201                 return serialVersionUID;
202         }
203
204         
205         public String getMsgSource() {
206                 return msgSource;
207         }
208
209         public void setMsgSource(String msgSource) {
210                 this.msgSource = msgSource;
211         }
212         
213         public String getNotificationHyperlink() {
214                 return notificationHyperlink;
215         }
216
217         public void setNotificationHyperlink(String notificationHyperlink) {
218                 this.notificationHyperlink = notificationHyperlink;
219         }
220
221 }