Initial source code
[oam/tr069-adapter.git] / ves-agent / src / main / java / org / commscope / tr069adapter / vesagent / InformEventData.java
1 /*\r
2  * ============LICENSE_START========================================================================\r
3  * ONAP : tr-069-adapter\r
4  * =================================================================================================\r
5  * Copyright (C) 2020 CommScope Inc Intellectual Property.\r
6  * =================================================================================================\r
7  * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,\r
8  * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You\r
9  * may obtain a copy of the License at\r
10  *\r
11  * http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\r
14  * either express or implied. See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  * ===============LICENSE_END=======================================================================\r
17  */\r
18 package org.commscope.tr069adapter.vesagent;\r
19 \r
20 import org.commscope.tr069adapter.acs.common.ParameterDTO;\r
21 import org.commscope.tr069adapter.vesagent.model.PnfRegEventFields;\r
22 \r
23 public class InformEventData {\r
24 \r
25   public static final String MANUFACTURER = "Manufacturer";\r
26   public static final String SERIALNUMBER = "SerialNumber";\r
27   public static final String SOFTWAREVERSION = "SoftwareVersion";\r
28   public static final String MANUFACTUREROUI = "ManufacturerOUI";\r
29   public static final String PRODUCTCLASS = "ProductClass";\r
30   public static final String IPV6ADDRESS = "IPv6Address";\r
31   public static final String IPADDRESS = "IPAddress";\r
32   private PnfRegEventFields feilds = new PnfRegEventFields();\r
33 \r
34   public void parse(ParameterDTO parameter, String tempEEParam) {\r
35     if (null == parameter.getParamValue()) {\r
36       return;\r
37     }\r
38     if (tempEEParam.endsWith(MANUFACTURER)) {\r
39       feilds.setVendorName(parameter.getParamValue());\r
40     } else if (tempEEParam.endsWith(SERIALNUMBER)) {\r
41       feilds.setSerialNumber(parameter.getParamValue());\r
42       feilds.setMacAddress(parameter.getParamValue());\r
43     } else if (tempEEParam.endsWith(SOFTWAREVERSION)) {\r
44       feilds.setSoftwareVersion(parameter.getParamValue());\r
45     } else if (tempEEParam.endsWith(MANUFACTUREROUI)) {\r
46       feilds.setUnitType(parameter.getParamValue());\r
47     } else if (tempEEParam.endsWith(PRODUCTCLASS)) {\r
48       feilds.setUnitFamily(parameter.getParamValue());\r
49     } else if (tempEEParam.contains(IPV6ADDRESS)) {\r
50       feilds.setOamV6IpAddress(parameter.getParamValue());\r
51     } else if (tempEEParam.contains(IPADDRESS)) {\r
52       feilds.setOamV4IpAddress(parameter.getParamValue());\r
53     }\r
54   }\r
55 \r
56   public PnfRegEventFields getFeilds() {\r
57     return feilds;\r
58   }\r
59 \r
60   public void setFeilds(PnfRegEventFields feilds) {\r
61     this.feilds = feilds;\r
62   }\r
63 }\r