2  * ================================================================================
 
   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
 
  11  *      http://www.apache.org/licenses/LICENSE-2.0
 
  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  * ================================================================================
 
  20 package org.openecomp.portalapp.portal.transport;
 
  22 import java.util.Date;
 
  24 import javax.persistence.Entity;
 
  25 import javax.persistence.Id;
 
  27 import org.openecomp.portalsdk.core.domain.support.DomainVo;
 
  30  * This is to handle notifications in user notifications and in notification history
 
  34  * POJO that models a single notification with the org user ID (not integer
 
  38 public class EpNotificationItemVO extends DomainVo {
 
  40         private static final long serialVersionUID = 9095479701352339201L;
 
  43         private Integer notificationId;
 
  45         private Character isForOnlineUsers;
 
  47         private Character isForAllRoles;
 
  49         private Character activeYn;
 
  51         private String msgHeader;
 
  53         private String msgDescription;
 
  55         private String msgSource;
 
  57         private Date startTime;
 
  61         private Integer priority;
 
  63         private Integer creatorId;
 
  65         private Date createdDate;
 
  67         private String loginId;
 
  70          * Answers whether the notification is expired.
 
  72          * @return true if the end time is past the current time, else false.
 
  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;
 
  83         public String getLoginId() {
 
  87         public void setLoginId(String loginId) {
 
  88                 this.loginId = loginId;
 
  91         public Integer getNotificationId() {
 
  92                 return notificationId;
 
  95         public void setNotificationId(Integer notificationId) {
 
  96                 this.notificationId = notificationId;
 
  99         public Character getIsForOnlineUsers() {
 
 100                 return isForOnlineUsers;
 
 103         public void setIsForOnlineUsers(Character isForOnlineUsers) {
 
 104                 this.isForOnlineUsers = isForOnlineUsers;
 
 107         public Character getIsForAllRoles() {
 
 108                 return isForAllRoles;
 
 111         public void setIsForAllRoles(Character isForAllRoles) {
 
 112                 this.isForAllRoles = isForAllRoles;
 
 115         public Character getActiveYn() {
 
 119         public void setActiveYn(Character activeYn) {
 
 120                 this.activeYn = activeYn;
 
 123         public String getMsgHeader() {
 
 127         public void setMsgHeader(String msgHeader) {
 
 128                 this.msgHeader = msgHeader;
 
 131         public String getMsgDescription() {
 
 132                 return msgDescription;
 
 135         public void setMsgDescription(String msgDescription) {
 
 136                 this.msgDescription = msgDescription;
 
 139         public Date getStartTime() {
 
 143         public void setStartTime(Date startTime) {
 
 144                 this.startTime = startTime;
 
 147         public Date getEndTime() {
 
 151         public void setEndTime(Date endTime) {
 
 152                 this.endTime = endTime;
 
 155         public Integer getPriority() {
 
 159         public void setPriority(Integer priority) {
 
 160                 this.priority = priority;
 
 163         public Integer getCreatorId() {
 
 167         public void setCreatorId(Integer creatorId) {
 
 168                 this.creatorId = creatorId;
 
 171         public Date getCreatedDate() {
 
 175         public void setCreatedDate(Date createdDate) {
 
 176                 this.createdDate = createdDate;
 
 179         public static long getSerialversionuid() {
 
 180                 return serialVersionUID;
 
 184         public String getMsgSource() {
 
 188         public void setMsgSource(String msgSource) {
 
 189                 this.msgSource = msgSource;