mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-21 20:35:02 +00:00
OVSDB State Table Changes
This commit is contained in:
@@ -4,6 +4,7 @@ import java.net.InetAddress;
|
|||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.EnumMap;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -14,6 +15,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.swing.UIDefaults.ActiveValue;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -1078,7 +1080,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
Double totalWifiUtilization = 100D * (iBSS + oBSS) / durationMs;
|
Double totalWifiUtilization = 100D * (iBSS + oBSS) / durationMs;
|
||||||
if (survey.getBand() == RadioBandType.BAND2G) { //
|
if (survey.getBand() == RadioBandType.BAND2G) { //
|
||||||
apNodeMetrics.setChannelUtilization(RadioType.is2dot4GHz, totalUtilization.intValue());
|
apNodeMetrics.setChannelUtilization(RadioType.is2dot4GHz, totalUtilization.intValue());
|
||||||
|
|
||||||
} else if (survey.getBand() == RadioBandType.BAND5G) {
|
} else if (survey.getBand() == RadioBandType.BAND5G) {
|
||||||
apNodeMetrics.setChannelUtilization(RadioType.is5GHz, totalUtilization.intValue());
|
apNodeMetrics.setChannelUtilization(RadioType.is5GHz, totalUtilization.intValue());
|
||||||
} else if (survey.getBand() == RadioBandType.BAND5GL) {
|
} else if (survey.getBand() == RadioBandType.BAND5GL) {
|
||||||
@@ -1226,9 +1227,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateClientConnectionDetails(customerId, equipmentId, clReport,
|
|
||||||
getRadioTypeFromOpensyncRadioBand(clReport.getBand()));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1582,82 +1580,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateClientConnectionDetails(int customerId, long equipmentId, ClientReport clientReport,
|
|
||||||
RadioType radioType) {
|
|
||||||
LOG.debug("Update updateClientConnectionDetails for equipment {} radio {}", equipmentId, radioType);
|
|
||||||
// update client status for radio type
|
|
||||||
Status clientConnectionStatus = statusServiceInterface.getOrNull(customerId, equipmentId,
|
|
||||||
StatusDataType.CLIENT_DETAILS);
|
|
||||||
|
|
||||||
if (clientConnectionStatus == null) {
|
|
||||||
clientConnectionStatus = new Status();
|
|
||||||
clientConnectionStatus.setCustomerId(customerId);
|
|
||||||
clientConnectionStatus.setEquipmentId(equipmentId);
|
|
||||||
clientConnectionStatus.setStatusDataType(StatusDataType.CLIENT_DETAILS);
|
|
||||||
clientConnectionStatus.setDetails(new ClientConnectionDetails());
|
|
||||||
clientConnectionStatus = statusServiceInterface.update(clientConnectionStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
ClientConnectionDetails connectionDetails = (ClientConnectionDetails) clientConnectionStatus.getDetails();
|
|
||||||
Map<RadioType, Integer> clientsPerRadio = connectionDetails.getNumClientsPerRadio();
|
|
||||||
|
|
||||||
initializeConnectedClientsPerRadioByActiveBSSID(customerId, equipmentId, clientsPerRadio,
|
|
||||||
clientReport.getTimestampMs());
|
|
||||||
LOG.debug("Clients per Radio after BSSID sync is {}", clientsPerRadio);
|
|
||||||
|
|
||||||
// take the report (metric) data for this RadioType
|
|
||||||
int clientCount = 0;
|
|
||||||
for (Client client : clientReport.getClientListList()) {
|
|
||||||
if (client.getConnected()) {
|
|
||||||
clientCount += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
clientsPerRadio.put(radioType, clientCount);
|
|
||||||
connectionDetails.setNumClientsPerRadio(clientsPerRadio);
|
|
||||||
clientConnectionStatus.setDetails(connectionDetails);
|
|
||||||
|
|
||||||
clientConnectionStatus = statusServiceInterface.update(clientConnectionStatus);
|
|
||||||
|
|
||||||
LOG.debug("Sending ClientConnectionDetails {} based on MQTT Client Report Data at {}", clientConnectionStatus,
|
|
||||||
new Date(clientReport.getTimestampMs()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initializeConnectedClientsPerRadioByActiveBSSID(int customerId, long equipmentId,
|
|
||||||
Map<RadioType, Integer> clientsPerRadio, long timestampForClientReport) {
|
|
||||||
LOG.debug("initializeConnectedClientsPerRadioByActiveBSSID for customer {} equipmentId {}", customerId,
|
|
||||||
equipmentId);
|
|
||||||
Status activeBSSIDStatus = statusServiceInterface.getOrNull(customerId, equipmentId,
|
|
||||||
StatusDataType.ACTIVE_BSSIDS);
|
|
||||||
if (activeBSSIDStatus != null) {
|
|
||||||
if (activeBSSIDStatus.getLastModifiedTimestamp() < timestampForClientReport) {
|
|
||||||
LOG.debug("Client report more recent than BSSID list, do not use for seeding");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ActiveBSSIDs activeBSSIDsDetails = (ActiveBSSIDs) activeBSSIDStatus.getDetails();
|
|
||||||
|
|
||||||
if (activeBSSIDsDetails != null) {
|
|
||||||
for (ActiveBSSID activeBssid : activeBSSIDsDetails.getActiveBSSIDs()) {
|
|
||||||
|
|
||||||
RadioType key = activeBssid.getRadioType();
|
|
||||||
|
|
||||||
LOG.debug("RadioKey is {}", key);
|
|
||||||
|
|
||||||
clientsPerRadio.put(key, activeBssid.getNumDevicesConnected());
|
|
||||||
LOG.debug("Updated number of devices connected {} for {}", clientsPerRadio.get(key),
|
|
||||||
activeBssid.getRadioType());
|
|
||||||
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LOG.debug("No details for activeBSSIDs");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LOG.debug("could not get active BSSIDs, status is null");
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG.debug("Updated clients per Radio is {}", clientsPerRadio);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int getNegativeSignedIntFromUnsigned(int unsignedValue) {
|
int getNegativeSignedIntFromUnsigned(int unsignedValue) {
|
||||||
int negSignedValue = (unsignedValue << 1) >> 1;
|
int negSignedValue = (unsignedValue << 1) >> 1;
|
||||||
return negSignedValue;
|
return negSignedValue;
|
||||||
@@ -1705,8 +1627,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
radioType = RadioType.is5GHzU;
|
radioType = RadioType.is5GHzU;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChannelBandwidth channelBandwidth = ((ApElementConfiguration) equipmentServiceInterface.get(equipmentId).getDetails())
|
ChannelBandwidth channelBandwidth = ((ApElementConfiguration) equipmentServiceInterface.get(equipmentId)
|
||||||
.getRadioMap().get(radioType).getChannelBandwidth();
|
.getDetails()).getRadioMap().get(radioType).getChannelBandwidth();
|
||||||
|
|
||||||
if (survey.getSurveyType().equals(SurveyType.OFF_CHANNEL)
|
if (survey.getSurveyType().equals(SurveyType.OFF_CHANNEL)
|
||||||
|| survey.getSurveyType().equals(SurveyType.FULL)) {
|
|| survey.getSurveyType().equals(SurveyType.FULL)) {
|
||||||
@@ -1731,7 +1653,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (List<SurveySample> surveySampleList : sampleByChannelMap.values()) {
|
for (List<SurveySample> surveySampleList : sampleByChannelMap.values()) {
|
||||||
ChannelInfo channelInfo = createChannelInfo(equipmentId, radioType, surveySampleList, channelBandwidth);
|
ChannelInfo channelInfo = createChannelInfo(equipmentId, radioType, surveySampleList,
|
||||||
|
channelBandwidth);
|
||||||
|
|
||||||
List<ChannelInfo> channelInfoList = channelInfoReports.getRadioInfo(radioType);
|
List<ChannelInfo> channelInfoList = channelInfoReports.getRadioInfo(radioType);
|
||||||
if (channelInfoList == null) {
|
if (channelInfoList == null) {
|
||||||
@@ -1761,7 +1684,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ChannelInfo createChannelInfo(long equipmentId, RadioType radioType, List<SurveySample> surveySampleList, ChannelBandwidth channelBandwidth) {
|
private ChannelInfo createChannelInfo(long equipmentId, RadioType radioType, List<SurveySample> surveySampleList,
|
||||||
|
ChannelBandwidth channelBandwidth) {
|
||||||
int busyTx = 0; /* Tx */
|
int busyTx = 0; /* Tx */
|
||||||
int busySelf = 0; /* Rx_self (derived from succesful Rx frames) */
|
int busySelf = 0; /* Rx_self (derived from succesful Rx frames) */
|
||||||
int busy = 0; /* Busy = Rx + Tx + Interference */
|
int busy = 0; /* Busy = Rx + Tx + Interference */
|
||||||
@@ -1855,34 +1779,13 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (OpensyncAPVIFState vifState : vifStateTables) {
|
|
||||||
|
|
||||||
if ((vifState.getMac() != null) && (vifState.getSsid() != null) && (vifState.getChannel() > 0)) {
|
|
||||||
String bssid = vifState.getMac();
|
|
||||||
String ssid = vifState.getSsid();
|
|
||||||
|
|
||||||
int channel = vifState.getChannel();
|
|
||||||
|
|
||||||
RadioType radioType = null;
|
|
||||||
|
|
||||||
Equipment apNode = equipmentServiceInterface.getOrNull(equipmentId);
|
Equipment apNode = equipmentServiceInterface.getOrNull(equipmentId);
|
||||||
if (apNode == null) {
|
if (apNode == null) {
|
||||||
continue; // we don't have the required info to get the
|
LOG.debug("wifiVIFStateDbTableUpdate::Cannot get EquipmentId for AP {}", apId);
|
||||||
|
return; // we don't have the required info to get the
|
||||||
// radio type yet
|
// radio type yet
|
||||||
}
|
}
|
||||||
|
|
||||||
ApElementConfiguration apElementConfig = (ApElementConfiguration) apNode.getDetails();
|
|
||||||
for (RadioType key : apElementConfig.getRadioMap().keySet()) {
|
|
||||||
if (apElementConfig.getRadioMap().get(key).getChannelNumber() == channel) {
|
|
||||||
radioType = key;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (radioType == null) {
|
|
||||||
continue; // we cannot determine radioType for this BSSID
|
|
||||||
}
|
|
||||||
|
|
||||||
Status activeBssidsStatus = statusServiceInterface.getOrNull(customerId, equipmentId,
|
Status activeBssidsStatus = statusServiceInterface.getOrNull(customerId, equipmentId,
|
||||||
StatusDataType.ACTIVE_BSSIDS);
|
StatusDataType.ACTIVE_BSSIDS);
|
||||||
|
|
||||||
@@ -1900,16 +1803,60 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
activeBssidsStatus = statusServiceInterface.update(activeBssidsStatus);
|
activeBssidsStatus = statusServiceInterface.update(activeBssidsStatus);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveBSSIDs statusDetails = (ActiveBSSIDs) activeBssidsStatus.getDetails();
|
ActiveBSSIDs statusDetails = (ActiveBSSIDs) activeBssidsStatus.getDetails();
|
||||||
|
|
||||||
|
for (OpensyncAPVIFState vifState : vifStateTables) {
|
||||||
|
|
||||||
|
LOG.debug("Processing vifState for interface {} on AP {}", vifState.getIfName(), apId);
|
||||||
|
|
||||||
|
String bssid = vifState.getMac();
|
||||||
|
|
||||||
|
if (bssid == null || bssid.equals("")) {
|
||||||
|
LOG.warn("BSSID from AP {} interface {} is null or empty", apId, vifState.getIfName());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String ssid = vifState.getSsid();
|
||||||
|
|
||||||
|
if (ssid == null || ssid.equals("")) {
|
||||||
|
LOG.warn("SSID from AP {} interface {} is null or empty", apId, vifState.getIfName());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
int channel = vifState.getChannel();
|
||||||
|
|
||||||
|
if (channel < 1) {
|
||||||
|
LOG.warn("Channel from AP {} interface {} is invalid, {}", apId, vifState.getIfName(), channel);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
int numClients = vifState.getAssociatedClients().size();
|
||||||
|
|
||||||
|
LOG.debug("Values from Vif State Mac (BSSID) {} SSID {} Channel {} numAssociatedClients {}", bssid, ssid,
|
||||||
|
channel, numClients);
|
||||||
|
|
||||||
|
RadioType radioType = null;
|
||||||
|
|
||||||
|
ApElementConfiguration apElementConfig = (ApElementConfiguration) apNode.getDetails();
|
||||||
|
for (RadioType key : apElementConfig.getRadioMap().keySet()) {
|
||||||
|
if (apElementConfig.getRadioMap().get(key).getChannelNumber() == channel) {
|
||||||
|
radioType = key;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (radioType == null) {
|
||||||
|
continue; // we cannot determine radioType for this BSSID
|
||||||
|
}
|
||||||
|
|
||||||
List<ActiveBSSID> bssidList = statusDetails.getActiveBSSIDs();
|
List<ActiveBSSID> bssidList = statusDetails.getActiveBSSIDs();
|
||||||
boolean bssidAlreadyPresent = false;
|
boolean bssidAlreadyPresent = false;
|
||||||
for (ActiveBSSID activeBssid : bssidList) {
|
for (ActiveBSSID activeBssid : bssidList) {
|
||||||
|
|
||||||
if (activeBssid.getBssid().equals(bssid) && activeBssid.getSsid().equals(ssid)
|
if (activeBssid.getBssid().equals(bssid) && activeBssid.getSsid().equals(ssid)
|
||||||
&& activeBssid.getRadioType().equals(radioType)) {
|
&& activeBssid.getRadioType().equals(radioType)) {
|
||||||
activeBssid.setNumDevicesConnected(vifState.getAssociatedClients().size());
|
|
||||||
|
LOG.debug(
|
||||||
|
"BSSID {} is already present for radio {} on AP {} with SSID {}, update number of associated wifi clients to {}",
|
||||||
|
bssid, radioType, apId, ssid, numClients);
|
||||||
|
activeBssid.setNumDevicesConnected(numClients);
|
||||||
bssidAlreadyPresent = true;
|
bssidAlreadyPresent = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1917,6 +1864,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!bssidAlreadyPresent) {
|
if (!bssidAlreadyPresent) {
|
||||||
|
LOG.debug(
|
||||||
|
"Adding new active BSSID {} for radio {} on AP {} with SSID {}, with number of associated wifi clients to {}",
|
||||||
|
bssid, radioType, apId, ssid, numClients);
|
||||||
|
|
||||||
ActiveBSSID newActiveBssid = new ActiveBSSID();
|
ActiveBSSID newActiveBssid = new ActiveBSSID();
|
||||||
newActiveBssid.setBssid(bssid);
|
newActiveBssid.setBssid(bssid);
|
||||||
newActiveBssid.setSsid(ssid);
|
newActiveBssid.setSsid(ssid);
|
||||||
@@ -1926,11 +1877,47 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
}
|
}
|
||||||
|
|
||||||
statusDetails.setActiveBSSIDs(bssidList);
|
statusDetails.setActiveBSSIDs(bssidList);
|
||||||
activeBssidsStatus.setDetails(statusDetails);
|
|
||||||
activeBssidsStatus = statusServiceInterface.update(activeBssidsStatus);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
activeBssidsStatus.setDetails(statusDetails);
|
||||||
|
|
||||||
|
if (!statusDetails.equals((ActiveBSSIDs) statusServiceInterface
|
||||||
|
.getOrNull(customerId, equipmentId, StatusDataType.ACTIVE_BSSIDS).getDetails())) {
|
||||||
|
activeBssidsStatus = statusServiceInterface.update(activeBssidsStatus);
|
||||||
|
LOG.info("Updated activeBSSIDs for AP {} to {}", apId, activeBssidsStatus);
|
||||||
|
|
||||||
|
// update clients based on all active BSSIDs per Radio Type
|
||||||
|
// only if the BSSIDs have changed
|
||||||
|
Status clientDetailsStatus = statusServiceInterface.getOrNull(customerId, equipmentId,
|
||||||
|
StatusDataType.CLIENT_DETAILS);
|
||||||
|
|
||||||
|
if (clientDetailsStatus == null) {
|
||||||
|
clientDetailsStatus = new Status();
|
||||||
|
clientDetailsStatus.setCustomerId(customerId);
|
||||||
|
clientDetailsStatus.setEquipmentId(equipmentId);
|
||||||
|
clientDetailsStatus.setStatusDataType(StatusDataType.CLIENT_DETAILS);
|
||||||
|
clientDetailsStatus.setDetails(new ClientConnectionDetails());
|
||||||
|
}
|
||||||
|
|
||||||
|
ClientConnectionDetails clientConnectionDetails = (ClientConnectionDetails) clientDetailsStatus
|
||||||
|
.getDetails();
|
||||||
|
|
||||||
|
Map<RadioType, Integer> clientsPerRadioType = new EnumMap<>(RadioType.class);
|
||||||
|
statusDetails = (ActiveBSSIDs) activeBssidsStatus.getDetails();
|
||||||
|
for (ActiveBSSID bssid : statusDetails.getActiveBSSIDs()) {
|
||||||
|
Integer numClientsPerRadioType = clientsPerRadioType.put(bssid.getRadioType(),
|
||||||
|
clientsPerRadioType.get(bssid.getRadioType()) + bssid.getNumDevicesConnected());
|
||||||
|
LOG.debug("Upgrade numClients for RadioType {} to {} on AP {}", bssid.getRadioType(),
|
||||||
|
numClientsPerRadioType, apId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!clientConnectionDetails.getNumClientsPerRadio().equals(clientsPerRadioType)) {
|
||||||
|
clientConnectionDetails.setNumClientsPerRadio(clientsPerRadioType);
|
||||||
|
clientDetailsStatus.setDetails(clientConnectionDetails);
|
||||||
|
clientDetailsStatus = statusServiceInterface.update(clientDetailsStatus);
|
||||||
|
LOG.info("Updated clientConnectionDetails for AP {) to {}", apId, clientDetailsStatus);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ public class OpensyncAPVIFState extends BaseJsonModel {
|
|||||||
public Map<String, String> security;
|
public Map<String, String> security;
|
||||||
public String macList;
|
public String macList;
|
||||||
public Set<Uuid> associatedClients;
|
public Set<Uuid> associatedClients;
|
||||||
|
public Set<String> associatedClientsByMac;
|
||||||
|
|
||||||
|
|
||||||
public boolean enabled;
|
public boolean enabled;
|
||||||
public int vlanId;
|
public int vlanId;
|
||||||
public int btm;
|
public int btm;
|
||||||
@@ -267,4 +270,11 @@ public class OpensyncAPVIFState extends BaseJsonModel {
|
|||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<String> getAssociatedClientsByMac() {
|
||||||
|
return associatedClientsByMac;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssociatedClientsByMac(Set<String> associatedClientsByMac) {
|
||||||
|
this.associatedClientsByMac = associatedClientsByMac;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,11 +102,11 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
extIntegrationInterface.apConnected(key, connectNodeInfo);
|
extIntegrationInterface.apConnected(key, connectNodeInfo);
|
||||||
|
|
||||||
monitorOvsdbStateTables(ovsdbClient, key);
|
|
||||||
|
|
||||||
// push configuration to AP
|
// push configuration to AP
|
||||||
connectNodeInfo = processConnectRequest(ovsdbClient, clientCn, connectNodeInfo);
|
connectNodeInfo = processConnectRequest(ovsdbClient, clientCn, connectNodeInfo);
|
||||||
|
|
||||||
|
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 = {}", ovsdbSessionMapInterface.getNumSessions());
|
LOG.info("ovsdbClient connectedClients = {}", ovsdbSessionMapInterface.getNumSessions());
|
||||||
|
|
||||||
@@ -241,9 +241,14 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
|
|
||||||
if (opensyncAPConfig != null) {
|
if (opensyncAPConfig != null) {
|
||||||
try {
|
try {
|
||||||
|
ovsdbClient.cancelMonitor(OvsdbDao.awlanNodeDbTable + "_" + apId).join();
|
||||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + apId).join();
|
ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + apId).join();
|
||||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_" + apId).join();
|
ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_" + apId).join();
|
||||||
|
ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_delete_" + apId).join();
|
||||||
|
ovsdbClient.cancelMonitor(OvsdbDao.wifiInetStateDbTable + "_" + apId).join();
|
||||||
|
ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable + "_" + apId).join();
|
||||||
|
ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable + "_delete_" + apId).join();
|
||||||
|
|
||||||
ovsdbDao.removeAllSsids(ovsdbClient);
|
ovsdbDao.removeAllSsids(ovsdbClient);
|
||||||
|
|
||||||
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
|
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
|
||||||
@@ -255,12 +260,12 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) {
|
if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) {
|
||||||
ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats);
|
ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats);
|
||||||
}
|
}
|
||||||
monitorWifiRadioStateDbTable(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 {}",
|
LOG.error("Could not enable/disable table state monitors, cannot proccess config change for AP {}",
|
||||||
apId);
|
apId);
|
||||||
|
} finally {
|
||||||
|
monitorOvsdbStateTables(ovsdbClient, apId);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -270,18 +275,48 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
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) {
|
||||||
|
|
||||||
|
LOG.info("Received ovsdb table state monitor request for {}", key);
|
||||||
|
try {
|
||||||
monitorWifiRadioStateDbTable(ovsdbClient, key);
|
monitorWifiRadioStateDbTable(ovsdbClient, key);
|
||||||
|
} catch (OvsdbClientException e) {
|
||||||
|
LOG.debug("Could not enable monitor for Wifi_Radio_State table. {}", e.getMessage());
|
||||||
|
}
|
||||||
|
try {
|
||||||
monitorWifiInetStateDbTable(ovsdbClient, key);
|
monitorWifiInetStateDbTable(ovsdbClient, key);
|
||||||
|
} catch (OvsdbClientException e) {
|
||||||
monitorWifiVifStateDbTableDeletion(ovsdbClient, key);
|
LOG.debug("Could not enable monitor for Wifi_Inet_State table. {}", e.getMessage());
|
||||||
|
}
|
||||||
|
try {
|
||||||
monitorWifiVifStateDbTable(ovsdbClient, key);
|
monitorWifiVifStateDbTable(ovsdbClient, key);
|
||||||
|
} catch (OvsdbClientException e) {
|
||||||
|
LOG.debug("Could not enable monitor for Wifi_VIF_State table. {}", e.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
monitorWifiVifStateDbTableDeletion(ovsdbClient, key);
|
||||||
|
} catch (OvsdbClientException e) {
|
||||||
|
LOG.debug("Could not enable monitor for deletions to Wifi_VIF_State table. {}", e.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
try {
|
||||||
monitorWifiAssociatedClientsDbTable(ovsdbClient, key);
|
monitorWifiAssociatedClientsDbTable(ovsdbClient, key);
|
||||||
|
} catch (OvsdbClientException e) {
|
||||||
|
LOG.debug("Could not enable monitor for Wifi_Associated_Clients table. {}", e.getMessage());
|
||||||
|
}
|
||||||
|
try {
|
||||||
monitorWifiAssociatedClientsDbTableDeletion(ovsdbClient, key);
|
monitorWifiAssociatedClientsDbTableDeletion(ovsdbClient, key);
|
||||||
|
} catch (OvsdbClientException e) {
|
||||||
|
LOG.debug("Could not enable monitor for deletions to Wifi_Associated_Clients table. {}", e.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
try {
|
||||||
monitorAwlanNodeDbTable(ovsdbClient, key);
|
monitorAwlanNodeDbTable(ovsdbClient, key);
|
||||||
|
} catch (OvsdbClientException e) {
|
||||||
|
LOG.debug("Could not enable monitor for deletions to AWLAN_Node table. {}", e.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,10 +505,10 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void monitorWifiVifStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
private void monitorWifiVifStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
||||||
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, false, true)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
|
|||||||
@@ -994,8 +994,7 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
wifiVifConfigInfo.macList = row.getSetColumn("mac_list");
|
wifiVifConfigInfo.macList = row.getSetColumn("mac_list");
|
||||||
|
|
||||||
if (row.getColumns().get("mac_list_type") != null &&
|
if (row.getColumns().get("mac_list_type") != null && row.getColumns().get("mac_list_type").getClass()
|
||||||
row.getColumns().get("mac_list_type").getClass()
|
|
||||||
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
|
||||||
wifiVifConfigInfo.macListType = row.getStringColumn("mac_list_type");
|
wifiVifConfigInfo.macListType = row.getStringColumn("mac_list_type");
|
||||||
}
|
}
|
||||||
@@ -1829,6 +1828,16 @@ public class OvsdbDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (map.get("associated_clients") != null) {
|
if (map.get("associated_clients") != null) {
|
||||||
|
|
||||||
|
LOG.debug("associated_clients {}", row.getSetColumn("associated_clients"));
|
||||||
|
Set<Uuid> clients = row.getSetColumn("associated_clients");
|
||||||
|
for (Uuid client : clients) {
|
||||||
|
|
||||||
|
|
||||||
|
LOG.debug("Associated Client Uuid {} UUID {} ", client.toString(), client.getUuid());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
tableState.setAssociatedClients(row.getSetColumn("associated_clients"));
|
tableState.setAssociatedClients(row.getSetColumn("associated_clients"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2872,14 +2881,14 @@ public class OvsdbDao {
|
|||||||
// waiting on AP to provide guidance wrt load naming and version
|
// waiting on AP to provide guidance wrt load naming and version
|
||||||
// matrix content
|
// matrix content
|
||||||
// get existing table info
|
// get existing table info
|
||||||
// Row awlanNode = getAWLANNodeDbTableForFirmwareUpdate(ovsdbClient);
|
// Row awlanNode =
|
||||||
|
// getAWLANNodeDbTableForFirmwareUpdate(ovsdbClient);
|
||||||
//
|
//
|
||||||
// if (awlanNode == null) {
|
// if (awlanNode == null) {
|
||||||
// LOG.error("Cannot update AWLAN_Node firmware information");
|
// LOG.error("Cannot update AWLAN_Node firmware information");
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
List<Operation> operations = new ArrayList<>();
|
List<Operation> operations = new ArrayList<>();
|
||||||
Map<String, Value> updateColumns = new HashMap<>();
|
Map<String, Value> updateColumns = new HashMap<>();
|
||||||
updateColumns.put("upgrade_dl_timer", new Atom<>(upgradeDlTimerSeconds));
|
updateColumns.put("upgrade_dl_timer", new Atom<>(upgradeDlTimerSeconds));
|
||||||
|
|||||||
Reference in New Issue
Block a user