Bump to yangtools-2.0.0 and odlparent-3.0.2
[unimgr.git] / impl / src / main / java / org / opendaylight / unimgr / mef / nrp / impl / AbstractNodeHandler.java
index 5805a64b2e32a4d0f67b515944b8aa57f4ce2902..2a32f41b0828ed122cb699cfced1cdf474d28b7c 100644 (file)
@@ -79,6 +79,7 @@ public class AbstractNodeHandler implements DataTreeChangeListener<Topology> {
                         .map(DataTreeModification::getRootNode)
                         .flatMap(topo -> topo.getModifiedChildren().stream())
                         .flatMap(node -> node.getModifiedChildren().stream())
+                        .filter(this::isNep)
                         .filter(this::checkIfUpdated)
                         .map(nep -> (OwnedNodeEdgePoint) nep.getDataAfter())
                         .collect(Collectors.toList());
@@ -88,6 +89,7 @@ public class AbstractNodeHandler implements DataTreeChangeListener<Topology> {
                 .map(DataTreeModification::getRootNode)
                 .flatMap(topo -> topo.getModifiedChildren().stream())
                 .flatMap(node -> node.getModifiedChildren().stream())
+                .filter(this::isNep)
                 .filter(this::checkIfDeleted)
                 .map(nep -> (OwnedNodeEdgePoint) nep.getDataBefore())
                 .collect(Collectors.toList());
@@ -115,6 +117,10 @@ public class AbstractNodeHandler implements DataTreeChangeListener<Topology> {
         });
     }
 
+    private boolean isNep(DataObjectModification dataObjectModificationNep) {
+        return OwnedNodeEdgePoint.class.isAssignableFrom(dataObjectModificationNep.getDataType());
+    }
+
     private boolean checkIfDeleted(DataObjectModification dataObjectModificationNep) {
         OwnedNodeEdgePoint b = (OwnedNodeEdgePoint) dataObjectModificationNep.getDataBefore();
         OwnedNodeEdgePoint a = (OwnedNodeEdgePoint) dataObjectModificationNep.getDataAfter();