commit | dbffc043a6dbcc02ce9c5cbc35dd34b3d0c156e1 | [log] [tgz] |
---|---|---|
author | Anurag Chadha <anurag.chadha@hsc.com> | Wed Feb 09 21:12:55 2022 +0530 |
committer | Thomas Vachuska <tom@opennetworking.org> | Thu Feb 10 22:30:18 2022 +0000 |
tree | ec138ae2c8d3d7f517de341ebdcc35f68fd5e781 | |
parent | 909b958bffe90f4d28ef0446340b8e41c630d24a [diff] |
[ONOS-8152] Adding new event in NetconfDeviceListener for netconf connection re-establishment after idle-timeout/session close received from device Change-Id: I13f9ba181a0512b7496b76c04df67d38a9cea7df
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 beae1bf..30c5318 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 @@ */ 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 51e8913..cbf12f4 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 @@ 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); }