- Plugin sends Barrier msg every 100 async msgs (configurable thru config.ini: of...
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / core / internal / Controller.java
index f183b516de5fb4de0b60a79618664c58108209e1..9ec5b10ea8ee82624fd0f8702b33cc110e6c756a 100644 (file)
@@ -121,7 +121,6 @@ public class Controller implements IController, CommandProvider {
         this.switchStateListener = null;
         this.switchInstanceNumber = new AtomicInteger(0);
         registerWithOSGIConsole();
-
     }
 
     /**
@@ -146,7 +145,7 @@ public class Controller implements IController, CommandProvider {
             logger.error("Caught exception: " + ex + " during start");
         }
     }
-
+    
     /**
      * Function called by the dependency manager before the services
      * exported by the component are unregistered, this will be
@@ -246,6 +245,7 @@ public class Controller implements IController, CommandProvider {
             }
         }
         ((SwitchHandler) sw).stop();
+        sw = null;
     }
 
     private void notifySwitchAdded(ISwitch sw) {
@@ -264,8 +264,7 @@ public class Controller implements IController, CommandProvider {
         try {
             this.switchEvents.put(event);
         } catch (InterruptedException e) {
-            e.printStackTrace();
-            logger.error("Interrupt Exception " + e.toString());
+            logger.debug("SwitchEvent caught Interrupt Exception");
         }
     }
 
@@ -338,6 +337,28 @@ public class Controller implements IController, CommandProvider {
         }
     }
 
+    public void _controllerShowConnConfig(CommandInterpreter ci) {
+        String str = System.getProperty("secureChannelEnabled");
+        if ((str != null) && (str.trim().equalsIgnoreCase("true"))) {
+            ci.print("The Controller and Switch should communicate through TLS connetion.\n");
+
+            String keyStoreFile = System.getProperty("controllerKeyStore");
+            String trustStoreFile = System.getProperty("controllerTrustStore");
+            if ((keyStoreFile == null) || keyStoreFile.trim().isEmpty()) {
+                ci.print("controllerKeyStore not specified in ./configuration/config.ini\n");
+            } else {
+                ci.print("controllerKeyStore=" + keyStoreFile + "\n");
+            }
+            if ((trustStoreFile == null) || trustStoreFile.trim().isEmpty()) {
+                ci.print("controllerTrustStore not specified in ./configuration/config.ini\n");
+            } else {
+                ci.print("controllerTrustStore=" + trustStoreFile + "\n");
+            }
+        } else {
+            ci.print("The Controller and Switch should communicate through TCP connetion.\n");
+        }
+    }
+
     private void registerWithOSGIConsole() {
         BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass())
                 .getBundleContext();
@@ -348,9 +369,10 @@ public class Controller implements IController, CommandProvider {
     @Override
     public String getHelp() {
         StringBuffer help = new StringBuffer();
-        help.append("--Open Flow Controller --\n");
-        help.append("\tcontrollerShowSwitches\n");
-        help.append("\tcontrollerReset\n");
+        help.append("-- Open Flow Controller --\n");
+        help.append("\t controllerShowSwitches\n");
+        help.append("\t controllerReset\n");
+        help.append("\t controllerShowConnConfig\n");
         return help.toString();
     }
 }