@Test public void removeDevice() { connectDevice(DID1, SW1); connectDevice(DID2, SW2); assertEquals("incorrect device count", 2, service.getDeviceCount()); admin.removeDevice(DID1); assertNull("device should not be found", service.getDevice(DID1)); assertNotNull("device should be found", service.getDevice(DID2)); assertEquals("incorrect device count", 1, service.getDeviceCount()); }
@Override public void removeDevice(DeviceId deviceId) { checkNotNull(deviceId, DEVICE_ID_NULL); DeviceEvent event = store.removeDevice(deviceId); if (event != null) { log.info("Device {} administratively removed", deviceId); post(event); } }
DeviceManager extends AbstractListenerProviderRegistry<DeviceEvent, DeviceListener, DeviceProvider, DeviceProviderService> implements DeviceService, DeviceAdminService, DeviceProviderRegistry { @Override public void removeDevice(DeviceId deviceId) { checkNotNull(deviceId, DEVICE_ID_NULL); DeviceEvent event = store.removeDevice(deviceId); if (event != null) { log.info("Device {} administratively removed", deviceId); post(event); } } }
DeviceManager extends AbstractListenerProviderRegistry<DeviceEvent, DeviceListener, DeviceProvider, DeviceProviderService> implements DeviceService, DeviceAdminService, DeviceProviderRegistry { @Override public void removeDevice(DeviceId deviceId) { checkNotNull(deviceId, DEVICE_ID_NULL); DeviceEvent event = store.removeDevice(deviceId); if (event != null) { log.info("Device {} administratively removed", deviceId); post(event); } }  }
DeviceManager extends AbstractListenerProviderRegistry<DeviceEvent, DeviceListener, DeviceProvider, DeviceProviderService> implements DeviceService, DeviceAdminService, DeviceProviderRegistry { @Override public void removeDevice(DeviceId deviceId) { checkNotNull(deviceId, DEVICE_ID_NULL); DeviceEvent event = store.removeDevice(deviceId); if (event != null) { log.info("Device {} administratively removed", deviceId); post(event); } }  @Activate void activate(); @Deactivate void deactivate(); @Override int getDeviceCount(); @Override Iterable<Device> getDevices(); @Override Iterable<Device> getAvailableDevices(); @Override Device getDevice(DeviceId deviceId); @Override MastershipRole getRole(DeviceId deviceId); @Override List<Port> getPorts(DeviceId deviceId); @Override List<PortStatistics> getPortStatistics(DeviceId deviceId); @Override List<PortStatistics> getPortDeltaStatistics(DeviceId deviceId); @Override Port getPort(DeviceId deviceId, PortNumber portNumber); @Override boolean isAvailable(DeviceId deviceId); @Override void removeDevice(DeviceId deviceId); @Override void changePortState(DeviceId deviceId, PortNumber portNumber,
                                boolean enable); @Override Iterable<Device> getDevices(Type type); @Override Iterable<Device> getAvailableDevices(Type type); }
DeviceManager extends AbstractListenerProviderRegistry<DeviceEvent, DeviceListener, DeviceProvider, DeviceProviderService> implements DeviceService, DeviceAdminService, DeviceProviderRegistry { @Override public void removeDevice(DeviceId deviceId) { checkNotNull(deviceId, DEVICE_ID_NULL); DeviceEvent event = store.removeDevice(deviceId); if (event != null) { log.info("Device {} administratively removed", deviceId); post(event); } }  @Activate void activate(); @Deactivate void deactivate(); @Override int getDeviceCount(); @Override Iterable<Device> getDevices(); @Override Iterable<Device> getAvailableDevices(); @Override Device getDevice(DeviceId deviceId); @Override MastershipRole getRole(DeviceId deviceId); @Override List<Port> getPorts(DeviceId deviceId); @Override List<PortStatistics> getPortStatistics(DeviceId deviceId); @Override List<PortStatistics> getPortDeltaStatistics(DeviceId deviceId); @Override Port getPort(DeviceId deviceId, PortNumber portNumber); @Override boolean isAvailable(DeviceId deviceId); @Override void removeDevice(DeviceId deviceId); @Override void changePortState(DeviceId deviceId, PortNumber portNumber,
                                boolean enable); @Override Iterable<Device> getDevices(Type type); @Override Iterable<Device> getAvailableDevices(Type type);  }