Adding locationId for ClientSessions. Throttling table state changes for FW Flash

This commit is contained in:
Mike Hansen
2020-07-24 18:47:16 -04:00
parent 1d6f980c30
commit 57a87d345e
3 changed files with 28 additions and 7 deletions

View File

@@ -2313,7 +2313,14 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
return;
}
if ((wifiAssociatedClients == null) || wifiAssociatedClients.isEmpty() || (apId == null)) {
Equipment ce = getCustomerEquipment(apId);
if (ce == null) {
LOG.debug("Cannot get customer Equipment for {}", apId);
return;
}
if ((wifiAssociatedClients == null) || wifiAssociatedClients.isEmpty()) {
return;
}
@@ -2353,12 +2360,15 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
clientSession = new ClientSession();
clientSession.setCustomerId(customerId);
clientSession.setEquipmentId(equipmentId);
clientSession.setLocationId(ce.getLocationId());
clientSession.setMacAddress(new MacAddress(opensyncWifiAssociatedClients.getMac()));
ClientSessionDetails clientSessionDetails = new ClientSessionDetails();
clientSession.setDetails(clientSessionDetails);
clientSession = clientServiceInterface.updateSession(clientSession);
}
clientSession.setLocationId(ce.getLocationId());
ClientSessionDetails clientSessionDetails = clientSession.getDetails();
clientSessionDetails.setHostname(clientDetails.getHostName());
clientSessionDetails.setIsReassociation(isReassociation);

View File

@@ -602,17 +602,28 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
@Override
public String processFirmwareFlash(String apId, String firmwareVersion, String username) {
try {
OvsdbSession session = ovsdbSessionMapInterface.getSession(apId);
OvsdbClient ovsdbClient = session.getOvsdbClient();
try {
ovsdbClient.cancelMonitor(OvsdbDao.awlanNodeDbTable + "_" + apId).join();
ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + apId).join();
ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_" + apId).join();
ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_delete_" + apId).join();
ovsdbClient.cancelMonitor(OvsdbDao.wifiInetStateDbTable + "_" + apId).join();
ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable + "_" + apId).join();
ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable + "_delete_" + apId).join();
ovsdbDao.configureFirmwareFlash(session.getOvsdbClient(), apId, firmwareVersion, username);
} catch (Exception e) {
LOG.error("Failed to initialize firmware download to " + apId + " " + e.getLocalizedMessage());
return "Failed to initialize firmware download to " + apId + " " + e.getLocalizedMessage();
LOG.error("Failed to flash firmware for " + apId + " " + e.getLocalizedMessage());
return "Failed to flash firmware for " + apId + " " + e.getLocalizedMessage();
} finally {
monitorOvsdbStateTables(ovsdbClient, apId);
}
LOG.debug("Initialized firmware download to " + apId);
return "Initialized firmware download to " + apId;
LOG.debug("Flashed Firmware for AP {} to {} ", apId, firmwareVersion);
return "Flashed Firmware for AP " + apId + " to " + firmwareVersion;
}
}

View File

@@ -3074,7 +3074,7 @@ public class OvsdbDao {
operations.add(new Delete(wifiStatsConfigDbTable));
CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations);
OperationResult[] result = fResult.get(ovsdbTimeoutSec, TimeUnit.SECONDS);
OperationResult[] result = fResult.get(240, TimeUnit.SECONDS);
if (LOG.isDebugEnabled()) {
LOG.debug("Removed all existing config from {}:", wifiStatsConfigDbTable);