use of org.opendaylight.controller.md.sal.binding.api.DataObjectModification in project lispflowmapping by opendaylight.
the class VppEndpointListener method handleChange.
private ListenableFuture<Void> handleChange(DataObjectModification modification) {
Collection<DataObjectModification<? extends DataObject>> modifiedChildren = modification.getModifiedChildren();
List<ListenableFuture<KeyedInstanceIdentifier<Node, NodeKey>>> processingTasks = new ArrayList<>();
for (DataObjectModification modifiedNode : modifiedChildren) {
final Node newOrModifiedNode = (Node) modifiedNode.getDataAfter();
ListenableFuture<KeyedInstanceIdentifier<Node, NodeKey>> processingTask = processNode(newOrModifiedNode);
Futures.addCallback(processingTask, new FutureCallback<KeyedInstanceIdentifier<Node, NodeKey>>() {
@Override
public void onSuccess(@Nullable KeyedInstanceIdentifier<Node, NodeKey> kiiToNode) {
hostInformationManager.addHostRelatedInfo(newOrModifiedNode.getNodeId().getValue(), LispAddressUtil.toRloc(vppNodeReader.rlocIpOfNode(kiiToNode)));
}
@Override
public void onFailure(Throwable throwable) {
LOG.debug("Couldn't process {}", newOrModifiedNode.getNodeId().getValue());
}
}, MoreExecutors.directExecutor());
processingTasks.add(processNode(newOrModifiedNode));
}
return Futures.immediateFuture(null);
}
Aggregations