Skip to content
Snippets Groups Projects
Commit c958dfe8 authored by abat's avatar abat
Browse files

Merge into master from pull request #266:

pull request for deleteDevice method (https://github.com/floodlight/floodlight/pull/266)
parents 3e605340 72afdd5d
No related branches found
No related tags found
No related merge requests found
......@@ -1508,6 +1508,23 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
others);
}
}
/**
* method to delete a given device, remove all entities first and then
* finally delete the device itself.
* @param device
*/
protected void deleteDevice(Device device) {
ArrayList<Entity> emptyToKeep = new ArrayList<Entity>();
for (Entity entity : device.getEntities()) {
this.removeEntity(entity, device.getEntityClass(),
device.getDeviceKey(), emptyToKeep);
}
if (!deviceMap.remove(device.getDeviceKey(), device)) {
logger.info("device map does not have this device -" +
device.toString());
}
}
private EnumSet<DeviceField> getEntityKeys(Long macAddress,
Short vlan,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment