- private void createEventSource(final InstanceIdentifier<?> key, final Node node) {
- final Optional<DOMMountPoint> netconfMount = domMounts.getMountPoint(domMountPath(node.getNodeId()));
- final Optional<MountPoint> bindingMount = bindingMounts.getMountPoint(key);
-
- if(netconfMount.isPresent() && bindingMount.isPresent()) {
-
- final NetconfEventSource netconfEventSource =
- new NetconfEventSource(node, streamMap, netconfMount.get(), publishService, bindingMount.get());
- final EventSourceRegistration<NetconfEventSource> registration = eventSourceRegistry.registerEventSource(netconfEventSource);
- eventSourceRegistration.putIfAbsent(key, registration);
-
+ private void nodeRemoved(final InstanceIdentifier<?> key){
+ Preconditions.checkNotNull(key);
+ LOG.info("Netconf event source [{}] is removing...", key.toString());
+ NetconfEventSourceRegistration nesr = registrationMap.remove(key);
+ if(nesr != null){
+ nesr.close();