mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-02 19:47:52 +00:00
Wifi_Stats_Config support all radio freq_bands, create on/off channel by radio types. Status update improvement for Wifi_Radio_State changes.
This commit is contained in:
@@ -96,10 +96,7 @@ import com.telecominfraproject.wlan.status.equipment.models.VLANStatusData;
|
|||||||
import com.telecominfraproject.wlan.status.equipment.report.models.ActiveBSSID;
|
import com.telecominfraproject.wlan.status.equipment.report.models.ActiveBSSID;
|
||||||
import com.telecominfraproject.wlan.status.equipment.report.models.ActiveBSSIDs;
|
import com.telecominfraproject.wlan.status.equipment.report.models.ActiveBSSIDs;
|
||||||
import com.telecominfraproject.wlan.status.equipment.report.models.ClientConnectionDetails;
|
import com.telecominfraproject.wlan.status.equipment.report.models.ClientConnectionDetails;
|
||||||
import com.telecominfraproject.wlan.status.equipment.report.models.EquipmentCapacityDetails;
|
|
||||||
import com.telecominfraproject.wlan.status.equipment.report.models.EquipmentPerRadioUtilizationDetails;
|
|
||||||
import com.telecominfraproject.wlan.status.equipment.report.models.OperatingSystemPerformance;
|
import com.telecominfraproject.wlan.status.equipment.report.models.OperatingSystemPerformance;
|
||||||
import com.telecominfraproject.wlan.status.equipment.report.models.RadioUtilizationReport;
|
|
||||||
import com.telecominfraproject.wlan.status.models.Status;
|
import com.telecominfraproject.wlan.status.models.Status;
|
||||||
import com.telecominfraproject.wlan.status.models.StatusCode;
|
import com.telecominfraproject.wlan.status.models.StatusCode;
|
||||||
import com.telecominfraproject.wlan.status.models.StatusDataType;
|
import com.telecominfraproject.wlan.status.models.StatusDataType;
|
||||||
@@ -1479,15 +1476,13 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
LOG.debug("tidStats {}", tidStats);
|
LOG.debug("tidStats {}", tidStats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (ssidStatistics.getBssid() != null && ssid != null
|
if ((ssidStatistics.getBssid() != null) && (ssid != null) && (client.getMacAddress() != null)) {
|
||||||
&& client.getMacAddress() != null) {
|
handleClientSessionUpdate(customerId, equipmentId, apId, locationId, clientReport.getChannel(),
|
||||||
handleClientSessionUpdate(customerId, equipmentId, apId, locationId,
|
clientReport.getBand(), clientReport.getTimestampMs(), client, report.getNodeID(),
|
||||||
clientReport.getChannel(), clientReport.getBand(), clientReport.getTimestampMs(),
|
ssidStatistics.getBssid(), ssid);
|
||||||
client, report.getNodeID(), ssidStatistics.getBssid(), ssid);
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.debug("Unabled to update client {} session {}", client, e);
|
LOG.debug("Unabled to update client {} session {}", client, e);
|
||||||
@@ -1908,6 +1903,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails());
|
ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails());
|
||||||
|
|
||||||
|
Status protocolStatus = null;
|
||||||
|
|
||||||
for (OpensyncAPRadioState radioState : radioStateTables) {
|
for (OpensyncAPRadioState radioState : radioStateTables) {
|
||||||
|
|
||||||
if (radioState.getFreqBand().equals(RadioType.UNSUPPORTED)) {
|
if (radioState.getFreqBand().equals(RadioType.UNSUPPORTED)) {
|
||||||
@@ -1944,35 +1941,22 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Status protocolStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.PROTOCOL);
|
protocolStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.PROTOCOL);
|
||||||
|
|
||||||
if (protocolStatus == null) {
|
if (protocolStatus != null) {
|
||||||
protocolStatus = new Status();
|
|
||||||
protocolStatus.setCustomerId(customerId);
|
|
||||||
protocolStatus.setEquipmentId(equipmentId);
|
|
||||||
protocolStatus.setStatusDataType(StatusDataType.PROTOCOL);
|
|
||||||
EquipmentProtocolStatusData protocolStatusData = new EquipmentProtocolStatusData();
|
|
||||||
protocolStatus.setDetails(protocolStatusData);
|
|
||||||
|
|
||||||
protocolStatus = statusServiceInterface.update(protocolStatus);
|
EquipmentProtocolStatusData protocolStatusData = (EquipmentProtocolStatusData) protocolStatus
|
||||||
|
.getDetails();
|
||||||
}
|
if (!protocolStatusData.getReportedCC()
|
||||||
|
.equals(CountryCode.valueOf(radioState.getCountry().toLowerCase()))) {
|
||||||
EquipmentProtocolStatusData protocolStatusData = (EquipmentProtocolStatusData) protocolStatus.getDetails();
|
protocolStatusData.setReportedCC(CountryCode.valueOf(radioState.getCountry().toLowerCase()));
|
||||||
protocolStatusData.setReportedCC(CountryCode.valueOf(radioState.getCountry().toLowerCase()));
|
protocolStatus.setDetails(protocolStatusData);
|
||||||
|
} else {
|
||||||
try {
|
protocolStatusData = null; // no change we will ignore at
|
||||||
Location location = locationServiceInterface.get(ce.getLocationId());
|
// the end
|
||||||
if (location != null) {
|
|
||||||
protocolStatusData.setSystemLocation(location.getName());
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.debug("Could not get location {} for customer {} equipment {}", ce.getLocationId(),
|
|
||||||
ce.getCustomerId(), ce.getId());
|
|
||||||
}
|
|
||||||
protocolStatus.setDetails(protocolStatusData);
|
|
||||||
|
|
||||||
protocolStatus = statusServiceInterface.update(protocolStatus);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ce = equipmentServiceInterface.getByInventoryIdOrNull(apId);
|
ce = equipmentServiceInterface.getByInventoryIdOrNull(apId);
|
||||||
@@ -1992,6 +1976,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
ce = equipmentServiceInterface.update(ce);
|
ce = equipmentServiceInterface.update(ce);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (protocolStatus != null) {
|
||||||
|
statusServiceInterface.update(protocolStatus);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -2133,8 +2121,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
List<ActiveBSSID> bssidList = statusDetails.getActiveBSSIDs();
|
List<ActiveBSSID> bssidList = statusDetails.getActiveBSSIDs();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bssidList.clear();
|
bssidList.clear();
|
||||||
|
|
||||||
statusDetails.setActiveBSSIDs(bssidList);
|
statusDetails.setActiveBSSIDs(bssidList);
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ public interface ConnectusOvsdbClientInterface {
|
|||||||
String validationCode);
|
String validationCode);
|
||||||
|
|
||||||
String processFlashFirmware(String apId, String firmwareVersion);
|
String processFlashFirmware(String apId, String firmwareVersion);
|
||||||
|
|
||||||
String closeSession(String apId);
|
String closeSession(String apId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
ConnectionCallback connectionCallback = new ConnectionCallback() {
|
ConnectionCallback connectionCallback = new ConnectionCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void connected(OvsdbClient ovsdbClient) {
|
public void connected(OvsdbClient ovsdbClient) {
|
||||||
|
|
||||||
|
LOG.info("MJH {}", ovsdbClient.getConnectionInfo());
|
||||||
String remoteHost = ovsdbClient.getConnectionInfo().getRemoteAddress().getHostAddress();
|
String remoteHost = ovsdbClient.getConnectionInfo().getRemoteAddress().getHostAddress();
|
||||||
int localPort = ovsdbClient.getConnectionInfo().getLocalPort();
|
int localPort = ovsdbClient.getConnectionInfo().getLocalPort();
|
||||||
String subjectDn = null;
|
String subjectDn = null;
|
||||||
@@ -97,7 +99,7 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
// with the serialNumber and using it as a key (equivalent
|
// with the serialNumber and using it as a key (equivalent
|
||||||
// of KDC unique qrCode)
|
// of KDC unique qrCode)
|
||||||
String key = clientCn + "_" + connectNodeInfo.serialNumber;
|
String key = clientCn + "_" + connectNodeInfo.serialNumber;
|
||||||
ConnectusOvsdbClient.this.ovsdbSessionMapInterface.newSession(key, ovsdbClient);
|
ovsdbSessionMapInterface.newSession(key, ovsdbClient);
|
||||||
extIntegrationInterface.apConnected(key, connectNodeInfo);
|
extIntegrationInterface.apConnected(key, connectNodeInfo);
|
||||||
|
|
||||||
// push configuration to AP
|
// push configuration to AP
|
||||||
@@ -105,8 +107,7 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
monitorOvsdbStateTables(ovsdbClient, key);
|
monitorOvsdbStateTables(ovsdbClient, key);
|
||||||
|
|
||||||
LOG.info("ovsdbClient connected from {} on port {} key {} ", remoteHost, localPort, key);
|
LOG.info("ovsdbClient connected from {} on port {} key {} ", remoteHost, localPort, key);
|
||||||
LOG.info("ovsdbClient connectedClients = {}",
|
LOG.info("ovsdbClient connectedClients = {}", ovsdbSessionMapInterface.getNumSessions());
|
||||||
ConnectusOvsdbClient.this.ovsdbSessionMapInterface.getNumSessions());
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("ovsdbClient error", e);
|
LOG.error("ovsdbClient error", e);
|
||||||
@@ -139,13 +140,12 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
// so we are doing a reverse lookup here, and then if we find
|
// so we are doing a reverse lookup here, and then if we find
|
||||||
// the key we will
|
// the key we will
|
||||||
// remove the entry from the connectedClients.
|
// remove the entry from the connectedClients.
|
||||||
String key = ConnectusOvsdbClient.this.ovsdbSessionMapInterface.lookupClientId(ovsdbClient);
|
String key = ovsdbSessionMapInterface.lookupClientId(ovsdbClient);
|
||||||
|
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
cancelMonitors(ovsdbClient, key);
|
|
||||||
try {
|
try {
|
||||||
extIntegrationInterface.apDisconnected(key);
|
extIntegrationInterface.apDisconnected(key);
|
||||||
ConnectusOvsdbClient.this.ovsdbSessionMapInterface.removeSession(key);
|
ovsdbSessionMapInterface.removeSession(key);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.debug("Unable to process ap disconnect. {}", e.getMessage());
|
LOG.debug("Unable to process ap disconnect. {}", e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
@@ -155,19 +155,16 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
LOG.info("ovsdbClient disconnected from {} on port {} clientCn {} key {} ", remoteHost, localPort,
|
LOG.info("ovsdbClient disconnected from {} on port {} clientCn {} key {} ", remoteHost, localPort,
|
||||||
clientCn, key);
|
clientCn, key);
|
||||||
LOG.info("ovsdbClient connectedClients = {}",
|
LOG.info("ovsdbClient connectedClients = {}", ovsdbSessionMapInterface.getNumSessions());
|
||||||
ConnectusOvsdbClient.this.ovsdbSessionMapInterface.getNumSessions());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
listener.startListeningWithSsl(ovsdbListenPort, sslContext, connectionCallback).join();
|
listener.startListeningWithSsl(ovsdbListenPort, sslContext, connectionCallback).join();
|
||||||
|
|
||||||
LOG.info("Manager waiting for connection on port {}...", ovsdbListenPort);
|
LOG.info("Manager waiting for connection on port {}...", ovsdbListenPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cancelMonitors(OvsdbClient ovsdbClient, String key) {
|
private void cancelMonitors(OvsdbClient ovsdbClient, String key) {
|
||||||
try {
|
try {
|
||||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + key).join();
|
ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + key).join();
|
||||||
@@ -203,7 +200,7 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
|
||||||
ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
|
ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
|
||||||
ovsdbDao.configureStats(ovsdbClient);
|
ovsdbDao.configureStats(ovsdbClient);
|
||||||
|
|
||||||
@@ -253,22 +250,21 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
OvsdbClient ovsdbClient = ovsdbSession.getOvsdbClient();
|
OvsdbClient ovsdbClient = ovsdbSession.getOvsdbClient();
|
||||||
|
|
||||||
|
|
||||||
OpensyncAPConfig opensyncAPConfig = extIntegrationInterface.getApConfig(apId);
|
OpensyncAPConfig opensyncAPConfig = extIntegrationInterface.getApConfig(apId);
|
||||||
|
|
||||||
if (opensyncAPConfig != null) {
|
if (opensyncAPConfig != null) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + apId).join();
|
ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + apId).join();
|
||||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_" + apId).join();
|
ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_" + apId).join();
|
||||||
ovsdbDao.removeAllSsids(ovsdbClient);
|
ovsdbDao.removeAllSsids(ovsdbClient);
|
||||||
|
|
||||||
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
|
||||||
ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig);
|
||||||
|
|
||||||
|
|
||||||
ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
|
ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
|
||||||
ovsdbDao.configureStats(ovsdbClient);
|
ovsdbDao.configureStats(ovsdbClient);
|
||||||
|
|
||||||
if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) {
|
if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) {
|
||||||
ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats);
|
ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats);
|
||||||
}
|
}
|
||||||
@@ -276,32 +272,27 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
monitorWifiVifStateDbTable(ovsdbClient, apId);
|
monitorWifiVifStateDbTable(ovsdbClient, apId);
|
||||||
|
|
||||||
} catch (OvsdbClientException e) {
|
} catch (OvsdbClientException e) {
|
||||||
LOG.error("Could not enable/disable table state monitors, cannot proccess config change for AP {}", apId);
|
LOG.error("Could not enable/disable table state monitors, cannot proccess config change for AP {}",
|
||||||
|
apId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
LOG.warn("Could not get provisioned configuration for AP {}", apId);
|
LOG.warn("Could not get provisioned configuration for AP {}", apId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LOG.debug("Finished processConfigChanged for {}", apId);
|
LOG.debug("Finished processConfigChanged for {}", apId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void monitorOvsdbStateTables(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
private void monitorOvsdbStateTables(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
||||||
monitorWifiRadioStateDbTable(ovsdbClient, key);
|
monitorWifiRadioStateDbTable(ovsdbClient, key);
|
||||||
// monitorWifiInetStateDbTable(ovsdbClient, key);
|
monitorWifiInetStateDbTable(ovsdbClient, key);
|
||||||
|
|
||||||
monitorWifiVifStateDbTableDeletion(ovsdbClient, key);
|
monitorWifiVifStateDbTableDeletion(ovsdbClient, key);
|
||||||
|
|
||||||
monitorWifiVifStateDbTable(ovsdbClient, key);
|
monitorWifiVifStateDbTable(ovsdbClient, key);
|
||||||
|
|
||||||
// monitorWifiAssociatedClientsDbTableDeletion(ovsdbClient, key);
|
monitorWifiAssociatedClientsDbTable(ovsdbClient, key);
|
||||||
|
monitorWifiAssociatedClientsDbTableDeletion(ovsdbClient, key);
|
||||||
// monitorWifiAssociatedClientsDbTable(ovsdbClient, key);
|
|
||||||
|
|
||||||
monitorAwlanNodeDbTable(ovsdbClient, key);
|
monitorAwlanNodeDbTable(ovsdbClient, key);
|
||||||
|
|
||||||
@@ -316,6 +307,8 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
|
LOG.info("Monitor callback received {}", tableUpdates);
|
||||||
|
|
||||||
extIntegrationInterface.awlanNodeDbTableUpdate(
|
extIntegrationInterface.awlanNodeDbTableUpdate(
|
||||||
ovsdbDao.getOpensyncAWLANNode(tableUpdates, key, ovsdbClient), key);
|
ovsdbDao.getOpensyncAWLANNode(tableUpdates, key, ovsdbClient), key);
|
||||||
}
|
}
|
||||||
@@ -333,6 +326,7 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
|
LOG.info("Monitor callback received {}", tableUpdates);
|
||||||
|
|
||||||
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
||||||
|
|
||||||
@@ -355,6 +349,7 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
|
LOG.info("Monitor callback received {}", tableUpdates);
|
||||||
|
|
||||||
extIntegrationInterface.wifiInetStateDbTableUpdate(
|
extIntegrationInterface.wifiInetStateDbTableUpdate(
|
||||||
ovsdbDao.getOpensyncAPInetState(tableUpdates, key, ovsdbClient), key);
|
ovsdbDao.getOpensyncAPInetState(tableUpdates, key, ovsdbClient), key);
|
||||||
@@ -374,6 +369,8 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
|
LOG.info("Monitor callback received {}", tableUpdates);
|
||||||
|
|
||||||
extIntegrationInterface.wifiRadioStatusDbTableUpdate(
|
extIntegrationInterface.wifiRadioStatusDbTableUpdate(
|
||||||
ovsdbDao.getOpensyncAPRadioState(tableUpdates, key, ovsdbClient), key);
|
ovsdbDao.getOpensyncAPRadioState(tableUpdates, key, ovsdbClient), key);
|
||||||
}
|
}
|
||||||
@@ -390,6 +387,9 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
|
|
||||||
|
LOG.info("Monitor callback received {}", tableUpdates);
|
||||||
|
|
||||||
// extIntegrationInterface.wifiVIFStateDbTableUpdate(
|
// extIntegrationInterface.wifiVIFStateDbTableUpdate(
|
||||||
// ovsdbDao.getOpensyncAPVIFState(tableUpdates,
|
// ovsdbDao.getOpensyncAPVIFState(tableUpdates,
|
||||||
// key, ovsdbClient), key);
|
// key, ovsdbClient), key);
|
||||||
@@ -399,22 +399,22 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
for (Entry<UUID, RowUpdate> rowUpdate : tableUpdate.getValue().getRowUpdates()
|
for (Entry<UUID, RowUpdate> rowUpdate : tableUpdate.getValue().getRowUpdates()
|
||||||
.entrySet()) {
|
.entrySet()) {
|
||||||
if (rowUpdate.getValue().getOld() != null
|
if ((rowUpdate.getValue().getOld() != null)
|
||||||
&& rowUpdate.getValue().getNew() == null) {
|
&& (rowUpdate.getValue().getNew() == null)) {
|
||||||
Row row = rowUpdate.getValue().getOld();
|
Row row = rowUpdate.getValue().getOld();
|
||||||
String ifName = null;
|
String ifName = null;
|
||||||
String ssid = null;
|
String ssid = null;
|
||||||
if (row.getColumns().get("ssid") != null
|
if ((row.getColumns().get("ssid") != null)
|
||||||
&& row.getColumns().get("ssid").getClass().equals(
|
&& row.getColumns().get("ssid").getClass().equals(
|
||||||
com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
||||||
ssid = row.getStringColumn("ssid");
|
ssid = row.getStringColumn("ssid");
|
||||||
}
|
}
|
||||||
if (row.getColumns().get("if_name") != null
|
if ((row.getColumns().get("if_name") != null)
|
||||||
&& row.getColumns().get("if_name").getClass().equals(
|
&& row.getColumns().get("if_name").getClass().equals(
|
||||||
com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
||||||
ifName = row.getStringColumn("if_name");
|
ifName = row.getStringColumn("if_name");
|
||||||
}
|
}
|
||||||
if (ifName != null && ssid != null) {
|
if ((ifName != null) && (ssid != null)) {
|
||||||
OpensyncAPVIFState toBeDeleted = new OpensyncAPVIFState();
|
OpensyncAPVIFState toBeDeleted = new OpensyncAPVIFState();
|
||||||
toBeDeleted.setSsid(ssid);
|
toBeDeleted.setSsid(ssid);
|
||||||
toBeDeleted.setIfName(ifName);
|
toBeDeleted.setIfName(ifName);
|
||||||
@@ -425,7 +425,7 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tableUpdate.getValue().getRowUpdates().values().isEmpty()) {
|
if (tableUpdate.getValue().getRowUpdates().isEmpty()) {
|
||||||
tableUpdates.getTableUpdates().remove(tableUpdate.getKey());
|
tableUpdates.getTableUpdates().remove(tableUpdate.getKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,7 +442,8 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
vsdCf.join();
|
vsdCf.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void monitorWifiAssociatedClientsDbTableDeletion(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
private void monitorWifiAssociatedClientsDbTableDeletion(OvsdbClient ovsdbClient, String key)
|
||||||
|
throws OvsdbClientException {
|
||||||
CompletableFuture<TableUpdates> acdCf = ovsdbClient
|
CompletableFuture<TableUpdates> acdCf = ovsdbClient
|
||||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiAssociatedClientsDbTable + "_delete_" + key,
|
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiAssociatedClientsDbTable + "_delete_" + key,
|
||||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiAssociatedClientsDbTable,
|
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiAssociatedClientsDbTable,
|
||||||
@@ -451,11 +452,12 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
|
LOG.info("Monitor callback received {}", tableUpdates);
|
||||||
|
|
||||||
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
||||||
|
|
||||||
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
|
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
|
||||||
if (rowUpdate.getOld() != null && rowUpdate.getNew() == null) {
|
if ((rowUpdate.getOld() != null) && (rowUpdate.getNew() == null)) {
|
||||||
Row row = rowUpdate.getOld();
|
Row row = rowUpdate.getOld();
|
||||||
String deletedClientMac = row.getStringColumn("mac");
|
String deletedClientMac = row.getStringColumn("mac");
|
||||||
extIntegrationInterface.wifiAssociatedClientsDbTableDelete(deletedClientMac,
|
extIntegrationInterface.wifiAssociatedClientsDbTableDelete(deletedClientMac,
|
||||||
@@ -479,6 +481,7 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
|
LOG.info("Monitor callback received {}", tableUpdates);
|
||||||
|
|
||||||
extIntegrationInterface.wifiVIFStateDbTableUpdate(
|
extIntegrationInterface.wifiVIFStateDbTableUpdate(
|
||||||
ovsdbDao.getOpensyncAPVIFState(tableUpdates, key, ovsdbClient), key);
|
ovsdbDao.getOpensyncAPVIFState(tableUpdates, key, ovsdbClient), key);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user