d1ebe13c16dd249338c3f72c24dd1a13af3b666d
[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         private String notificationHyperlink;
70
71         
72         /**
73          * Answers whether the notification is expired.
74          * 
75          * @return true if the end time is past the current time, else false.
76          */
77         public boolean isExpired() {
78                 boolean result = false;
79                 if (endTime != null) {
80                         int expired = endTime.compareTo(new Date());
81                         result = (expired == -1) ? true : false;
82                 }
83                 return result;
84         }
85
86         public String getLoginId() {
87                 return loginId;
88         }
89
90         public void setLoginId(String loginId) {
91                 this.loginId = loginId;
92         }
93
94         public Integer getNotificationId() {
95                 return notificationId;
96         }
97
98         public void setNotificationId(Integer notificationId) {
99                 this.notificationId = notificationId;
100         }
101
102         public Character getIsForOnlineUsers() {
103                 return isForOnlineUsers;
104         }
105
106         public void setIsForOnlineUsers(Character isForOnlineUsers) {
107                 this.isForOnlineUsers = isForOnlineUsers;
108         }
109
110         public Character getIsForAllRoles() {
111                 return isForAllRoles;
112         }
113
114         public void setIsForAllRoles(Character isForAllRoles) {
115                 this.isForAllRoles = isForAllRoles;
116         }
117
118         public Character getActiveYn() {
119                 return activeYn;
120         }
121
122         public void setActiveYn(Character activeYn) {
123                 this.activeYn = activeYn;
124         }
125
126         public String getMsgHeader() {
127                 return msgHeader;
128         }
129
130         public void setMsgHeader(String msgHeader) {
131                 this.msgHeader = msgHeader;
132         }
133
134         public String getMsgDescription() {
135                 return msgDescription;
136         }
137
138         public void setMsgDescription(String msgDescription) {
139                 this.msgDescription = msgDescription;
140         }
141
142         public Date getStartTime() {
143                 return startTime;
144         }
145
146         public void setStartTime(Date startTime) {
147                 this.startTime = startTime;
148         }
149
150         public Date getEndTime() {
151                 return endTime;
152         }
153
154         public void setEndTime(Date endTime) {
155                 this.endTime = endTime;
156         }
157
158         public Integer getPriority() {
159                 return priority;
160         }
161
162         public void setPriority(Integer priority) {
163                 this.priority = priority;
164         }
165
166         public Integer getCreatorId() {
167                 return creatorId;
168         }
169
170         public void setCreatorId(Integer creatorId) {
171                 this.creatorId = creatorId;
172         }
173
174         public Date getCreatedDate() {
175                 return createdDate;
176         }
177
178         public void setCreatedDate(Date createdDate) {
179                 this.createdDate = createdDate;
180         }
181
182         public static long getSerialversionuid() {
183                 return serialVersionUID;
184         }
185
186         
187         public String getMsgSource() {
188                 return msgSource;
189         }
190
191         public void setMsgSource(String msgSource) {
192                 this.msgSource = msgSource;
193         }
194         
195         public String getNotificationHyperlink() {
196                 return notificationHyperlink;
197         }
198
199         public void setNotificationHyperlink(String notificationHyperlink) {
200                 this.notificationHyperlink = notificationHyperlink;
201         }
202
203 }