/** * {@inheritDoc} */ @Override protected final void handleTree(TreeChangeContext<T> ctx, C ectx, DataTreeModification<T> change) { handleTreeNode(ctx, ectx, change.getRootNode()); } }
@Override public void remove(DataTreeModification<Evc> removedDataObject) { if (removedDataObject.getRootPath() != null && removedDataObject.getRootNode() != null) { log.info("evc {} deleted", removedDataObject.getRootNode().getIdentifier()); removeEvc(removedDataObject); } }
@Override public void add(DataTreeModification<Evc> newDataObject) { if (newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) { log.info("evc {} created", newDataObject.getRootNode().getIdentifier()); addEvc(newDataObject); } }
@Override public void update(DataTreeModification<Evc> modifiedDataObject) { if (modifiedDataObject.getRootPath() != null && modifiedDataObject.getRootNode() != null) { log.info("evc {} updated", modifiedDataObject.getRootNode().getIdentifier()); updateEvc(modifiedDataObject); } }
@Override public void update(DataTreeModification<FlowCapableNodeConnector> modifiedDataObject) { if (modifiedDataObject.getRootPath() != null && modifiedDataObject.getRootNode() != null) { log.info("node connector {} updated", modifiedDataObject.getRootNode().getIdentifier()); updateFlowCapableNodeConnector(modifiedDataObject); } }
@Override public void remove(DataTreeModification<FlowCapableNodeConnector> removedDataObject) { if (removedDataObject.getRootPath() != null && removedDataObject.getRootNode() != null) { log.info("node connector {} deleted", removedDataObject.getRootNode().getIdentifier()); removeFlowCapableNodeConnector(removedDataObject); } }
@Override public void update(final DataTreeModification<Node> modifiedDataObject) { if (modifiedDataObject.getRootPath() != null && modifiedDataObject.getRootNode() != null) { LOG.info("uni node {} updated", modifiedDataObject.getRootNode().getIdentifier()); final UniUpdateCommand uniUpdateCmd = new UniUpdateCommand(dataBroker, modifiedDataObject); uniUpdateCmd.execute(); } }
@Override public void add(final DataTreeModification<Link> newDataObject) { if (newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) { LOG.info("evc link {} created", newDataObject.getRootNode().getIdentifier()); final EvcAddCommand evcAddCmd = new EvcAddCommand(dataBroker, newDataObject); evcAddCmd.execute(); } }
@Override public void add(final DataTreeModification<Node> newDataObject) { if (newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) { LOG.info("uni node {} created", newDataObject.getRootNode().getIdentifier()); final UniAddCommand uniAddCmd = new UniAddCommand(dataBroker, newDataObject); uniAddCmd.execute(); } }
@Override public void remove(final DataTreeModification<Node> removedDataObject) { if (removedDataObject.getRootPath() != null && removedDataObject.getRootNode() != null) { LOG.info("uni node {} deleted", removedDataObject.getRootNode().getIdentifier()); final UniRemoveCommand uniRemoveCmd = new UniRemoveCommand(dataBroker, removedDataObject); uniRemoveCmd.execute(); } }
@Override public void add(final DataTreeModification<Node> newDataObject) { if (newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) { LOG.info("ovs node {} created", newDataObject.getRootNode().getIdentifier()); final OvsNodeAddCommand ovsNodeAddCmd = new OvsNodeAddCommand(dataBroker, newDataObject); ovsNodeAddCmd.execute(); } }
@Override public void remove(final DataTreeModification<Link> removedDataObject) { if (removedDataObject.getRootPath() != null && removedDataObject.getRootNode() != null) { LOG.info("evc link {} deleted", removedDataObject.getRootNode().getIdentifier()); final EvcRemoveCommand evcRemovedCmd = new EvcRemoveCommand(dataBroker, removedDataObject); evcRemovedCmd.execute(); } }
private void updateFlowCapableNodeConnector(DataTreeModification<FlowCapableNodeConnector> modifiedDataObject) { try { FlowCapableNodeConnector original = modifiedDataObject.getRootNode().getDataBefore(); FlowCapableNodeConnector update = modifiedDataObject.getRootNode().getDataAfter(); String dpnFromNodeConnectorId = getDpnIdFromNodeConnector(modifiedDataObject); handleNodeConnectorUpdated(dataBroker, dpnFromNodeConnectorId, original, update); } catch (final Exception e) { log.error("Update node connector failed !", e); } }
@Override public void update(final DataTreeModification<Link> modifiedDataObject) { if (modifiedDataObject.getRootPath() != null && modifiedDataObject.getRootNode() != null) { LOG.info("evc link {} updated", modifiedDataObject.getRootNode().getIdentifier()); final EvcUpdateCommand evcUpdateCmd = new EvcUpdateCommand(dataBroker, modifiedDataObject); evcUpdateCmd.execute(); } } }
public static <K, V extends DataObject> void updateCachedDao(final SimpleCachedDao<K, V> valueCachedDao, final K key, final DataTreeModification<V> change) { final V value = change.getRootNode().getDataAfter(); valueCachedDao.update(key, value); }
@Override public void onDataTreeChanged(Collection<DataTreeModification<T>> changes) { changes.forEach(modif -> { DataObjectModification<T> rootNode = modif.getRootNode(); ModificationType modificationType = rootNode.getModificationType(); if (modificationType == modificationForFutureSet) { LOG.debug("{} in OPER DS: {}", modificationType.name(), iid.getRootIdentifier()); unregisterOnTrue(future.set(null)); } }); }
private void removeFlowCapableNodeConnector(DataTreeModification<FlowCapableNodeConnector> removedDataObject) { try { FlowCapableNodeConnector data = removedDataObject.getRootNode().getDataBefore(); String dpnFromNodeConnectorId = getDpnIdFromNodeConnector(removedDataObject); handleNodeConnectorRemoved(dataBroker, dpnFromNodeConnectorId, data); } catch (final Exception e) { log.error("Remove node connector failed !", e); } }
@Override public void onDataTreeChanged(final Collection<DataTreeModification<Node>> changes) { logger.info("onDataTreeChanged called"); for (final DataTreeModification<Node> change : changes) { final DataObjectModification<Node> changeDiff = change.getRootNode(); if (changeDiff.getModificationType().equals( org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType.SUBTREE_MODIFIED)) { logger.info("There is a sub-tree modified operation performed"); extractOpenFlowStatistics(changeDiff.getDataAfter()); } } }
@Override public void onDataTreeChanged(@Nonnull final Collection<DataTreeModification<EndpointForwardingTemplateBySubnet>> collection) { for (DataTreeModification<EndpointForwardingTemplateBySubnet> change : collection) { LOG.trace("received modification: {} -> {}", change.getRootPath(), change.getRootNode().getModificationType()); // update cached dao final InstanceIdentifier<EndpointForwardingTemplateBySubnet> changePath = change.getRootPath().getRootIdentifier(); final IpPrefix changeKey = changePath.firstKeyOf(EndpointForwardingTemplateBySubnet.class).getIpPrefix(); SxpListenerUtil.updateCachedDao(templateCachedDao, changeKey, change); final EndpointForwardingTemplateBySubnet epForwardingTemplate = change.getRootNode().getDataAfter(); processWithEPTemplates(epForwardingTemplate); } }
private void processAddedConnector(final DataTreeModification<T> modification) { final InstanceIdentifier<T> identifier = modification.getRootPath().getRootIdentifier(); InstanceIdentifier<NodeConnector> nodeConnectorInstanceId =identifier.firstIdentifierOf(NodeConnector.class); if (compareIITail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) { FlowCapableNodeConnector flowConnector = (FlowCapableNodeConnector) modification.getRootNode().getDataAfter(); if (!isPortDown(flowConnector)) { notifyNodeConnectorAppeared(nodeConnectorInstanceId, flowConnector); } else { iiToDownFlowCapableNodeConnectors.put(nodeConnectorInstanceId, flowConnector); } } }