-/*-\r
- * ================================================================================\r
- * ECOMP Portal\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ================================================================================\r
- */\r
-package org.openecomp.portalapp.portal.transport;\r
-\r
-import java.util.Date;\r
-import java.util.List;\r
-import java.util.Set;\r
-\r
-import javax.persistence.CascadeType;\r
-import javax.persistence.Column;\r
-import javax.persistence.Entity;\r
-import javax.persistence.FetchType;\r
-import javax.persistence.GeneratedValue;\r
-import javax.persistence.GenerationType;\r
-import javax.persistence.Id;\r
-import javax.persistence.JoinColumn;\r
-import javax.persistence.OneToMany;\r
-import javax.persistence.Table;\r
-import javax.persistence.Transient;\r
-\r
-import org.openecomp.portalsdk.core.domain.support.DomainVo;\r
-\r
-\r
-/**\r
- * This is to handle notifications in notification PopUp\r
- */\r
-\r
-\r
-@Entity\r
-@Table(name = "ep_notification")\r
-public class EpNotificationItem extends DomainVo {\r
- public EpNotificationItem() {\r
- };\r
-\r
- private static final long serialVersionUID = 1L;\r
-\r
- @Id\r
- @GeneratedValue(strategy = GenerationType.IDENTITY)\r
- @Column(name = "notification_ID")\r
- public Long notificationId;\r
-\r
- @Column(name = "is_for_online_users")\r
- public String isForOnlineUsers;\r
-\r
- @Column(name = "is_for_all_roles")\r
- public String isForAllRoles;\r
-\r
- @Column(name = "active_YN")\r
- public String activeYn;\r
- \r
- @Column(name = "msg_header")\r
- public String msgHeader;\r
-\r
- @Column(name = "msg_description")\r
- public String msgDescription;\r
- \r
- @Column(name = "msg_source")\r
- public String msgSource;\r
-\r
- @Column(name = "start_time")\r
- public Date startTime;\r
- \r
- @Column(name = "end_time")\r
- public Date endTime;\r
-\r
- @Column(name = "priority")\r
- public Long priority;\r
- \r
- @Column(name = "creator_ID")\r
- public Long creatorId;\r
- \r
- @Column(name = "created_date")\r
- public Date createdDate;\r
- \r
- \r
- @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL}, orphanRemoval = true)\r
- @JoinColumn(name="notification_ID")\r
- private Set<EpRoleNotificationItem> roles;\r
- \r
- @Transient\r
- private List<Long> roleIds;\r
- \r
- public Long getNotificationId() {\r
- return notificationId;\r
- }\r
-\r
- public void setNotificationId(Long notificationId) {\r
- this.notificationId = notificationId;\r
- }\r
-\r
- public String getIsForOnlineUsers() {\r
- return isForOnlineUsers;\r
- }\r
-\r
- public void setIsForOnlineUsers(String isForOnlineUsers) {\r
- this.isForOnlineUsers = isForOnlineUsers;\r
- }\r
-\r
- public String getIsForAllRoles() {\r
- return isForAllRoles;\r
- }\r
-\r
- public void setIsForAllRoles(String isForAllRoles) {\r
- this.isForAllRoles = isForAllRoles;\r
- }\r
- \r
- public String getActiveYn() {\r
- return activeYn;\r
- }\r
-\r
- public void setActiveYn(String activeYn) {\r
- this.activeYn = activeYn;\r
- }\r
-\r
- public String getMsgHeader() {\r
- return msgHeader;\r
- }\r
-\r
- public void setMsgHeader(String msgHeader) {\r
- this.msgHeader = msgHeader;\r
- }\r
-\r
- public String getMsgDescription() {\r
- return msgDescription;\r
- }\r
-\r
- public void setMsgDescription(String msgDescription) {\r
- this.msgDescription = msgDescription;\r
- }\r
-\r
- public Date getStartTime() {\r
- return startTime;\r
- }\r
-\r
- public void setStartTime(Date startTime) {\r
- this.startTime = startTime;\r
- }\r
-\r
- public Date getEndTime() {\r
- return endTime;\r
- }\r
-\r
- public void setEndTime(Date endTime) {\r
- this.endTime = endTime;\r
- }\r
-\r
- public Long getPriority() {\r
- return priority;\r
- }\r
-\r
- public void setPriority(Long priority) {\r
- this.priority = priority;\r
- }\r
-\r
- public Long getCreatorId() {\r
- return creatorId;\r
- }\r
-\r
- public void setCreatorId(Long creatorId) {\r
- this.creatorId = creatorId;\r
- }\r
-\r
- public Date getCreatedDate() {\r
- return createdDate;\r
- }\r
-\r
- public void setCreatedDate(Date createdDate) {\r
- this.createdDate = createdDate;\r
- }\r
-\r
- public static long getSerialversionuid() {\r
- return serialVersionUID;\r
- }\r
-\r
- public Set<EpRoleNotificationItem> getRoles() {\r
- return roles;\r
- }\r
-\r
- public void setRoles(Set<EpRoleNotificationItem> roles) {\r
- this.roles = roles;\r
- }\r
-\r
- public List<Long> getRoleIds() {\r
- return roleIds;\r
- }\r
-\r
- public void setRoleIds(List<Long> roleIds) {\r
- this.roleIds = roleIds;\r
- }\r
- \r
- public String getMsgSource() {\r
- return msgSource;\r
- }\r
-\r
- public void setMsgSource(String msgSource) {\r
- this.msgSource = msgSource;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- final int prime = 31;\r
- int result = 1;\r
- result = prime * result + ((activeYn == null) ? 0 : activeYn.hashCode());\r
- result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode());\r
- result = prime * result + ((creatorId == null) ? 0 : creatorId.hashCode());\r
- result = prime * result + ((endTime == null) ? 0 : endTime.hashCode());\r
- result = prime * result + ((isForAllRoles == null) ? 0 : isForAllRoles.hashCode());\r
- result = prime * result + ((isForOnlineUsers == null) ? 0 : isForOnlineUsers.hashCode());\r
- result = prime * result + ((msgDescription == null) ? 0 : msgDescription.hashCode());\r
- result = prime * result + ((msgHeader == null) ? 0 : msgHeader.hashCode());\r
- result = prime * result + ((msgSource == null) ? 0 : msgSource.hashCode());\r
- result = prime * result + ((notificationId == null) ? 0 : notificationId.hashCode());\r
- result = prime * result + ((priority == null) ? 0 : priority.hashCode());\r
- result = prime * result + ((roleIds == null) ? 0 : roleIds.hashCode());\r
- result = prime * result + ((roles == null) ? 0 : roles.hashCode());\r
- result = prime * result + ((startTime == null) ? 0 : startTime.hashCode());\r
- return result;\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj)\r
- return true;\r
- if (obj == null)\r
- return false;\r
- if (getClass() != obj.getClass())\r
- return false;\r
- EpNotificationItem other = (EpNotificationItem) obj;\r
- if (activeYn == null) {\r
- if (other.activeYn != null)\r
- return false;\r
- } else if (!activeYn.equals(other.activeYn))\r
- return false;\r
- if (createdDate == null) {\r
- if (other.createdDate != null)\r
- return false;\r
- } else if (!createdDate.equals(other.createdDate))\r
- return false;\r
- if (creatorId == null) {\r
- if (other.creatorId != null)\r
- return false;\r
- } else if (!creatorId.equals(other.creatorId))\r
- return false;\r
- if (endTime == null) {\r
- if (other.endTime != null)\r
- return false;\r
- } else if (!endTime.equals(other.endTime))\r
- return false;\r
- if (isForAllRoles == null) {\r
- if (other.isForAllRoles != null)\r
- return false;\r
- } else if (!isForAllRoles.equals(other.isForAllRoles))\r
- return false;\r
- if (isForOnlineUsers == null) {\r
- if (other.isForOnlineUsers != null)\r
- return false;\r
- } else if (!isForOnlineUsers.equals(other.isForOnlineUsers))\r
- return false;\r
- if (msgDescription == null) {\r
- if (other.msgDescription != null)\r
- return false;\r
- } else if (!msgDescription.equals(other.msgDescription))\r
- return false;\r
- if (msgHeader == null) {\r
- if (other.msgHeader != null)\r
- return false;\r
- } else if (!msgHeader.equals(other.msgHeader))\r
- return false;\r
- if (msgSource == null) {\r
- if (other.msgSource != null)\r
- return false;\r
- } else if (!msgSource.equals(other.msgSource))\r
- return false;\r
- if (notificationId == null) {\r
- if (other.notificationId != null)\r
- return false;\r
- } else if (!notificationId.equals(other.notificationId))\r
- return false;\r
- if (priority == null) {\r
- if (other.priority != null)\r
- return false;\r
- } else if (!priority.equals(other.priority))\r
- return false;\r
- if (roleIds == null) {\r
- if (other.roleIds != null)\r
- return false;\r
- } else if (!roleIds.equals(other.roleIds))\r
- return false;\r
- if (roles == null) {\r
- if (other.roles != null)\r
- return false;\r
- } else if (!roles.equals(other.roles))\r
- return false;\r
- if (startTime == null) {\r
- if (other.startTime != null)\r
- return false;\r
- } else if (!startTime.equals(other.startTime))\r
- return false;\r
- return true;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- return "EpNotificationItem [notificationId=" + notificationId + ", isForOnlineUsers=" + isForOnlineUsers\r
- + ", isForAllRoles=" + isForAllRoles + ", activeYn=" + activeYn + ", msgHeader=" + msgHeader\r
- + ", msgDescription=" + msgDescription + ", msgSource=" + msgSource + ", startTime=" + startTime\r
- + ", endTime=" + endTime + ", priority=" + priority + ", creatorId=" + creatorId + ", createdDate="\r
- + createdDate + ", roles=" + roles + ", roleIds=" + roleIds + "]";\r
- }\r
- \r
-}\r
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.transport;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+
+/**
+ * This is to handle notifications in notification PopUp
+ */
+
+
+@Entity
+@Table(name = "ep_notification")
+public class EpNotificationItem extends DomainVo {
+ public EpNotificationItem() {
+ };
+
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "notification_ID")
+ public Long notificationId;
+
+ @Column(name = "is_for_online_users")
+ public String isForOnlineUsers;
+
+ @Column(name = "is_for_all_roles")
+ public String isForAllRoles;
+
+ @Column(name = "active_YN")
+ public String activeYn;
+
+ @Column(name = "msg_header")
+ public String msgHeader;
+
+ @Column(name = "msg_description")
+ public String msgDescription;
+
+ @Column(name = "msg_source")
+ public String msgSource;
+
+ @Column(name = "start_time")
+ public Date startTime;
+
+ @Column(name = "end_time")
+ public Date endTime;
+
+ @Column(name = "priority")
+ public Long priority;
+
+ @Column(name = "creator_ID")
+ public Long creatorId;
+
+ @Column(name = "created_date")
+ public Date createdDate;
+
+ @Column(name = "notification_hyperlink")
+ public String notificationHyperlink;
+
+
+ @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL}, orphanRemoval = true)
+ @JoinColumn(name="notification_ID")
+ private Set<EpRoleNotificationItem> roles;
+
+ @Transient
+ private List<Long> roleIds;
+
+ public Long getNotificationId() {
+ return notificationId;
+ }
+
+ public void setNotificationId(Long notificationId) {
+ this.notificationId = notificationId;
+ }
+
+ public String getIsForOnlineUsers() {
+ return isForOnlineUsers;
+ }
+
+ public void setIsForOnlineUsers(String isForOnlineUsers) {
+ this.isForOnlineUsers = isForOnlineUsers;
+ }
+
+ public String getIsForAllRoles() {
+ return isForAllRoles;
+ }
+
+ public void setIsForAllRoles(String isForAllRoles) {
+ this.isForAllRoles = isForAllRoles;
+ }
+
+ public String getActiveYn() {
+ return activeYn;
+ }
+
+ public void setActiveYn(String activeYn) {
+ this.activeYn = activeYn;
+ }
+
+ public String getMsgHeader() {
+ return msgHeader;
+ }
+
+ public void setMsgHeader(String msgHeader) {
+ this.msgHeader = msgHeader;
+ }
+
+ public String getMsgDescription() {
+ return msgDescription;
+ }
+
+ public void setMsgDescription(String msgDescription) {
+ this.msgDescription = msgDescription;
+ }
+
+ public Date getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(Date startTime) {
+ this.startTime = startTime;
+ }
+
+ public Date getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ }
+
+ public Long getPriority() {
+ return priority;
+ }
+
+ public void setPriority(Long priority) {
+ this.priority = priority;
+ }
+
+ public Long getCreatorId() {
+ return creatorId;
+ }
+
+ public void setCreatorId(Long creatorId) {
+ this.creatorId = creatorId;
+ }
+
+ public Date getCreatedDate() {
+ return createdDate;
+ }
+
+ public void setCreatedDate(Date createdDate) {
+ this.createdDate = createdDate;
+ }
+
+ public static long getSerialversionuid() {
+ return serialVersionUID;
+ }
+
+ public Set<EpRoleNotificationItem> getRoles() {
+ return roles;
+ }
+
+ public void setRoles(Set<EpRoleNotificationItem> roles) {
+ this.roles = roles;
+ }
+
+ public List<Long> getRoleIds() {
+ return roleIds;
+ }
+
+ public void setRoleIds(List<Long> roleIds) {
+ this.roleIds = roleIds;
+ }
+
+ public String getMsgSource() {
+ return msgSource;
+ }
+
+ public void setMsgSource(String msgSource) {
+ this.msgSource = msgSource;
+ }
+
+ public String getNotificationHyperlink() {
+ return notificationHyperlink;
+ }
+
+ public void setNotificationHyperlink(String notificationHyperlink) {
+ this.notificationHyperlink = notificationHyperlink;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((activeYn == null) ? 0 : activeYn.hashCode());
+ result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode());
+ result = prime * result + ((creatorId == null) ? 0 : creatorId.hashCode());
+ result = prime * result + ((endTime == null) ? 0 : endTime.hashCode());
+ result = prime * result + ((isForAllRoles == null) ? 0 : isForAllRoles.hashCode());
+ result = prime * result + ((isForOnlineUsers == null) ? 0 : isForOnlineUsers.hashCode());
+ result = prime * result + ((msgDescription == null) ? 0 : msgDescription.hashCode());
+ result = prime * result + ((msgHeader == null) ? 0 : msgHeader.hashCode());
+ result = prime * result + ((msgSource == null) ? 0 : msgSource.hashCode());
+ result = prime * result + ((notificationId == null) ? 0 : notificationId.hashCode());
+ result = prime * result + ((priority == null) ? 0 : priority.hashCode());
+ result = prime * result + ((roleIds == null) ? 0 : roleIds.hashCode());
+ result = prime * result + ((roles == null) ? 0 : roles.hashCode());
+ result = prime * result + ((startTime == null) ? 0 : startTime.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ EpNotificationItem other = (EpNotificationItem) obj;
+ if (activeYn == null) {
+ if (other.activeYn != null)
+ return false;
+ } else if (!activeYn.equals(other.activeYn))
+ return false;
+ if (createdDate == null) {
+ if (other.createdDate != null)
+ return false;
+ } else if (!createdDate.equals(other.createdDate))
+ return false;
+ if (creatorId == null) {
+ if (other.creatorId != null)
+ return false;
+ } else if (!creatorId.equals(other.creatorId))
+ return false;
+ if (endTime == null) {
+ if (other.endTime != null)
+ return false;
+ } else if (!endTime.equals(other.endTime))
+ return false;
+ if (isForAllRoles == null) {
+ if (other.isForAllRoles != null)
+ return false;
+ } else if (!isForAllRoles.equals(other.isForAllRoles))
+ return false;
+ if (isForOnlineUsers == null) {
+ if (other.isForOnlineUsers != null)
+ return false;
+ } else if (!isForOnlineUsers.equals(other.isForOnlineUsers))
+ return false;
+ if (msgDescription == null) {
+ if (other.msgDescription != null)
+ return false;
+ } else if (!msgDescription.equals(other.msgDescription))
+ return false;
+ if (msgHeader == null) {
+ if (other.msgHeader != null)
+ return false;
+ } else if (!msgHeader.equals(other.msgHeader))
+ return false;
+ if (msgSource == null) {
+ if (other.msgSource != null)
+ return false;
+ } else if (!msgSource.equals(other.msgSource))
+ return false;
+ if (notificationId == null) {
+ if (other.notificationId != null)
+ return false;
+ } else if (!notificationId.equals(other.notificationId))
+ return false;
+ if (priority == null) {
+ if (other.priority != null)
+ return false;
+ } else if (!priority.equals(other.priority))
+ return false;
+ if (roleIds == null) {
+ if (other.roleIds != null)
+ return false;
+ } else if (!roleIds.equals(other.roleIds))
+ return false;
+ if (roles == null) {
+ if (other.roles != null)
+ return false;
+ } else if (!roles.equals(other.roles))
+ return false;
+ if (startTime == null) {
+ if (other.startTime != null)
+ return false;
+ } else if (!startTime.equals(other.startTime))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "EpNotificationItem [notificationId=" + notificationId + ", isForOnlineUsers=" + isForOnlineUsers
+ + ", isForAllRoles=" + isForAllRoles + ", activeYn=" + activeYn + ", msgHeader=" + msgHeader
+ + ", msgDescription=" + msgDescription + ", msgSource=" + msgSource + ", startTime=" + startTime
+ + ", endTime=" + endTime + ", priority=" + priority + ", creatorId=" + creatorId + ", createdDate="
+ + createdDate + ", roles=" + roles + ", roleIds=" + roleIds + "]";
+ }
+
+}