2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt
4 * =================================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.pm;
20 import java.util.Optional;
21 import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Helper;
22 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
23 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.OtnHistoryDataG;
24 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceHistoricalPerformanceTypeG;
25 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.ContainerHistoricalPerformanceTypeG;
26 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performance.type.g.PerformanceData;
27 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceConfiguration;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.GranularityPeriodType;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntityBuilder;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.pmdata.entity.PerformanceDataBuilder;
31 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
33 public class PerformanceDataAirInterface170324Builder extends PmdataEntityBuilder {
35 private PerformanceDataAirInterface170324Builder(NodeId nodeId, Lp lp, OtnHistoryDataG pmRecord) {
37 Optional<GranularityPeriodType> gp = GranularityPeriodType
38 .forName(Helper.nnGetGranularityPeriodType(pmRecord.getGranularityPeriod()).getName());
39 this.setGranularityPeriod(gp.orElse(GranularityPeriodType.Unknown));
40 this.setUuidInterface(Helper.nnGetUniversalId(lp.getUuid()).getValue());
41 this.setLayerProtocolName(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue());
42 this.setNodeName(nodeId.getValue());
43 this.setScannerId(pmRecord.getHistoryDataId());
44 this.setTimeStamp(pmRecord.getPeriodEndTime());
45 this.setSuspectIntervalFlag(pmRecord.isSuspectIntervalFlag());
49 * Move data to generic type
51 * @param nodeId of node
52 * @param lp to get data from
53 * @param pmRecord data itself
54 * @param airConfiguration configuration for additional parameter
56 public PerformanceDataAirInterface170324Builder(NodeId nodeId, Lp lp,
57 AirInterfaceHistoricalPerformanceTypeG pmRecord, AirInterfaceConfiguration airConfiguration) {
58 this(nodeId, lp, pmRecord);
60 this.setRadioSignalId(airConfiguration.getRadioSignalId());
61 PerformanceData pmr = pmRecord.getPerformanceData();
63 PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
64 bPerformanceData.setTimePeriod(pmr.getTimePeriod());
65 bPerformanceData.setEs(pmr.getEs());
66 bPerformanceData.setSes(pmr.getSes());
67 bPerformanceData.setCses(pmr.getCses());
68 bPerformanceData.setUnavailability(pmr.getUnavailability());
69 bPerformanceData.setTxLevelMin(pmr.getTxLevelMin());
70 bPerformanceData.setTxLevelMax(pmr.getTxLevelMax());
71 bPerformanceData.setTxLevelAvg(pmr.getTxLevelAvg());
72 bPerformanceData.setRxLevelMin(pmr.getRxLevelMin());
73 bPerformanceData.setRxLevelMax(pmr.getRxLevelMax());
74 bPerformanceData.setRxLevelAvg(pmr.getRxLevelAvg());
75 bPerformanceData.setTime2States(pmr.getTime2States());
76 bPerformanceData.setTime4StatesS(pmr.getTime4StatesS());
77 bPerformanceData.setTime4States(pmr.getTime4States());
78 bPerformanceData.setTime8States(pmr.getTime8States());
79 bPerformanceData.setTime16StatesS(pmr.getTime16StatesS());
80 bPerformanceData.setTime16States(pmr.getTime16States());
81 bPerformanceData.setTime32States(pmr.getTime32States());
82 bPerformanceData.setTime64States(pmr.getTime64States());
83 bPerformanceData.setTime128States(pmr.getTime128States());
84 bPerformanceData.setTime256States(pmr.getTime256States());
85 bPerformanceData.setTime512States(pmr.getTime512States());
86 bPerformanceData.setTime512StatesL(pmr.getTime512StatesL());
87 bPerformanceData.setTime1024States(pmr.getTime1024States());
88 bPerformanceData.setTime1024StatesL(pmr.getTime1024StatesL());
89 bPerformanceData.setTime2048States(pmr.getTime2048States());
90 bPerformanceData.setTime2048StatesL(pmr.getTime2048StatesL());
91 bPerformanceData.setTime4096States(pmr.getTime4096States());
92 bPerformanceData.setTime4096StatesL(pmr.getTime4096StatesL());
93 bPerformanceData.setTime8192States(pmr.getTime8192States());
94 bPerformanceData.setTime8192StatesL(pmr.getTime8192StatesL());
95 bPerformanceData.setSnirMin(pmr.getSnirMin());
96 bPerformanceData.setSnirMax(pmr.getSnirMax());
97 bPerformanceData.setSnirAvg(pmr.getSnirAvg());
98 bPerformanceData.setXpdMin(pmr.getXpdMin());
99 bPerformanceData.setXpdMax(pmr.getXpdMax());
100 bPerformanceData.setXpdAvg(pmr.getXpdAvg());
101 bPerformanceData.setRfTempMin(pmr.getRfTempMin());
102 bPerformanceData.setRfTempMax(pmr.getRfTempMax());
103 bPerformanceData.setRfTempAvg(pmr.getRfTempAvg());
104 bPerformanceData.setDefectBlocksSum(pmr.getDefectBlocksSum());
105 this.setPerformanceData(bPerformanceData.build());
110 * Move data to generic type
112 * @param nodeId of node
113 * @param lp to get data from
114 * @param pmRecord data itself
116 public PerformanceDataAirInterface170324Builder(NodeId nodeId, Lp lp,
117 ContainerHistoricalPerformanceTypeG pmRecord) {
118 this(nodeId, lp, (OtnHistoryDataG) pmRecord);
119 org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.container.historical.performance.type.g.PerformanceData pmr =
120 pmRecord.getPerformanceData();
122 PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
123 bPerformanceData.setTimePeriod(pmr.getTimePeriod());
124 bPerformanceData.setTxEthernetBytesMaxM(pmr.getTxEthernetBytesMaxM());
125 bPerformanceData.setTxEthernetBytesMaxS(pmr.getTxEthernetBytesMaxS());
126 bPerformanceData.setTxEthernetBytesSum(pmr.getTxEthernetBytesSum());
127 this.setPerformanceData(bPerformanceData.build());