- @Override
- public void onDataChanged(AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
-
- /*
- * TerminationPoint notifications with OVSDB augmentations
- * vSwitch ports. Iterate through the list of new ports.
- */
- for (Entry<InstanceIdentifier<?>, DataObject> entry : change.getCreatedData().entrySet()) {
- if (entry.getValue() instanceof OvsdbTerminationPointAugmentation) {
- OvsdbTerminationPointAugmentation ovsdbTp = (OvsdbTerminationPointAugmentation) entry.getValue();
- InstanceIdentifier<OvsdbTerminationPointAugmentation> ovsdbTpIid = (InstanceIdentifier<OvsdbTerminationPointAugmentation>) entry.getKey();
- OvsdbBridgeAugmentation ovsdbBridge = getOvsdbBridgeFromTerminationPoint(ovsdbTpIid, dataBroker);
- processOvsdbBridge(ovsdbBridge, ovsdbTp, ovsdbTpIid);
- }
- }
-
- /*
- * Updates
- */
- for (Entry<InstanceIdentifier<?>, DataObject> entry : change.getUpdatedData().entrySet()) {
- if (entry.getValue() instanceof OvsdbTerminationPointAugmentation) {
- OvsdbTerminationPointAugmentation ovsdbTp = (OvsdbTerminationPointAugmentation) entry.getValue();
- InstanceIdentifier<OvsdbTerminationPointAugmentation> ovsdbTpIid = (InstanceIdentifier<OvsdbTerminationPointAugmentation>) entry.getKey();
- OvsdbBridgeAugmentation ovsdbBridge = getOvsdbBridgeFromTerminationPoint(ovsdbTpIid, dataBroker);
- processOvsdbBridge(ovsdbBridge, ovsdbTp, ovsdbTpIid);
- }
- }
+ /*
+ * When vSwitch is deleted, we loose data in operational DS to determine Iid of
+ * corresponding NodeId.
+ */
+ private static final Map<InstanceIdentifier<OvsdbTerminationPointAugmentation>, NodeId> NODE_ID_BY_TERMIN_POINT =
+ new HashMap<>();