mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-02 03:28:00 +00:00
Compare commits
2 Commits
WIFI-7888-
...
WIFI-7514-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
665cf5f3b8 | ||
|
|
284f9bcf37 |
@@ -514,12 +514,12 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
|
||||
|
||||
if (rowUpdate.getNew() == null) {
|
||||
// delete
|
||||
Map<String, String> rowMap = new HashMap<>();
|
||||
|
||||
rowUpdate.getOld().getColumns().entrySet().forEach(c -> OvsdbDao.translateDhcpFpValueToString(c, rowMap));
|
||||
|
||||
delete.add(rowMap);
|
||||
// delete
|
||||
} else if (rowUpdate.getOld() == null) {
|
||||
// insert
|
||||
Map<String, String> rowMap = new HashMap<>();
|
||||
@@ -528,15 +528,13 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
|
||||
insert.add(rowMap);
|
||||
} else {
|
||||
|
||||
// insert
|
||||
// update
|
||||
Map<String, String> rowMap = new HashMap<>();
|
||||
|
||||
rowUpdate.getOld().getColumns().putAll(rowUpdate.getNew().getColumns());
|
||||
rowUpdate.getOld().getColumns().entrySet().forEach(c -> OvsdbDao.translateDhcpFpValueToString(c, rowMap));
|
||||
|
||||
update.add(rowMap);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -560,7 +558,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
|
||||
});
|
||||
|
||||
awCf.join();
|
||||
extIntegrationInterface.dhcpLeasedIpDbTableUpdate(ovsdbDao.getInitialOpensyncDhcpLeasedIp(awCf.join(), key, ovsdbClient), key, RowUpdateOperation.INIT);
|
||||
|
||||
}
|
||||
|
||||
@@ -680,7 +678,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(ovsdbDao.getInitialOpensyncWifiAssociatedClients(acCf.join(), key, ovsdbClient), key);
|
||||
|
||||
}
|
||||
|
||||
@@ -152,6 +152,11 @@ public class OvsdbDao extends OvsdbDaoBase {
|
||||
OvsdbClient ovsdbClient) {
|
||||
return ovsdbMonitor.getInitialOpensyncWifiAssociatedClients(join, key, ovsdbClient);
|
||||
}
|
||||
|
||||
public List<Map<String, String>> getInitialOpensyncDhcpLeasedIp(TableUpdates join, String key,
|
||||
OvsdbClient ovsdbClient) {
|
||||
return ovsdbMonitor.getInitialOpensyncDhcpLeasedIp(join, key, ovsdbClient);
|
||||
}
|
||||
|
||||
public Collection<? extends OpensyncAPInetState> getOpensyncApInetStateForRowUpdate(RowUpdate rowUpdate, String key,
|
||||
OvsdbClient ovsdbClient) {
|
||||
|
||||
@@ -83,6 +83,33 @@ public class OvsdbMonitor extends OvsdbDaoBase {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
List<Map<String, String>> getInitialOpensyncDhcpLeasedIp(TableUpdates tableUpdates, String apId,
|
||||
OvsdbClient ovsdbClient) {
|
||||
LOG.debug("getInitialOpensyncDhcpLeasedIp:");
|
||||
List<Map<String, String>> ret = new ArrayList<>();
|
||||
try {
|
||||
LOG.debug(dhcpLeasedIpDbTable + "_" + apId + " initial monitor table state received {}",
|
||||
tableUpdates);
|
||||
|
||||
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
||||
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
|
||||
|
||||
if (rowUpdate.getNew() != null) {
|
||||
|
||||
Map<String, String> rowMap = new HashMap<>();
|
||||
|
||||
rowUpdate.getNew().getColumns().entrySet().forEach(c -> OvsdbDao.translateDhcpFpValueToString(c, rowMap));
|
||||
|
||||
ret.add(rowMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw (e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
List<OpensyncAPInetState> getOpensyncApInetStateForRowUpdate(RowUpdate rowUpdate, String apId,
|
||||
OvsdbClient ovsdbClient) {
|
||||
|
||||
Reference in New Issue
Block a user