+ if (notification.getEdit() == null) {
+ LOG.warn("unable to handle {} notificatin received - list of edit is null", ChangeNotification.QNAME);
+ return;
+ }
+ for (Edit edit : notification.getEdit()) {
+ // 1. Detect the org-openroadm-device object modified
+ switch (edit.getTarget().getTargetType().getSimpleName()) {
+ case "Ports":
+ LinkedList<PathArgument> path = new LinkedList<>();
+ path.addAll((Collection<? extends PathArgument>) edit.getTarget().getPathArguments());
+ InstanceIdentifier<Ports> portIID = (InstanceIdentifier<Ports>) InstanceIdentifier
+ .create(path);
+ String portName = InstanceIdentifier.keyOf(portIID).getPortName();
+ path.removeLast();
+ InstanceIdentifier<CircuitPacks> cpIID = (InstanceIdentifier<CircuitPacks>) InstanceIdentifier
+ .create(path);
+ String cpName = InstanceIdentifier.keyOf(cpIID).getCircuitPackName();
+ LOG.info("port {} of circruit-pack {} modified on device {}", portName, cpName, this.nodeId);
+ Mapping oldMapping = portMapping.getMapping(nodeId, cpName, portName);
+ if (oldMapping == null) {
+ return;
+ }
+ Runnable handleNetconfEvent = new Runnable() {
+ @Override
+ public void run() {
+ portMapping.updateMapping(nodeId, oldMapping);
+ LOG.info("{} : mapping data for {} updated", nodeId,
+ oldMapping.getLogicalConnectionPoint());
+ }
+ };
+ Thread thread = new Thread(handleNetconfEvent);
+ thread.start();
+ break;
+ default:
+ LOG.debug("modification of type {} not managed yet", edit.getTarget().getTargetType());
+ break;
+ }
+ }