package org.opendaylight.controller.protocol_plugin.openflow.core.internal;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
*
*/
public void stop() {
-
for (Iterator<Entry<Long, ISwitch>> it = switches.entrySet().iterator(); it
.hasNext();) {
Entry<Long, ISwitch> entry = it.next();
it.remove();
}
switchEventThread.interrupt();
- controllerIO.shutDown();
+ try {
+ controllerIO.shutDown();
+ } catch (IOException ex) {
+ logger.error("Caught exception: " + ex + " during stop");
+ }
}
/**
switchHandler.start();
logger.info(instanceName + " connected: " + sc.toString());
} catch (IOException e) {
- logger
- .error("Caught I/O Exception when trying to accept a new connection");
return;
}
}
}
}
((SwitchHandler) sw).stop();
+ sw = null;
}
private void notifySwitchAdded(ISwitch sw) {
try {
this.switchEvents.put(event);
} catch (InterruptedException e) {
- e.printStackTrace();
- logger.error("Interrupt Exception " + e.toString());
+ logger.debug("SwitchEvent caught Interrupt Exception");
}
}
}
}
+ 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();
help.append("--Open Flow Controller --\n");
help.append("\tcontrollerShowSwitches\n");
help.append("\tcontrollerReset\n");
+ help.append("\tcontrollerShowConnConfig\n");
return help.toString();
}
}