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