ONOS-3575 Netconf connection exceptions refactoring and port number in netconf-cfg.json

Change-Id: I46771a1a3ce99b25c2aecd7ba1838f9f1614e789
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 73c435f..2a19514 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
@@ -16,6 +16,7 @@
 
 package org.onosproject.netconf;
 
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -30,14 +31,14 @@
      * @param request the XML containing the request to the server.
      * @return device running configuration
      */
-    String get(String request);
+    String get(String request) throws IOException;
 
     /**
      * Executes an RPC to the server.
      * @param request the XML containing the RPC for the server.
      * @return Server response or ERROR
      */
-    String doRPC(String request);
+    String doRPC(String request) throws IOException;
 
     /**
      * Retrives the specified configuration.
@@ -45,7 +46,7 @@
      * @param targetConfiguration the type of configuration to retrieve.
      * @return specified configuration.
      */
-    String getConfig(String targetConfiguration);
+    String getConfig(String targetConfiguration) throws IOException;
 
     /**
      * Retrives part of the specivied configuration based on the filterSchema.
@@ -55,7 +56,8 @@
      *                                  elements we are interested in
      * @return device running configuration.
      */
-    String getConfig(String targetConfiguration, String configurationFilterSchema);
+    String getConfig(String targetConfiguration, String configurationFilterSchema)
+            throws IOException;
 
     /**
      * Retrives part of the specified configuration based on the filterSchema.
@@ -64,7 +66,7 @@
      * @return true if the configuration was edited correctly
      */
 
-    boolean editConfig(String newConfiguration);
+    boolean editConfig(String newConfiguration) throws IOException;
 
     /**
      * Copies the new configuration, an Url or a complete configuration xml tree
@@ -75,7 +77,8 @@
      * @param newConfiguration    configuration to set
      * @return true if the configuration was copied correctly
      */
-    boolean copyConfig(String targetConfiguration, String newConfiguration);
+    boolean copyConfig(String targetConfiguration, String newConfiguration)
+            throws IOException;
 
     /**
      * Deletes part of the specified configuration based on the filterSchema.
@@ -83,28 +86,28 @@
      * @param targetConfiguration the name of the configuration to delete
      * @return true if the configuration was copied correctly
      */
-    boolean deleteConfig(String targetConfiguration);
+    boolean deleteConfig(String targetConfiguration) throws IOException;
 
     /**
      * Locks the candidate configuration.
      *
      * @return true if successful.
      */
-    boolean lock();
+    boolean lock() throws IOException;
 
     /**
      * Unlocks the candidate configuration.
      *
      * @return true if successful.
      */
-    boolean unlock();
+    boolean unlock() throws IOException;
 
     /**
      * Closes the Netconf session with the device.
      * the first time it tries gracefully, then kills it forcefully
      * @return true if closed
      */
-    boolean close();
+    boolean close() throws IOException;
 
     /**
      * Gets the session ID of the Netconf session.