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