missingDevices.remove(ndb.getIpAddress());
}
}
}
for (String missing : missingDevices) {
final NetworkDeviceBean ndb = deviceMap.get(missing);
ndb.setPresent(false);
dao.updateDevice(ndb, cfg.getUSN());
}
for (NetworkDeviceBean ndb : newDevices) {
NetworkDeviceBean existingDevice = dao.findDevice(ndb);
if (existingDevice != null) {
ndb.setActivated(existingDevice.isActivated());
} else {
ndb.setActivated(true);
}
final NetworkDeviceBean enabled = dao.updateDevice(ndb, cfg.getUSN());
deviceMap.put(enabled.getIpAddress(), enabled);
}
}