7c333d8e0cf6f7fa49f6a167d243e03807daa912
[dcaegen2/analytics/tca.git] / dcae-analytics-cdap-common / src / main / java / org / openecomp / dcae / apod / analytics / cdap / common / persistance / tca / TCAVESAlertEntity.java
1 /*
2  * ===============================LICENSE_START======================================
3  *  dcae-analytics
4  * ================================================================================
5  *    Copyright © 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
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  *  ============================LICENSE_END===========================================
19  */
20
21 package org.openecomp.dcae.apod.analytics.cdap.common.persistance.tca;
22
23 import org.apache.hadoop.io.Writable;
24 import org.apache.hadoop.io.WritableUtils;
25
26 import java.io.DataInput;
27 import java.io.DataOutput;
28 import java.io.IOException;
29 import java.io.Serializable;
30
31 /**
32  *
33  * @author Rajiv Singla . Creation Date: 11/16/2016.
34  */
35 public class TCAVESAlertEntity implements Writable, Serializable {
36
37     private static final long serialVersionUID = 1L;
38
39     private long creationTS;
40     private String alertMessage;
41
42     public TCAVESAlertEntity() {
43         // no argument constructor required for json serialization / deserialization
44     }
45
46     public TCAVESAlertEntity(long creationTS, String alertMessage) {
47         this.creationTS = creationTS;
48         this.alertMessage = alertMessage;
49     }
50
51     public long getCreationTS() {
52         return creationTS;
53     }
54
55     public void setCreationTS(long creationTS) {
56         this.creationTS = creationTS;
57     }
58
59     public String getAlertMessage() {
60         return alertMessage;
61     }
62
63     public void setAlertMessage(String alertMessage) {
64         this.alertMessage = alertMessage;
65     }
66
67     @Override
68     public void write(DataOutput dataOutput) throws IOException {
69         WritableUtils.writeVLong(dataOutput, creationTS);
70         WritableUtils.writeString(dataOutput, alertMessage);
71     }
72
73     @Override
74     public void readFields(DataInput dataInput) throws IOException {
75         creationTS = WritableUtils.readVLong(dataInput);
76         alertMessage = WritableUtils.readString(dataInput);
77     }
78 }