@Test public void testRemoveDevice() throws Exception { ctrl.removeDevice(deviceInfo1.getDeviceId()); assertFalse("Incorrect device removal", ctrl.getDevicesMap().containsKey(deviceId1)); }
@Override public void removeDevice(DeviceId deviceId) { if (!netconfDeviceMap.containsKey(deviceId)) { log.warn("Device {} is not present", deviceId); for (NetconfDeviceListener l : netconfDeviceListeners) { l.deviceRemoved(deviceId); } } else { netconfDeviceMap.remove(deviceId); for (NetconfDeviceListener l : netconfDeviceListeners) { l.deviceRemoved(deviceId); } } }
NetconfControllerImpl implements NetconfController { @Override public void removeDevice(DeviceId deviceId) { if (!netconfDeviceMap.containsKey(deviceId)) { log.warn("Device {} is not present", deviceId); for (NetconfDeviceListener l : netconfDeviceListeners) { l.deviceRemoved(deviceId); } } else { netconfDeviceMap.remove(deviceId); for (NetconfDeviceListener l : netconfDeviceListeners) { l.deviceRemoved(deviceId); } } } }
NetconfControllerImpl implements NetconfController { @Override public void removeDevice(DeviceId deviceId) { if (!netconfDeviceMap.containsKey(deviceId)) { log.warn("Device {} is not present", deviceId); for (NetconfDeviceListener l : netconfDeviceListeners) { l.deviceRemoved(deviceId); } } else { netconfDeviceMap.remove(deviceId); for (NetconfDeviceListener l : netconfDeviceListeners) { l.deviceRemoved(deviceId); } } }  }
NetconfControllerImpl implements NetconfController { @Override public void removeDevice(DeviceId deviceId) { if (!netconfDeviceMap.containsKey(deviceId)) { log.warn("Device {} is not present", deviceId); for (NetconfDeviceListener l : netconfDeviceListeners) { l.deviceRemoved(deviceId); } } else { netconfDeviceMap.remove(deviceId); for (NetconfDeviceListener l : netconfDeviceListeners) { l.deviceRemoved(deviceId); } } }  @Activate void activate(ComponentContext context); @Deactivate void deactivate(); @Modified void modified(ComponentContext context); @Override void addDeviceListener(NetconfDeviceListener listener); @Override void removeDeviceListener(NetconfDeviceListener listener); @Override NetconfDevice getNetconfDevice(DeviceId deviceInfo); @Override NetconfDevice getNetconfDevice(IpAddress ip, int port); @Override NetconfDevice connectDevice(DeviceId deviceId); @Override void disconnectDevice(DeviceId deviceId, boolean remove); @Override void removeDevice(DeviceId deviceId); @Override Map<DeviceId, NetconfDevice> getDevicesMap(); @Override Set<DeviceId> getNetconfDevices(); }
NetconfControllerImpl implements NetconfController { @Override public void removeDevice(DeviceId deviceId) { if (!netconfDeviceMap.containsKey(deviceId)) { log.warn("Device {} is not present", deviceId); for (NetconfDeviceListener l : netconfDeviceListeners) { l.deviceRemoved(deviceId); } } else { netconfDeviceMap.remove(deviceId); for (NetconfDeviceListener l : netconfDeviceListeners) { l.deviceRemoved(deviceId); } } }  @Activate void activate(ComponentContext context); @Deactivate void deactivate(); @Modified void modified(ComponentContext context); @Override void addDeviceListener(NetconfDeviceListener listener); @Override void removeDeviceListener(NetconfDeviceListener listener); @Override NetconfDevice getNetconfDevice(DeviceId deviceInfo); @Override NetconfDevice getNetconfDevice(IpAddress ip, int port); @Override NetconfDevice connectDevice(DeviceId deviceId); @Override void disconnectDevice(DeviceId deviceId, boolean remove); @Override void removeDevice(DeviceId deviceId); @Override Map<DeviceId, NetconfDevice> getDevicesMap(); @Override Set<DeviceId> getNetconfDevices(); static final Logger log; }