class TopologyLinkDataChangeHandler implements DataTreeChangeListener<Link> {

    @Override
    public void onDataTreeChanged(Collection<DataTreeModification<Link>> changes) {
        boolean isGraphUpdated = false;

        for (DataTreeModification<Link> change: changes) {
            DataObjectModification<Link> rootNode = change.getRootNode();
            switch (rootNode.getModificationType()) {
                case WRITE:
                    Link createdLink = rootNode.getDataAfter();
                    if (rootNode.getDataBefore() == null && !createdLink.getLinkId().getValue().contains("host")) {
                        isGraphUpdated = true;
                        LOG.debug("Graph is updated! Added Link {}", createdLink.getLinkId().getValue());
                    }
                    break;
                case DELETE:
                    Link deletedLink = rootNode.getDataBefore();
                    if (!deletedLink.getLinkId().getValue().contains("host")) {
                        isGraphUpdated = true;
                        LOG.debug("Graph is updated! Removed Link {}", deletedLink.getLinkId().getValue());
                        break;
                    }
                    break;
                default:
                    break;
            }
        }

        if (!isGraphUpdated) {
            return;
        }
        if (!networkGraphRefreshScheduled) {
            synchronized (this) {
                if (!networkGraphRefreshScheduled) {
                    topologyDataChangeEventProcessor.schedule(new TopologyDataChangeEventProcessor(), graphRefreshDelay,
                            TimeUnit.MILLISECONDS);
                    networkGraphRefreshScheduled = true;
                    LOG.debug("Scheduled Graph for refresh.");
                }
            }
        } else {
            LOG.debug("Already scheduled for network graph refresh.");
            threadReschedule = true;
        }
    }

    public  TopologyLinkDataChangeHandler(DataBroker dataBroker, NetworkGraphService networkGraphService);

}