- NodeId nodeId = toTopologyNodeId(getNodeKey(notification.getNodeConnectorRef()).getId());
- TerminationPoint point = toTerminationPoint(toTerminationPointId(notification.getId()),
- notification.getNodeConnectorRef());
- InstanceIdentifier<TerminationPoint> path = tpPath(nodeId, point.getKey().getTpId());
-
- DataModificationTransaction tx = dataService.beginTransaction();
- tx.putOperationalData(path, point);
- if ((fcncu.getState() != null && fcncu.getState().isLinkDown())
- || (fcncu.getConfiguration() != null && fcncu.getConfiguration().isPORTDOWN())) {
- removeAffectedLinks(tx, point.getTpId());
- }
- try {
- tx.commit().get();
- } catch (InterruptedException | ExecutionException e) {
- LOG.error("Topology state export not successful. ",e);
- }
+ processor.enqueueOperation(new TopologyOperation() {
+ @Override
+ public void applyOperation(final ReadWriteTransaction transaction) {
+ final NodeId nodeId = toTopologyNodeId(getNodeKey(notification.getNodeConnectorRef()).getId());
+ TerminationPoint point = toTerminationPoint(toTerminationPointId(notification.getId()),
+ notification.getNodeConnectorRef());
+ final InstanceIdentifier<TerminationPoint> path = tpPath(nodeId, point.getKey().getTpId());
+ transaction.merge(LogicalDatastoreType.OPERATIONAL, path, point, true);
+ if ((fcncu.getState() != null && fcncu.getState().isLinkDown())
+ || (fcncu.getConfiguration() != null && fcncu.getConfiguration().isPORTDOWN())) {
+ removeAffectedLinks(point.getTpId(), transaction);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "onNodeConnectorUpdated";
+ }
+ });