[ONOS-8152] Adding new event in NetconfDeviceListener for netconf connection re-establishment after idle-timeout/session close received from device

Change-Id: I13f9ba181a0512b7496b76c04df67d38a9cea7df
This commit is contained in:
Anurag Chadha 2022-02-09 21:12:55 +05:30 committed by Thomas Vachuska
parent 909b958bff
commit dbffc043a6
2 changed files with 11 additions and 0 deletions

View File

@ -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) {
}
}

View File

@ -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);
}