Skip to content
Snippets Groups Projects
Commit 72afdd5d authored by Sandeep Hebbani's avatar Sandeep Hebbani
Browse files

method to delete a device removing all entities, updating secondary map...

method to delete a device removing all entities, updating secondary map indices first and then delete from devicemap.
parent 5c643e7d
No related branches found
No related tags found
No related merge requests found
......@@ -1513,6 +1513,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