mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-02 19:47:52 +00:00
Opensync AP State Tables row parsing delete handling fix.
This commit is contained in:
@@ -281,8 +281,8 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
||||
extIntegrationInterface
|
||||
.wifiInetStateDbTableUpdate(ovsdbDao.getOpensyncAPInetState(isCf.join(), key, ovsdbClient), key);
|
||||
|
||||
CompletableFuture<TableUpdates> vsCf = ovsdbClient
|
||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiVifStateDbTable + "_" + key,
|
||||
CompletableFuture<TableUpdates> vsCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
|
||||
OvsdbDao.wifiVifStateDbTable + "_" + key,
|
||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiVifStateDbTable,
|
||||
new MonitorRequest(new MonitorSelect(true, true, true, true)))),
|
||||
new MonitorCallback() {
|
||||
@@ -292,13 +292,10 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
||||
// ovsdbDao.getOpensyncAPVIFState(tableUpdates,
|
||||
// key, ovsdbClient), key);
|
||||
List<OpensyncAPVIFState> vifsToDelete = new ArrayList<OpensyncAPVIFState>();
|
||||
for (Entry<String, TableUpdate> tableUpdate : tableUpdates.getTableUpdates()
|
||||
.entrySet()) {
|
||||
for (Entry<String, TableUpdate> tableUpdate : tableUpdates.getTableUpdates().entrySet()) {
|
||||
|
||||
for (Entry<UUID, RowUpdate> rowUpdate : tableUpdate.getValue().getRowUpdates()
|
||||
.entrySet()) {
|
||||
if (rowUpdate.getValue().getOld() != null
|
||||
&& rowUpdate.getValue().getNew() == null) {
|
||||
for (Entry<UUID, RowUpdate> rowUpdate : tableUpdate.getValue().getRowUpdates().entrySet()) {
|
||||
if (rowUpdate.getValue().getOld() != null && rowUpdate.getValue().getNew() == null) {
|
||||
Row row = rowUpdate.getValue().getOld();
|
||||
String ifName = row.getStringColumn("if_name");
|
||||
String ssid = row.getStringColumn("ssid");
|
||||
@@ -306,14 +303,21 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
||||
toBeDeleted.setSsid(ssid);
|
||||
toBeDeleted.setIfName(ifName);
|
||||
vifsToDelete.add(toBeDeleted);
|
||||
tableUpdate.getValue().getRowUpdates().entrySet().remove(rowUpdate);
|
||||
tableUpdate.getValue().getRowUpdates().remove(rowUpdate.getKey());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (tableUpdate.getValue().getRowUpdates().values().isEmpty()) {
|
||||
tableUpdates.getTableUpdates().remove(tableUpdate.getKey());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!vifsToDelete.isEmpty()) {
|
||||
extIntegrationInterface.wifiVIFStateDbTableDelete(vifsToDelete, key);
|
||||
}
|
||||
if (tableUpdates.getTableUpdates().entrySet().isEmpty())
|
||||
extIntegrationInterface.wifiVIFStateDbTableUpdate(
|
||||
ovsdbDao.getOpensyncAPVIFState(tableUpdates, key, ovsdbClient), key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user