@Test public void testRemovePort() { assertThat(provider.discoverers.entrySet(), hasSize(2)); deviceListener.event(new DeviceEvent(DeviceEvent.Type.PORT_ADDED, dev3, new DefaultPort(dev3, portNumber3, true))); assertThat(provider.discoverers.entrySet(), hasSize(3)); deviceListener.event(new DeviceEvent(DeviceEvent.Type.PORT_REMOVED, dev3, new DefaultPort(dev3, portNumber3, true))); assertThat(provider.discoverers.entrySet(), hasSize(3)); }
private void removePort(Port port) { if (port.element() instanceof Device) { Device d = (Device) port.element(); LinkDiscovery ld = discoverers.get(d.id()); if (ld != null) { ld.removePort(port.number()); } } else { log.warn("Attempted to remove non-Device port", port); } }
NetworkConfigLinksProvider extends AbstractProvider implements ProbedLinkProvider { private void removePort(Port port) { if (port.element() instanceof Device) { Device d = (Device) port.element(); LinkDiscovery ld = discoverers.get(d.id()); if (ld != null) { ld.removePort(port.number()); } } else { log.warn("Attempted to remove non-Device port", port); } } }
NetworkConfigLinksProvider extends AbstractProvider implements ProbedLinkProvider { private void removePort(Port port) { if (port.element() instanceof Device) { Device d = (Device) port.element(); LinkDiscovery ld = discoverers.get(d.id()); if (ld != null) { ld.removePort(port.number()); } } else { log.warn("Attempted to remove non-Device port", port); } } NetworkConfigLinksProvider(); }
NetworkConfigLinksProvider extends AbstractProvider implements ProbedLinkProvider { private void removePort(Port port) { if (port.element() instanceof Device) { Device d = (Device) port.element(); LinkDiscovery ld = discoverers.get(d.id()); if (ld != null) { ld.removePort(port.number()); } } else { log.warn("Attempted to remove non-Device port", port); } } NetworkConfigLinksProvider();  }
NetworkConfigLinksProvider extends AbstractProvider implements ProbedLinkProvider { private void removePort(Port port) { if (port.element() instanceof Device) { Device d = (Device) port.element(); LinkDiscovery ld = discoverers.get(d.id()); if (ld != null) { ld.removePort(port.number()); } } else { log.warn("Attempted to remove non-Device port", port); } } NetworkConfigLinksProvider();   }