[ONOS-6236] Adding retry mechanism when NETCONF device sends socket closed signal

Change-Id: Ie48e94f92ce745f3f65a352d80b7a74c2eceba04
diff --git a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfSession.java b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfSession.java
index e2d435d..31481d2 100644
--- a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfSession.java
+++ b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfSession.java
@@ -17,6 +17,8 @@
 package org.onosproject.netconf;
 
 import com.google.common.annotations.Beta;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
@@ -327,6 +329,19 @@
     void setDeviceCapabilities(List<String> capabilities);
 
     /**
+     * Checks the state of the underlying SSH session and connection
+     * and if necessary it reestablishes it.
+     * Should be implemented, providing a default here for retrocompatibility.
+     * @throws NetconfException when there is a problem in reestablishing
+     * the connection or the session to the device.
+     */
+
+    default void checkAndReestablish() throws NetconfException {
+        Logger log = LoggerFactory.getLogger(NetconfSession.class);
+        log.error("Not implemented/exposed by the underlying session implementation");
+    }
+
+    /**
      * Remove a listener from the underlying stream handler implementation.
      *
      * @param listener event listener.