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