mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-02 19:47:52 +00:00
Adding locationId for ClientSessions. Throttling table state changes for FW Flash
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user