- private void createEventSource(final InstanceIdentifier<?> key, final Node node) {
- final Optional<DOMMountPoint> netconfMount = domMounts.getMountPoint(domMountPath(node.getNodeId()));
-
- if(netconfMount.isPresent()) {
- final NetconfEventSource netconfEventSource =
- new NetconfEventSource(node, streamMap, netconfMount.get(), publishService);
- final EventSourceRegistration<NetconfEventSource> registration = eventSourceRegistry.registerEventSource(netconfEventSource);
- LOG.info("Event source {} has been registered",node.getNodeId().getValue());
- 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();