2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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 * ============LICENSE_END=========================================================
21 package org.onap.policy.jpa;
23 import java.io.Serializable;
24 import java.util.Date;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.GeneratedValue;
29 import javax.persistence.GenerationType;
30 import javax.persistence.Id;
31 import javax.persistence.Lob;
32 import javax.persistence.NamedQuery;
33 import javax.persistence.PrePersist;
34 import javax.persistence.PreUpdate;
35 import javax.persistence.Table;
36 import javax.persistence.Temporal;
37 import javax.persistence.TemporalType;
41 @Table(name="BackUpMonitorEntity")
42 @NamedQuery(name="BackUpMonitorEntity.findAll", query= "SELECT b FROM BackUpMonitorEntity b ")
43 public class BackUpMonitorEntity implements Serializable{
44 private static final long serialVersionUID = -9190606334322230630L;
47 @GeneratedValue(strategy = GenerationType.AUTO)
51 @Column(name="node_name", nullable=false)
52 private String resourceNodeName;
54 @Column(name="resource_name", nullable=false, unique=true)
55 private String resourceName;
57 @Column(name="flag", nullable=false)
61 @Column(name="notification_record")
62 private String notificationRecord;
64 @Temporal(TemporalType.TIMESTAMP)
65 @Column(name="last_seen")
66 private Date timeStamp;
69 public void prePersist(){
70 this.timeStamp = new Date();
74 public void preUpdate(){
75 this.timeStamp = new Date();
78 public String getResourceName(){
79 return this.resourceName;
82 public String getResourceNodeName(){
83 return this.resourceNodeName;
86 public String getFlag(){
90 public String getNotificationRecord(){
91 return this.notificationRecord;
94 public Date getTimeStamp(){
95 return this.timeStamp;
98 public void setResourceName(String resourceName){
99 this.resourceName = resourceName;
102 public void setResoruceNodeName(String resourceNodeName){
103 this.resourceNodeName = resourceNodeName;
106 public void setFlag(String flag){
110 public void setNotificationRecord(String notificationRecord){
111 this.notificationRecord = notificationRecord;
114 public void setTimeStamp(Date timeStamp){
115 this.timeStamp = timeStamp;