Sonar Critical Fix
[dcaegen2/analytics/tca.git] / dcae-analytics-cdap-common / src / main / java / org / openecomp / dcae / apod / analytics / cdap / common / persistance / tca / TCAVESAlertEntity.java
1 /*\r
2  * ===============================LICENSE_START======================================\r
3  *  dcae-analytics\r
4  * ================================================================================\r
5  *    Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  *  Licensed under the Apache License, Version 2.0 (the "License");\r
8  *  you may not use this file except in compliance with the License.\r
9  *   You may obtain a copy of the License at\r
10  *\r
11  *          http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  *  Unless required by applicable law or agreed to in writing, software\r
14  *  distributed under the License is distributed on an "AS IS" BASIS,\r
15  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  *  See the License for the specific language governing permissions and\r
17  *  limitations under the License.\r
18  *  ============================LICENSE_END===========================================\r
19  */\r
20 \r
21 package org.openecomp.dcae.apod.analytics.cdap.common.persistance.tca;\r
22 \r
23 import org.apache.hadoop.io.Writable;\r
24 import org.apache.hadoop.io.WritableUtils;\r
25 \r
26 import java.io.DataInput;\r
27 import java.io.DataOutput;\r
28 import java.io.IOException;\r
29 import java.io.Serializable;\r
30 \r
31 /**\r
32  *\r
33  * @author Rajiv Singla . Creation Date: 11/16/2016.\r
34  */\r
35 public class TCAVESAlertEntity implements Writable, Serializable {\r
36 \r
37     private static final long serialVersionUID = 1L;\r
38 \r
39     private long creationTS;\r
40     private String alertMessage;\r
41 \r
42     public TCAVESAlertEntity() {\r
43         // no argument constructor required for json serialization / deserialization\r
44     }\r
45 \r
46     public TCAVESAlertEntity(long creationTS, String alertMessage) {\r
47         this.creationTS = creationTS;\r
48         this.alertMessage = alertMessage;\r
49     }\r
50 \r
51     public long getCreationTS() {\r
52         return creationTS;\r
53     }\r
54 \r
55     public void setCreationTS(long creationTS) {\r
56         this.creationTS = creationTS;\r
57     }\r
58 \r
59     public String getAlertMessage() {\r
60         return alertMessage;\r
61     }\r
62 \r
63     public void setAlertMessage(String alertMessage) {\r
64         this.alertMessage = alertMessage;\r
65     }\r
66 \r
67     @Override\r
68     public void write(DataOutput dataOutput) throws IOException {\r
69         WritableUtils.writeVLong(dataOutput, creationTS);\r
70         WritableUtils.writeString(dataOutput, alertMessage);\r
71     }\r
72 \r
73     @Override\r
74     public void readFields(DataInput dataInput) throws IOException {\r
75         creationTS = WritableUtils.readVLong(dataInput);\r
76         alertMessage = WritableUtils.readString(dataInput);\r
77     }\r
78 }\r