WIFI-1150 Network: The AP list table should also show the Connected/Disconnected status of every AP

This commit is contained in:
Lynn Shi
2020-12-03 15:05:00 -05:00
parent 4837b0e026
commit 6ece024535

View File

@@ -742,12 +742,39 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
} else {
LOG.warn("Cannot find ap {} in inventory", apId);
}
updateApDisconnectedStatus(apId);
} catch (Exception e) {
LOG.error("Exception when registering ap routing {}", apId, e);
}
}
private void updateApDisconnectedStatus(String apId) {
try {
Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId);
if (ce == null) {
LOG.debug("updateDisconnectedApStatus::Cannot get Equipment for AP {}", apId);
return;
}
Status statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(),
StatusDataType.EQUIPMENT_ADMIN);
if (statusRecord == null) {
LOG.debug("updateApDisconnectedStatus::Cannot get EQUIPMENT_ADMIN status for CustomerId {} or EquipmentId {} for AP {}",
ce.getCustomerId(), ce.getId(), apId);
return;
}
((EquipmentAdminStatusData) statusRecord.getDetails()).setStatusCode(StatusCode.error);
// Update the equipment admin status
statusRecord = statusServiceInterface.update(statusRecord);
} catch (Exception e) {
LOG.error("Exception in updateApDisconnectedStatus", e);
throw e;
}
}
@Override
public OpensyncAPConfig getApConfig(String apId) {
LOG.info("Retrieving config for AP {} ", apId);