import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.PmUtil;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.LayerProtocolName;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.GranularityPeriodType;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performance.type.g.PerformanceData;
+import org.opendaylight.yangtools.yang.binding.DataObject;
/**
* @author herbert
*/
public class Helper {
- private static final @NonNull UniversalId DEFAULT_UniversalId = new UniversalId("Default");
- private static final @NonNull LayerProtocolName DEFAULT_LayerProtocolName = new LayerProtocolName("default");
- private static final @NonNull GranularityPeriodType DEFAULT_GranularityPeriodType = GranularityPeriodType.Unknown;
- private static final @NonNull String DEFAULT_String = "";
+ private static final @NonNull UniversalId DEFAULT_UniversalId = new UniversalId("Default");
+ private static final @NonNull LayerProtocolName DEFAULT_LayerProtocolName = new LayerProtocolName("default");
+ private static final @NonNull GranularityPeriodType DEFAULT_GranularityPeriodType = GranularityPeriodType.Unknown;
+ private static final @NonNull String DEFAULT_String = "";
- public static @NonNull UniversalId nnGetUniversalId(@Nullable UniversalId x) {
- return x == null ? DEFAULT_UniversalId : x;
- }
+ public static @NonNull UniversalId nnGetUniversalId(@Nullable UniversalId x) {
+ return x == null ? DEFAULT_UniversalId : x;
+ }
- public static @NonNull LayerProtocolName nnGetLayerProtocolName(@Nullable LayerProtocolName x) {
- return x == null ? DEFAULT_LayerProtocolName : x;
- }
+ public static @NonNull LayerProtocolName nnGetLayerProtocolName(@Nullable LayerProtocolName x) {
+ return x == null ? DEFAULT_LayerProtocolName : x;
+ }
- public static @NonNull GranularityPeriodType nnGetGranularityPeriodType(@Nullable GranularityPeriodType x) {
- return x == null ? DEFAULT_GranularityPeriodType : x;
- }
+ public static @NonNull GranularityPeriodType nnGetGranularityPeriodType(@Nullable GranularityPeriodType x) {
+ return x == null ? DEFAULT_GranularityPeriodType : x;
+ }
- public static @NonNull String nnGetString(@Nullable String x) {
- return x == null ? DEFAULT_String : x;
- }
+ public static @NonNull String nnGetString(@Nullable String x) {
+ return x == null ? DEFAULT_String : x;
+ }
+
+ public static @NonNull <T extends DataObject> T throwIfPerformanceDataNull(T pmRecord, String uuidInterface,
+ String lpName) throws InconsistentPMDataException {
+
+ String msg = new StringBuffer().append("Ignore record without PerformanceData. Node/Lp: ").append(uuidInterface).append("/")
+ .append(lpName).toString();
+ return PmUtil.throwIfDataObjectNull(pmRecord, msg);
+ }
}
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity;
* @return the pm data object
*/
@NonNull
- PerformanceDataLtp getLtpHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName, @NonNull Lp lp);
+ PerformanceDataLtp getLtpHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName, @NonNull Lp lp)
+ throws InconsistentPMDataException;
/** Set notificationqueue worker for specific notification that needs to be forwarded **/
void setNotificationQueue(NotificationWorker<EventlogEntity> notificationQueue);
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
@Override
public @NonNull PerformanceDataLtp getLtpHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName,
- @NonNull Lp lp) {
+ @NonNull Lp lp) throws InconsistentPMDataException {
PerformanceDataLtp res = new PerformanceDataLtp();
readAirInterfacePerformanceData(lp, res);
readEthernetContainerPerformanceData(lp, res);
* @param lp to read from
* @param result Object to be filled with data
* @return result
+ * @throws InconsistentPMDataException
*/
- private @NonNull PerformanceDataLtp readAirInterfacePerformanceData(Lp lp, PerformanceDataLtp result) {
+ private @NonNull PerformanceDataLtp readAirInterfacePerformanceData(Lp lp, PerformanceDataLtp result) throws InconsistentPMDataException {
LOG.debug("DBRead Get {} MWAirInterfacePac: {}", acessor.getNodeId(), lp.getUuid());
// ----
}
- private @NonNull PerformanceDataLtp readEthernetContainerPerformanceData(Lp lp, PerformanceDataLtp result) {
+ private @NonNull PerformanceDataLtp readEthernetContainerPerformanceData(Lp lp, PerformanceDataLtp result) throws InconsistentPMDataException {
final String myName = "MWEthernetContainerPac";
String mountpointId = acessor.getNodeId().getValue();
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
@Override
public @NonNull PerformanceDataLtp getLtpHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName,
- @NonNull Lp lp) {
+ @NonNull Lp lp) throws InconsistentPMDataException {
PerformanceDataLtp res = new PerformanceDataLtp();
switch (lpName) {
case MWAIRINTERFACE:
* @param lp to read from
* @param result Object to be filled with data
* @return result
+ * @throws InconsistentPMDataException
*/
- private @NonNull PerformanceDataLtp readAirInterfacePerformanceData(Lp lp, PerformanceDataLtp result) {
+ private @NonNull PerformanceDataLtp readAirInterfacePerformanceData(Lp lp, PerformanceDataLtp result) throws InconsistentPMDataException {
LOG.debug("DBRead Get {} MWAirInterfacePac: {}", acessor.getNodeId(), lp.getUuid());
// ----
return result;
}
- private @NonNull PerformanceDataLtp readEthernetContainerPerformanceData(Lp lp, PerformanceDataLtp result) {
+ private @NonNull PerformanceDataLtp readEthernetContainerPerformanceData(Lp lp, PerformanceDataLtp result) throws InconsistentPMDataException {
final String myName = "MWEthernetContainerPac";
LOG.debug("DBRead Get {} : {}", myName, lp.getUuid());
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
@Override
public @NonNull PerformanceDataLtp getLtpHistoricalPerformanceData(@NonNull ONFLayerProtocolName lpName,
- @NonNull Lp lp) {
+ @NonNull Lp lp) throws InconsistentPMDataException {
PerformanceDataLtp res = new PerformanceDataLtp();
switch (lpName) {
case MWAIRINTERFACE:
LOG.debug("Got event of type :: {}", ProblemNotification.class.getSimpleName());
FaultlogEntity faultAlarm = new FaultlogBuilder().setObjectId(notification.getObjectIdRef().getValue())
.setProblem(notification.getProblem()).setSourceType(SourceType.Netconf)
- .setTimestamp(notification.getTimeStamp())
- .setNodeId(this.acessor.getNodeId().getValue())
- .setSeverity(mapSeverity(notification.getSeverity())).setCounter(notification.getCounter())
- .build();
+ .setTimestamp(notification.getTimeStamp()).setNodeId(this.acessor.getNodeId().getValue())
+ .setSeverity(mapSeverity(notification.getSeverity())).setCounter(notification.getCounter()).build();
// Send devicemanager specific notification for database and ODLUX
faultService.faultNotification(faultAlarm);
// Send model specific notification to WebSocketManager
* @param lp to read from
* @param result Object to be filled with data
* @return result
+ * @throws InconsistentPMDataException
*/
- private @NonNull PerformanceDataLtp readAirInterfacePerformanceData(Lp lp, PerformanceDataLtp result) {
+ private @NonNull PerformanceDataLtp readAirInterfacePerformanceData(Lp lp, PerformanceDataLtp result)
+ throws InconsistentPMDataException {
LOG.debug("DBRead Get {} MWAirInterfacePac: {}", acessor.getNodeId(), lp.getUuid());
// ----
return result;
}
- private @NonNull PerformanceDataLtp readEthernetContainerPerformanceData(Lp lp, PerformanceDataLtp result) {
+ private @NonNull PerformanceDataLtp readEthernetContainerPerformanceData(Lp lp, PerformanceDataLtp result)
+ throws InconsistentPMDataException {
final String myName = "MWEthernetContainerPac";
LOG.debug("DBRead Get {} : {}", mountpointId, myName, lp.getUuid());
package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.pm;
import java.util.Optional;
+
+import org.eclipse.jdt.annotation.NonNull;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Helper;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.PmUtil;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.OtnHistoryDataG;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.AirInterfaceHistoricalPerformanceTypeG;
public class PerformanceDataAirInterface170324Builder extends PmdataEntityBuilder {
- private PerformanceDataAirInterface170324Builder(NodeId nodeId, Lp lp, OtnHistoryDataG pmRecord) {
- super();
- Optional<GranularityPeriodType> gp = GranularityPeriodType
- .forName(Helper.nnGetGranularityPeriodType(pmRecord.getGranularityPeriod()).getName());
- this.setGranularityPeriod(gp.orElse(GranularityPeriodType.Unknown));
- this.setUuidInterface(Helper.nnGetUniversalId(lp.getUuid()).getValue());
- this.setLayerProtocolName(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue());
- this.setNodeName(nodeId.getValue());
- this.setScannerId(pmRecord.getHistoryDataId());
- this.setTimeStamp(pmRecord.getPeriodEndTime());
- this.setSuspectIntervalFlag(pmRecord.isSuspectIntervalFlag());
- }
+ private PerformanceDataAirInterface170324Builder(NodeId nodeId, Lp lp, OtnHistoryDataG pmRecord) {
+ super();
+ Optional<GranularityPeriodType> gp = GranularityPeriodType
+ .forName(Helper.nnGetGranularityPeriodType(pmRecord.getGranularityPeriod()).getName());
+ this.setGranularityPeriod(gp.orElse(GranularityPeriodType.Unknown));
+ this.setUuidInterface(Helper.nnGetUniversalId(lp.getUuid()).getValue());
+ this.setLayerProtocolName(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue());
+ this.setNodeName(nodeId.getValue());
+ this.setScannerId(pmRecord.getHistoryDataId());
+ this.setTimeStamp(pmRecord.getPeriodEndTime());
+ this.setSuspectIntervalFlag(pmRecord.isSuspectIntervalFlag());
+ }
+
+ /**
+ * Move data to generic type
+ *
+ * @param nodeId of node
+ * @param lp to get data from
+ * @param pmRecord data itself
+ * @param airConfiguration configuration for additional parameter
+ * @throws InconsistentPMDataException
+ */
+ public PerformanceDataAirInterface170324Builder(NodeId nodeId, Lp lp,
+ AirInterfaceHistoricalPerformanceTypeG pmRecord, AirInterfaceConfiguration airConfiguration)
+ throws InconsistentPMDataException {
+ this(nodeId, lp, pmRecord);
+
+ this.setRadioSignalId(airConfiguration.getRadioSignalId());
+ @NonNull
+ PerformanceData pmr = Helper.throwIfPerformanceDataNull(pmRecord.getPerformanceData(),
+ getUuidInterface(), getLayerProtocolName());
- /**
- * Move data to generic type
- *
- * @param nodeId of node
- * @param lp to get data from
- * @param pmRecord data itself
- * @param airConfiguration configuration for additional parameter
- */
- public PerformanceDataAirInterface170324Builder(NodeId nodeId, Lp lp,
- AirInterfaceHistoricalPerformanceTypeG pmRecord, AirInterfaceConfiguration airConfiguration) {
- this(nodeId, lp, pmRecord);
+ PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
+ bPerformanceData.setTimePeriod(pmr.getTimePeriod());
+ bPerformanceData.setEs(pmr.getEs());
+ bPerformanceData.setSes(pmr.getSes());
+ bPerformanceData.setCses(pmr.getCses());
+ bPerformanceData.setUnavailability(pmr.getUnavailability());
+ bPerformanceData.setTxLevelMin(pmr.getTxLevelMin());
+ bPerformanceData.setTxLevelMax(pmr.getTxLevelMax());
+ bPerformanceData.setTxLevelAvg(pmr.getTxLevelAvg());
+ bPerformanceData.setRxLevelMin(pmr.getRxLevelMin());
+ bPerformanceData.setRxLevelMax(pmr.getRxLevelMax());
+ bPerformanceData.setRxLevelAvg(pmr.getRxLevelAvg());
+ bPerformanceData.setTime2States(pmr.getTime2States());
+ bPerformanceData.setTime4StatesS(pmr.getTime4StatesS());
+ bPerformanceData.setTime4States(pmr.getTime4States());
+ bPerformanceData.setTime8States(pmr.getTime8States());
+ bPerformanceData.setTime16StatesS(pmr.getTime16StatesS());
+ bPerformanceData.setTime16States(pmr.getTime16States());
+ bPerformanceData.setTime32States(pmr.getTime32States());
+ bPerformanceData.setTime64States(pmr.getTime64States());
+ bPerformanceData.setTime128States(pmr.getTime128States());
+ bPerformanceData.setTime256States(pmr.getTime256States());
+ bPerformanceData.setTime512States(pmr.getTime512States());
+ bPerformanceData.setTime512StatesL(pmr.getTime512StatesL());
+ bPerformanceData.setTime1024States(pmr.getTime1024States());
+ bPerformanceData.setTime1024StatesL(pmr.getTime1024StatesL());
+ bPerformanceData.setTime2048States(pmr.getTime2048States());
+ bPerformanceData.setTime2048StatesL(pmr.getTime2048StatesL());
+ bPerformanceData.setTime4096States(pmr.getTime4096States());
+ bPerformanceData.setTime4096StatesL(pmr.getTime4096StatesL());
+ bPerformanceData.setTime8192States(pmr.getTime8192States());
+ bPerformanceData.setTime8192StatesL(pmr.getTime8192StatesL());
+ bPerformanceData.setSnirMin(pmr.getSnirMin());
+ bPerformanceData.setSnirMax(pmr.getSnirMax());
+ bPerformanceData.setSnirAvg(pmr.getSnirAvg());
+ bPerformanceData.setXpdMin(pmr.getXpdMin());
+ bPerformanceData.setXpdMax(pmr.getXpdMax());
+ bPerformanceData.setXpdAvg(pmr.getXpdAvg());
+ bPerformanceData.setRfTempMin(pmr.getRfTempMin());
+ bPerformanceData.setRfTempMax(pmr.getRfTempMax());
+ bPerformanceData.setRfTempAvg(pmr.getRfTempAvg());
+ bPerformanceData.setDefectBlocksSum(pmr.getDefectBlocksSum());
+ this.setPerformanceData(bPerformanceData.build());
+ }
- this.setRadioSignalId(airConfiguration.getRadioSignalId());
- PerformanceData pmr = pmRecord.getPerformanceData();
- if (pmr != null) {
- PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
- bPerformanceData.setTimePeriod(pmr.getTimePeriod());
- bPerformanceData.setEs(pmr.getEs());
- bPerformanceData.setSes(pmr.getSes());
- bPerformanceData.setCses(pmr.getCses());
- bPerformanceData.setUnavailability(pmr.getUnavailability());
- bPerformanceData.setTxLevelMin(pmr.getTxLevelMin());
- bPerformanceData.setTxLevelMax(pmr.getTxLevelMax());
- bPerformanceData.setTxLevelAvg(pmr.getTxLevelAvg());
- bPerformanceData.setRxLevelMin(pmr.getRxLevelMin());
- bPerformanceData.setRxLevelMax(pmr.getRxLevelMax());
- bPerformanceData.setRxLevelAvg(pmr.getRxLevelAvg());
- bPerformanceData.setTime2States(pmr.getTime2States());
- bPerformanceData.setTime4StatesS(pmr.getTime4StatesS());
- bPerformanceData.setTime4States(pmr.getTime4States());
- bPerformanceData.setTime8States(pmr.getTime8States());
- bPerformanceData.setTime16StatesS(pmr.getTime16StatesS());
- bPerformanceData.setTime16States(pmr.getTime16States());
- bPerformanceData.setTime32States(pmr.getTime32States());
- bPerformanceData.setTime64States(pmr.getTime64States());
- bPerformanceData.setTime128States(pmr.getTime128States());
- bPerformanceData.setTime256States(pmr.getTime256States());
- bPerformanceData.setTime512States(pmr.getTime512States());
- bPerformanceData.setTime512StatesL(pmr.getTime512StatesL());
- bPerformanceData.setTime1024States(pmr.getTime1024States());
- bPerformanceData.setTime1024StatesL(pmr.getTime1024StatesL());
- bPerformanceData.setTime2048States(pmr.getTime2048States());
- bPerformanceData.setTime2048StatesL(pmr.getTime2048StatesL());
- bPerformanceData.setTime4096States(pmr.getTime4096States());
- bPerformanceData.setTime4096StatesL(pmr.getTime4096StatesL());
- bPerformanceData.setTime8192States(pmr.getTime8192States());
- bPerformanceData.setTime8192StatesL(pmr.getTime8192StatesL());
- bPerformanceData.setSnirMin(pmr.getSnirMin());
- bPerformanceData.setSnirMax(pmr.getSnirMax());
- bPerformanceData.setSnirAvg(pmr.getSnirAvg());
- bPerformanceData.setXpdMin(pmr.getXpdMin());
- bPerformanceData.setXpdMax(pmr.getXpdMax());
- bPerformanceData.setXpdAvg(pmr.getXpdAvg());
- bPerformanceData.setRfTempMin(pmr.getRfTempMin());
- bPerformanceData.setRfTempMax(pmr.getRfTempMax());
- bPerformanceData.setRfTempAvg(pmr.getRfTempAvg());
- bPerformanceData.setDefectBlocksSum(pmr.getDefectBlocksSum());
- this.setPerformanceData(bPerformanceData.build());
- }
- }
+ /**
+ * Move data to generic type
+ *
+ * @param nodeId of node
+ * @param lp to get data from
+ * @param pmRecord data itself
+ * @throws InconsistentPMDataException
+ */
+ public PerformanceDataAirInterface170324Builder(NodeId nodeId, Lp lp, ContainerHistoricalPerformanceTypeG pmRecord)
+ throws InconsistentPMDataException {
+ this(nodeId, lp, (OtnHistoryDataG) pmRecord);
+ org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.container.historical.performance.type.g.@NonNull PerformanceData pmr = Helper
+ .throwIfPerformanceDataNull(pmRecord.getPerformanceData(), getUuidInterface(), getLayerProtocolName());
- /**
- * Move data to generic type
- *
- * @param nodeId of node
- * @param lp to get data from
- * @param pmRecord data itself
- */
- public PerformanceDataAirInterface170324Builder(NodeId nodeId, Lp lp,
- ContainerHistoricalPerformanceTypeG pmRecord) {
- this(nodeId, lp, (OtnHistoryDataG) pmRecord);
- org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.container.historical.performance.type.g.PerformanceData pmr =
- pmRecord.getPerformanceData();
- if (pmr != null) {
- PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
- bPerformanceData.setTimePeriod(pmr.getTimePeriod());
- bPerformanceData.setTxEthernetBytesMaxM(pmr.getTxEthernetBytesMaxM());
- bPerformanceData.setTxEthernetBytesMaxS(pmr.getTxEthernetBytesMaxS());
- bPerformanceData.setTxEthernetBytesSum(pmr.getTxEthernetBytesSum());
- this.setPerformanceData(bPerformanceData.build());
- }
- }
+ PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
+ bPerformanceData.setTimePeriod(pmr.getTimePeriod());
+ bPerformanceData.setTxEthernetBytesMaxM(pmr.getTxEthernetBytesMaxM());
+ bPerformanceData.setTxEthernetBytesMaxS(pmr.getTxEthernetBytesMaxS());
+ bPerformanceData.setTxEthernetBytesSum(pmr.getTxEthernetBytesSum());
+ this.setPerformanceData(bPerformanceData.build());
+ }
}
package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.pm;
import java.util.Optional;
+
+import org.eclipse.jdt.annotation.NonNull;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Helper;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.PmUtil;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.OtnHistoryDataG;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.AirInterfaceHistoricalPerformanceTypeG;
public class PerformanceDataAirInterface180907Builder extends PmdataEntityBuilder {
- private PerformanceDataAirInterface180907Builder(NodeId nodeId, Lp lp, OtnHistoryDataG pmRecord) {
- super();
- Optional<GranularityPeriodType> gp = GranularityPeriodType
- .forName(Helper.nnGetGranularityPeriodType(pmRecord.getGranularityPeriod()).getName());
- this.setGranularityPeriod(gp.orElse(GranularityPeriodType.Unknown));
- this.setUuidInterface(Helper.nnGetUniversalId(lp.getUuid()).getValue());
- this.setLayerProtocolName(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue());
- this.setNodeName(nodeId.getValue());
- this.setScannerId(pmRecord.getHistoryDataId());
- this.setTimeStamp(pmRecord.getPeriodEndTime());
- this.setSuspectIntervalFlag(pmRecord.isSuspectIntervalFlag());
- }
+ private PerformanceDataAirInterface180907Builder(NodeId nodeId, Lp lp, OtnHistoryDataG pmRecord) {
+ super();
+ Optional<GranularityPeriodType> gp = GranularityPeriodType
+ .forName(Helper.nnGetGranularityPeriodType(pmRecord.getGranularityPeriod()).getName());
+ this.setGranularityPeriod(gp.orElse(GranularityPeriodType.Unknown));
+ this.setUuidInterface(Helper.nnGetUniversalId(lp.getUuid()).getValue());
+ this.setLayerProtocolName(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue());
+ this.setNodeName(nodeId.getValue());
+ this.setScannerId(pmRecord.getHistoryDataId());
+ this.setTimeStamp(pmRecord.getPeriodEndTime());
+ this.setSuspectIntervalFlag(pmRecord.isSuspectIntervalFlag());
+ }
+
+ /**
+ * Move data to generic type
+ *
+ * @param nodeId of node
+ * @param lp to get data from
+ * @param pmRecord data itself
+ * @param airConfiguration configuration for additional parameter
+ * @throws InconsistentPMDataException
+ */
+ public PerformanceDataAirInterface180907Builder(NodeId nodeId, Lp lp,
+ AirInterfaceHistoricalPerformanceTypeG pmRecord, AirInterfaceConfiguration airConfiguration)
+ throws InconsistentPMDataException {
+ this(nodeId, lp, pmRecord);
+
+ this.setRadioSignalId(airConfiguration.getRadioSignalId());
+ @NonNull
+ PerformanceData pmr = Helper.throwIfPerformanceDataNull(pmRecord.getPerformanceData(),
+ getUuidInterface(), getLayerProtocolName());
- /**
- * Move data to generic type
- *
- * @param nodeId of node
- * @param lp to get data from
- * @param pmRecord data itself
- * @param airConfiguration configuration for additional parameter
- */
- public PerformanceDataAirInterface180907Builder(NodeId nodeId, Lp lp,
- AirInterfaceHistoricalPerformanceTypeG pmRecord, AirInterfaceConfiguration airConfiguration) {
- this(nodeId, lp, pmRecord);
+ PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
+ bPerformanceData.setTimePeriod(pmr.getTimePeriod());
+ bPerformanceData.setEs(pmr.getEs());
+ bPerformanceData.setSes(pmr.getSes());
+ bPerformanceData.setCses(pmr.getCses());
+ bPerformanceData.setUnavailability(pmr.getUnavailability());
+ bPerformanceData.setTxLevelMin(pmr.getTxLevelMin());
+ bPerformanceData.setTxLevelMax(pmr.getTxLevelMax());
+ bPerformanceData.setTxLevelAvg(pmr.getTxLevelAvg());
+ bPerformanceData.setRxLevelMin(pmr.getRxLevelMin());
+ bPerformanceData.setRxLevelMax(pmr.getRxLevelMax());
+ bPerformanceData.setRxLevelAvg(pmr.getRxLevelAvg());
+ bPerformanceData.setTime2States(pmr.getTime2States());
+ bPerformanceData.setTime4StatesS(pmr.getTime4StatesS());
+ bPerformanceData.setTime4States(pmr.getTime4States());
+ bPerformanceData.setTime8States(pmr.getTime8States());
+ bPerformanceData.setTime16StatesS(pmr.getTime16StatesS());
+ bPerformanceData.setTime16States(pmr.getTime16States());
+ bPerformanceData.setTime32States(pmr.getTime32States());
+ bPerformanceData.setTime64States(pmr.getTime64States());
+ bPerformanceData.setTime128States(pmr.getTime128States());
+ bPerformanceData.setTime256States(pmr.getTime256States());
+ bPerformanceData.setTime512States(pmr.getTime512States());
+ bPerformanceData.setTime512StatesL(pmr.getTime512StatesL());
+ bPerformanceData.setTime1024States(pmr.getTime1024States());
+ bPerformanceData.setTime1024StatesL(pmr.getTime1024StatesL());
+ bPerformanceData.setTime2048States(pmr.getTime2048States());
+ bPerformanceData.setTime2048StatesL(pmr.getTime2048StatesL());
+ bPerformanceData.setTime4096States(pmr.getTime4096States());
+ bPerformanceData.setTime4096StatesL(pmr.getTime4096StatesL());
+ bPerformanceData.setTime8192States(pmr.getTime8192States());
+ bPerformanceData.setTime8192StatesL(pmr.getTime8192StatesL());
+ bPerformanceData.setSnirMin(pmr.getSnirMin());
+ bPerformanceData.setSnirMax(pmr.getSnirMax());
+ bPerformanceData.setSnirAvg(pmr.getSnirAvg());
+ bPerformanceData.setXpdMin(pmr.getXpdMin());
+ bPerformanceData.setXpdMax(pmr.getXpdMax());
+ bPerformanceData.setXpdAvg(pmr.getXpdAvg());
+ bPerformanceData.setRfTempMin(pmr.getRfTempMin());
+ bPerformanceData.setRfTempMax(pmr.getRfTempMax());
+ bPerformanceData.setRfTempAvg(pmr.getRfTempAvg());
+ bPerformanceData.setDefectBlocksSum(pmr.getDefectBlocksSum());
+ this.setPerformanceData(bPerformanceData.build());
+ }
- this.setRadioSignalId(airConfiguration.getRadioSignalId());
- PerformanceData pmr = pmRecord.getPerformanceData();
- if (pmr != null) {
- PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
- bPerformanceData.setTimePeriod(pmr.getTimePeriod());
- bPerformanceData.setEs(pmr.getEs());
- bPerformanceData.setSes(pmr.getSes());
- bPerformanceData.setCses(pmr.getCses());
- bPerformanceData.setUnavailability(pmr.getUnavailability());
- bPerformanceData.setTxLevelMin(pmr.getTxLevelMin());
- bPerformanceData.setTxLevelMax(pmr.getTxLevelMax());
- bPerformanceData.setTxLevelAvg(pmr.getTxLevelAvg());
- bPerformanceData.setRxLevelMin(pmr.getRxLevelMin());
- bPerformanceData.setRxLevelMax(pmr.getRxLevelMax());
- bPerformanceData.setRxLevelAvg(pmr.getRxLevelAvg());
- bPerformanceData.setTime2States(pmr.getTime2States());
- bPerformanceData.setTime4StatesS(pmr.getTime4StatesS());
- bPerformanceData.setTime4States(pmr.getTime4States());
- bPerformanceData.setTime8States(pmr.getTime8States());
- bPerformanceData.setTime16StatesS(pmr.getTime16StatesS());
- bPerformanceData.setTime16States(pmr.getTime16States());
- bPerformanceData.setTime32States(pmr.getTime32States());
- bPerformanceData.setTime64States(pmr.getTime64States());
- bPerformanceData.setTime128States(pmr.getTime128States());
- bPerformanceData.setTime256States(pmr.getTime256States());
- bPerformanceData.setTime512States(pmr.getTime512States());
- bPerformanceData.setTime512StatesL(pmr.getTime512StatesL());
- bPerformanceData.setTime1024States(pmr.getTime1024States());
- bPerformanceData.setTime1024StatesL(pmr.getTime1024StatesL());
- bPerformanceData.setTime2048States(pmr.getTime2048States());
- bPerformanceData.setTime2048StatesL(pmr.getTime2048StatesL());
- bPerformanceData.setTime4096States(pmr.getTime4096States());
- bPerformanceData.setTime4096StatesL(pmr.getTime4096StatesL());
- bPerformanceData.setTime8192States(pmr.getTime8192States());
- bPerformanceData.setTime8192StatesL(pmr.getTime8192StatesL());
- bPerformanceData.setSnirMin(pmr.getSnirMin());
- bPerformanceData.setSnirMax(pmr.getSnirMax());
- bPerformanceData.setSnirAvg(pmr.getSnirAvg());
- bPerformanceData.setXpdMin(pmr.getXpdMin());
- bPerformanceData.setXpdMax(pmr.getXpdMax());
- bPerformanceData.setXpdAvg(pmr.getXpdAvg());
- bPerformanceData.setRfTempMin(pmr.getRfTempMin());
- bPerformanceData.setRfTempMax(pmr.getRfTempMax());
- bPerformanceData.setRfTempAvg(pmr.getRfTempAvg());
- bPerformanceData.setDefectBlocksSum(pmr.getDefectBlocksSum());
- this.setPerformanceData(bPerformanceData.build());
- }
- }
+ /**
+ * Move data to generic type
+ *
+ * @param nodeId of node
+ * @param lp to get data from
+ * @param pmRecord data itself
+ * @throws InconsistentPMDataException
+ */
+ public PerformanceDataAirInterface180907Builder(NodeId nodeId, Lp lp, ContainerHistoricalPerformanceTypeG pmRecord)
+ throws InconsistentPMDataException {
+ this(nodeId, lp, (OtnHistoryDataG) pmRecord);
+ org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.container.historical.performance.type.g.@NonNull PerformanceData pmr = Helper
+ .throwIfPerformanceDataNull(pmRecord.getPerformanceData(), getUuidInterface(),
+ getLayerProtocolName());
- /**
- * Move data to generic type
- *
- * @param nodeId of node
- * @param lp to get data from
- * @param pmRecord data itself
- */
- public PerformanceDataAirInterface180907Builder(NodeId nodeId, Lp lp,
- ContainerHistoricalPerformanceTypeG pmRecord) {
- this(nodeId, lp, (OtnHistoryDataG) pmRecord);
- org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.container.historical.performance.type.g.PerformanceData pmr =
- pmRecord.getPerformanceData();
- if (pmr != null) {
- PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
- bPerformanceData.setTimePeriod(pmr.getTimePeriod());
- bPerformanceData.setTxEthernetBytesMaxM(pmr.getTxEthernetBytesMaxM());
- bPerformanceData.setTxEthernetBytesMaxS(pmr.getTxEthernetBytesMaxS());
- bPerformanceData.setTxEthernetBytesSum(pmr.getTxEthernetBytesSum());
- this.setPerformanceData(bPerformanceData.build());
- }
- }
+ PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
+ bPerformanceData.setTimePeriod(pmr.getTimePeriod());
+ bPerformanceData.setTxEthernetBytesMaxM(pmr.getTxEthernetBytesMaxM());
+ bPerformanceData.setTxEthernetBytesMaxS(pmr.getTxEthernetBytesMaxS());
+ bPerformanceData.setTxEthernetBytesSum(pmr.getTxEthernetBytesSum());
+ this.setPerformanceData(bPerformanceData.build());
+ }
}
package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.pm;
import java.util.Optional;
+
+import org.eclipse.jdt.annotation.NonNull;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Helper;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.PmUtil;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.g._874._1.model.rev170320.OtnHistoryDataG;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.AirInterfaceHistoricalPerformanceTypeG;
public class PerformanceDataAirInterface181010Builder extends PmdataEntityBuilder {
- private PerformanceDataAirInterface181010Builder(NodeId nodeId, Lp lp, OtnHistoryDataG pmRecord) {
- super();
- Optional<GranularityPeriodType> gp = GranularityPeriodType
- .forName(Helper.nnGetGranularityPeriodType(pmRecord.getGranularityPeriod()).getName());
- this.setGranularityPeriod(gp.orElse(GranularityPeriodType.Unknown));
- this.setUuidInterface(Helper.nnGetUniversalId(lp.getUuid()).getValue());
- this.setLayerProtocolName(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue());
- this.setNodeName(nodeId.getValue());
- this.setScannerId(pmRecord.getHistoryDataId());
- this.setTimeStamp(pmRecord.getPeriodEndTime());
- this.setSuspectIntervalFlag(pmRecord.isSuspectIntervalFlag());
- }
+ private PerformanceDataAirInterface181010Builder(NodeId nodeId, Lp lp, OtnHistoryDataG pmRecord) {
+ super();
+ Optional<GranularityPeriodType> gp = GranularityPeriodType
+ .forName(Helper.nnGetGranularityPeriodType(pmRecord.getGranularityPeriod()).getName());
+ this.setGranularityPeriod(gp.orElse(GranularityPeriodType.Unknown));
+ this.setUuidInterface(Helper.nnGetUniversalId(lp.getUuid()).getValue());
+ this.setLayerProtocolName(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue());
+ this.setNodeName(nodeId.getValue());
+ this.setScannerId(pmRecord.getHistoryDataId());
+ this.setTimeStamp(pmRecord.getPeriodEndTime());
+ this.setSuspectIntervalFlag(pmRecord.isSuspectIntervalFlag());
+ }
+
+ /**
+ * Move data to generic type
+ *
+ * @param nodeId of node
+ * @param lp to get data from
+ * @param pmRecord data itself
+ * @param airConfiguration configuration for additional parameter
+ * @throws InconsistentPMDataException
+ */
+ public PerformanceDataAirInterface181010Builder(NodeId nodeId, Lp lp,
+ AirInterfaceHistoricalPerformanceTypeG pmRecord, AirInterfaceConfiguration airConfiguration)
+ throws InconsistentPMDataException {
+
+ this(nodeId, lp, pmRecord);
+
+ this.setRadioSignalId(airConfiguration.getRadioSignalId());
+ @NonNull
+ PerformanceData pmr = Helper.throwIfPerformanceDataNull(pmRecord.getPerformanceData(),
+ getUuidInterface(), getLayerProtocolName());
- /**
- * Move data to generic type
- *
- * @param nodeId of node
- * @param lp to get data from
- * @param pmRecord data itself
- * @param airConfiguration configuration for additional parameter
- */
- public PerformanceDataAirInterface181010Builder(NodeId nodeId, Lp lp,
- AirInterfaceHistoricalPerformanceTypeG pmRecord, AirInterfaceConfiguration airConfiguration) {
- this(nodeId, lp, pmRecord);
+ PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
+ bPerformanceData.setTimePeriod(pmr.getTimePeriod());
+ bPerformanceData.setEs(pmr.getEs());
+ bPerformanceData.setSes(pmr.getSes());
+ bPerformanceData.setCses(pmr.getCses());
+ bPerformanceData.setUnavailability(pmr.getUnavailability());
+ bPerformanceData.setTxLevelMin(pmr.getTxLevelMin());
+ bPerformanceData.setTxLevelMax(pmr.getTxLevelMax());
+ bPerformanceData.setTxLevelAvg(pmr.getTxLevelAvg());
+ bPerformanceData.setRxLevelMin(pmr.getRxLevelMin());
+ bPerformanceData.setRxLevelMax(pmr.getRxLevelMax());
+ bPerformanceData.setRxLevelAvg(pmr.getRxLevelAvg());
+ bPerformanceData.setTime2States(pmr.getTime2States());
+ bPerformanceData.setTime4StatesS(pmr.getTime4StatesS());
+ bPerformanceData.setTime4States(pmr.getTime4States());
+ bPerformanceData.setTime8States(pmr.getTime8States());
+ bPerformanceData.setTime16StatesS(pmr.getTime16StatesS());
+ bPerformanceData.setTime16States(pmr.getTime16States());
+ bPerformanceData.setTime32States(pmr.getTime32States());
+ bPerformanceData.setTime64States(pmr.getTime64States());
+ bPerformanceData.setTime128States(pmr.getTime128States());
+ bPerformanceData.setTime256States(pmr.getTime256States());
+ bPerformanceData.setTime512States(pmr.getTime512States());
+ bPerformanceData.setTime512StatesL(pmr.getTime512StatesL());
+ bPerformanceData.setTime1024States(pmr.getTime1024States());
+ bPerformanceData.setTime1024StatesL(pmr.getTime1024StatesL());
+ bPerformanceData.setTime2048States(pmr.getTime2048States());
+ bPerformanceData.setTime2048StatesL(pmr.getTime2048StatesL());
+ bPerformanceData.setTime4096States(pmr.getTime4096States());
+ bPerformanceData.setTime4096StatesL(pmr.getTime4096StatesL());
+ bPerformanceData.setTime8192States(pmr.getTime8192States());
+ bPerformanceData.setTime8192StatesL(pmr.getTime8192StatesL());
+ bPerformanceData.setSnirMin(pmr.getSnirMin());
+ bPerformanceData.setSnirMax(pmr.getSnirMax());
+ bPerformanceData.setSnirAvg(pmr.getSnirAvg());
+ bPerformanceData.setXpdMin(pmr.getXpdMin());
+ bPerformanceData.setXpdMax(pmr.getXpdMax());
+ bPerformanceData.setXpdAvg(pmr.getXpdAvg());
+ bPerformanceData.setRfTempMin(pmr.getRfTempMin());
+ bPerformanceData.setRfTempMax(pmr.getRfTempMax());
+ bPerformanceData.setRfTempAvg(pmr.getRfTempAvg());
+ bPerformanceData.setDefectBlocksSum(pmr.getDefectBlocksSum());
+ this.setPerformanceData(bPerformanceData.build());
+ }
- this.setRadioSignalId(airConfiguration.getRadioSignalId());
- PerformanceData pmr = pmRecord.getPerformanceData();
- if (pmr != null) {
- PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
- bPerformanceData.setTimePeriod(pmr.getTimePeriod());
- bPerformanceData.setEs(pmr.getEs());
- bPerformanceData.setSes(pmr.getSes());
- bPerformanceData.setCses(pmr.getCses());
- bPerformanceData.setUnavailability(pmr.getUnavailability());
- bPerformanceData.setTxLevelMin(pmr.getTxLevelMin());
- bPerformanceData.setTxLevelMax(pmr.getTxLevelMax());
- bPerformanceData.setTxLevelAvg(pmr.getTxLevelAvg());
- bPerformanceData.setRxLevelMin(pmr.getRxLevelMin());
- bPerformanceData.setRxLevelMax(pmr.getRxLevelMax());
- bPerformanceData.setRxLevelAvg(pmr.getRxLevelAvg());
- bPerformanceData.setTime2States(pmr.getTime2States());
- bPerformanceData.setTime4StatesS(pmr.getTime4StatesS());
- bPerformanceData.setTime4States(pmr.getTime4States());
- bPerformanceData.setTime8States(pmr.getTime8States());
- bPerformanceData.setTime16StatesS(pmr.getTime16StatesS());
- bPerformanceData.setTime16States(pmr.getTime16States());
- bPerformanceData.setTime32States(pmr.getTime32States());
- bPerformanceData.setTime64States(pmr.getTime64States());
- bPerformanceData.setTime128States(pmr.getTime128States());
- bPerformanceData.setTime256States(pmr.getTime256States());
- bPerformanceData.setTime512States(pmr.getTime512States());
- bPerformanceData.setTime512StatesL(pmr.getTime512StatesL());
- bPerformanceData.setTime1024States(pmr.getTime1024States());
- bPerformanceData.setTime1024StatesL(pmr.getTime1024StatesL());
- bPerformanceData.setTime2048States(pmr.getTime2048States());
- bPerformanceData.setTime2048StatesL(pmr.getTime2048StatesL());
- bPerformanceData.setTime4096States(pmr.getTime4096States());
- bPerformanceData.setTime4096StatesL(pmr.getTime4096StatesL());
- bPerformanceData.setTime8192States(pmr.getTime8192States());
- bPerformanceData.setTime8192StatesL(pmr.getTime8192StatesL());
- bPerformanceData.setSnirMin(pmr.getSnirMin());
- bPerformanceData.setSnirMax(pmr.getSnirMax());
- bPerformanceData.setSnirAvg(pmr.getSnirAvg());
- bPerformanceData.setXpdMin(pmr.getXpdMin());
- bPerformanceData.setXpdMax(pmr.getXpdMax());
- bPerformanceData.setXpdAvg(pmr.getXpdAvg());
- bPerformanceData.setRfTempMin(pmr.getRfTempMin());
- bPerformanceData.setRfTempMax(pmr.getRfTempMax());
- bPerformanceData.setRfTempAvg(pmr.getRfTempAvg());
- bPerformanceData.setDefectBlocksSum(pmr.getDefectBlocksSum());
- this.setPerformanceData(bPerformanceData.build());
- }
- }
+ /**
+ * Move data to generic type
+ *
+ * @param nodeId of node
+ * @param lp to get data from
+ * @param pmRecord data itself
+ * @throws InconsistentPMDataException
+ */
+ public PerformanceDataAirInterface181010Builder(NodeId nodeId, Lp lp, ContainerHistoricalPerformanceTypeG pmRecord)
+ throws InconsistentPMDataException {
+ this(nodeId, lp, (OtnHistoryDataG) pmRecord);
+ org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.container.historical.performance.type.g.@NonNull PerformanceData pmr = Helper
+ .throwIfPerformanceDataNull(pmRecord.getPerformanceData(), getUuidInterface(),
+ getLayerProtocolName());
- /**
- * Move data to generic type
- *
- * @param nodeId of node
- * @param lp to get data from
- * @param pmRecord data itself
- */
- public PerformanceDataAirInterface181010Builder(NodeId nodeId, Lp lp,
- ContainerHistoricalPerformanceTypeG pmRecord) {
- this(nodeId, lp, (OtnHistoryDataG) pmRecord);
- org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.container.historical.performance.type.g.PerformanceData pmr =
- pmRecord.getPerformanceData();
- if (pmr != null) {
- PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
- bPerformanceData.setTimePeriod(pmr.getTimePeriod());
- bPerformanceData.setTxEthernetBytesMaxM(pmr.getTxEthernetBytesMaxM());
- bPerformanceData.setTxEthernetBytesMaxS(pmr.getTxEthernetBytesMaxS());
- bPerformanceData.setTxEthernetBytesSum(pmr.getTxEthernetBytesSum());
- this.setPerformanceData(bPerformanceData.build());
- }
- }
+ PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder();
+ bPerformanceData.setTimePeriod(pmr.getTimePeriod());
+ bPerformanceData.setTxEthernetBytesMaxM(pmr.getTxEthernetBytesMaxM());
+ bPerformanceData.setTxEthernetBytesMaxS(pmr.getTxEthernetBytesMaxS());
+ bPerformanceData.setTxEthernetBytesSum(pmr.getTxEthernetBytesSum());
+ this.setPerformanceData(bPerformanceData.build());
+ }
}
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.InventoryInformationDcae;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.opendaylight.mdsal.binding.api.MountPoint;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
* Constructor
*/
- protected ONFCoreNetworkElement12Base(@NonNull NetconfBindingAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider) {
+ protected ONFCoreNetworkElement12Base(@NonNull NetconfBindingAccessor acessor,
+ @NonNull DeviceManagerServiceProvider serviceProvider) {
super(acessor);
this.optionalNe = Optional.empty();
- this.nodeId = getAcessor().get().getNodeId();
+ this.nodeId = acessor.getNodeId();
this.isNetworkElementCurrentProblemsSupporting12 =
acessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElementPac.QNAME);
this.equipment = new ONFCoreNetworkElement12Equipment(acessor, this);
synchronized (pmLock) {
boolean change = false;
- if (!optionalNe.isPresent()) {
+ if (optionalNe.isEmpty()) {
LOG.debug("Unable to read NE data for mountpoint {}", getMountpoint());
if (!interfaceList.isEmpty()) {
interfaceList.clear();
} else {
NetworkElement ne = optionalNe.get();
Optional<Guicutthrough> oGuicutthrough = getGuicutthrough(ne);
- if (oGuicutthrough.isPresent()) {
- databaseService.writeGuiCutThroughData(oGuicutthrough.get(), getAcessor().get().getNodeId().getValue());
+ Optional<NetconfAccessor> netconfAccessorOpt = getAcessor();
+ if (oGuicutthrough.isPresent() && netconfAccessorOpt.isPresent()) {
+ databaseService.writeGuiCutThroughData(oGuicutthrough.get(),
+ netconfAccessorOpt.get().getNodeId().getValue());
}
LOG.debug("Mountpoint '{}' NE-Name '{}'", getMountpoint(), ne.getName());
List<Lp> actualInterfaceList = getLtpList(ne);
List<String> uuids = new ArrayList<>();
LOG.debug("request inventory information. filter: {}" + layerProtocolFilter);
- if (optionalNe != null) {
- // uuids
- for (Lp lp : this.interfaceList) {
- if (layerProtocolFilter == null || layerProtocolFilter.isEmpty() || layerProtocolFilter
- .equals(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue())) {
- uuids.add(Helper.nnGetUniversalId(lp.getUuid()).getValue());
- }
+ // uuids
+ for (Lp lp : this.interfaceList) {
+ if (layerProtocolFilter == null || layerProtocolFilter.isEmpty() || layerProtocolFilter
+ .equals(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue())) {
+ uuids.add(Helper.nnGetUniversalId(lp.getUuid()).getValue());
}
}
LOG.debug("uuids found: {}", uuids);
LOG.debug("PM reset iterator");
}
- @SuppressWarnings("null")
@Override
public boolean hasNext() {
boolean res;
return res;
}
- @SuppressWarnings("null")
@Override
public void next() {
synchronized (pmLock) {
}
}
- @SuppressWarnings("null")
@Override
public String pmStatusToString() {
StringBuilder res = new StringBuilder();
synchronized (pmLock) {
- res.append(pmLp == null ? "no interface"
- : Helper.nnGetLayerProtocolName(pmLp.getLayerProtocolName()).getValue());
+ if (pmLp == null) {
+ res.append("no interface");
+ } else {
+ res.append("ActualLP=");
+ res.append(Helper.nnGetLayerProtocolName(pmLp.getLayerProtocolName()).getValue());
+ }
+ res.append(" IFList=");
+ int no=0;
for (Lp lp : getInterfaceList()) {
- res.append("IF:");
+ res.append("[");
+ res.append(no++);
+ res.append("]=");
res.append(Helper.nnGetLayerProtocolName(lp.getLayerProtocolName()).getValue());
res.append(" ");
}
}
@Override
- public Optional<PerformanceDataLtp> getLtpHistoricalPerformanceData() {
+ public Optional<PerformanceDataLtp> getLtpHistoricalPerformanceData() throws InconsistentPMDataException {
return Optional.empty();
}
//Guicutthrough
- public Optional<Guicutthrough> getGuicutthrough(NetworkElement ne) {
+ private Optional<Guicutthrough> getGuicutthrough(NetworkElement ne) {
Extension extension = ne.nonnullExtension().get(new ExtensionKey("webUri"));
- if (extension != null) {
+ Optional<NetconfAccessor> netconfAccessorOpt = getAcessor();
+ if (extension != null && netconfAccessorOpt.isPresent()) {
GuicutthroughBuilder gcBuilder = new GuicutthroughBuilder();
- gcBuilder.setName(getAcessor().get().getNodeId().getValue());
+ gcBuilder.setName(netconfAccessorOpt.get().getNodeId().getValue());
gcBuilder.setWeburi(extension.getValue());
return Optional.of(gcBuilder.build());
} else {
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.opendaylight.mdsal.binding.api.MountPoint;
import org.opendaylight.mdsal.binding.api.NotificationService;
}
@Override
- public Optional<PerformanceDataLtp> getLtpHistoricalPerformanceData() {
+ public Optional<PerformanceDataLtp> getLtpHistoricalPerformanceData() throws InconsistentPMDataException {
synchronized (getPmLock()) {
if (pmLp != null) {
LOG.debug("Enter query PM");
- @SuppressWarnings("null")
@NonNull
Lp lp = pmLp;
ONFLayerProtocolName lpName = ONFLayerProtocolName.valueOf(lp.getLayerProtocolName());
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.opendaylight.mdsal.binding.api.DataBroker;
}
@Test
- public void testgetLtpHistoricalPerformanceData() {
+ public void testgetLtpHistoricalPerformanceData() throws InconsistentPMDataException {
InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID =
InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid))
.child(AirInterfaceConfiguration.class).build();
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
}
@Test
- public void testgetLtpHistoricalPerformanceData() {
+ public void testgetLtpHistoricalPerformanceData() throws InconsistentPMDataException {
InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID =
InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid))
.child(AirInterfaceConfiguration.class).build();
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.opendaylight.mdsal.binding.api.DataBroker;
}
@Test
- public void testgetLtpHistoricalPerformanceData() {
+ public void testgetLtpHistoricalPerformanceData() throws InconsistentPMDataException {
InstanceIdentifier<AirInterfaceConfiguration> mwAirInterfaceConfigurationIID =
InstanceIdentifier.builder(MwAirInterfacePac.class, new MwAirInterfacePacKey(uid))
.child(AirInterfaceConfiguration.class).build();
--- /dev/null
+/*
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ */
+package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.pm.PerformanceDataAirInterface170324Builder;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.util.InconsistentPMDataException;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.LpBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performances.g.HistoricalPerformanceDataList;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performances.g.HistoricalPerformanceDataListBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performance.type.g.PerformanceData;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.air._interface.historical.performance.type.g.PerformanceDataBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceConfiguration;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.mw.air._interface.pac.AirInterfaceConfigurationBuilder;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
+
+public class TestWrapperNoPmData {
+
+ @Test
+ public void test() {
+ NodeId nodeId = new NodeId("TestNode");
+ Lp lp = new LpBuilder().setUuid(new UniversalId("NodeUUID")).build();
+ //Build empty, without PerformanceData
+ HistoricalPerformanceDataList pmRecord =
+ new HistoricalPerformanceDataListBuilder().setHistoryDataId("1").build();
+ AirInterfaceConfiguration airConfiguration = new AirInterfaceConfigurationBuilder().build();
+
+ @SuppressWarnings("unused")
+ Exception exception = assertThrows(InconsistentPMDataException.class, () -> {
+ PerformanceDataAirInterface170324Builder pmdata =
+ new PerformanceDataAirInterface170324Builder(nodeId, lp, pmRecord, airConfiguration);
+ });
+ String expectedMessage = "Ignore record without PerformanceData. Node/Lp: NodeUUID/default";
+ String actualMessage = exception.getMessage();
+ assertEquals(actualMessage,expectedMessage);
+ }
+}