@Override public void processRemovedChanges(YangInstanceIdentifier identifier, String topologyId) { if (identifier != null) { LOGGER.trace("Processing removeChanges"); Map<YangInstanceIdentifier, UnderlayItem> items = topoStoreProvider.getTopologyStore(topologyId).getUnderlayItems(); UnderlayItem underlayItem = items.remove(identifier); if (null != underlayItem) { manager.removeOverlayItem(underlayItem.getOverlayItem()); } } }
@Override public void processCreatedChanges( YangInstanceIdentifier identifier, UnderlayItem createdEntry, String topologyId) { if (createdEntry != null) { LOGGER.trace("Processing createdChnages"); Map<YangInstanceIdentifier, UnderlayItem> items = topoStoreProvider.getTopologyStore(topologyId).getUnderlayItems(); items.put(identifier, createdEntry); OverlayItem item = wrapUnderlayItem(createdEntry); createdEntry.setOverlayItem(item); manager.addOverlayItem(item); } }
@Override public void processUpdatedChanges( YangInstanceIdentifier identifier, UnderlayItem updatedEntry, String topologyId) { if (updatedEntry != null) { LOGGER.trace("Processing updateChanges"); Map<YangInstanceIdentifier, UnderlayItem> items = topoStoreProvider.getTopologyStore(topologyId).getUnderlayItems(); UnderlayItem oldItem = items.get(identifier); OverlayItem item = oldItem.getOverlayItem(); Queue<UnderlayItem> underlayItems = new ConcurrentLinkedQueue<>(); underlayItems.add(updatedEntry); item.setUnderlayItems(underlayItems); updatedEntry.setOverlayItem(item); items.put(identifier, updatedEntry); manager.updateOverlayItem(item); } }