private void connectInitialDevices() { for (OpenFlowSwitch sw : controller.getSwitches()) { try { listener.switchAdded(new Dpid(sw.getId())); } catch (Exception e) { LOG.warn("Failed initially adding {} : {}", sw.getStringId(), e.getMessage()); LOG.debug("Error details:", e); // disconnect to trigger switch-add later sw.disconnectSwitch(); } PortStatsCollector psc = new PortStatsCollector(sw, portStatsPollFrequency); psc.start(); collectors.put(new Dpid(sw.getId()), psc); } }