From de7d156429104f9a92d717c095ca136a0c482128 Mon Sep 17 00:00:00 2001 From: Christie Unitt Date: Tue, 12 Apr 2022 15:56:47 -0400 Subject: [PATCH] NETEXP-4690 Port to 1.4: OpenSync gateway change to dervie radioType from AP chan number --- .../OpensyncExternalIntegrationCloud.java | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java index 629a395..a8de96e 100644 --- a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java +++ b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java @@ -98,7 +98,6 @@ import com.telecominfraproject.wlan.profile.models.ProfileType; import com.telecominfraproject.wlan.profile.network.models.ApNetworkConfiguration; import com.telecominfraproject.wlan.profile.network.models.RadioProfileConfiguration; import com.telecominfraproject.wlan.profile.rf.models.RfConfiguration; -import com.telecominfraproject.wlan.profile.rf.models.RfElementConfiguration; import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration; import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration.SecureMode; import com.telecominfraproject.wlan.routing.RoutingServiceInterface; @@ -143,6 +142,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra private static final String NATIVE_VLAN_ID = "pvid"; private static final String SPACE_SEPERATOR = " "; + public final static int MAX_ALLOWED_2GHz_CHANNEL_NUMBER = 14; + private static final Logger LOG = LoggerFactory.getLogger(OpensyncExternalIntegrationCloud.class); @Autowired @@ -1123,11 +1124,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra return; } - ApElementConfiguration apElementConfig = (ApElementConfiguration) apNode.getDetails(); - - ProfileContainer profileContainer = new ProfileContainer(profileServiceInterface.getProfileWithChildren(apNode.getProfileId())); - RfConfiguration rfConfig = (RfConfiguration) profileContainer.getChildOfTypeOrNull(apNode.getProfileId(), ProfileType.rf).getDetails(); - for (OpensyncAPVIFState vifState : vifStateTables) { LOG.debug("Processing vifState for interface {} on AP {}", vifState.getIfName(), apId); @@ -1158,19 +1154,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra vifState.getAssociatedClients(), channel); RadioType radioType = null; - Map rfElementMap = rfConfig.getRfConfigMap(); - Map elementRadioMap = apElementConfig.getRadioMap(); - - if (apElementConfig.getAdvancedRadioMap().isEmpty()) { - LOG.warn("No AdvancedRadioMap for ap {} {}", apId, apElementConfig); - continue; - } - for (RadioType rType : elementRadioMap.keySet()) { - boolean autoChannelSelection = rfElementMap.get(rType).getAutoChannelSelection(); - if (elementRadioMap.get(rType).getActiveChannel(autoChannelSelection) == channel) { - radioType = rType; - break; - } + if (channel <= MAX_ALLOWED_2GHz_CHANNEL_NUMBER) { + radioType = RadioType.is2dot4GHz; + } else { + radioType = RadioType.is5GHz; // 8300 isn't supported } updateActiveBssids(customerId, equipmentId, apId, ssid, radioType, bssid, numClients); @@ -1461,8 +1448,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra if (currentActiveBSSIDs == null) { currentActiveBSSIDs = new ArrayList<>(); } else { - currentActiveBSSIDs = currentActiveBSSIDs.stream().filter(p -> (p.getRadioType() != null && p.getSsid() != null)) - .filter(p -> !p.getRadioType().equals(freqBand) || !p.getSsid().equals(ssid)).collect(Collectors.toList()); + currentActiveBSSIDs = currentActiveBSSIDs.stream() + .filter(p -> (p.getRadioType() != null && p.getSsid() != null)) + .filter(p -> !(p.getRadioType().equals(freqBand) && p.getSsid().equals(ssid)) ) + .collect(Collectors.toList()); LOG.debug("Processing Wifi_VIF_State table update for AP {}, activeBSSIDs bssidList without current radio freq {} and ssid {}", apId, currentActiveBSSIDs, ssid); }