mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-03 20:17:53 +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
|
extIntegrationInterface
|
||||||
.wifiInetStateDbTableUpdate(ovsdbDao.getOpensyncAPInetState(isCf.join(), key, ovsdbClient), key);
|
.wifiInetStateDbTableUpdate(ovsdbDao.getOpensyncAPInetState(isCf.join(), key, ovsdbClient), key);
|
||||||
|
|
||||||
CompletableFuture<TableUpdates> vsCf = ovsdbClient
|
CompletableFuture<TableUpdates> vsCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
|
||||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiVifStateDbTable + "_" + key,
|
OvsdbDao.wifiVifStateDbTable + "_" + key,
|
||||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiVifStateDbTable,
|
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiVifStateDbTable,
|
||||||
new MonitorRequest(new MonitorSelect(true, true, true, true)))),
|
new MonitorRequest(new MonitorSelect(true, true, true, true)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
@@ -292,13 +292,10 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
// ovsdbDao.getOpensyncAPVIFState(tableUpdates,
|
// ovsdbDao.getOpensyncAPVIFState(tableUpdates,
|
||||||
// key, ovsdbClient), key);
|
// key, ovsdbClient), key);
|
||||||
List<OpensyncAPVIFState> vifsToDelete = new ArrayList<OpensyncAPVIFState>();
|
List<OpensyncAPVIFState> vifsToDelete = new ArrayList<OpensyncAPVIFState>();
|
||||||
for (Entry<String, TableUpdate> tableUpdate : tableUpdates.getTableUpdates()
|
for (Entry<String, TableUpdate> tableUpdate : tableUpdates.getTableUpdates().entrySet()) {
|
||||||
.entrySet()) {
|
|
||||||
|
|
||||||
for (Entry<UUID, RowUpdate> rowUpdate : tableUpdate.getValue().getRowUpdates()
|
for (Entry<UUID, RowUpdate> rowUpdate : tableUpdate.getValue().getRowUpdates().entrySet()) {
|
||||||
.entrySet()) {
|
if (rowUpdate.getValue().getOld() != null && rowUpdate.getValue().getNew() == null) {
|
||||||
if (rowUpdate.getValue().getOld() != null
|
|
||||||
&& rowUpdate.getValue().getNew() == null) {
|
|
||||||
Row row = rowUpdate.getValue().getOld();
|
Row row = rowUpdate.getValue().getOld();
|
||||||
String ifName = row.getStringColumn("if_name");
|
String ifName = row.getStringColumn("if_name");
|
||||||
String ssid = row.getStringColumn("ssid");
|
String ssid = row.getStringColumn("ssid");
|
||||||
@@ -306,14 +303,21 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
toBeDeleted.setSsid(ssid);
|
toBeDeleted.setSsid(ssid);
|
||||||
toBeDeleted.setIfName(ifName);
|
toBeDeleted.setIfName(ifName);
|
||||||
vifsToDelete.add(toBeDeleted);
|
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()) {
|
if (!vifsToDelete.isEmpty()) {
|
||||||
extIntegrationInterface.wifiVIFStateDbTableDelete(vifsToDelete, key);
|
extIntegrationInterface.wifiVIFStateDbTableDelete(vifsToDelete, key);
|
||||||
}
|
}
|
||||||
|
if (tableUpdates.getTableUpdates().entrySet().isEmpty())
|
||||||
extIntegrationInterface.wifiVIFStateDbTableUpdate(
|
extIntegrationInterface.wifiVIFStateDbTableUpdate(
|
||||||
ovsdbDao.getOpensyncAPVIFState(tableUpdates, key, ovsdbClient), key);
|
ovsdbDao.getOpensyncAPVIFState(tableUpdates, key, ovsdbClient), key);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user