TW-208: Table State Changes to EquipmentStatus

This commit is contained in:
Mike Hansen
2020-04-06 17:22:00 -04:00
parent 54dc0a3009
commit fc5a796413
2 changed files with 29 additions and 24 deletions

View File

@@ -143,7 +143,8 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
rowContents.put("if_name", newRow.getStringColumn("if_name")); rowContents.put("if_name", newRow.getStringColumn("if_name"));
rowContents.put("freq_band", rowContents.put("freq_band",
ovsdbDao.getSingleValueFromSet(newRow, "freq_band")); ovsdbDao.getSingleValueFromSet(newRow, "freq_band"));
rowContents.put("country", newRow.getStringColumn("country")); rowContents.put("country",
newRow.getSetColumn("country").toString());
extIntegrationInterface.wifiRadioStatusDbTableUpdate( extIntegrationInterface.wifiRadioStatusDbTableUpdate(
rowContents, key, rowContents, key,
@@ -257,7 +258,8 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
rowContents.put("if_name", newRow.getStringColumn("if_name")); rowContents.put("if_name", newRow.getStringColumn("if_name"));
rowContents.put("security", rowContents.put("security",
newRow.getMapColumn("security").toString()); newRow.getMapColumn("security").toString());
rowContents.put("bridge", newRow.getStringColumn("bridge")); rowContents.put("bridge", newRow.getSetColumn("bridge")
.iterator().next().toString());
Set<Long> channel = newRow.getSetColumn("channel"); Set<Long> channel = newRow.getSetColumn("channel");
if (!channel.isEmpty()) { if (!channel.isEmpty()) {
@@ -282,7 +284,8 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
rowContents.put("if_name", oldRow.getStringColumn("if_name")); rowContents.put("if_name", oldRow.getStringColumn("if_name"));
rowContents.put("security", rowContents.put("security",
oldRow.getMapColumn("security").toString()); oldRow.getMapColumn("security").toString());
rowContents.put("bridge", oldRow.getStringColumn("bridge")); rowContents.put("bridge", oldRow.getSetColumn("bridge")
.iterator().next().toString());
Set<Long> channel = oldRow.getSetColumn("channel"); Set<Long> channel = oldRow.getSetColumn("channel");
if (!channel.isEmpty()) { if (!channel.isEmpty()) {
rowContents.put("channel", rowContents.put("channel",
@@ -307,7 +310,8 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
rowContents.put("if_name", newRow.getStringColumn("if_name")); rowContents.put("if_name", newRow.getStringColumn("if_name"));
rowContents.put("security", rowContents.put("security",
newRow.getMapColumn("security").toString()); newRow.getMapColumn("security").toString());
rowContents.put("bridge", newRow.getStringColumn("bridge")); rowContents.put("bridge", newRow.getSetColumn("bridge")
.iterator().next().toString());
Set<Long> channel = newRow.getSetColumn("channel"); Set<Long> channel = newRow.getSetColumn("channel");
if (!channel.isEmpty()) { if (!channel.isEmpty()) {
rowContents.put("channel", rowContents.put("channel",
@@ -464,6 +468,7 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable); ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable);
ovsdbClient.cancelMonitor(OvsdbDao.wifiInetStateDbTable); ovsdbClient.cancelMonitor(OvsdbDao.wifiInetStateDbTable);
ovsdbClient.cancelMonitor(OvsdbDao.awlanNodeDbTable); ovsdbClient.cancelMonitor(OvsdbDao.awlanNodeDbTable);
ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable);
} catch (OvsdbClientException e) { } catch (OvsdbClientException e) {
LOG.warn("Could not cancel Monitor {}", e); LOG.warn("Could not cancel Monitor {}", e);
} }

View File

@@ -1385,7 +1385,7 @@ public class OvsdbDao {
com.vmware.ovsdb.protocol.operation.notation.Map<String, Integer> thresholds = com.vmware.ovsdb.protocol.operation.notation.Map com.vmware.ovsdb.protocol.operation.notation.Map<String, Integer> thresholds = com.vmware.ovsdb.protocol.operation.notation.Map
.of(thresholdMap); .of(thresholdMap);
if (!provisionedWifiStatsConfigs.containsKey("2.4G_device_null")) { if (!provisionedWifiStatsConfigs.containsKey("2.4G_device_on-chan")) {
// //
// updateColumns.put("channel_list", channels ); // updateColumns.put("channel_list", channels );
updateColumns.put("radio_type", new Atom<>("2.4G")); updateColumns.put("radio_type", new Atom<>("2.4G"));
@@ -1469,7 +1469,7 @@ public class OvsdbDao {
// //
} }
if (!provisionedWifiStatsConfigs.containsKey("5GL_client_null")) { if (!provisionedWifiStatsConfigs.containsKey("5GL_client_on-chan")) {
// //
updateColumns = new HashMap<>(); updateColumns = new HashMap<>();
// updateColumns.put("channel_list", channels ); // updateColumns.put("channel_list", channels );
@@ -1488,7 +1488,7 @@ public class OvsdbDao {
// //
} }
if (!provisionedWifiStatsConfigs.containsKey("5GU_client_null")) { if (!provisionedWifiStatsConfigs.containsKey("5GU_client_on-chan")) {
// //
updateColumns = new HashMap<>(); updateColumns = new HashMap<>();
// updateColumns.put("channel_list", channels ); // updateColumns.put("channel_list", channels );
@@ -1524,7 +1524,7 @@ public class OvsdbDao {
// //
} }
if (!provisionedWifiStatsConfigs.containsKey("2.4G_client_null")) { if (!provisionedWifiStatsConfigs.containsKey("2.4G_client_on-chan")) {
// //
updateColumns = new HashMap<>(); updateColumns = new HashMap<>();
// updateColumns.put("channel_list", channels ); // updateColumns.put("channel_list", channels );
@@ -1594,22 +1594,22 @@ public class OvsdbDao {
// //
} }
// for (String band : new String[] { "2.4G", "5GL", "5G" }) { for (String band : new String[] { "2.4G", "5GL", "5G" }) {
// if (!provisionedWifiStatsConfigs.containsKey(band + "_rssi_onChannel")) { if (!provisionedWifiStatsConfigs.containsKey(band + "_rssi_on-chan")) {
// updateColumns = new HashMap<>(); updateColumns = new HashMap<>();
// updateColumns.put("radio_type", new Atom<>(band)); updateColumns.put("radio_type", new Atom<>(band));
// updateColumns.put("reporting_interval", new Atom<>(120)); updateColumns.put("reporting_interval", new Atom<>(120));
// updateColumns.put("sampling_interval", new Atom<>(10)); updateColumns.put("sampling_interval", new Atom<>(10));
// updateColumns.put("report_type", new Atom<>("average")); updateColumns.put("report_type", new Atom<>("average"));
// updateColumns.put("stats_type", new Atom<>("rssi")); updateColumns.put("stats_type", new Atom<>("rssi"));
// updateColumns.put("survey_interval_ms", new Atom<>(0)); updateColumns.put("survey_interval_ms", new Atom<>(0));
// updateColumns.put("survey_type", new Atom<>("on-chan")); updateColumns.put("survey_type", new Atom<>("on-chan"));
// row = new Row(updateColumns); row = new Row(updateColumns);
//
// operations.add(new Update(wifiStatsConfigDbTable, row)); operations.add(new Insert(wifiStatsConfigDbTable, row));
// } }
//
// } }
if (!operations.isEmpty()) { if (!operations.isEmpty()) {
CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations); CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations);