mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-03 12:08:07 +00:00
Robustness for ActiveBSSIDs, state change handling cleanup
This commit is contained in:
@@ -111,7 +111,6 @@ 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.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.equipment.report.models.RadioUtilizationReport;
|
||||||
import com.telecominfraproject.wlan.status.models.Status;
|
import com.telecominfraproject.wlan.status.models.Status;
|
||||||
@@ -1121,7 +1120,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
// private Integer nonWifi;
|
// private Integer nonWifi;
|
||||||
// private Integer timestampSeconds;
|
// private Integer timestampSeconds;
|
||||||
Map<RadioType, Integer> avgNoiseFloor = new HashMap<>();
|
Map<RadioType, Integer> avgNoiseFloor = new HashMap<>();
|
||||||
Map<RadioType, EquipmentPerRadioUtilizationDetails> radioUtilization = new HashMap<>();
|
new HashMap<>();
|
||||||
Map<RadioType, EquipmentCapacityDetails> capacityDetails = new HashMap<>();
|
Map<RadioType, EquipmentCapacityDetails> capacityDetails = new HashMap<>();
|
||||||
RadioUtilizationReport radioUtilizationReport = new RadioUtilizationReport();
|
RadioUtilizationReport radioUtilizationReport = new RadioUtilizationReport();
|
||||||
|
|
||||||
@@ -1181,7 +1180,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (survey.getSurveyListCount() > 0 && radioType != RadioType.UNSUPPORTED) {
|
if ((survey.getSurveyListCount() > 0) && (radioType != RadioType.UNSUPPORTED)) {
|
||||||
int noiseAvg = (int) Math.round(DecibelUtils.getAverageDecibel(toIntArray(noiseList)));
|
int noiseAvg = (int) Math.round(DecibelUtils.getAverageDecibel(toIntArray(noiseList)));
|
||||||
avgNoiseFloor.put(radioType, noiseAvg);
|
avgNoiseFloor.put(radioType, noiseAvg);
|
||||||
apNodeMetrics.setNoiseFloor(radioType, noiseAvg);
|
apNodeMetrics.setNoiseFloor(radioType, noiseAvg);
|
||||||
@@ -1212,11 +1211,14 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
updateDeviceStatusRadioUtilizationReport(customerId, equipmentId, radioUtilizationReport);
|
updateDeviceStatusRadioUtilizationReport(customerId, equipmentId, radioUtilizationReport);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDeviceStatusRadioUtilizationReport(int customerId, long equipmentId, RadioUtilizationReport radioUtilizationReport) {
|
private void updateDeviceStatusRadioUtilizationReport(int customerId, long equipmentId,
|
||||||
LOG.debug("Processing updateDeviceStatusRadioUtilizationReport for equipmentId {} with RadioUtilizationReport {}",
|
RadioUtilizationReport radioUtilizationReport) {
|
||||||
|
LOG.debug(
|
||||||
|
"Processing updateDeviceStatusRadioUtilizationReport for equipmentId {} with RadioUtilizationReport {}",
|
||||||
equipmentId, radioUtilizationReport);
|
equipmentId, radioUtilizationReport);
|
||||||
|
|
||||||
Status radioUtilizationStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.RADIO_UTILIZATION);
|
Status radioUtilizationStatus = statusServiceInterface.getOrNull(customerId, equipmentId,
|
||||||
|
StatusDataType.RADIO_UTILIZATION);
|
||||||
|
|
||||||
if (radioUtilizationStatus == null) {
|
if (radioUtilizationStatus == null) {
|
||||||
LOG.debug("Create new radioUtilizationStatus");
|
LOG.debug("Create new radioUtilizationStatus");
|
||||||
@@ -1238,14 +1240,22 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
NetworkProbeMetrics networkProbeMetrics = new NetworkProbeMetrics();
|
NetworkProbeMetrics networkProbeMetrics = new NetworkProbeMetrics();
|
||||||
|
|
||||||
|
List<DnsProbeMetric> dnsProbeResults = new ArrayList<>();
|
||||||
if (networkProbe.hasDnsProbe()) {
|
if (networkProbe.hasDnsProbe()) {
|
||||||
|
|
||||||
DNSProbeMetric dnsProbeMetricStats = networkProbe.getDnsProbe();
|
DNSProbeMetric dnsProbeMetricFromAp = networkProbe.getDnsProbe();
|
||||||
DnsProbeMetric dnsProbeMetric = new DnsProbeMetric();
|
|
||||||
networkProbeMetrics.setDnsLatencyMs(dnsProbeMetricStats.getLatency());
|
|
||||||
dnsProbeMetric.setDnsLatencyMs(dnsProbeMetricStats.getLatency());
|
|
||||||
|
|
||||||
switch (dnsProbeMetricStats.getState()) {
|
LOG.debug("DNSProbeMetric from AP {}", dnsProbeMetricFromAp);
|
||||||
|
|
||||||
|
DnsProbeMetric dnsProbeMetric = new DnsProbeMetric();
|
||||||
|
|
||||||
|
if (dnsProbeMetricFromAp.hasLatency()) {
|
||||||
|
networkProbeMetrics.setDnsLatencyMs(dnsProbeMetricFromAp.getLatency());
|
||||||
|
dnsProbeMetric.setDnsLatencyMs(dnsProbeMetricFromAp.getLatency());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dnsProbeMetricFromAp.hasState()) {
|
||||||
|
switch (dnsProbeMetricFromAp.getState()) {
|
||||||
case SUD_down:
|
case SUD_down:
|
||||||
networkProbeMetrics.setDnsState(StateUpDownError.disabled);
|
networkProbeMetrics.setDnsState(StateUpDownError.disabled);
|
||||||
dnsProbeMetric.setDnsState(StateUpDownError.disabled);
|
dnsProbeMetric.setDnsState(StateUpDownError.disabled);
|
||||||
@@ -1262,27 +1272,30 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
networkProbeMetrics.setDnsState(StateUpDownError.UNSUPPORTED);
|
networkProbeMetrics.setDnsState(StateUpDownError.UNSUPPORTED);
|
||||||
dnsProbeMetric.setDnsState(StateUpDownError.UNSUPPORTED);
|
dnsProbeMetric.setDnsState(StateUpDownError.UNSUPPORTED);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dnsProbeMetricFromAp.hasServerIP()) {
|
||||||
|
InetAddress ipAddress;
|
||||||
try {
|
try {
|
||||||
InetAddress ipAddress = InetAddress.getByName(dnsProbeMetricStats.getServerIP());
|
ipAddress = InetAddress.getByName(dnsProbeMetricFromAp.getServerIP());
|
||||||
dnsProbeMetric.setDnsServerIp(ipAddress);
|
dnsProbeMetric.setDnsServerIp(ipAddress);
|
||||||
} catch (Exception e) {
|
|
||||||
LOG.error("Unable to get the DNS server IP.", e);
|
} catch (UnknownHostException e) {
|
||||||
|
LOG.error("Could not get DNS Server IP from network_probe metrics", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (networkProbeMetrics.getDnsProbeResults() == null) {
|
dnsProbeResults.add(dnsProbeMetric);
|
||||||
List<DnsProbeMetric> dnsProbeMetricList = new ArrayList<>();
|
|
||||||
dnsProbeMetricList.add(dnsProbeMetric);
|
|
||||||
networkProbeMetrics.setDnsProbeResults(dnsProbeMetricList);
|
|
||||||
} else {
|
|
||||||
networkProbeMetrics.getDnsProbeResults().add(dnsProbeMetric);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
networkProbeMetrics.setDnsProbeResults(dnsProbeResults);
|
||||||
|
|
||||||
if (networkProbe.hasRadiusProbe()) {
|
if (networkProbe.hasRadiusProbe()) {
|
||||||
|
|
||||||
RADIUSMetrics radiusMetrics = networkProbe.getRadiusProbe();
|
RADIUSMetrics radiusMetrics = networkProbe.getRadiusProbe();
|
||||||
|
|
||||||
|
LOG.debug("Network Probe Radius Metrics {}", radiusMetrics);
|
||||||
if (networkProbe.hasVlanProbe()) {
|
if (networkProbe.hasVlanProbe()) {
|
||||||
if (networkProbe.getVlanProbe().hasObsV200RadiusLatency()) {
|
if (networkProbe.getVlanProbe().hasObsV200RadiusLatency()) {
|
||||||
networkProbeMetrics.setRadiusLatencyInMs(networkProbe.getVlanProbe().getObsV200RadiusLatency());
|
networkProbeMetrics.setRadiusLatencyInMs(networkProbe.getVlanProbe().getObsV200RadiusLatency());
|
||||||
@@ -1305,15 +1318,23 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// take the average if we don't have from the VLAN Probe
|
// take the average if we don't have from the VLAN Probe
|
||||||
|
if (radiusMetrics.hasLatencyAve()) {
|
||||||
networkProbeMetrics.setRadiusLatencyInMs(radiusMetrics.getLatencyAve());
|
networkProbeMetrics.setRadiusLatencyInMs(radiusMetrics.getLatencyAve());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (networkProbe.hasVlanProbe()) {
|
if (networkProbe.hasVlanProbe()) {
|
||||||
VLANMetrics vlanMetrics = networkProbe.getVlanProbe();
|
VLANMetrics vlanMetrics = networkProbe.getVlanProbe();
|
||||||
networkProbeMetrics.setVlanIF(vlanMetrics.getVlanIF());
|
|
||||||
networkProbeMetrics.setDhcpLatencyMs(vlanMetrics.getDhcpLatency());
|
|
||||||
|
|
||||||
|
LOG.debug("NetworkProbe Vlan Metrics {}", vlanMetrics);
|
||||||
|
if (vlanMetrics.hasVlanIF()) {
|
||||||
|
networkProbeMetrics.setVlanIF(vlanMetrics.getVlanIF());
|
||||||
|
}
|
||||||
|
if (vlanMetrics.hasDhcpLatency()) {
|
||||||
|
networkProbeMetrics.setDhcpLatencyMs(vlanMetrics.getDhcpLatency());
|
||||||
|
}
|
||||||
|
if (vlanMetrics.hasDhcpState()) {
|
||||||
switch (vlanMetrics.getDhcpState()) {
|
switch (vlanMetrics.getDhcpState()) {
|
||||||
case SUD_down:
|
case SUD_down:
|
||||||
networkProbeMetrics.setDhcpState(StateUpDownError.disabled);
|
networkProbeMetrics.setDhcpState(StateUpDownError.disabled);
|
||||||
@@ -1327,6 +1348,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
default:
|
default:
|
||||||
networkProbeMetrics.setDhcpState(StateUpDownError.UNSUPPORTED);
|
networkProbeMetrics.setDhcpState(StateUpDownError.UNSUPPORTED);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1887,7 +1909,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
channelInfoList = new ArrayList<>();
|
channelInfoList = new ArrayList<>();
|
||||||
}
|
}
|
||||||
channelInfoList.add(channelInfo);
|
channelInfoList.add(channelInfo);
|
||||||
Map<RadioType,List<ChannelInfo>> channelInfoMap = channelInfoReports.getChannelInformationReportsPerRadio();
|
Map<RadioType, List<ChannelInfo>> channelInfoMap = channelInfoReports
|
||||||
|
.getChannelInformationReportsPerRadio();
|
||||||
channelInfoMap.put(radioType, channelInfoList);
|
channelInfoMap.put(radioType, channelInfoList);
|
||||||
channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap);
|
channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap);
|
||||||
}
|
}
|
||||||
@@ -1903,7 +1926,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
channelInfoList = new ArrayList<>();
|
channelInfoList = new ArrayList<>();
|
||||||
}
|
}
|
||||||
channelInfoList.add(channelInfo);
|
channelInfoList.add(channelInfo);
|
||||||
Map<RadioType,List<ChannelInfo>> channelInfoMap = channelInfoReports.getChannelInformationReportsPerRadio();
|
Map<RadioType, List<ChannelInfo>> channelInfoMap = channelInfoReports
|
||||||
|
.getChannelInformationReportsPerRadio();
|
||||||
channelInfoMap.put(radioType, channelInfoList);
|
channelInfoMap.put(radioType, channelInfoList);
|
||||||
channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap);
|
channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap);
|
||||||
}
|
}
|
||||||
@@ -1929,7 +1953,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
busySelf += sample.getBusySelf();
|
busySelf += sample.getBusySelf();
|
||||||
busy += sample.getBusy();
|
busy += sample.getBusy();
|
||||||
channelInfo.setChanNumber(sample.getChannel());
|
channelInfo.setChanNumber(sample.getChannel());
|
||||||
noiseArray[index++] = getNegativeSignedIntFrom8BitUnsigned(sample.getNoise()); }
|
noiseArray[index++] = getNegativeSignedIntFrom8BitUnsigned(sample.getNoise());
|
||||||
|
}
|
||||||
|
|
||||||
int iBSS = busyTx + busySelf;
|
int iBSS = busyTx + busySelf;
|
||||||
|
|
||||||
@@ -2254,15 +2279,24 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
apId, currentActiveBSSIDs);
|
apId, currentActiveBSSIDs);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (OpensyncAPVIFState vifState : radioState.getVifStates()) {
|
ProfileContainer profileContainer = new ProfileContainer(
|
||||||
|
profileServiceInterface.getProfileWithChildren(ce.getProfileId()));
|
||||||
|
|
||||||
|
List<Profile> ssidProfiles = profileContainer.getChildrenOfType(ce.getProfileId(), ProfileType.ssid);
|
||||||
|
|
||||||
|
for (Profile ssidProfile : ssidProfiles) {
|
||||||
|
|
||||||
|
SsidConfiguration ssidConfig = (SsidConfiguration) ssidProfile.getDetails();
|
||||||
|
if (ssidConfig.getAppliedRadios().contains(radioState.freqBand)) {
|
||||||
ActiveBSSID activeBssid = new ActiveBSSID();
|
ActiveBSSID activeBssid = new ActiveBSSID();
|
||||||
activeBssid.setBssid(vifState.getMac());
|
activeBssid.setBssid(radioState.getMac());
|
||||||
activeBssid.setSsid(vifState.getSsid());
|
activeBssid.setSsid(ssidConfig.getSsid());
|
||||||
activeBssid.setNumDevicesConnected(vifState.getAssociatedClients().size());
|
|
||||||
activeBssid.setRadioType(radioState.getFreqBand());
|
activeBssid.setRadioType(radioState.getFreqBand());
|
||||||
currentActiveBSSIDs.add(activeBssid);
|
currentActiveBSSIDs.add(activeBssid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
statusDetails.setActiveBSSIDs(currentActiveBSSIDs);
|
statusDetails.setActiveBSSIDs(currentActiveBSSIDs);
|
||||||
activeBssidsStatus.setDetails(statusDetails);
|
activeBssidsStatus.setDetails(statusDetails);
|
||||||
|
|
||||||
@@ -2605,6 +2639,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
Equipment ce = getCustomerEquipment(apId);
|
Equipment ce = getCustomerEquipment(apId);
|
||||||
if (ce != null) {
|
if (ce != null) {
|
||||||
|
ce.getDetails();
|
||||||
|
|
||||||
if (fwUpgradeState.equals(EquipmentUpgradeState.up_to_date)) {
|
if (fwUpgradeState.equals(EquipmentUpgradeState.up_to_date)) {
|
||||||
LOG.info("Firmware load is up to date.");
|
LOG.info("Firmware load is up to date.");
|
||||||
|
|
||||||
@@ -2614,7 +2650,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
if (!firmwareStatusData.getActiveSwVersion().equals(reportedFwImageName)
|
if (!firmwareStatusData.getActiveSwVersion().equals(reportedFwImageName)
|
||||||
|| !firmwareStatusData.getUpgradeState().equals(fwUpgradeState)) {
|
|| !firmwareStatusData.getUpgradeState().equals(fwUpgradeState)) {
|
||||||
firmwareStatusData.setActiveSwVersion(reportedFwImageName);
|
firmwareStatusData.setActiveSwVersion(reportedFwImageName);
|
||||||
firmwareStatusData.setUpgradeState(fwUpgradeState);
|
firmwareStatusData.setUpgradeState(fwUpgradeState, fwUpgradeFailureReason);
|
||||||
firmwareStatus.setDetails(firmwareStatusData);
|
firmwareStatus.setDetails(firmwareStatusData);
|
||||||
updates.add(firmwareStatus);
|
updates.add(firmwareStatus);
|
||||||
}
|
}
|
||||||
@@ -2643,7 +2679,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
if (!firmwareStatusData.getActiveSwVersion().equals(reportedFwImageName)
|
if (!firmwareStatusData.getActiveSwVersion().equals(reportedFwImageName)
|
||||||
|| !firmwareStatusData.getUpgradeState().equals(fwUpgradeState)) {
|
|| !firmwareStatusData.getUpgradeState().equals(fwUpgradeState)) {
|
||||||
firmwareStatusData.setActiveSwVersion(reportedFwImageName);
|
firmwareStatusData.setActiveSwVersion(reportedFwImageName);
|
||||||
firmwareStatusData.setUpgradeState(fwUpgradeState);
|
firmwareStatusData.setUpgradeState(fwUpgradeState, fwUpgradeFailureReason);
|
||||||
if (fwUpgradeState.equals(EquipmentUpgradeState.apply_initiated)) {
|
if (fwUpgradeState.equals(EquipmentUpgradeState.apply_initiated)) {
|
||||||
firmwareStatusData.setUpgradeStartTime(System.currentTimeMillis());
|
firmwareStatusData.setUpgradeStartTime(System.currentTimeMillis());
|
||||||
} else if (fwUpgradeState.equals(EquipmentUpgradeState.reboot_initiated)
|
} else if (fwUpgradeState.equals(EquipmentUpgradeState.reboot_initiated)
|
||||||
@@ -2678,6 +2714,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
firmwareStatus.setDetails(firmwareStatusData);
|
firmwareStatus.setDetails(firmwareStatusData);
|
||||||
updates.add(firmwareStatus);
|
updates.add(firmwareStatus);
|
||||||
updates = statusServiceInterface.update(updates);
|
updates = statusServiceInterface.update(updates);
|
||||||
|
|
||||||
reconcileFwVersionToTrack(ce, reportedFwImageName, opensyncAPState.getModel());
|
reconcileFwVersionToTrack(ce, reportedFwImageName, opensyncAPState.getModel());
|
||||||
} else {
|
} else {
|
||||||
if (!updates.isEmpty()) {
|
if (!updates.isEmpty()) {
|
||||||
@@ -2701,7 +2738,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
if (!firmwareStatusData.getActiveSwVersion().equals(reportedFwImageName)
|
if (!firmwareStatusData.getActiveSwVersion().equals(reportedFwImageName)
|
||||||
|| !firmwareStatusData.getUpgradeState().equals(fwUpgradeState)) {
|
|| !firmwareStatusData.getUpgradeState().equals(fwUpgradeState)) {
|
||||||
firmwareStatusData.setActiveSwVersion(reportedFwImageName);
|
firmwareStatusData.setActiveSwVersion(reportedFwImageName);
|
||||||
firmwareStatusData.setUpgradeState(fwUpgradeState);
|
firmwareStatusData.setUpgradeState(fwUpgradeState, fwUpgradeFailureReason);
|
||||||
firmwareStatus.setDetails(firmwareStatusData);
|
firmwareStatus.setDetails(firmwareStatusData);
|
||||||
updates.add(firmwareStatus);
|
updates.add(firmwareStatus);
|
||||||
updates = statusServiceInterface.update(updates);
|
updates = statusServiceInterface.update(updates);
|
||||||
@@ -2728,6 +2765,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
@Override
|
@Override
|
||||||
public void wifiVIFStateDbTableDelete(List<OpensyncAPVIFState> vifStateTables, String apId) {
|
public void wifiVIFStateDbTableDelete(List<OpensyncAPVIFState> vifStateTables, String apId) {
|
||||||
|
|
||||||
|
LOG.info("wifiVIFStateDbTableDelete for AP {} rows {}", apId, vifStateTables);
|
||||||
OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
|
OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
|
||||||
|
|
||||||
if (ovsdbSession == null) {
|
if (ovsdbSession == null) {
|
||||||
@@ -2760,8 +2798,20 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
ActiveBSSIDs statusDetails = (ActiveBSSIDs) activeBssidsStatus.getDetails();
|
ActiveBSSIDs statusDetails = (ActiveBSSIDs) activeBssidsStatus.getDetails();
|
||||||
|
|
||||||
List<ActiveBSSID> bssidList = statusDetails.getActiveBSSIDs();
|
List<ActiveBSSID> bssidList = statusDetails.getActiveBSSIDs();
|
||||||
|
List<ActiveBSSID> toBeDeleted = new ArrayList<>();
|
||||||
|
for (OpensyncAPVIFState vifState : vifStateTables) {
|
||||||
|
|
||||||
bssidList.clear();
|
if (bssidList != null) {
|
||||||
|
for (ActiveBSSID activeBSSID : bssidList) {
|
||||||
|
if (activeBSSID.getBssid().equals(vifState.getMac())
|
||||||
|
&& activeBSSID.getSsid().equals(vifState.getSsid())) {
|
||||||
|
toBeDeleted.add(activeBSSID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bssidList.removeAll(toBeDeleted);
|
||||||
|
|
||||||
statusDetails.setActiveBSSIDs(bssidList);
|
statusDetails.setActiveBSSIDs(bssidList);
|
||||||
|
|
||||||
|
|||||||
@@ -645,48 +645,27 @@ public class OpensyncExternalIntegrationCloudTest {
|
|||||||
public void testWifiRadioStatusDbTableUpdate() {
|
public void testWifiRadioStatusDbTableUpdate() {
|
||||||
|
|
||||||
String apId = "Test_Client_21P10C68818122";
|
String apId = "Test_Client_21P10C68818122";
|
||||||
OpensyncAPVIFState vifState1 = new OpensyncAPVIFState();
|
|
||||||
vifState1.setMac("24:f5:a2:ef:2e:54");
|
|
||||||
vifState1.setSsid("ssid-1");
|
|
||||||
Uuid uuid1 = Uuid.of(UUID.randomUUID());
|
|
||||||
|
|
||||||
vifState1.setAssociatedClients(ImmutableList.of(uuid1));
|
|
||||||
|
|
||||||
OpensyncAPRadioState radioState1 = new OpensyncAPRadioState();
|
OpensyncAPRadioState radioState1 = new OpensyncAPRadioState();
|
||||||
radioState1.setChannel(6);
|
radioState1.setChannel(6);
|
||||||
radioState1.setVifStates(ImmutableList.of(vifState1));
|
radioState1.setVifStates(ImmutableSet.of(new Uuid(UUID.randomUUID())));
|
||||||
radioState1.setFreqBand(RadioType.is5GHzL);
|
radioState1.setFreqBand(RadioType.is5GHzL);
|
||||||
radioState1.setAllowedChannels(ImmutableSet.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11));
|
radioState1.setAllowedChannels(ImmutableSet.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11));
|
||||||
radioState1.setTxPower(32);
|
radioState1.setTxPower(32);
|
||||||
radioState1.setEnabled(true);
|
radioState1.setEnabled(true);
|
||||||
radioState1.setCountry("CA");
|
radioState1.setCountry("CA");
|
||||||
|
|
||||||
OpensyncAPVIFState vifState2 = new OpensyncAPVIFState();
|
|
||||||
vifState2.setMac("24:f5:a2:ef:2e:55");
|
|
||||||
vifState2.setSsid("ssid-2");
|
|
||||||
Uuid uuid2 = Uuid.of(UUID.randomUUID());
|
|
||||||
|
|
||||||
vifState2.setAssociatedClients(ImmutableList.of(uuid2));
|
|
||||||
|
|
||||||
OpensyncAPRadioState radioState2 = new OpensyncAPRadioState();
|
OpensyncAPRadioState radioState2 = new OpensyncAPRadioState();
|
||||||
radioState2.setChannel(36);
|
radioState2.setChannel(36);
|
||||||
radioState2.setVifStates(ImmutableList.of(vifState2));
|
radioState2.setVifStates(ImmutableSet.of(new Uuid(UUID.randomUUID())));
|
||||||
radioState2.setFreqBand(RadioType.is5GHzL);
|
radioState2.setFreqBand(RadioType.is5GHzL);
|
||||||
radioState2.setAllowedChannels(ImmutableSet.of(36, 40, 44, 48, 52, 56, 60, 64));
|
radioState2.setAllowedChannels(ImmutableSet.of(36, 40, 44, 48, 52, 56, 60, 64));
|
||||||
radioState2.setTxPower(32);
|
radioState2.setTxPower(32);
|
||||||
radioState2.setEnabled(true);
|
radioState2.setEnabled(true);
|
||||||
radioState2.setCountry("CA");
|
radioState2.setCountry("CA");
|
||||||
|
|
||||||
OpensyncAPVIFState vifState3 = new OpensyncAPVIFState();
|
|
||||||
vifState3.setMac("24:f5:a2:ef:2e:56");
|
|
||||||
vifState3.setSsid("ssid-3");
|
|
||||||
Uuid uuid3 = Uuid.of(UUID.randomUUID());
|
|
||||||
|
|
||||||
vifState3.setAssociatedClients(ImmutableList.of(uuid3));
|
|
||||||
|
|
||||||
OpensyncAPRadioState radioState3 = new OpensyncAPRadioState();
|
OpensyncAPRadioState radioState3 = new OpensyncAPRadioState();
|
||||||
radioState3.setChannel(149);
|
radioState3.setChannel(149);
|
||||||
radioState3.setVifStates(ImmutableList.of(vifState3));
|
radioState3.setVifStates(ImmutableSet.of(new Uuid(UUID.randomUUID())));
|
||||||
radioState3.setFreqBand(RadioType.is5GHzL);
|
radioState3.setFreqBand(RadioType.is5GHzL);
|
||||||
radioState3.setAllowedChannels(
|
radioState3.setAllowedChannels(
|
||||||
ImmutableSet.of(00, 104, 108, 112, 116, 132, 136, 140, 144, 149, 153, 157, 161, 165));
|
ImmutableSet.of(00, 104, 108, 112, 116, 132, 136, 140, 144, 149, 153, 157, 161, 165));
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class OpensyncAPRadioState extends BaseJsonModel {
|
|||||||
public Map<String, String> hwParams;
|
public Map<String, String> hwParams;
|
||||||
public RadioType freqBand;
|
public RadioType freqBand;
|
||||||
public int thermalIntegration;
|
public int thermalIntegration;
|
||||||
public List<OpensyncAPVIFState> vifStates;
|
public Set<Uuid> vifStates;
|
||||||
|
|
||||||
public OpensyncAPRadioState() {
|
public OpensyncAPRadioState() {
|
||||||
super();
|
super();
|
||||||
@@ -56,7 +56,7 @@ public class OpensyncAPRadioState extends BaseJsonModel {
|
|||||||
hwConfig = new HashMap<>();
|
hwConfig = new HashMap<>();
|
||||||
channels = new HashMap<>();
|
channels = new HashMap<>();
|
||||||
hwParams = new HashMap<>();
|
hwParams = new HashMap<>();
|
||||||
vifStates = new ArrayList<>();
|
vifStates = new HashSet<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String channelMode;
|
public String channelMode;
|
||||||
@@ -103,11 +103,11 @@ public class OpensyncAPRadioState extends BaseJsonModel {
|
|||||||
this.mac = mac;
|
this.mac = mac;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OpensyncAPVIFState> getVifStates() {
|
public Set<Uuid> getVifStates() {
|
||||||
return vifStates;
|
return vifStates;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVifStates(List<OpensyncAPVIFState> vifStates) {
|
public void setVifStates(Set<Uuid> vifStates) {
|
||||||
this.vifStates = vifStates;
|
this.vifStates = vifStates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.telecominfraproject.wlan.opensync.ovsdb;
|
|||||||
|
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -352,12 +351,13 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
CompletableFuture<TableUpdates> awCf = ovsdbClient
|
CompletableFuture<TableUpdates> awCf = ovsdbClient
|
||||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.awlanNodeDbTable + "_" + key,
|
.monitor(OvsdbDao.ovsdbName, OvsdbDao.awlanNodeDbTable + "_" + key,
|
||||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.awlanNodeDbTable,
|
new MonitorRequests(ImmutableMap.of(OvsdbDao.awlanNodeDbTable,
|
||||||
new MonitorRequest(new MonitorSelect(true, false, false, true)))),
|
new MonitorRequest(new MonitorSelect(false, false, false, true)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
LOG.info("Monitor callback received {}", tableUpdates);
|
LOG.info(OvsdbDao.awlanNodeDbTable + "_" + key + " monitor callback received {}",
|
||||||
|
tableUpdates);
|
||||||
|
|
||||||
extIntegrationInterface.awlanNodeDbTableUpdate(
|
extIntegrationInterface.awlanNodeDbTableUpdate(
|
||||||
ovsdbDao.getOpensyncAWLANNode(tableUpdates, key, ovsdbClient), key);
|
ovsdbDao.getOpensyncAWLANNode(tableUpdates, key, ovsdbClient), key);
|
||||||
@@ -365,8 +365,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
extIntegrationInterface.awlanNodeDbTableUpdate(ovsdbDao.getOpensyncAWLANNode(awCf.join(), key, ovsdbClient),
|
awCf.join();
|
||||||
key);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,38 +373,38 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
CompletableFuture<TableUpdates> acCf = ovsdbClient
|
CompletableFuture<TableUpdates> acCf = ovsdbClient
|
||||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiAssociatedClientsDbTable + "_" + key,
|
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiAssociatedClientsDbTable + "_" + key,
|
||||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiAssociatedClientsDbTable,
|
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiAssociatedClientsDbTable,
|
||||||
new MonitorRequest(new MonitorSelect(true, true, false, true)))),
|
new MonitorRequest(new MonitorSelect(false, true, false, true)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
LOG.info("Monitor callback received {}", tableUpdates);
|
LOG.info(OvsdbDao.wifiAssociatedClientsDbTable + "_" + key
|
||||||
|
+ " monitor callback received {}", tableUpdates);
|
||||||
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
|
||||||
|
|
||||||
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(
|
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(
|
||||||
ovsdbDao.getOpensyncWifiAssociatedClients(tableUpdates, key, ovsdbClient),
|
ovsdbDao.getOpensyncWifiAssociatedClients(tableUpdates, key, ovsdbClient), key);
|
||||||
key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(
|
acCf.join();
|
||||||
ovsdbDao.getOpensyncWifiAssociatedClients(acCf.join(), key, ovsdbClient), key);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void monitorWifiInetStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
private void monitorWifiInetStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
||||||
CompletableFuture<TableUpdates> isCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
|
CompletableFuture<TableUpdates> isCf = ovsdbClient
|
||||||
OvsdbDao.wifiInetStateDbTable + "_" + key,
|
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiInetStateDbTable + "_" + key,
|
||||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiInetStateDbTable,
|
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiInetStateDbTable,
|
||||||
new MonitorRequest(new MonitorSelect(true, true, true, true)))),
|
new MonitorRequest(new MonitorSelect(false, true, true, true)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
LOG.info("Monitor callback received {}", tableUpdates);
|
LOG.info(OvsdbDao.ovsdbName,
|
||||||
|
OvsdbDao.wifiInetStateDbTable + "_" + key + " monitor callback received {}",
|
||||||
|
tableUpdates);
|
||||||
|
|
||||||
extIntegrationInterface.wifiInetStateDbTableUpdate(
|
extIntegrationInterface.wifiInetStateDbTableUpdate(
|
||||||
ovsdbDao.getOpensyncAPInetState(tableUpdates, key, ovsdbClient), key);
|
ovsdbDao.getOpensyncAPInetState(tableUpdates, key, ovsdbClient), key);
|
||||||
@@ -413,41 +412,42 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
isCf.join();
|
||||||
|
|
||||||
extIntegrationInterface
|
|
||||||
.wifiInetStateDbTableUpdate(ovsdbDao.getOpensyncAPInetState(isCf.join(), key, ovsdbClient), key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void monitorWifiRadioStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
private void monitorWifiRadioStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
||||||
CompletableFuture<TableUpdates> rsCf = ovsdbClient
|
CompletableFuture<TableUpdates> rsCf = ovsdbClient
|
||||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiRadioStateDbTable + "_" + key,
|
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiRadioStateDbTable + "_" + key,
|
||||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiRadioStateDbTable,
|
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiRadioStateDbTable,
|
||||||
new MonitorRequest(new MonitorSelect(true, false, false, true)))),
|
new MonitorRequest(new MonitorSelect(false, false, false, true)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
LOG.info("Monitor callback received {}", tableUpdates);
|
LOG.info(OvsdbDao.wifiRadioStateDbTable + "_" + key + " monitor callback received {}",
|
||||||
|
tableUpdates);
|
||||||
|
|
||||||
extIntegrationInterface.wifiRadioStatusDbTableUpdate(
|
extIntegrationInterface.wifiRadioStatusDbTableUpdate(
|
||||||
ovsdbDao.getOpensyncAPRadioState(tableUpdates, key, ovsdbClient), key);
|
ovsdbDao.getOpensyncAPRadioState(tableUpdates, key, ovsdbClient), key);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
extIntegrationInterface
|
rsCf.join();
|
||||||
.wifiRadioStatusDbTableUpdate(ovsdbDao.getOpensyncAPRadioState(rsCf.join(), key, ovsdbClient), key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void monitorWifiVifStateDbTableDeletion(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
private void monitorWifiVifStateDbTableDeletion(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
||||||
CompletableFuture<TableUpdates> vsdCf = ovsdbClient
|
CompletableFuture<TableUpdates> vsdCf = ovsdbClient
|
||||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiVifStateDbTable + "_delete_" + key,
|
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiVifStateDbTable + "_delete_" + key,
|
||||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiVifStateDbTable,
|
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiVifStateDbTable,
|
||||||
new MonitorRequest(new MonitorSelect(true, false, true, false)))),
|
new MonitorRequest(new MonitorSelect(false, false, true, false)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
|
|
||||||
LOG.info("Monitor callback received {}", tableUpdates);
|
LOG.info(OvsdbDao.wifiVifStateDbTable + "_delete_" + key
|
||||||
|
+ " monitor callback received {}", tableUpdates);
|
||||||
|
|
||||||
// extIntegrationInterface.wifiVIFStateDbTableUpdate(
|
// extIntegrationInterface.wifiVIFStateDbTableUpdate(
|
||||||
// ovsdbDao.getOpensyncAPVIFState(tableUpdates,
|
// ovsdbDao.getOpensyncAPVIFState(tableUpdates,
|
||||||
@@ -458,8 +458,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
|
|
||||||
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)) {
|
|
||||||
Row row = rowUpdate.getValue().getOld();
|
Row row = rowUpdate.getValue().getOld();
|
||||||
String ifName = null;
|
String ifName = null;
|
||||||
String ssid = null;
|
String ssid = null;
|
||||||
@@ -506,12 +505,13 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
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,
|
||||||
new MonitorRequest(new MonitorSelect(true, false, true, false)))),
|
new MonitorRequest(new MonitorSelect(false, false, true, false)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
LOG.info("Monitor callback received {}", tableUpdates);
|
LOG.info(OvsdbDao.wifiAssociatedClientsDbTable + "_delete_" + key
|
||||||
|
+ " monitor callback received {}", tableUpdates);
|
||||||
|
|
||||||
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
|
||||||
|
|
||||||
@@ -536,11 +536,13 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
CompletableFuture<TableUpdates> vsCf = ovsdbClient
|
CompletableFuture<TableUpdates> vsCf = ovsdbClient
|
||||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiVifStateDbTable + "_" + key,
|
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiVifStateDbTable + "_" + key,
|
||||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiVifStateDbTable,
|
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiVifStateDbTable,
|
||||||
new MonitorRequest(new MonitorSelect(true, true, false, true)))),
|
new MonitorRequest(new MonitorSelect(false, true, false, true)))),
|
||||||
new MonitorCallback() {
|
new MonitorCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void update(TableUpdates tableUpdates) {
|
public void update(TableUpdates tableUpdates) {
|
||||||
LOG.info("Monitor callback received {}", tableUpdates);
|
|
||||||
|
LOG.info(OvsdbDao.wifiVifStateDbTable + "_" + key + " monitor callback received {}",
|
||||||
|
tableUpdates);
|
||||||
List<OpensyncAPVIFState> vifStates = ovsdbDao.getOpensyncAPVIFState(tableUpdates, key,
|
List<OpensyncAPVIFState> vifStates = ovsdbDao.getOpensyncAPVIFState(tableUpdates, key,
|
||||||
ovsdbClient);
|
ovsdbClient);
|
||||||
LOG.info("Calling wifiVIFStateDbTableUpdate for {}, {}", vifStates, key);
|
LOG.info("Calling wifiVIFStateDbTableUpdate for {}, {}", vifStates, key);
|
||||||
@@ -550,8 +552,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
extIntegrationInterface.wifiVIFStateDbTableUpdate(ovsdbDao.getOpensyncAPVIFState(vsCf.join(), key, ovsdbClient),
|
vsCf.join();
|
||||||
key);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -608,10 +608,7 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ovsdbClient
|
* @param ovsdbClient
|
||||||
* @param value
|
*
|
||||||
* of reporting_interval column for the stats_type=device from
|
|
||||||
* the Wifi_Stats_Config table. If value is not provisioned then
|
|
||||||
* return -1.
|
|
||||||
*/
|
*/
|
||||||
public void enableNetworkProbeForSyntheticClient(OvsdbClient ovsdbClient) {
|
public void enableNetworkProbeForSyntheticClient(OvsdbClient ovsdbClient) {
|
||||||
LOG.debug("Enable network_probe metrics for synthetic client");
|
LOG.debug("Enable network_probe metrics for synthetic client");
|
||||||
@@ -735,35 +732,6 @@ public class OvsdbDao {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getWifiVIFsForRadioByUuid(OvsdbClient ovsdbClient, List<OpensyncAPVIFState> vifList, Uuid uuid) {
|
|
||||||
List<Operation> operations = new ArrayList<>();
|
|
||||||
List<Condition> conditions = new ArrayList<>();
|
|
||||||
|
|
||||||
conditions.add(new Condition("_uuid", Function.EQUALS, new Atom<>(uuid)));
|
|
||||||
operations.add(new Select(wifiVifStateDbTable, conditions));
|
|
||||||
|
|
||||||
try {
|
|
||||||
CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations);
|
|
||||||
OperationResult[] result = fResult.get(ovsdbTimeoutSec, TimeUnit.SECONDS);
|
|
||||||
|
|
||||||
if ((result != null) && (result.length > 0) && result[0] instanceof SelectResult
|
|
||||||
&& !((SelectResult) result[0]).getRows().isEmpty()) {
|
|
||||||
|
|
||||||
Row row = ((SelectResult) result[0]).getRows().iterator().next();
|
|
||||||
|
|
||||||
OpensyncAPVIFState tableState = processWifiVIFStateColumn(ovsdbClient, row, false);
|
|
||||||
|
|
||||||
vifList.add(tableState);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
LOG.info("Could not get Wifi_VIF_State for UUID {}. {}", uuid, e.getMessage());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private OpensyncAPVIFState processWifiVIFStateColumn(OvsdbClient ovsdbClient, Row row, boolean update) {
|
private OpensyncAPVIFState processWifiVIFStateColumn(OvsdbClient ovsdbClient, Row row, boolean update) {
|
||||||
OpensyncAPVIFState tableState = new OpensyncAPVIFState();
|
OpensyncAPVIFState tableState = new OpensyncAPVIFState();
|
||||||
|
|
||||||
@@ -1201,7 +1169,7 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
wifiVifConfigInfo.macList = row.getSetColumn("mac_list");
|
wifiVifConfigInfo.macList = row.getSetColumn("mac_list");
|
||||||
|
|
||||||
if (row.getColumns().get("mac_list_type") != null && row.getColumns().get("mac_list_type").getClass()
|
if ((row.getColumns().get("mac_list_type") != null) && 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");
|
||||||
}
|
}
|
||||||
@@ -1640,7 +1608,6 @@ public class OvsdbDao {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Now clean up references in the vif_configs columns
|
// Now clean up references in the vif_configs columns
|
||||||
operations = new ArrayList<>();
|
operations = new ArrayList<>();
|
||||||
Map<String, Value> updateColumns = new HashMap<>();
|
Map<String, Value> updateColumns = new HashMap<>();
|
||||||
@@ -1770,14 +1737,20 @@ public class OvsdbDao {
|
|||||||
enabled, ht_mode, txPower);
|
enabled, ht_mode, txPower);
|
||||||
} catch (OvsdbClientException e) {
|
} catch (OvsdbClientException e) {
|
||||||
LOG.error("ConfigureWifiRadios failed with OvsdbClient exception.", e);
|
LOG.error("ConfigureWifiRadios failed with OvsdbClient exception.", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
} catch (TimeoutException e) {
|
} catch (TimeoutException e) {
|
||||||
LOG.error("ConfigureWifiRadios failed with Timeout.", e);
|
LOG.error("ConfigureWifiRadios failed with Timeout.", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
LOG.error("ConfigureWifiRadios excecution failed.", e);
|
LOG.error("ConfigureWifiRadios excecution failed.", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
LOG.error("ConfigureWifiRadios interrupted.", e);
|
LOG.error("ConfigureWifiRadios interrupted.", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1882,14 +1855,7 @@ public class OvsdbDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Set<Uuid> vifStates = row.getSetColumn("vif_states");
|
Set<Uuid> vifStates = row.getSetColumn("vif_states");
|
||||||
List<OpensyncAPVIFState> vifStatesList = new ArrayList<>();
|
tableState.setVifStates(vifStates);
|
||||||
if (vifStates != null) {
|
|
||||||
for (Uuid uuid : vifStates) {
|
|
||||||
getWifiVIFsForRadioByUuid(ovsdbClient, vifStatesList, uuid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tableState.setVifStates(vifStatesList);
|
|
||||||
|
|
||||||
ret.add(tableState);
|
ret.add(tableState);
|
||||||
}
|
}
|
||||||
@@ -1905,6 +1871,8 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Could not parse update for Wifi_Radio_State", e);
|
LOG.error("Could not parse update for Wifi_Radio_State", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1979,6 +1947,8 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Could not parse update for Wifi_Inet_State", e);
|
LOG.error("Could not parse update for Wifi_Inet_State", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -2014,6 +1984,7 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Could not parse update for Wifi_VIF_State", e);
|
LOG.error("Could not parse update for Wifi_VIF_State", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -2069,6 +2040,8 @@ public class OvsdbDao {
|
|||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Could not get Wifi_Associated_Clients list from table update", e);
|
LOG.error("Could not get Wifi_Associated_Clients list from table update", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -2194,6 +2167,8 @@ public class OvsdbDao {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Failed to handle AWLAN_Node update", e);
|
LOG.error("Failed to handle AWLAN_Node update", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tableState;
|
return tableState;
|
||||||
@@ -2357,7 +2332,7 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
private void updateBlockList(Map<String, Value> updateColumns, List<MacAddress> macBlockList) {
|
private void updateBlockList(Map<String, Value> updateColumns, List<MacAddress> macBlockList) {
|
||||||
|
|
||||||
if (macBlockList != null && !macBlockList.isEmpty()) {
|
if ((macBlockList != null) && !macBlockList.isEmpty()) {
|
||||||
updateColumns.put("mac_list_type", new Atom<>("blacklist"));
|
updateColumns.put("mac_list_type", new Atom<>("blacklist"));
|
||||||
Set<Atom<String>> atomMacList = new HashSet<>();
|
Set<Atom<String>> atomMacList = new HashSet<>();
|
||||||
for (MacAddress mac : macBlockList) {
|
for (MacAddress mac : macBlockList) {
|
||||||
@@ -2495,8 +2470,8 @@ public class OvsdbDao {
|
|||||||
int clientDlLimit = 0;
|
int clientDlLimit = 0;
|
||||||
int clientUlLimit = 0;
|
int clientUlLimit = 0;
|
||||||
|
|
||||||
if ((ssidConfig.getBandwidthLimitDown() != null && ssidConfig.getBandwidthLimitUp() > 0)
|
if (((ssidConfig.getBandwidthLimitDown() != null) && (ssidConfig.getBandwidthLimitUp() > 0))
|
||||||
|| (ssidConfig.getBandwidthLimitUp() != null && ssidConfig.getBandwidthLimitUp() > 0)) {
|
|| ((ssidConfig.getBandwidthLimitUp() != null) && (ssidConfig.getBandwidthLimitUp() > 0))) {
|
||||||
rateLimitEnable = true;
|
rateLimitEnable = true;
|
||||||
ssidUlLimit = ssidConfig.getBandwidthLimitUp();
|
ssidUlLimit = ssidConfig.getBandwidthLimitUp();
|
||||||
ssidDlLimit = ssidConfig.getBandwidthLimitDown();
|
ssidDlLimit = ssidConfig.getBandwidthLimitDown();
|
||||||
@@ -2509,25 +2484,25 @@ public class OvsdbDao {
|
|||||||
String ifName = null;
|
String ifName = null;
|
||||||
String radioName = null;
|
String radioName = null;
|
||||||
for (Entry<String, WifiRadioConfigInfo> entry : provisionedRadioConfigs.entrySet()) {
|
for (Entry<String, WifiRadioConfigInfo> entry : provisionedRadioConfigs.entrySet()) {
|
||||||
if (radioType == RadioType.is2dot4GHz && entry.getValue().freqBand.equals("2.4G")) {
|
if ((radioType == RadioType.is2dot4GHz) && entry.getValue().freqBand.equals("2.4G")) {
|
||||||
freqBand = "2.4G";
|
freqBand = "2.4G";
|
||||||
radioName = entry.getKey();
|
radioName = entry.getKey();
|
||||||
break;
|
break;
|
||||||
} else if (radioType == RadioType.is5GHzL && entry.getValue().freqBand.equals("5GL")) {
|
} else if ((radioType == RadioType.is5GHzL) && entry.getValue().freqBand.equals("5GL")) {
|
||||||
freqBand = "5GL";
|
freqBand = "5GL";
|
||||||
radioName = entry.getKey();
|
radioName = entry.getKey();
|
||||||
break;
|
break;
|
||||||
} else if (radioType == RadioType.is5GHzU && entry.getValue().freqBand.equals("5GU")) {
|
} else if ((radioType == RadioType.is5GHzU) && entry.getValue().freqBand.equals("5GU")) {
|
||||||
freqBand = "5GU";
|
freqBand = "5GU";
|
||||||
radioName = entry.getKey();
|
radioName = entry.getKey();
|
||||||
break;
|
break;
|
||||||
} else if (radioType == RadioType.is5GHz && entry.getValue().freqBand.equals("5G")) {
|
} else if ((radioType == RadioType.is5GHz) && entry.getValue().freqBand.equals("5G")) {
|
||||||
freqBand = "5G";
|
freqBand = "5G";
|
||||||
radioName = entry.getKey();
|
radioName = entry.getKey();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (radioName == null || freqBand == null) {
|
if ((radioName == null) || (freqBand == null)) {
|
||||||
LOG.debug("Cannot provision SSID with radio if_name {} and freqBand {}", radioName, freqBand);
|
LOG.debug("Cannot provision SSID with radio if_name {} and freqBand {}", radioName, freqBand);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -2726,9 +2701,10 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
private void getCaptiveConfiguration(OpensyncAPConfig opensyncApConfig, SsidConfiguration ssidConfig,
|
private void getCaptiveConfiguration(OpensyncAPConfig opensyncApConfig, SsidConfiguration ssidConfig,
|
||||||
Map<String, String> captiveMap, List<String> walledGardenAllowlist) {
|
Map<String, String> captiveMap, List<String> walledGardenAllowlist) {
|
||||||
if (ssidConfig.getCaptivePortalId() != null && opensyncApConfig.getCaptiveProfiles() != null) {
|
if ((ssidConfig.getCaptivePortalId() != null) && (opensyncApConfig.getCaptiveProfiles() != null)) {
|
||||||
for (Profile profileCaptive : opensyncApConfig.getCaptiveProfiles()) {
|
for (Profile profileCaptive : opensyncApConfig.getCaptiveProfiles()) {
|
||||||
if (ssidConfig.getCaptivePortalId() == profileCaptive.getId() && profileCaptive.getDetails() != null) {
|
if ((ssidConfig.getCaptivePortalId() == profileCaptive.getId())
|
||||||
|
&& (profileCaptive.getDetails() != null)) {
|
||||||
CaptivePortalConfiguration captiveProfileDetails = ((CaptivePortalConfiguration) profileCaptive
|
CaptivePortalConfiguration captiveProfileDetails = ((CaptivePortalConfiguration) profileCaptive
|
||||||
.getDetails());
|
.getDetails());
|
||||||
captiveMap.put("sessionTimeoutInMinutes",
|
captiveMap.put("sessionTimeoutInMinutes",
|
||||||
@@ -2755,7 +2731,7 @@ public class OvsdbDao {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getCaptiveManagedFileUrl(String fileDesc, ManagedFileInfo fileInfo) {
|
private String getCaptiveManagedFileUrl(String fileDesc, ManagedFileInfo fileInfo) {
|
||||||
if (fileInfo == null || fileInfo.getApExportUrl() == null) {
|
if ((fileInfo == null) || (fileInfo.getApExportUrl() == null)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if (fileInfo.getApExportUrl().startsWith(HTTP)) {
|
if (fileInfo.getApExportUrl().startsWith(HTTP)) {
|
||||||
@@ -3158,6 +3134,8 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Could not download firmware {} to AP {}", firmwareVersion, apId, e);
|
LOG.error("Could not download firmware {} to AP {}", firmwareVersion, apId, e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3183,6 +3161,8 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Could not configure timer for flashing firmware {} on AP {}", firmwareVersion, apId, e);
|
LOG.error("Could not configure timer for flashing firmware {} on AP {}", firmwareVersion, apId, e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3217,7 +3197,12 @@ public class OvsdbDao {
|
|||||||
Map<String, WifiRadioConfigInfo> radioConfigs = getProvisionedWifiRadioConfigs(ovsdbClient);
|
Map<String, WifiRadioConfigInfo> radioConfigs = getProvisionedWifiRadioConfigs(ovsdbClient);
|
||||||
Map<String, String> radioIfNameMap = new HashMap<>();
|
Map<String, String> radioIfNameMap = new HashMap<>();
|
||||||
|
|
||||||
radioConfigs.entrySet().stream().forEach(e -> radioIfNameMap.put(e.getValue().freqBand, e.getKey()));
|
radioConfigs.entrySet().stream().forEach(new Consumer<Entry<String, WifiRadioConfigInfo>>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Entry<String, WifiRadioConfigInfo> e) {
|
||||||
|
radioIfNameMap.put(e.getValue().freqBand, e.getKey());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
ApElementConfiguration apElementConfig = (ApElementConfiguration) opensyncApConfig.getCustomerEquipment()
|
ApElementConfiguration apElementConfig = (ApElementConfiguration) opensyncApConfig.getCustomerEquipment()
|
||||||
.getDetails();
|
.getDetails();
|
||||||
@@ -3265,14 +3250,19 @@ public class OvsdbDao {
|
|||||||
managementRate);
|
managementRate);
|
||||||
} catch (OvsdbClientException e) {
|
} catch (OvsdbClientException e) {
|
||||||
LOG.error("configureRrm failed with OvsdbClient exception.", e);
|
LOG.error("configureRrm failed with OvsdbClient exception.", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
} catch (TimeoutException e) {
|
} catch (TimeoutException e) {
|
||||||
LOG.error("configureRrm failed with Timeout.", e);
|
LOG.error("configureRrm failed with Timeout.", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
LOG.error("configureRrm excecution failed.", e);
|
LOG.error("configureRrm excecution failed.", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
LOG.error("configureRrm interrupted.", e);
|
LOG.error("configureRrm interrupted.", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user