2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
26 * https://creativecommons.org/licenses/by/4.0/
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.
34 * ============LICENSE_END============================================
38 package org.onap.portalapp.portal.transport;
40 import java.util.Date;
41 import java.util.List;
44 import javax.persistence.CascadeType;
45 import javax.persistence.Column;
46 import javax.persistence.Entity;
47 import javax.persistence.FetchType;
48 import javax.persistence.GeneratedValue;
49 import javax.persistence.GenerationType;
50 import javax.persistence.Id;
51 import javax.persistence.JoinColumn;
52 import javax.persistence.OneToMany;
53 import javax.persistence.Table;
54 import javax.persistence.Transient;
55 import javax.validation.constraints.Digits;
56 import javax.validation.constraints.Size;
57 import lombok.EqualsAndHashCode;
59 import lombok.NoArgsConstructor;
61 import org.hibernate.validator.constraints.SafeHtml;
62 import org.onap.portalsdk.core.domain.support.DomainVo;
66 * This is to handle notifications in notification PopUp
71 @Table(name = "ep_notification")
75 @EqualsAndHashCode(callSuper = false)
76 public class EpNotificationItem extends DomainVo {
77 private static final long serialVersionUID = 1L;
80 @GeneratedValue(strategy = GenerationType.IDENTITY)
81 @Column(name = "notification_ID")
82 @Digits(integer = 11, fraction = 0)
83 public Long notificationId;
85 @Column(name = "is_for_online_users")
88 public String isForOnlineUsers;
90 @Column(name = "is_for_all_roles")
93 public String isForAllRoles;
95 @Column(name = "active_YN")
98 public String activeYn;
100 @Column(name = "msg_header")
103 public String msgHeader;
105 @Column(name = "msg_description")
108 public String msgDescription;
110 @Column(name = "msg_source")
113 public String msgSource;
115 @Column(name = "start_time")
116 public Date startTime;
118 @Column(name = "end_time")
121 @Column(name = "priority")
122 @Digits(integer = 11, fraction = 0)
123 public Long priority;
125 @Column(name = "creator_ID")
126 @Digits(integer = 11, fraction = 0)
127 public Long creatorId;
129 @Column(name = "created_date")
130 public Date createdDate;
132 @Column(name = "notification_hyperlink")
135 public String notificationHyperlink;
137 @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL}, orphanRemoval = true)
138 @JoinColumn(name="notification_ID")
139 private Set<EpRoleNotificationItem> roles;
142 private List<Long> roleIds;
145 public String toString() {
146 return "EpNotificationItem [notificationId=" + notificationId + ", isForOnlineUsers=" + isForOnlineUsers
147 + ", isForAllRoles=" + isForAllRoles + ", activeYn=" + activeYn + ", msgHeader=" + msgHeader
148 + ", msgDescription=" + msgDescription + ", msgSource=" + msgSource + ", startTime=" + startTime
149 + ", endTime=" + endTime + ", priority=" + priority + ", creatorId=" + creatorId + ", createdDate="
150 + createdDate + ", roles=" + roles + ", roleIds=" + roleIds + "]";