diff --git a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceListener.java b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceListener.java index beae1bf1da..30c531802e 100644 --- a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceListener.java +++ b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceListener.java @@ -37,4 +37,12 @@ public interface NetconfDeviceListener { */ void deviceRemoved(DeviceId deviceId); + + /** + * Notifies that netconf connection with device is reestablished. + * + * @param deviceId the device with which netconf connection is reestablished + */ + default void netconfConnectionReestablished(DeviceId deviceId) { + } } diff --git a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java index 51e8913743..cbf12f4c23 100644 --- a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java +++ b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java @@ -815,6 +815,9 @@ public class NetconfControllerImpl implements NetconfController { if (device != null) { device.getSession().checkAndReestablish(); log.info("Connection with device {} was reestablished", did); + for (NetconfDeviceListener l : netconfDeviceListeners) { + l.netconfConnectionReestablished(did); + } } else { log.warn("The device {} is not in the system", did); }