diff options
Diffstat (limited to 'sdnr/wt/devicemanager-onap/onf14')
11 files changed, 170 insertions, 201 deletions
diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/pom.xml b/sdnr/wt/devicemanager-onap/onf14/provider/pom.xml index cf59fa044..ec5c8c63a 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/pom.xml +++ b/sdnr/wt/devicemanager-onap/onf14/provider/pom.xml @@ -52,7 +52,7 @@ <buildtime>${maven.build.timestamp} UTC</buildtime> <databaseport>49400</databaseport> </properties> - + <dependencies> <dependency> <groupId>${project.groupId}</groupId> @@ -64,7 +64,7 @@ <artifactId>sdnr-wt-devicemanager-core-model</artifactId> <version>${project.version}</version> <scope>provided</scope> - </dependency> + </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>sdnr-wt-websocketmanager-model</artifactId> @@ -82,7 +82,7 @@ <artifactId>sdnr-wt-common</artifactId> <version>${project.version}</version> <scope>provided</scope> - </dependency> + </dependency> <dependency> <groupId>org.opendaylight.mdsal</groupId> <artifactId>mdsal-binding-dom-codec-api</artifactId> @@ -95,11 +95,6 @@ <scope>provided</scope> </dependency> <dependency> - <groupId>org.opendaylight.netconf</groupId> - <artifactId>sal-netconf-connector</artifactId> - <scope>provided</scope> - </dependency> - <dependency> <groupId>org.opendaylight.mdsal</groupId> <artifactId>mdsal-singleton-common-api</artifactId> <scope>provided</scope> @@ -109,12 +104,62 @@ <artifactId>rfc6991-ietf-yang-types</artifactId> <scope>provided</scope> </dependency> + <dependency> + <groupId>org.opendaylight.mdsal.model</groupId> + <artifactId>ietf-topology</artifactId> + </dependency> + <dependency> + <groupId>org.opendaylight.mdsal</groupId> + <artifactId>mdsal-common-api</artifactId> + </dependency> + <dependency> + <groupId>org.opendaylight.mdsal</groupId> + <artifactId>mdsal-dom-api</artifactId> + </dependency> + <dependency> + <groupId>org.opendaylight.mdsal</groupId> + <artifactId>mdsal-binding-api</artifactId> + </dependency> + <dependency> + <groupId>org.opendaylight.netconf.model</groupId> + <artifactId>rfc5277</artifactId> + </dependency> + <dependency> + <groupId>org.opendaylight.yangtools</groupId> + <artifactId>yang-data-codec-binfmt</artifactId> + </dependency> <!-- begin for testing --> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <scope>test</scope> - </dependency> + </dependency> + <dependency> + <groupId>org.opendaylight.yangtools</groupId> + <artifactId>yang-model-util</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.opendaylight.yangtools</groupId> + <artifactId>yang-parser-api</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.opendaylight.yangtools</groupId> + <artifactId>yang-data-codec-gson</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.opendaylight.yangtools</groupId> + <artifactId>yang-data-codec-xml</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.opendaylight.netconf</groupId> + <artifactId>netconf-topology</artifactId> + <scope>test</scope> + </dependency> + <!-- end for testing --> </dependencies> @@ -125,87 +170,7 @@ <filtering>true</filtering> </resource> </resources> - <pluginManagement><plugins> - <plugin> - <groupId>org.opendaylight.yangtools</groupId> - <artifactId>yang-maven-plugin</artifactId> - <version>7.0.9</version> - <executions> - <execution> - <id>binding</id> - <phase>none</phase> - <goals> - <goal>generate-sources</goal> - </goals> - <configuration> - <inspectDependencies>true</inspectDependencies> - </configuration> - </execution> - </executions> - <dependencies> - <dependency> - <groupId>org.opendaylight.mdsal</groupId> - <artifactId>mdsal-binding-java-api-generator</artifactId> - <version>8.0.6</version> - <scope>compile</scope> - </dependency> - </dependencies> - </plugin> - </plugins> - </pluginManagement> <plugins> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <configuration> - <excludes> - <exclude>**/gen/**</exclude> - <exclude>**/generated-sources/**</exclude> - <exclude>**/yang-gen-sal/**</exclude> - <exclude>**/pax/**</exclude> - </excludes> - </configuration> - </plugin> - <plugin> - <artifactId>maven-enforcer-plugin</artifactId> - <version>3.0.0</version> - <executions> - <execution> - <id>enforce-maven</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <requireJavaVersion> - <version>11</version> - </requireJavaVersion> - <requireMavenVersion> - <version>[3.5.0,)</version> - </requireMavenVersion> - </rules> - </configuration> - </execution> - <execution> - <id>enforce-banned-dependencies</id> - <goals> - <goal>enforce</goal> - </goals> - <configuration> - <rules> - <bannedDependencies> - <message>Please always use mockito-core instead of mockito-all (see https://bugs.opendaylight.org/show_bug.cgi?id=7662), and spotbugs:annotations instead of findbugs:annotations</message> - <excludes> - <exclude>org.mockito:mockito-all</exclude> - <exclude>com.google.code.findbugs:annotations</exclude> - </excludes> - </bannedDependencies> - </rules> - <fail>false</fail> - </configuration> - </execution> - </executions> - </plugin> </plugins> </build> </project> 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 4431865e2..61381554b 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 @@ -30,7 +30,6 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovider 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.qnames.Onf14DevicemanagerQNames; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.yangspecs.CoreModel14; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; @@ -131,6 +130,7 @@ public class Onf14DomNetworkElement implements NetworkElement, PerformanceDataPr @Override public void deregister() { + faultService.removeAllCurrentProblemsOfNode(netconfDomAccessor.getNodeId()); performanceManager.deRegistration(netconfDomAccessor.getNodeId()); } @@ -146,7 +146,17 @@ public class Onf14DomNetworkElement implements NetworkElement, PerformanceDataPr } @Override - public void warmstart() {} + public void warmstart() { + int problems = removeAllCurrentProblemsOfNode(); + log.debug("Removed all {} problems from database at deregistration for {}", problems, netconfDomAccessor.getNodeId().getValue()); + } + + /** + * Remove all entries from list + */ + public int removeAllCurrentProblemsOfNode() { + return faultService.removeAllCurrentProblemsOfNode(netconfDomAccessor.getNodeId()); + } @Override public Optional<NetconfAccessor> getAcessor() { 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 6f7b24a19..557ddbca7 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 @@ -85,6 +85,7 @@ public class Onf14DomEquipmentManager { List<Inventory> inventoryList = new ArrayList<>(); for (String uuid : getTopLevelEquipment(controlConstruct)) { Optional<NormalizedNode> equipment = readEquipmentInstance(netconfDomAccessor, uuid); + log.info("Equipment Data is - {}", equipment.get().prettyTree()); MapEntryNode equipmentEntry = (MapEntryNode) equipment.get(); if (equipmentEntry != null) { collectEquipment(inventoryList, equipmentEntry, null, EQUIPMENTROOTLEVEL); diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/AirInterface20.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/AirInterface20.java index 19dab4be9..f6f2fac74 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/AirInterface20.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/AirInterface20.java @@ -21,12 +21,10 @@ */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.yangspecs; -import com.google.common.collect.Sets; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Optional; -import org.eclipse.jdt.annotation.NonNull; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovider.InternalDataModelSeverity; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.interfaces.TechnologySpecificPacKeys; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.pm.PerformanceDataAirInterface; @@ -43,10 +41,8 @@ import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; 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; @@ -70,8 +66,7 @@ public class AirInterface20 extends YangModule { this.coreModel14 = coreModel14; } - public FaultData readAllCurrentProblems(FaultData resultList, - List<TechnologySpecificPacKeys> airInterfaceList) { + public FaultData readAllCurrentProblems(FaultData resultList, List<TechnologySpecificPacKeys> airInterfaceList) { int idxStart; // Start index for debug messages @@ -107,20 +102,24 @@ public class AirInterface20 extends YangModule { // model YangInstanceIdentifier layerProtocolIID = coreModel14.getLayerProtocolIId(ltpUuid, localId); - - @NonNull - AugmentationIdentifier airInterfacePacIID = - YangInstanceIdentifier.AugmentationIdentifier.create(Sets.newHashSet(getQName("air-interface-pac"))); - - InstanceIdentifierBuilder augmentedAirInterfacePacIID = - YangInstanceIdentifier.builder(layerProtocolIID).node(airInterfacePacIID); - + InstanceIdentifierBuilder airInterfacePacIID = + YangInstanceIdentifier.builder(layerProtocolIID).node(getQName("air-interface-pac")); + + // @NonNull + // AugmentationIdentifier airInterfacePacIID = + // YangInstanceIdentifier.AugmentationIdentifier.create(Sets.newHashSet(getQName("air-interface-pac"))); + // + // InstanceIdentifierBuilder augmentedAirInterfacePacIID = + // YangInstanceIdentifier.builder(layerProtocolIID).node(airInterfacePacIID); + // // reading all the current-problems list for this specific LTP and LP Optional<NormalizedNode> airInterfacePacDataOpt = - netconfDomAccessor.readDataNode(LogicalDatastoreType.OPERATIONAL, augmentedAirInterfacePacIID.build()); - + netconfDomAccessor.readDataNode(LogicalDatastoreType.OPERATIONAL, airInterfacePacIID.build()); if (airInterfacePacDataOpt.isPresent()) { - AugmentationNode airInterfacePacData = (AugmentationNode) airInterfacePacDataOpt.get(); + LOG.info("Air Interface = {}", airInterfacePacDataOpt.get().prettyTree()); + } + if (airInterfacePacDataOpt.isPresent()) { + ContainerNode airInterfacePacData = (ContainerNode) airInterfacePacDataOpt.get(); MapNode airInterfaceCurrentProblemsList = (MapNode) airInterfacePacData.childByArg(new NodeIdentifier(getQName("current-problem-list"))); if (airInterfaceCurrentProblemsList != null) { @@ -151,42 +150,44 @@ public class AirInterface20 extends YangModule { // model YangInstanceIdentifier layerProtocolIID = coreModel14.getLayerProtocolIId(ltpUuid, localId); - - @NonNull - AugmentationIdentifier airInterfacePacIID = YangInstanceIdentifier.AugmentationIdentifier - .create(Sets.newHashSet(Onf14DevicemanagerQNames.AIR_INTERFACE_PAC)); - - InstanceIdentifierBuilder augmentedAirInterfacePacIID = - YangInstanceIdentifier.builder(layerProtocolIID).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)); + InstanceIdentifierBuilder airInterfacePacIID = + YangInstanceIdentifier.builder(layerProtocolIID).node(getQName("air-interface-pac")); + + // @NonNull + // AugmentationIdentifier airInterfacePacIID = YangInstanceIdentifier.AugmentationIdentifier + // .create(Sets.newHashSet(Onf14DevicemanagerQNames.AIR_INTERFACE_PAC)); + // + // InstanceIdentifierBuilder augmentedAirInterfacePacIID = + // YangInstanceIdentifier.builder(layerProtocolIID).node(airInterfacePacIID); + // + // // reading historical performance list for this specific LTP and LP + Optional<NormalizedNode> airInterfacePacDataOpt = + netconfDomAccessor.readDataNode(LogicalDatastoreType.OPERATIONAL, airInterfacePacIID.build()); + LOG.debug("Performance Data = {}", airInterfacePacDataOpt.get().body()); + if (airInterfacePacDataOpt.isPresent()) { + ContainerNode airInterfacePacData = (ContainerNode) 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 res; - } else { - LOG.debug("DBRead Id {} empty CurrentProblemList", ltpUuid); } } - } - } return null; } diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/Alarms10.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/Alarms10.java index 3f92eb0ca..efbcab158 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/Alarms10.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/Alarms10.java @@ -21,7 +21,6 @@ */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.yangspecs; -import com.google.common.collect.Sets; import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -44,10 +43,8 @@ import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; 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; @@ -132,21 +129,22 @@ public class Alarms10 extends YangModule { YangInstanceIdentifier alarmsPacIID = YangInstanceIdentifier.builder().node(coreModel14.getControlConstructQName()).build(); - - @NonNull - AugmentationIdentifier alarmsContainerIID = - YangInstanceIdentifier.AugmentationIdentifier.create(Sets.newHashSet(ALARM_PAC)); - - InstanceIdentifierBuilder augmentedAlarmsIID = - YangInstanceIdentifier.builder(alarmsPacIID).node(alarmsContainerIID); - - // reading all the alarms + InstanceIdentifierBuilder alarmsContainerIID = YangInstanceIdentifier.builder(alarmsPacIID).node(ALARM_PAC); + + // @NonNull + // AugmentationIdentifier alarmsContainerIID = + // YangInstanceIdentifier.AugmentationIdentifier.create(Sets.newHashSet(ALARM_PAC)); + // + // InstanceIdentifierBuilder augmentedAlarmsIID = + // YangInstanceIdentifier.builder(alarmsPacIID).node(alarmsContainerIID); + // + // // reading all the alarms Optional<NormalizedNode> alarms = - this.getNetconfDomAccessor().readDataNode(LogicalDatastoreType.OPERATIONAL, augmentedAlarmsIID.build()); + this.getNetconfDomAccessor().readDataNode(LogicalDatastoreType.OPERATIONAL, alarmsContainerIID.build()); FaultData resultList = new FaultData(); if (alarms.isPresent()) { - AugmentationNode alarmsDataNode = (AugmentationNode) alarms.get(); + ContainerNode alarmsDataNode = (ContainerNode) alarms.get(); ContainerNode alarmsContainer = (ContainerNode) alarmsDataNode.childByArg(new NodeIdentifier(ALARM_PAC)); ContainerNode currentAlarmsContainer = (ContainerNode) alarmsContainer.childByArg(new NodeIdentifier(CURRENT_ALARMS)); @@ -167,6 +165,7 @@ public class Alarms10 extends YangModule { } } return resultList; + } public boolean isSupported(Capabilities capabilites) { diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/CoreModel14.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/CoreModel14.java index 5a2b5772b..f2990a07d 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/CoreModel14.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/CoreModel14.java @@ -68,11 +68,6 @@ public class CoreModel14 extends YangModule { return module.getRevision().get().toString(); } - @Override - public QName getQName(String localName) { - return QName.create(module, localName); - } - public QName getControlConstructQName() { return CONTROL_CONSTRUCT; } diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/EthernetContainer20.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/EthernetContainer20.java index 81aec9dd0..cbc76bc7f 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/EthernetContainer20.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/EthernetContainer20.java @@ -21,12 +21,10 @@ */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.yangspecs; -import com.google.common.collect.Sets; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Optional; -import org.eclipse.jdt.annotation.NonNull; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovider.InternalDataModelSeverity; 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.Debug; @@ -40,10 +38,9 @@ import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; 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; @@ -74,20 +71,20 @@ public class EthernetContainer20 extends YangModule { // constructing the IID needs the augmentation exposed by the // ethernet-container-2-0 model YangInstanceIdentifier layerProtocolIID = coreModel14.getLayerProtocolIId(ltpUuid, localId); - - @NonNull - AugmentationIdentifier ethernetContainerIID = YangInstanceIdentifier.AugmentationIdentifier - .create(Sets.newHashSet(getQName("ethernet-container-pac"))); - - InstanceIdentifierBuilder augmentedEthernetContainerConfigurationIID = - YangInstanceIdentifier.builder(layerProtocolIID).node(ethernetContainerIID); - - // reading all the current-problems list for this specific LTP and LP + InstanceIdentifierBuilder ethernetContainerIID = YangInstanceIdentifier.builder(layerProtocolIID).node(getQName("ethernet-container-pac")); +// @NonNull +// AugmentationIdentifier ethernetContainerIID = YangInstanceIdentifier.AugmentationIdentifier +// .create(Sets.newHashSet(getQName("ethernet-container-pac"))); +// +// InstanceIdentifierBuilder augmentedEthernetContainerConfigurationIID = +// YangInstanceIdentifier.builder(layerProtocolIID).node(ethernetContainerIID); +// +// // reading all the current-problems list for this specific LTP and LP Optional<NormalizedNode> etherntContainerConfigurationOpt = netconfDomAccessor - .readDataNode(LogicalDatastoreType.OPERATIONAL, augmentedEthernetContainerConfigurationIID.build()); + .readDataNode(LogicalDatastoreType.OPERATIONAL, ethernetContainerIID.build()); if (etherntContainerConfigurationOpt.isPresent()) { - AugmentationNode etherntContainerConfiguration = (AugmentationNode) etherntContainerConfigurationOpt.get(); + ContainerNode etherntContainerConfiguration = (ContainerNode) etherntContainerConfigurationOpt.get(); MapNode ethernetContainerCurrentProblemsList = (MapNode) etherntContainerConfiguration .childByArg(new NodeIdentifier(getQName("current-problem-list"))); if (ethernetContainerCurrentProblemsList != null) { diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/WireInterface20.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/WireInterface20.java index c97449d69..977fdb19c 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/WireInterface20.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/impl/yangspecs/WireInterface20.java @@ -21,12 +21,10 @@ */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.yangspecs; -import com.google.common.collect.Sets; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Optional; -import org.eclipse.jdt.annotation.NonNull; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.dataprovider.InternalDataModelSeverity; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.interfaces.TechnologySpecificPacKeys; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.dom.impl.qnames.Onf14DevicemanagerQNames; @@ -41,10 +39,9 @@ import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; 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; @@ -74,20 +71,21 @@ public class WireInterface20 extends YangModule { // constructing the IID needs the augmentation exposed by the wire-interface-2-0 // model YangInstanceIdentifier layerProtocolIID = coreModel14.getLayerProtocolIId(ltpUuid, localId); - - @NonNull - AugmentationIdentifier wireInterfacePacIID = YangInstanceIdentifier.AugmentationIdentifier - .create(Sets.newHashSet(Onf14DevicemanagerQNames.WIRE_INTERFACE_PAC)); - - InstanceIdentifierBuilder augmentedWireInterfaceConfigurationIID = - YangInstanceIdentifier.builder(layerProtocolIID).node(wireInterfacePacIID); + InstanceIdentifierBuilder wireInterfacePacIID = + YangInstanceIdentifier.builder(layerProtocolIID).node(Onf14DevicemanagerQNames.WIRE_INTERFACE_PAC); + // @NonNull + // YangInstanceIdentifier wireInterfacePacIID = + // YangInstanceIdentifier.of(Onf14DevicemanagerQNames.WIRE_INTERFACE_PAC); + // + // InstanceIdentifierBuilder augmentedWireInterfaceConfigurationIID = + // YangInstanceIdentifier.builder(layerProtocolIID).node(wireInterfacePacIID.getLastPathArgument()); // reading all the current-problems list for this specific LTP and LP - Optional<NormalizedNode> wireInterfaceConfigurationOpt = netconfDomAccessor - .readDataNode(LogicalDatastoreType.OPERATIONAL, augmentedWireInterfaceConfigurationIID.build()); + Optional<NormalizedNode> wireInterfaceConfigurationOpt = + netconfDomAccessor.readDataNode(LogicalDatastoreType.OPERATIONAL, wireInterfacePacIID.build()); if (wireInterfaceConfigurationOpt.isPresent()) { - AugmentationNode wireInterfaceConfiguration = (AugmentationNode) wireInterfaceConfigurationOpt.get(); + ContainerNode wireInterfaceConfiguration = (ContainerNode) wireInterfaceConfigurationOpt.get(); MapNode wireInterfaceCurrentProblemsList = (MapNode) wireInterfaceConfiguration .childByArg(new NodeIdentifier(Onf14DevicemanagerQNames.WIRE_INTERFACE_CURRENT_PROBLEMS_LIST)); if (wireInterfaceCurrentProblemsList != null) { @@ -111,8 +109,7 @@ public class WireInterface20 extends YangModule { return resultList; } - public FaultData readAllCurrentProblems(FaultData resultList, - List<TechnologySpecificPacKeys> wireInterfaceList) { + public FaultData readAllCurrentProblems(FaultData resultList, List<TechnologySpecificPacKeys> wireInterfaceList) { int idxStart; // Start index for debug messages diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14ToInternalDataModel2.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14ToInternalDataModel2.java index b889f39c9..01809bbb7 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14ToInternalDataModel2.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/dom/TestOnf14ToInternalDataModel2.java @@ -71,6 +71,7 @@ public class TestOnf14ToInternalDataModel2 extends Mockito { Onf14DomToInternalDataModel model = new Onf14DomToInternalDataModel(); ContainerNode cn = (ContainerNode) Onf14DomTestUtils.getNormalizedNodeFromJson(); + System.out.println("Container Node = "+cn); MapNode equipmentMap = (MapNode) cn.getChildByArg(new NodeIdentifier(QName.create(qnm, "equipment"))); List<Inventory> inventoryList = new ArrayList<Inventory>(); diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/Onf14DomTestUtils.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/Onf14DomTestUtils.java index ec0013cf4..a810373ea 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/Onf14DomTestUtils.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/Onf14DomTestUtils.java @@ -38,16 +38,19 @@ import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizationResult; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter; + import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactory; import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier; import org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream; import org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter; -import org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult; +import org.opendaylight.yangtools.yang.data.impl.schema.NormalizationResultHolder; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; -import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference; + //import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference; //Yangtool 8.0 +import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference; import org.xml.sax.SAXException; public class Onf14DomTestUtils { @@ -88,7 +91,7 @@ public class Onf14DomTestUtils { loadTextFile(new File(Onf14DomTestUtils.class.getResource("/ControlConstruct-data-test.json").toURI())); final JsonReader reader = new JsonReader(new StringReader(streamAsString)); - NormalizedNodeResult result = new NormalizedNodeResult(); + NormalizationResultHolder result = new NormalizationResultHolder(); // StreamWriter which attaches NormalizedNode under parent final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); @@ -99,7 +102,7 @@ public class Onf14DomTestUtils { } // Finally build the node - transformedInput = result.getResult(); + transformedInput = result.getResult().data(); return transformedInput; } @@ -116,7 +119,7 @@ public class Onf14DomTestUtils { */ final XMLStreamReader reader = UntrustedXML.createXMLStreamReader(resourceAsStream); - final NormalizedNodeResult result = new NormalizedNodeResult(); + final NormalizationResultHolder result = new NormalizationResultHolder(); final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); final XmlParserStream xmlParser = XmlParserStream.create(streamWriter, hwContainerSchema); @@ -125,7 +128,7 @@ public class Onf14DomTestUtils { xmlParser.flush(); xmlParser.close(); - transformedInput = result.getResult(); + transformedInput = result.getResult().data(); return transformedInput; } @@ -142,7 +145,7 @@ public class Onf14DomTestUtils { */ final XMLStreamReader reader = UntrustedXML.createXMLStreamReader(resourceAsStream); - final NormalizedNodeResult result = new NormalizedNodeResult(); + final NormalizationResultHolder result = new NormalizationResultHolder(); final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); final XmlParserStream xmlParser = XmlParserStream.create(streamWriter, hwContainerSchema); @@ -151,7 +154,7 @@ public class Onf14DomTestUtils { xmlParser.flush(); xmlParser.close(); - transformedInput = result.getResult(); + transformedInput = result.getResult().data(); return transformedInput; } diff --git a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/TestYangParserUtil.java b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/TestYangParserUtil.java index 004f08da3..514ea51f9 100644 --- a/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/TestYangParserUtil.java +++ b/sdnr/wt/devicemanager-onap/onf14/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/util/TestYangParserUtil.java @@ -33,11 +33,11 @@ import java.util.Iterator; import java.util.ServiceLoader; import java.util.Set; import java.util.stream.Collectors; - import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.YangConstants; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; +import org.opendaylight.yangtools.yang.model.api.stmt.FeatureSet; import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation; import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; import org.opendaylight.yangtools.yang.parser.api.YangParser; @@ -98,7 +98,7 @@ public final class TestYangParserUtil { final Set<QName> supportedFeatures, final Collection<? extends SchemaSourceRepresentation> sources) { final YangParser parser = PARSER_FACTORY.createParser(config); if (supportedFeatures != null) { - parser.setSupportedFeatures(supportedFeatures); + parser.setSupportedFeatures(FeatureSet.of(supportedFeatures)); } try { |