diff options
Diffstat (limited to 'sdnr/wt/devicemanager-onap/onf14/provider')
18 files changed, 645 insertions, 150 deletions
diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomNetworkElement.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomNetworkElement.java index 56834a13d..6ff43bd69 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomNetworkElement.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomNetworkElement.java @@ -17,19 +17,26 @@ */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl; +import java.util.Iterator; import java.util.Map; import java.util.Optional; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement; import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElementService; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.PerformanceDataProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovider.Onf14DomToInternalDataModel; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.equipment.Onf14DomEquipmentManager; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.interfaces.Onf14DomInterfacePacManager; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.interfaces.TechnologySpecificPacKeys; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DevicemanagerQNames; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.PerformanceManager; +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.NetconfDomAccessor; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -47,7 +54,7 @@ import org.slf4j.LoggerFactory; * Representation of ONF Core model 1.4 device Top level element is "ControlConstruct" (replaces "NetworkElement" of * older ONF Version) NOTE: */ -public class Onf14DomNetworkElement implements NetworkElement { +public class Onf14DomNetworkElement implements NetworkElement, PerformanceDataProvider { private static final Logger log = LoggerFactory.getLogger(Onf14DomNetworkElement.class); @@ -55,9 +62,13 @@ public class Onf14DomNetworkElement implements NetworkElement { YangInstanceIdentifier.builder().node(Onf14DevicemanagerQNames.CORE_MODEL_CONTROL_CONSTRUCT_CONTAINER) .node(Onf14DevicemanagerQNames.CORE_MODEL_CC_TOP_LEVEL_EQPT).build(); + private final @NonNull Object pmLock = new Object(); + protected @Nullable TechnologySpecificPacKeys pmLp = null; + protected @Nullable Iterator<TechnologySpecificPacKeys> interfaceListIterator = null; private final NetconfDomAccessor netconfDomAccessor; private final DataProvider databaseService; private final @NonNull FaultService faultService; + private final @NonNull PerformanceManager performanceManager; private final @NonNull NotificationService notificationService; private final Onf14DomToInternalDataModel onf14Mapper; @@ -73,6 +84,7 @@ public class Onf14DomNetworkElement implements NetworkElement { this.databaseService = serviceProvider.getDataProvider(); this.notificationService = serviceProvider.getNotificationService(); this.faultService = serviceProvider.getFaultService(); + this.performanceManager = serviceProvider.getPerformanceManagerService(); this.namespaceRevision = namespaceRevision; this.onf14Mapper = new Onf14DomToInternalDataModel(); this.equipmentManager = new Onf14DomEquipmentManager(netconfDomAccessor, databaseService, onf14Mapper); @@ -84,16 +96,16 @@ public class Onf14DomNetworkElement implements NetworkElement { * reading the inventory (CoreModel 1.4 Equipment Model) and adding it to the DB */ public void initialReadFromNetworkElement() { - log.info("Calling read equipment"); + log.debug("Calling read equipment"); // Read complete device tree readEquipmentData(); - // Read fault data and subscribe for notifications - interfacePacManager.register(); - int problems = faultService.removeAllCurrentProblemsOfNode(netconfDomAccessor.getNodeId()); log.debug("Removed all {} problems from database at registration", problems); + // Read fault data and subscribe for notifications + interfacePacManager.register(); + } /** @@ -114,23 +126,28 @@ public class Onf14DomNetworkElement implements NetworkElement { if (netconfDomAccessor.isNotificationsRFC5277Supported()) { // Output notification streams to LOG Map<StreamKey, Stream> streams = netconfDomAccessor.getNotificationStreamsAsMap(); - log.info("Available notifications streams: {}", streams); + log.debug("Available notifications streams: {}", streams); // Register to default stream netconfDomAccessor.invokeCreateSubscription(); } + // -- Register NE to performance manager + performanceManager.registration(netconfDomAccessor.getNodeId(), this); } @Override - public void deregister() {} + public void deregister() { + performanceManager.deRegistration(netconfDomAccessor.getNodeId()); + } @Override public NodeId getNodeId() { return netconfDomAccessor.getNodeId(); } + @SuppressWarnings("unchecked") @Override public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) { - return Optional.empty(); + return clazz.isInstance(this) ? Optional.of((L) this) : Optional.empty(); } @Override @@ -148,7 +165,7 @@ public class Onf14DomNetworkElement implements NetworkElement { private void readEquipmentData() { Optional<NormalizedNode> topLevelEquipment = readTopLevelEquipment(netconfDomAccessor); - log.info("Top level equipment data is {}", topLevelEquipment.isPresent() ? topLevelEquipment.get() : null); + log.debug("Top level equipment data is {}", topLevelEquipment.isPresent() ? topLevelEquipment.get() : null); if (topLevelEquipment.isPresent()) { equipmentManager.setEquipmentData(topLevelEquipment.get()); } @@ -156,8 +173,78 @@ public class Onf14DomNetworkElement implements NetworkElement { } private Optional<NormalizedNode> readTopLevelEquipment(NetconfDomAccessor netconfDomAccessor) { - log.info("Reading Top level equipment data"); return netconfDomAccessor.readDataNode(LogicalDatastoreType.CONFIGURATION, TOPLEVELEQUIPMENT_IID); } + public Object getPmLock() { + return pmLock; + } + + @Override + public void resetPMIterator() { + synchronized (pmLock) { + interfaceListIterator = interfacePacManager.getAirInterfaceList().iterator(); + } + log.debug("PM reset iterator"); + } + + @Override + public boolean hasNext() { + boolean res; + synchronized (pmLock) { + res = interfaceListIterator != null ? interfaceListIterator.hasNext() : false; + } + log.debug("PM hasNext LTP {}", res); + return res; + } + + @Override + public void next() { + synchronized (pmLock) { + if (interfaceListIterator == null) { + pmLp = null; + log.debug("PM next LTP null"); + } else { + pmLp = interfaceListIterator.next(); + } + } + + } + + @Override + public Optional<PerformanceDataLtp> getLtpHistoricalPerformanceData() throws InconsistentPMDataException { + synchronized (getPmLock()) { + if (pmLp != null) { + log.debug("Enter query PM"); + @NonNull + TechnologySpecificPacKeys lp = pmLp; + return Optional.of(interfacePacManager.getLtpHistoricalPerformanceData(lp)); + } + return Optional.empty(); + } + } + + @Override + public String pmStatusToString() { + StringBuilder res = new StringBuilder(); + synchronized (pmLock) { + if (pmLp == null) { + res.append("no interface"); + } else { + res.append("ActualLP="); + res.append(pmLp.getLocalId()); + } + res.append(" IFList="); + int no = 0; + for (TechnologySpecificPacKeys lp : interfacePacManager.getAirInterfaceList()) { + res.append("["); + res.append(no++); + res.append("]="); + res.append(lp.getLocalId()); + res.append(" "); + } + } + return res.toString(); + } + } diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomNetworkElementFactory.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomNetworkElementFactory.java index b47f56d31..0c84cdf1b 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomNetworkElementFactory.java @@ -39,13 +39,14 @@ public class Onf14DomNetworkElementFactory implements NetworkElementFactory { Optional<NetworkElement> ne = Optional.empty(); Capabilities capabilities = accessor.getCapabilites(); if (capabilities.isSupportingNamespace(Onf14DevicemanagerQNames.CORE_MODEL_CONTROL_CONSTRUCT_CONTAINER)) { - String namespaceRevision = capabilities.getRevisionForNamespace(Onf14DevicemanagerQNames.CORE_MODEL_CONTROL_CONSTRUCT_CONTAINER); + String namespaceRevision = capabilities + .getRevisionForNamespace(Onf14DevicemanagerQNames.CORE_MODEL_CONTROL_CONSTRUCT_CONTAINER); + + Optional<NetconfDomAccessor> domAccessor = accessor.getNetconfDomAccessor(); + if (domAccessor.isPresent()) { + ne = Optional.of(new Onf14DomNetworkElement(domAccessor.get(), serviceProvider, namespaceRevision)); + } - Optional<NetconfDomAccessor> domAccessor = accessor.getNetconfDomAccessor(); - if (domAccessor.isPresent()) { - ne = Optional.of(new Onf14DomNetworkElement(domAccessor.get(), serviceProvider, namespaceRevision)); - } - log.info("Create device:{}", ne.isPresent() ? ne.get().getClass().getSimpleName() : "not"); } return ne; diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/dataprovider/InternalDataModelSeverity.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/dataprovider/InternalDataModelSeverity.java index 6d31d7392..917a82122 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/dataprovider/InternalDataModelSeverity.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/dataprovider/InternalDataModelSeverity.java @@ -30,10 +30,19 @@ import org.slf4j.LoggerFactory; public class InternalDataModelSeverity { private static Logger log = LoggerFactory.getLogger(InternalDataModelSeverity.class); - private static final Map<String, SeverityType> SEVERITYMAP = - Map.of("SEVERITY_TYPE_MAJOR", SeverityType.Major, "SEVERITY_TYPE_CRITICAL", SeverityType.Critical, - "SEVERITY_TYPE_MINOR", SeverityType.Minor, "SEVERITY_TYPE_WARNING", SeverityType.Warning); - + // @formatter:off + private static final Map<String, SeverityType> SEVERITYMAP = Map.of( + "SEVERITY_TYPE_MAJOR", SeverityType.Major, + "SEVERITY_AND_CLEARED_TYPE_MAJOR", SeverityType.Major, + "SEVERITY_TYPE_CRITICAL", SeverityType.Critical, + "SEVERITY_AND_CLEARED_TYPE_CRITICAL", SeverityType.Critical, + "SEVERITY_TYPE_MINOR", SeverityType.Minor, + "SEVERITY_AND_CLEARED_TYPE_MINOR", SeverityType.Minor, + "SEVERITY_TYPE_WARNING", SeverityType.Warning, + "SEVERITY_AND_CLEARED_TYPE_WARNING", SeverityType.Warning, + "SEVERITY_AND_CLEARED_TYPE_INDETERMINATE", SeverityType.NonAlarmed, + "SEVERITY_AND_CLEARED_TYPE_CLEARED", SeverityType.NonAlarmed); + // @formatter:on public static SeverityType mapSeverity(String severity) { log.debug("Severity is - {}", severity); SeverityType res = null; diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/dataprovider/Onf14DomToInternalDataModel.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/dataprovider/Onf14DomToInternalDataModel.java index 2a931378f..af817fe18 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/dataprovider/Onf14DomToInternalDataModel.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/dataprovider/Onf14DomToInternalDataModel.java @@ -1,12 +1,9 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovider; -import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; -import java.util.List; import java.util.Objects; import java.util.Set; - import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DMDOMUtility; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DevicemanagerQNames; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory; diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/equipment/Onf14DomEquipmentManager.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/equipment/Onf14DomEquipmentManager.java index 8f7a44858..5c7101199 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/equipment/Onf14DomEquipmentManager.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/equipment/Onf14DomEquipmentManager.java @@ -65,56 +65,11 @@ public class Onf14DomEquipmentManager { this.equipmentUuidList = new ArrayList<>(); } + // public methods public List<String> getEquipmentUuidList() { return equipmentUuidList; } - private List<Inventory> collectEquipment(List<Inventory> list, MapEntryNode currentEq, MapEntryNode parentEq, - long treeLevel) { - - // if the Equipment UUID is already in the list, it was already processed - // needed for solving possible circular dependencies - if (equipmentUuidList.contains(Onf14DMDOMUtility.getUuidFromEquipment(currentEq))) { - log.debug("Not adding equipment with uuid {} because it was aleady added...", - Onf14DMDOMUtility.getUuidFromEquipment(currentEq)); - return list; - } - - // we add this to our internal list, such that we avoid circular dependencies - equipmentUuidList.add(Onf14DMDOMUtility.getUuidFromEquipment(currentEq)); - log.debug("Adding equipment with uuid {} to the database...", - Onf14DMDOMUtility.getUuidFromEquipment(currentEq)); - - // we add our current equipment to the database - list.add(onf14Mapper.getInternalEquipment(netconfDomAccessor.getNodeId(), currentEq, parentEq, treeLevel)); - - // we iterate the kids of our current equipment and add them to the database - // recursively - // the actual reference is here: - // /core-model:control-construct/equipment/contained-holder/occupying-fru - - MapNode containedHolderMap = (MapNode) currentEq - .childByArg(new NodeIdentifier(Onf14DevicemanagerQNames.CORE_MODEL_CC_EQPT_CONTAINED_HOLDER)); - if (containedHolderMap != null) { - Collection<MapEntryNode> containedHolderCollection = containedHolderMap.body(); - for (MapEntryNode holder : containedHolderCollection) { - String occupyingFru = Onf14DMDOMUtility.getLeafValue(holder, - Onf14DevicemanagerQNames.CORE_MODEL_CC_EQPT_OCCUPYING_FRU); - - if (occupyingFru != null) { - Optional<NormalizedNode> childEq = readEquipmentInstance(netconfDomAccessor, occupyingFru); - if (childEq.isPresent()) { - // current becomes parent and tree level increases by 1 - collectEquipment(list, (MapEntryNode) childEq.get(), currentEq, treeLevel + 1); - } - } - } - } - - return list; - } - - // public methods /** * Set all equipment data from controlConstruct into database and into this manager. * @@ -124,7 +79,7 @@ public class Onf14DomEquipmentManager { Objects.requireNonNull(controlConstruct); // the top-level-equipment list contains the root objects of the Equipment Model - log.debug("Getting list of topLevelEquipment for mountpoint {}", netconfDomAccessor.getNodeId()); + log.debug("Iterating through the list of topLevelEquipment for mountpoint {}", netconfDomAccessor.getNodeId()); // adding all root Equipment objects to the DB List<Inventory> inventoryList = new ArrayList<>(); for (String uuid : getTopLevelEquipment(controlConstruct)) { @@ -156,7 +111,7 @@ public class Onf14DomEquipmentManager { */ private Optional<NormalizedNode> readEquipmentInstance(NetconfDomAccessor accessData, String equipmentUuid) { - log.info("DBRead Get equipment from mountpoint {} for uuid {}", accessData.getNodeId().getValue(), + log.debug("DBRead Get equipment from mountpoint {} for uuid {}", accessData.getNodeId().getValue(), equipmentUuid); InstanceIdentifierBuilder equipmentIIDBuilder = YangInstanceIdentifier.builder() @@ -168,4 +123,49 @@ public class Onf14DomEquipmentManager { return accessData.readDataNode(LogicalDatastoreType.CONFIGURATION, equipmentIIDBuilder.build()); } + private List<Inventory> collectEquipment(List<Inventory> list, MapEntryNode currentEq, MapEntryNode parentEq, + long treeLevel) { + + // if the Equipment UUID is already in the list, it was already processed + // needed for solving possible circular dependencies + if (equipmentUuidList.contains(Onf14DMDOMUtility.getUuidFromEquipment(currentEq))) { + log.debug("Not adding equipment with uuid {} because it was aleady added...", + Onf14DMDOMUtility.getUuidFromEquipment(currentEq)); + return list; + } + + // we add this to our internal list, such that we avoid circular dependencies + equipmentUuidList.add(Onf14DMDOMUtility.getUuidFromEquipment(currentEq)); + log.debug("Adding equipment with uuid {} to the database...", + Onf14DMDOMUtility.getUuidFromEquipment(currentEq)); + + // we add our current equipment to the database + list.add(onf14Mapper.getInternalEquipment(netconfDomAccessor.getNodeId(), currentEq, parentEq, treeLevel)); + + // we iterate the kids of our current equipment and add them to the database + // recursively + // the actual reference is here: + // /core-model:control-construct/equipment/contained-holder/occupying-fru + + MapNode containedHolderMap = (MapNode) currentEq + .childByArg(new NodeIdentifier(Onf14DevicemanagerQNames.CORE_MODEL_CC_EQPT_CONTAINED_HOLDER)); + if (containedHolderMap != null) { + Collection<MapEntryNode> containedHolderCollection = containedHolderMap.body(); + for (MapEntryNode holder : containedHolderCollection) { + String occupyingFru = Onf14DMDOMUtility.getLeafValue(holder, + Onf14DevicemanagerQNames.CORE_MODEL_CC_EQPT_OCCUPYING_FRU); + + if (occupyingFru != null) { + Optional<NormalizedNode> childEq = readEquipmentInstance(netconfDomAccessor, occupyingFru); + if (childEq.isPresent()) { + // current becomes parent and tree level increases by 1 + collectEquipment(list, (MapEntryNode) childEq.get(), currentEq, treeLevel + 1); + } + } + } + } + + return list; + } + } diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/interfaces/Onf14DomInterfacePacManager.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/interfaces/Onf14DomInterfacePacManager.java index eed6f5da3..71f94dc26 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/interfaces/Onf14DomInterfacePacManager.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/interfaces/Onf14DomInterfacePacManager.java @@ -28,16 +28,18 @@ import java.util.List; import java.util.Objects; import java.util.Optional; import org.eclipse.jdt.annotation.NonNull; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.Onf14DomAirInterfaceNotificationListener; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.Onf14DomEthernetContainerNotificationListener; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.Onf14DomWireInterfaceNotificationListener; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovider.InternalDataModelSeverity; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.pm.PerformanceDataAirInterface; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Debug; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DMDOMUtility; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DevicemanagerQNames; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.notifications.Onf14DomAirInterfaceNotificationListener; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.notifications.Onf14DomEthernetContainerNotificationListener; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.notifications.Onf14DomWireInterfaceNotificationListener; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; 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.netconfnodestateservice.NetconfDomAccessor; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; @@ -47,6 +49,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.Augmentat import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.MapNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; @@ -130,15 +133,77 @@ public class Onf14DomInterfacePacManager { registerForNotifications(); } + public List<TechnologySpecificPacKeys> getAirInterfaceList() { + return airInterfaceList; + } + + public PerformanceDataLtp readAirInterfaceHistoricalPerformanceData(String ltpUuid, String localId, + PerformanceDataLtp res) { + log.debug("Get historical performance data for class {} from mountpoint {} for LTP uuid {} and local-id {}", + Onf14DevicemanagerQNames.AIR_INTERFACE_2_0_MODULE, netconfDomAccessor.getNodeId().getValue(), ltpUuid, + localId); + + // constructing the IID needs the augmentation exposed by the air-interface-2-0 + // model + + InstanceIdentifierBuilder layerProtocolIID = + YangInstanceIdentifier.builder().node(Onf14DevicemanagerQNames.CORE_MODEL_CONTROL_CONSTRUCT_CONTAINER) + .node(Onf14DevicemanagerQNames.CORE_MODEL_CC_LTP) + .nodeWithKey(Onf14DevicemanagerQNames.CORE_MODEL_CC_LTP, + QName.create(Onf14DevicemanagerQNames.CORE_MODEL_CC_LTP, "uuid").intern(), ltpUuid) + .node(Onf14DevicemanagerQNames.CORE_MODEL_CC_LTP_LAYER_PROTOCOL) + .nodeWithKey(Onf14DevicemanagerQNames.CORE_MODEL_CC_LTP_LAYER_PROTOCOL, QName + .create(Onf14DevicemanagerQNames.CORE_MODEL_CC_LTP_LAYER_PROTOCOL, "local-id").intern(), + localId); + + @NonNull + AugmentationIdentifier airInterfacePacIID = YangInstanceIdentifier.AugmentationIdentifier + .create(Sets.newHashSet(Onf14DevicemanagerQNames.AIR_INTERFACE_PAC)); + + InstanceIdentifierBuilder augmentedAirInterfacePacIID = + YangInstanceIdentifier.builder(layerProtocolIID.build()).node(airInterfacePacIID); + + // reading historical performance list for this specific LTP and LP + Optional<NormalizedNode> airInterfacePacDataOpt = + netconfDomAccessor.readDataNode(LogicalDatastoreType.OPERATIONAL, augmentedAirInterfacePacIID.build()); + log.debug("Performance Data = {}", airInterfacePacDataOpt.get().body()); + if (airInterfacePacDataOpt.isPresent()) { + AugmentationNode airInterfacePacData = (AugmentationNode) airInterfacePacDataOpt.get(); + ContainerNode cn = (ContainerNode) airInterfacePacData + .childByArg(new NodeIdentifier(Onf14DevicemanagerQNames.AIR_INTERFACE_PAC)); + if (cn != null) { + ContainerNode airIntfHistPerf = (ContainerNode) cn + .childByArg(new NodeIdentifier(Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCES)); + if (airIntfHistPerf != null) { + MapNode airInterfaceHistoricalPerformanceList = (MapNode) airIntfHistPerf.childByArg( + new NodeIdentifier(Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCES_LIST)); + if (airInterfaceHistoricalPerformanceList != null) { + Collection<MapEntryNode> airInterfaceHistoricalPerfCollection = + airInterfaceHistoricalPerformanceList.body(); + for (MapEntryNode airInterfaceHistPerf : airInterfaceHistoricalPerfCollection) { + res.add(new PerformanceDataAirInterface(netconfDomAccessor.getNodeId(), ltpUuid, localId, + airInterfaceHistPerf)); + } + return res; + } else { + log.debug("DBRead Id {} empty CurrentProblemList", ltpUuid); + } + } + } + } + return null; + } + private void readAndWriteInterfaceCurrentProblems() { // Read all fault data FaultData resultList = new FaultData(); - int problems; + int problems = 0; readAllAirInterfaceCurrentProblems(resultList); problems = resultList.size(); log.debug("NETCONF read air interface current problems completed. Got back {} problems.", problems); - readAllEhernetContainerCurrentProblems(resultList); + + readAllEthernetContainerCurrentProblems(resultList); problems = resultList.size() - problems; log.debug("NETCONF read current problems completed. Got back {} problems.", problems); @@ -146,16 +211,18 @@ public class Onf14DomInterfacePacManager { problems = resultList.size(); log.debug("NETCONF read wire interface current problems completed. Got back {} problems.", problems); - faultService.initCurrentProblemStatus(netconfDomAccessor.getNodeId(), resultList); - log.debug("DB write current problems completed"); + + if (resultList.size() > 0) { + faultService.initCurrentProblemStatus(netconfDomAccessor.getNodeId(), resultList); + log.debug("DB write current problems completed"); + } } private void readKeys() { Optional<NormalizedNode> ltpData = readLtpData(netconfDomAccessor); - log.info("LTP Data is - {}", ltpData); + log.debug("LTP Data is - {}", ltpData); if (ltpData.isPresent()) { - log.debug("In readKeys - ltpData = {}", ltpData.get()); MapNode ccLtp = (MapNode) ltpData.get(); if (ccLtp != null) { @@ -194,7 +261,7 @@ public class Onf14DomInterfacePacManager { Onf14DMDOMUtility.getLeafValue(lpEntry, Onf14DevicemanagerQNames.CORE_MODEL_CC_LTP_LAYER_PROTOCOL_LOCAL_ID)); } - // if the LTP has an ethernetContainier technology extension, the layer protocol + // if the LTP has an ethernetContainer technology extension, the layer protocol // name is ethernet-container-layer else if (layerProtocolName.contains("LAYER_PROTOCOL_NAME_TYPE_ETHERNET_CONTAINER_LAYER")) { TechnologySpecificPacKeys ethernetContainerKey = new TechnologySpecificPacKeys( @@ -240,7 +307,7 @@ public class Onf14DomInterfacePacManager { } } - private void readAllEhernetContainerCurrentProblems(FaultData resultList) { + private void readAllEthernetContainerCurrentProblems(FaultData resultList) { int idxStart; // Start index for debug messages @@ -266,7 +333,7 @@ public class Onf14DomInterfacePacManager { private void readAirInterfaceCurrentProblemForLtp(String ltpUuid, String localId, FaultData resultList) { - log.info("DBRead Get current problems for class {} from mountpoint {} for LTP uuid {} and local-id {}", + log.debug("DBRead Get current problems for class {} from mountpoint {} for LTP uuid {} and local-id {}", Onf14DevicemanagerQNames.AIR_INTERFACE_2_0_MODULE, netconfDomAccessor.getNodeId().getValue(), ltpUuid, localId); @@ -296,7 +363,6 @@ public class Onf14DomInterfacePacManager { if (airInterfacePacDataOpt.isPresent()) { AugmentationNode airInterfacePacData = (AugmentationNode) airInterfacePacDataOpt.get(); - MapNode airInterfaceCurrentProblemsList = (MapNode) airInterfacePacData .childByArg(new NodeIdentifier(Onf14DevicemanagerQNames.AIR_INTERFACE_CURRENT_PROBLEMS_LIST)); if (airInterfaceCurrentProblemsList != null) { @@ -321,7 +387,7 @@ public class Onf14DomInterfacePacManager { private void readEthernetContainerCurrentProblemForLtp(String ltpUuid, String localId, FaultData resultList) { - log.info( + log.debug( "DBRead Get current problems for Ethernet Container from mountpoint {} for LTP uuid {} and local-id {}", netconfDomAccessor.getNodeId().getValue(), ltpUuid, localId); @@ -377,7 +443,7 @@ public class Onf14DomInterfacePacManager { private void readWireInterfaceCurrentProblemForLtp(String ltpUuid, String localId, FaultData resultList) { - log.info("DBRead Get current problems for Wire Interface from mountpoint {} for LTP uuid {} and local-id {}", + log.debug("DBRead Get current problems for Wire Interface from mountpoint {} for LTP uuid {} and local-id {}", netconfDomAccessor.getNodeId().getValue(), ltpUuid, localId); // constructing the IID needs the augmentation exposed by the wire-interface-2-0 @@ -419,7 +485,7 @@ public class Onf14DomInterfacePacManager { Onf14DMDOMUtility.getLeafValue(wireInterfaceProblem, Onf14DevicemanagerQNames.WIRE_INTERFACE_CURRENT_PROBLEMS_PROBLEM_NAME), InternalDataModelSeverity.mapSeverity(Onf14DMDOMUtility.getLeafValue(wireInterfaceProblem, - Onf14DevicemanagerQNames.WIRE_INTERFACE_CURRENT_PROBLEMS_PROBLEM_SEVERITY))); + Onf14DevicemanagerQNames.WIRE_INTERFACE_CURRENT_PROBLEMS_PROBLEM_SEVERITY))); } } else { log.debug("DBRead Id {} empty CurrentProblemList", ltpUuid); @@ -429,6 +495,7 @@ public class Onf14DomInterfacePacManager { } private void registerForNotifications() { + QName[] airInterfaceNotifications = {Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_CREATE_NOTIFICATION, Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_AVC_NOTIFICATION, Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_DELETE_NOTIFICATION, @@ -455,4 +522,10 @@ public class Onf14DomInterfacePacManager { log.info("Reading Logical Termination Point data"); return netconfDomAccessor.readDataNode(LogicalDatastoreType.CONFIGURATION, LTP_IID); } + + public PerformanceDataLtp getLtpHistoricalPerformanceData(@NonNull TechnologySpecificPacKeys lp) { + PerformanceDataLtp res = new PerformanceDataLtp(); + readAirInterfaceHistoricalPerformanceData(lp.getLtpUuid(), lp.getLocalId(), res); + return res; + } } diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/pm/Helper.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/pm/Helper.java new file mode 100644 index 000000000..0a64f938e --- /dev/null +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/pm/Helper.java @@ -0,0 +1,42 @@ +/* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2022 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.onf14.dom.impl.pm; + +import java.util.Map; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GranularityPeriodType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Helper { + + private static Logger log = LoggerFactory.getLogger(Helper.class); + private static final Map<String, GranularityPeriodType> GRANULARITYMAP = + Map.of("GRANULARITY_PERIOD_TYPE_PERIOD-15-MIN", GranularityPeriodType.Period15Min, + "GRANULARITY_PERIOD_TYPE_PERIOD-24-HOURS", GranularityPeriodType.Period24Hours); + + public static GranularityPeriodType mapGranularityPeriod(String gp) { + log.debug("Granularity Period is - {}", gp); + GranularityPeriodType res = null; + if (gp != null) { + res = GRANULARITYMAP.get(gp); + } + return res == null ? GranularityPeriodType.Unknown : res; + } + +} diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/pm/PerformanceDataAirInterface.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/pm/PerformanceDataAirInterface.java new file mode 100644 index 000000000..8abdb1e8f --- /dev/null +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/pm/PerformanceDataAirInterface.java @@ -0,0 +1,182 @@ +/* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2022 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.onf14.dom.impl.pm; + +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DMDOMUtility; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DevicemanagerQNames; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntityBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.entity.PerformanceDataBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; +import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class PerformanceDataAirInterface extends PmdataEntityBuilder { + + private static final Logger log = LoggerFactory.getLogger(PerformanceDataAirInterface.class); + + public PerformanceDataAirInterface(NodeId nodeId, String ltpUuid, String localId, + MapEntryNode airInterfaceHistPerfEntry) { + log.debug("Performance Data of Air Interface = {}", airInterfaceHistPerfEntry); + String leafVal; + + this.setGranularityPeriod(Helper.mapGranularityPeriod(Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerfEntry, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCES_LIST_GP))); + this.setUuidInterface(ltpUuid); + this.setLayerProtocolName(localId); // TODO + this.setNodeName(nodeId.getValue()); + this.setScannerId(Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerfEntry, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCES_LIST_HDI)); + this.setTimeStamp(new DateAndTime(Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerfEntry, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCES_LIST_PET))); + this.setSuspectIntervalFlag(Boolean.getBoolean(Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerfEntry, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCES_LIST_SIF))); + + PerformanceDataBuilder bPerformanceData = new PerformanceDataBuilder(); + ContainerNode airInterfaceHistPerf = (ContainerNode) airInterfaceHistPerfEntry + .childByArg(new NodeIdentifier(Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_DATA)); + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_ES)) != null) { + bPerformanceData.setEs(Integer.parseInt(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_SES)) != null) { + bPerformanceData.setSes(Integer.parseInt(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_CSES)) != null) { + bPerformanceData.setCses(Integer.parseInt(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_UNAVAILABILITY)) != null) { + bPerformanceData.setUnavailability(Integer.parseInt(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_TX_LEVEL_MIN)) != null) { + bPerformanceData.setTxLevelMin(Byte.parseByte(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_TX_LEVEL_MAX)) != null) { + bPerformanceData.setTxLevelMax(Byte.parseByte(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_TX_LEVEL_AVG)) != null) { + bPerformanceData.setTxLevelAvg(Byte.parseByte(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_RX_LEVEL_MIN)) != null) { + bPerformanceData.setTxLevelMin(Byte.parseByte(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_RX_LEVEL_MAX)) != null) { + bPerformanceData.setTxLevelMax(Byte.parseByte(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_RX_LEVEL_AVG)) != null) { + bPerformanceData.setTxLevelAvg(Byte.parseByte(leafVal)); + } + + + // //TODO: xstates-list 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()); + + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_SNIR_MIN)) != null) { + bPerformanceData.setSnirMin(Byte.parseByte(leafVal)); + } + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_SNIR_MAX)) != null) { + bPerformanceData.setSnirMax(Byte.parseByte(leafVal)); + } + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_SNIR_AVG)) != null) { + bPerformanceData.setSnirAvg(Byte.parseByte(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_XPD_MIN)) != null) { + bPerformanceData.setXpdMin(Byte.parseByte(leafVal)); + } + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_XPD_MAX)) != null) { + bPerformanceData.setXpdMax(Byte.parseByte(leafVal)); + } + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_XPD_AVG)) != null) { + bPerformanceData.setXpdAvg(Byte.parseByte(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_RF_TEMP_MIN)) != null) { + bPerformanceData.setRfTempMin(Byte.parseByte(leafVal)); + } + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_RF_TEMP_MAX)) != null) { + bPerformanceData.setRfTempMax(Byte.parseByte(leafVal)); + } + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_RF_TEMP_AVG)) != null) { + bPerformanceData.setRfTempAvg(Byte.parseByte(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_DEFECT_BLOCKS_SUM)) != null) { + bPerformanceData.setDefectBlocksSum(Short.valueOf(leafVal)); + } + + if ((leafVal = Onf14DMDOMUtility.getLeafValue(airInterfaceHistPerf, + Onf14DevicemanagerQNames.AIR_INTERFACE_HISTORICAL_PERFORMANCE_TIME_PERIOD)) != null) { + bPerformanceData.setTimePeriod(Integer.parseInt(leafVal)); + } + + this.setPerformanceData(bPerformanceData.build()); + } +} diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Debug.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Debug.java index 978c71e31..1af1da617 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Debug.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Debug.java @@ -27,23 +27,7 @@ import org.slf4j.LoggerFactory; public class Debug { - // constants private static final Logger log = LoggerFactory.getLogger(Debug.class); - // end of constants - - // variables - // end of variables - - // constructors - // end of constructors - - // getters and setters - // end of getters and setters - - // private methods - // end of private methods - - // public methods /** * LOG the newly added problems of the interface pac * @@ -62,11 +46,4 @@ public class Debug { } log.debug("Found problems {} {}", uuid, sb); } - // end of public methods - - // static methods - // end of static methods - - // private classes - // end of private classes } diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Onf14DMDOMUtility.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Onf14DMDOMUtility.java index 1cae567ff..ae1884dcb 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Onf14DMDOMUtility.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Onf14DMDOMUtility.java @@ -1,3 +1,24 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2022 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.onf14.dom.impl.util; import com.google.common.base.VerifyException; @@ -30,9 +51,11 @@ public class Onf14DMDOMUtility { try { LeafNode<?> optLeafNode = (LeafNode<?>) componentEntry.getChildByArg(leafNodeIdentifier); if (optLeafNode.body() instanceof QName) { - LOG.debug("Leaf is of type QName"); //Ex: ImmutableLeafNode{identifier=(urn:onf:yang:air-interface-2-0?revision=2020-01-21)severity, body=(urn:onf:yang:air-interface-2-0?revision=2020-01-21)SEVERITY_TYPE_MAJOR} + LOG.debug("Leaf is of type QName"); // Ex: + // ImmutableLeafNode{identifier=(urn:onf:yang:air-interface-2-0?revision=2020-01-21)severity, + // body=(urn:onf:yang:air-interface-2-0?revision=2020-01-21)SEVERITY_TYPE_MAJOR} String severity_ = optLeafNode.body().toString(); - return severity_.substring(severity_.indexOf(')')+1); //Any other solution?? + return severity_.substring(severity_.indexOf(')') + 1); // Any other solution?? } return optLeafNode.body().toString(); } catch (VerifyException ve) { @@ -74,4 +97,5 @@ public class Onf14DMDOMUtility { return Instant.now(); } } + } diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Onf14DevicemanagerQNames.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Onf14DevicemanagerQNames.java index 58abf021f..f4fd2118f 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Onf14DevicemanagerQNames.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/util/Onf14DevicemanagerQNames.java @@ -1,3 +1,24 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2022 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.onf14.dom.impl.util; import org.opendaylight.yangtools.yang.common.QName; @@ -61,6 +82,8 @@ public class Onf14DevicemanagerQNames { // Air-interface public static final QNameModule AIR_INTERFACE_2_0_MODULE = QNameModule.create(XMLNamespace.of("urn:onf:yang:air-interface-2-0"), Revision.of("2020-01-21")); + public static final QName AIR_INTERFACE_2_0_MODULE_NS = + QName.create(XMLNamespace.of("urn:onf:yang:air-interface-2-0"), "air-interface-2-0"); public static final QName AIR_INTERFACE_PAC = QName.create(AIR_INTERFACE_2_0_MODULE, "air-interface-pac"); public static final QName AIR_INTERFACE_CURRENT_PROBLEMS = QName.create(AIR_INTERFACE_2_0_MODULE, "air-interface-current-problems"); @@ -74,6 +97,81 @@ public class Onf14DevicemanagerQNames { QName.create(AIR_INTERFACE_2_0_MODULE, "problem-name"); public static final QName AIR_INTERFACE_CURRENT_PROBLEMS_PROBLEM_SEVERITY = QName.create(AIR_INTERFACE_2_0_MODULE, "problem-severity"); + + // Historical Performance + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCES = + QName.create(AIR_INTERFACE_2_0_MODULE, "air-interface-historical-performances"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCES_LIST = + QName.create(AIR_INTERFACE_2_0_MODULE, "historical-performance-data-list"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCES_LIST_GP = + QName.create(AIR_INTERFACE_2_0_MODULE, "granularity-period"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCES_LIST_SIF = + QName.create(AIR_INTERFACE_2_0_MODULE, "suspect-interval-flag"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCES_LIST_HDI = + QName.create(AIR_INTERFACE_2_0_MODULE, "history-data-id"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCES_LIST_PET = + QName.create(AIR_INTERFACE_2_0_MODULE, "period-end-time"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_DATA = + QName.create(AIR_INTERFACE_2_0_MODULE, "performance-data"); + + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_ES = QName.create(AIR_INTERFACE_2_0_MODULE, "es"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_SES = QName.create(AIR_INTERFACE_2_0_MODULE, "ses"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_CSES = + QName.create(AIR_INTERFACE_2_0_MODULE, "cses"); + + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_UNAVAILABILITY = + QName.create(AIR_INTERFACE_2_0_MODULE, "unavailability"); + + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_TX_LEVEL_MIN = + QName.create(AIR_INTERFACE_2_0_MODULE, "tx-level-min"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_TX_LEVEL_MAX = + QName.create(AIR_INTERFACE_2_0_MODULE, "tx-level-max"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_TX_LEVEL_AVG = + QName.create(AIR_INTERFACE_2_0_MODULE, "tx-level-avg"); + + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_RX_LEVEL_MIN = + QName.create(AIR_INTERFACE_2_0_MODULE, "rx-level-min"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_RX_LEVEL_MAX = + QName.create(AIR_INTERFACE_2_0_MODULE, "rx-level-max"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_RX_LEVEL_AVG = + QName.create(AIR_INTERFACE_2_0_MODULE, "rx-level-avg"); + + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_TIME_XSTATES_LIST = + QName.create(AIR_INTERFACE_2_0_MODULE, "time-xstates-list"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_TIME_XSTATE_SEQNO = + QName.create(AIR_INTERFACE_2_0_MODULE, "time-xstate-sequence-number"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_TIME_XSTATE_TX_MODE = + QName.create(AIR_INTERFACE_2_0_MODULE, "transmission-mode"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_TIME_XSTATE_TIME = + QName.create(AIR_INTERFACE_2_0_MODULE, "time"); + + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_SNIR_MIN = + QName.create(AIR_INTERFACE_2_0_MODULE, "snir-min"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_SNIR_MAX = + QName.create(AIR_INTERFACE_2_0_MODULE, "snir-max"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_SNIR_AVG = + QName.create(AIR_INTERFACE_2_0_MODULE, "snir-avg"); + + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_XPD_MIN = + QName.create(AIR_INTERFACE_2_0_MODULE, "xpd-min"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_XPD_MAX = + QName.create(AIR_INTERFACE_2_0_MODULE, "xpd-max"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_XPD_AVG = + QName.create(AIR_INTERFACE_2_0_MODULE, "xpd-avg"); + + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_RF_TEMP_MIN = + QName.create(AIR_INTERFACE_2_0_MODULE, "rf-temp-min"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_RF_TEMP_MAX = + QName.create(AIR_INTERFACE_2_0_MODULE, "rf-temp-max"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_RF_TEMP_AVG = + QName.create(AIR_INTERFACE_2_0_MODULE, "rf-temp-avg"); + + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_DEFECT_BLOCKS_SUM = + QName.create(AIR_INTERFACE_2_0_MODULE, "defect-blocks-sum"); + public static final QName AIR_INTERFACE_HISTORICAL_PERFORMANCE_TIME_PERIOD = + QName.create(AIR_INTERFACE_2_0_MODULE, "time-period"); + + // Creation notification public static final QName AIR_INTERFACE_OBJECT_CREATE_NOTIFICATION = QName.create(AIR_INTERFACE_2_0_MODULE, "object-creation-notification"); @@ -124,6 +222,8 @@ public class Onf14DevicemanagerQNames { // Ethernet interface public static final QNameModule ETHERNET_CONTAINER_2_0_MODULE = QNameModule.create(XMLNamespace.of("urn:onf:yang:ethernet-container-2-0"), Revision.of("2020-01-21")); + public static final QName ETHERNET_CONTAINER_2_0_NS = + QName.create(XMLNamespace.of("urn:onf:yang:ethernet-container-2-0"), "ethernet-container-2-0"); public static final QName ETHERNET_CONTAINER_PAC = QName.create(ETHERNET_CONTAINER_2_0_MODULE, "ethernet-container-pac"); public static final QName ETHERNET_CONTAINER_CURRENT_PROBLEMS = @@ -188,6 +288,8 @@ public class Onf14DevicemanagerQNames { //Wire interface public static final QNameModule WIRE_INTERFACE_2_0_MODULE = QNameModule.create(XMLNamespace.of("urn:onf:yang:wire-interface-2-0"), Revision.of("2020-01-23")); + public static final QName WIRE_INTERFACE_2_0_NS = + QName.create(XMLNamespace.of("urn:onf:yang:wire-interface-2-0"), "wire-interface-2-0"); public static final QName WIRE_INTERFACE_PAC = QName.create(WIRE_INTERFACE_2_0_MODULE, "wire-interface-pac"); public static final QName WIRE_INTERFACE_CURRENT_PROBLEMS = QName.create(WIRE_INTERFACE_2_0_MODULE, "wire-interface-current-problems"); diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomAirInterfaceNotificationListener.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/notifications/Onf14DomAirInterfaceNotificationListener.java index c510a1ae6..e32ca0134 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomAirInterfaceNotificationListener.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/notifications/Onf14DomAirInterfaceNotificationListener.java @@ -19,7 +19,7 @@ * ============LICENSE_END========================================================= * */ -package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl; +package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.notifications; import org.eclipse.jdt.annotation.NonNull; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovider.InternalDataModelSeverity; @@ -120,21 +120,20 @@ public class Onf14DomAirInterfaceNotificationListener implements DOMNotification private void onObjectProblemNotification(@NonNull DOMNotification domNotification) { ContainerNode cn = domNotification.getBody(); - FaultlogEntity faultAlarm = - new FaultlogBuilder() - .setObjectId(Onf14DMDOMUtility.getLeafValue(cn, - Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_OBJECT_ID_REF)) - .setProblem(Onf14DMDOMUtility.getLeafValue(cn, - Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_PROBLEM)) - .setSourceType(SourceType.Netconf) - .setTimestamp(new DateAndTime(Onf14DMDOMUtility.getLeafValue(cn, - Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_TIMESTAMP))) - .setNodeId(this.netconfDomAccessor.getNodeId().getValue()) - .setSeverity(InternalDataModelSeverity.mapSeverity(Onf14DMDOMUtility.getLeafValue(cn, - Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_SEVERITY))) - .setCounter(Integer.parseInt(Onf14DMDOMUtility.getLeafValue(cn, - Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_COUNTER))) - .build(); + FaultlogEntity faultAlarm = new FaultlogBuilder() + .setObjectId(Onf14DMDOMUtility.getLeafValue(cn, + Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_OBJECT_ID_REF)) + .setProblem(Onf14DMDOMUtility.getLeafValue(cn, + Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_PROBLEM)) + .setSourceType(SourceType.Netconf) + .setTimestamp(new DateAndTime(Onf14DMDOMUtility.getLeafValue(cn, + Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_TIMESTAMP))) + .setNodeId(this.netconfDomAccessor.getNodeId().getValue()) + .setSeverity(InternalDataModelSeverity.mapSeverity(Onf14DMDOMUtility.getLeafValue(cn, + Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_SEVERITY))) + .setCounter(Integer.parseInt(Onf14DMDOMUtility.getLeafValue(cn, + Onf14DevicemanagerQNames.AIR_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_COUNTER))) + .build(); serviceProvider.getFaultService().faultNotification(faultAlarm); serviceProvider.getWebsocketService().sendNotification(domNotification, netconfDomAccessor.getNodeId(), diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomEthernetContainerNotificationListener.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/notifications/Onf14DomEthernetContainerNotificationListener.java index 5aa069efb..3f2b95e93 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomEthernetContainerNotificationListener.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/notifications/Onf14DomEthernetContainerNotificationListener.java @@ -1,4 +1,4 @@ -package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl; +package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.notifications; import org.eclipse.jdt.annotation.NonNull; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovider.InternalDataModelSeverity; diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomWireInterfaceNotificationListener.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/notifications/Onf14DomWireInterfaceNotificationListener.java index 401fbbe8d..9e7b35bc2 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/Onf14DomWireInterfaceNotificationListener.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/notifications/Onf14DomWireInterfaceNotificationListener.java @@ -1,4 +1,4 @@ -package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl; +package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.notifications; import org.eclipse.jdt.annotation.NonNull; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovider.InternalDataModelSeverity; @@ -73,20 +73,19 @@ public class Onf14DomWireInterfaceNotificationListener implements DOMNotificatio public void onProblemNotification(DOMNotification notification) { ContainerNode cn = notification.getBody(); - FaultlogEntity faultAlarm = - new FaultlogBuilder() - .setObjectId(Onf14DMDOMUtility.getLeafValue(cn, - Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_OBJECT_ID_REF)) - .setProblem(Onf14DMDOMUtility.getLeafValue(cn, - Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_PROBLEM)) - .setTimestamp(new DateAndTime(Onf14DMDOMUtility.getLeafValue(cn, - Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_TIMESTAMP))) - .setNodeId(this.netconfDomAccessor.getNodeId().getValue()).setSourceType(SourceType.Netconf) - .setSeverity(InternalDataModelSeverity.mapSeverity(Onf14DMDOMUtility.getLeafValue(cn, - Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_SEVERITY))) - .setCounter(Integer.parseInt(Onf14DMDOMUtility.getLeafValue(cn, - Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_COUNTER))) - .build(); + FaultlogEntity faultAlarm = new FaultlogBuilder() + .setObjectId(Onf14DMDOMUtility.getLeafValue(cn, + Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_OBJECT_ID_REF)) + .setProblem(Onf14DMDOMUtility.getLeafValue(cn, + Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_PROBLEM)) + .setTimestamp(new DateAndTime(Onf14DMDOMUtility.getLeafValue(cn, + Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_TIMESTAMP))) + .setNodeId(this.netconfDomAccessor.getNodeId().getValue()).setSourceType(SourceType.Netconf) + .setSeverity(InternalDataModelSeverity.mapSeverity(Onf14DMDOMUtility.getLeafValue(cn, + Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_SEVERITY))) + .setCounter(Integer.parseInt(Onf14DMDOMUtility.getLeafValue(cn, + Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION_COUNTER))) + .build(); serviceProvider.getFaultService().faultNotification(faultAlarm); serviceProvider.getWebsocketService().sendNotification(notification, netconfDomAccessor.getNodeId(), Onf14DevicemanagerQNames.WIRE_INTERFACE_OBJECT_PROBLEM_NOTIFICATION, diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomAirInterfaceNotificationListener.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomAirInterfaceNotificationListener.java index a8e97e173..9b647a198 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomAirInterfaceNotificationListener.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomAirInterfaceNotificationListener.java @@ -23,8 +23,8 @@ import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.Onf14DomAirInterfaceNotificationListener; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DevicemanagerQNames; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.notifications.Onf14DomAirInterfaceNotificationListener; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.util.NetconfDeviceNotification; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomEthernetContainerNotificationListener.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomEthernetContainerNotificationListener.java index c2f7984a2..0b0c3aa6e 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomEthernetContainerNotificationListener.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomEthernetContainerNotificationListener.java @@ -22,8 +22,8 @@ import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.Onf14DomEthernetContainerNotificationListener; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DevicemanagerQNames; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.notifications.Onf14DomEthernetContainerNotificationListener; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.util.NetconfDeviceNotification; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomNetworkElement.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomNetworkElement.java index 0d30e4dd0..555bfd88d 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomNetworkElement.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomNetworkElement.java @@ -15,6 +15,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.Onf14DomNetw import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DevicemanagerQNames; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.PerformanceManager; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor; @@ -39,6 +40,8 @@ public class TestOnf14DomNetworkElement { @Mock FaultService faultService; @Mock + PerformanceManager pmService; + @Mock DeviceManagerServiceProvider serviceProvider; @Mock WebsocketManagerService websocketManagerService; @@ -60,14 +63,14 @@ public class TestOnf14DomNetworkElement { when(netconfDomAccessor.getNodeId()).thenReturn(nodeId); when(serviceProvider.getDataProvider()).thenReturn(dataProvider); when(serviceProvider.getFaultService()).thenReturn(faultService); + when(serviceProvider.getPerformanceManagerService()).thenReturn(pmService); when(netconfDomAccessor.readDataNode(LogicalDatastoreType.CONFIGURATION, TOPLEVELEQUIPMENT_IID)) .thenReturn(Optional.empty()); } @Test - public void test() { + public void testWithOldInterfaceRevisions() { Optional<NetworkElement> onfDomNe; - Onf14DomNetworkElementFactory factory = new Onf14DomNetworkElementFactory(); factory.init(serviceProvider); onfDomNe = factory.create(netconfDomAccessor, serviceProvider); @@ -78,7 +81,7 @@ public class TestOnf14DomNetworkElement { onfDomNe.get().getAcessor(); onfDomNe.get().getDeviceType(); onfDomNe.get().warmstart(); - onfDomNe.get().getService(null); + //onfDomNe.get().getService(null); assertEquals(onfDomNe.get().getNodeId().getValue(), "nSky"); } diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomWireInterfaceNotificationListener.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomWireInterfaceNotificationListener.java index 37cd5b45a..954acde78 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomWireInterfaceNotificationListener.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14DomWireInterfaceNotificationListener.java @@ -23,8 +23,8 @@ import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.Onf14DomWireInterfaceNotificationListener; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.util.Onf14DevicemanagerQNames; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.notifications.Onf14DomWireInterfaceNotificationListener; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.util.NetconfDeviceNotification; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; |