Adding RF Profile changes and updating static

This commit is contained in:
ralphlee
2020-09-18 11:55:36 -04:00
parent ce14eb359d
commit 71c41bb892
8 changed files with 152 additions and 53 deletions

View File

@@ -75,6 +75,7 @@ import com.telecominfraproject.wlan.profile.models.ProfileContainer;
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.network.models.RfConfiguration;
import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration;
import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration.SecureMode;
import com.telecominfraproject.wlan.routing.RoutingServiceInterface;
@@ -248,11 +249,11 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
}
if (!radioType.equals(RadioType.UNSUPPORTED)) {
advancedRadioConfiguration = RadioConfiguration.createWithDefaults(radioType);
advancedRadioConfiguration.setAutoChannelSelection(StateSetting.disabled);
// advancedRadioConfiguration.setAutoChannelSelection(StateSetting.disabled);
advancedRadioMap.put(radioType, advancedRadioConfiguration);
radioConfiguration = ElementRadioConfiguration.createWithDefaults(radioType);
radioConfiguration.setAutoChannelSelection(false);
// radioConfiguration.setAutoChannelSelection(false);
radioMap.put(radioType, radioConfiguration);
}
}
@@ -379,6 +380,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
Set<RadioType> radioTypes = radioProfileMap.keySet();
for (RadioType radioType : radioTypes) {
// SSID Profile set in AP Profile
Profile ssidProfile = new Profile();
ssidProfile.setCustomerId(ce.getCustomerId());
ssidProfile.setName(autoProvisionedSsid + radioType.name() + " for " + ce.getName());
@@ -397,9 +399,29 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
ssidProfile = profileServiceInterface.create(ssidProfile);
apProfile.getChildProfileIds().add(ssidProfile.getId());
// Update AP Profile with ssidProfile and rfProfile
apProfile = profileServiceInterface.update(apProfile);
}
// RF Profile set in AP Profile
Profile rfProfile = new Profile();
rfProfile.setCustomerId(ce.getCustomerId());
rfProfile.setName("DefaultRf-" + " for " + ce.getName());
RfConfiguration rfConfig = RfConfiguration.createWithDefaults();
// Override default values
for (RadioType radioType: radioTypes) {
rfConfig.getRfConfig(radioType).setRf(rfProfile.getName());
}
rfProfile.setDetails(rfConfig);
rfProfile = profileServiceInterface.create(rfProfile);
apProfile.getChildProfileIds().add(rfProfile.getId());
// Update AP Profile with ssidProfile and rfProfile
apProfile = profileServiceInterface.update(apProfile);
return apProfile;
}
@@ -723,6 +745,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
profileServiceInterface.getProfileWithChildren(equipmentConfig.getProfileId()));
ret.setApProfile(profileContainer.getOrNull(equipmentConfig.getProfileId()));
ret.setRfProfile(
profileContainer.getChildOfTypeOrNull(equipmentConfig.getProfileId(), ProfileType.rf));
ret.setSsidProfile(
profileContainer.getChildrenOfType(equipmentConfig.getProfileId(), ProfileType.ssid));

View File

@@ -39,13 +39,13 @@ import com.telecominfraproject.wlan.core.model.equipment.SecurityType;
import com.telecominfraproject.wlan.core.model.equipment.WiFiSessionUtility;
import com.telecominfraproject.wlan.core.model.utils.DecibelUtils;
import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
import com.telecominfraproject.wlan.equipment.models.ApElementConfiguration;
import com.telecominfraproject.wlan.equipment.models.Equipment;
import com.telecominfraproject.wlan.opensync.ovsdb.dao.utilities.OvsdbToWlanCloudTypeMappingUtility;
import com.telecominfraproject.wlan.profile.ProfileServiceInterface;
import com.telecominfraproject.wlan.profile.models.Profile;
import com.telecominfraproject.wlan.profile.models.ProfileContainer;
import com.telecominfraproject.wlan.profile.models.ProfileType;
import com.telecominfraproject.wlan.profile.network.models.RfConfiguration;
import com.telecominfraproject.wlan.profile.ssid.models.RadioBasedSsidConfiguration;
import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration;
import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration.SecureMode;
@@ -2159,9 +2159,14 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
continue;
}
ProfileContainer profileContainer = new ProfileContainer(
profileServiceInterface.getProfileWithChildren(
equipmentServiceInterface.get(equipmentId).getProfileId()));
ChannelBandwidth channelBandwidth = ((ApElementConfiguration) equipmentServiceInterface.get(equipmentId)
.getDetails()).getRadioMap().get(radioType).getChannelBandwidth();
RfConfiguration rfConfig = (RfConfiguration) profileContainer.getChildOfTypeOrNull(
equipmentServiceInterface.get(equipmentId).getProfileId(), ProfileType.rf).getDetails();
ChannelBandwidth channelBandwidth = rfConfig.getRfConfig(radioType).getChannelBandwidth();
Map<Integer, List<SurveySample>> sampleByChannelMap = new HashMap<>();

View File

@@ -29,6 +29,7 @@ public class OpensyncAPConfig extends BaseJsonModel {
private Equipment customerEquipment;
private Profile apProfile;
private Profile rfProfile;
private List<Profile> ssidProfile;
private List<Profile> radiusProfiles;
private Location equipmentLocation;
@@ -138,6 +139,14 @@ public class OpensyncAPConfig extends BaseJsonModel {
public void setApProfile(Profile apProfile) {
this.apProfile = apProfile;
}
public Profile getRfProfile() {
return rfProfile;
}
public void setRfProfile(Profile rfProfile) {
this.rfProfile = rfProfile;
}
public List<Profile> getSsidProfile() {
return ssidProfile;
@@ -195,6 +204,8 @@ public class OpensyncAPConfig extends BaseJsonModel {
}
if (apProfile != null)
ret.apProfile = apProfile.clone();
if (rfProfile != null)
ret.rfProfile = rfProfile.clone();
if (equipmentRouting != null)
ret.equipmentRouting = equipmentRouting.clone();
if (equipmentGateway != null)

View File

@@ -41,6 +41,9 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr
@Value("${tip.wlan.ovsdb.ssidProfileFileName:/app/config/ProfileSsid.json}")
private String ssidProfileFileName;
@Value("${tip.wlan.ovsdb.ssidProfileFileName:/app/config/ProfileRf.json}")
private String rfProfileFileName;
@Value("${tip.wlan.ovsdb.radiusProfileFileName:/app/config/ProfileRadius.json}")
private String radiusProfileFileName;
@@ -86,6 +89,11 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr
com.telecominfraproject.wlan.profile.models.Profile apProfile = com.telecominfraproject.wlan.profile.models.Profile
.fromFile(apProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class);
com.telecominfraproject.wlan.profile.models.Profile rfProfile = com.telecominfraproject.wlan.profile.models.Profile
.fromFile(rfProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class);
apProfile.getChildProfileIds().add(rfProfile.getId());
List<com.telecominfraproject.wlan.profile.models.Profile> ssidProfiles = com.telecominfraproject.wlan.profile.models.Profile
.listFromFile(ssidProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class);
@@ -124,6 +132,7 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr
ret.setCustomerEquipment(equipment);
ret.setApProfile(apProfile);
ret.setSsidProfile(ssidProfiles);
ret.setRfProfile(rfProfile);
ret.setRadiusProfiles(radiusProfiles);
ret.setEquipmentLocation(location);
ret.setCaptiveProfiles(captiveProfiles);

View File

@@ -38,8 +38,6 @@
"channelNumber": 6,
"manualChannelNumber": 6,
"backupChannelNumber": 11,
"autoChannelSelection": false,
"channelBandwidth": "is20MHz",
"bannedChannels": [],
"allowedChannels": [],
"rxCellSizeDb": {
@@ -81,8 +79,6 @@
"channelNumber": 149,
"manualChannelNumber": 149,
"backupChannelNumber": 154,
"autoChannelSelection": false,
"channelBandwidth": "is80MHz",
"bannedChannels": [],
"allowedChannels": [],
"rxCellSizeDb": {
@@ -124,8 +120,6 @@
"channelNumber": 36,
"manualChannelNumber": 36,
"backupChannelNumber": 44,
"autoChannelSelection": false,
"channelBandwidth": "is80MHz",
"bannedChannels": [],
"allowedChannels": [],
"rxCellSizeDb": {
@@ -168,22 +162,11 @@
"radioType": "is2dot4GHz",
"radioAdminState": "enabled",
"fragmentationThresholdBytes": 2346,
"rtsCtsThreshold": 65535,
"autoChannelSelection": "disabled",
"radioMode": "modeN",
"mimoMode": "twoByTwo",
"wmmState": "enabled",
"uapsdState": "enabled",
"maxNumClients": 100,
"stationIsolation": "disabled",
"multicastRate": "auto",
"managementRate": "auto",
"activeScanSettings": {
"model_type": "ActiveScanSettings",
"enabled": true,
"scanFrequencySeconds": 10,
"scanDurationMillis": 65
},
"channelHopSettings": {
"model_type": "ChannelHopSettings",
"noiseFloorThresholdInDB": -75,
@@ -200,7 +183,6 @@
},
"forceScanDuringVoice": "disabled",
"legacyBSSRate": "enabled",
"beaconInterval": 100,
"deauthAttackDetection": null
},
"is5GHzU": {
@@ -208,22 +190,11 @@
"radioType": "is5GHzU",
"radioAdminState": "enabled",
"fragmentationThresholdBytes": 2346,
"rtsCtsThreshold": 65535,
"autoChannelSelection": "disabled",
"radioMode": "modeAC",
"mimoMode": "twoByTwo",
"wmmState": "enabled",
"uapsdState": "enabled",
"maxNumClients": 100,
"stationIsolation": "disabled",
"multicastRate": "auto",
"managementRate": "auto",
"activeScanSettings": {
"model_type": "ActiveScanSettings",
"enabled": true,
"scanFrequencySeconds": 10,
"scanDurationMillis": 65
},
"channelHopSettings": {
"model_type": "ChannelHopSettings",
"noiseFloorThresholdInDB": -75,
@@ -240,7 +211,6 @@
},
"forceScanDuringVoice": "disabled",
"legacyBSSRate": "enabled",
"beaconInterval": 100,
"deauthAttackDetection": null
},
"is5GHzL": {
@@ -248,22 +218,11 @@
"radioType": "is5GHzL",
"radioAdminState": "enabled",
"fragmentationThresholdBytes": 2346,
"rtsCtsThreshold": 65535,
"autoChannelSelection": "disabled",
"radioMode": "modeAC",
"mimoMode": "twoByTwo",
"wmmState": "enabled",
"uapsdState": "enabled",
"maxNumClients": 100,
"stationIsolation": "disabled",
"multicastRate": "auto",
"managementRate": "auto",
"activeScanSettings": {
"model_type": "ActiveScanSettings",
"enabled": true,
"scanFrequencySeconds": 10,
"scanDurationMillis": 65
},
"channelHopSettings": {
"model_type": "ChannelHopSettings",
"noiseFloorThresholdInDB": -75,
@@ -280,7 +239,6 @@
},
"forceScanDuringVoice": "disabled",
"legacyBSSRate": "enabled",
"beaconInterval": 100,
"deauthAttackDetection": null
}
}

View File

@@ -49,6 +49,7 @@
"childProfileIds": [
6,
7,
8
8,
9
]
}

View File

@@ -0,0 +1,86 @@
{
"model_type": "Profile",
"id": 9,
"customerId": 2,
"profileType": "rf",
"name": "DefaultRf-2g",
"details": {
"model_type": "RfConfiguration",
"rf": "Default-RF-2g",
"profileType": "rf",
"rfConfigMap": {
"is2dot4GHz": {
"model_type": "RfElementConfiguration",
"beaconInterval": 100,
"forceScanDuringVoice": "disabled",
"rtsCtsThreshold": 65535,
"channelBandwidth": "is20MHz",
"mimoMode": "twoBytwo",
"maxNumClients": 100,
"multicastRate": "auto",
"autoChannelSelection": "disabled",
"activeScanSettings": {
"model_type": "ActiveScanSettings",
"enabled": true,
"scanFrequencySeconds": 10,
"scanDurationMillis": 65
}
},
"is5GHz": {
"model_type": "RfElementConfiguration",
"beaconInterval": 100,
"forceScanDuringVoice": "disabled",
"rtsCtsThreshold": 65535,
"channelBandwidth": "is80MHz",
"mimoMode": "twoBytwo",
"maxNumClients": 100,
"multicastRate": "auto",
"autoChannelSelection": "disabled",
"activeScanSettings": {
"model_type": "ActiveScanSettings",
"enabled": true,
"scanFrequencySeconds": 10,
"scanDurationMillis": 65
}
},
"is5GHzL": {
"model_type": "RfElementConfiguration",
"beaconInterval": 100,
"forceScanDuringVoice": "disabled",
"rtsCtsThreshold": 65535,
"channelBandwidth": "is80MHz",
"mimoMode": "twoBytwo",
"maxNumClients": 100,
"multicastRate": "auto",
"autoChannelSelection": "disabled",
"activeScanSettings": {
"model_type": "ActiveScanSettings",
"enabled": true,
"scanFrequencySeconds": 10,
"scanDurationMillis": 65
}
},
"is5GHzU": {
"model_type": "RfElementConfiguration",
"beaconInterval": 100,
"forceScanDuringVoice": "disabled",
"rtsCtsThreshold": 65535,
"channelBandwidth": "is80MHz",
"mimoMode": "twoBytwo",
"maxNumClients": 100,
"multicastRate": "auto",
"autoChannelSelection": "disabled",
"activeScanSettings": {
"model_type": "ActiveScanSettings",
"enabled": true,
"scanFrequencySeconds": 10,
"scanDurationMillis": 65
}
}
},
"createdTimestamp": 1591653239983,
"lastModifiedTimestamp": 1591653239983,
"childProfileIds": [
]
}
}

View File

@@ -22,7 +22,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import com.telecominfraproject.wlan.client.models.ClientType;
import com.telecominfraproject.wlan.core.model.equipment.AutoOrManualValue;
import com.telecominfraproject.wlan.core.model.equipment.ChannelBandwidth;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
@@ -61,6 +60,8 @@ import com.telecominfraproject.wlan.profile.captiveportal.models.CaptivePortalAu
import com.telecominfraproject.wlan.profile.captiveportal.models.CaptivePortalConfiguration;
import com.telecominfraproject.wlan.profile.captiveportal.models.ManagedFileInfo;
import com.telecominfraproject.wlan.profile.models.Profile;
import com.telecominfraproject.wlan.profile.network.models.RfConfiguration;
import com.telecominfraproject.wlan.profile.network.models.RfElementConfiguration;
import com.telecominfraproject.wlan.profile.radius.models.RadiusProfile;
import com.telecominfraproject.wlan.profile.radius.models.RadiusServer;
import com.telecominfraproject.wlan.profile.radius.models.RadiusServiceRegion;
@@ -1709,15 +1710,18 @@ public class OvsdbDao {
// radios on this AP
// ;-)
RfConfiguration rfConfig = (RfConfiguration) opensyncAPConfig.getRfProfile().getDetails();
ApElementConfiguration apElementConfiguration = (ApElementConfiguration) opensyncAPConfig.getCustomerEquipment()
.getDetails();
for (RadioType radioType : apElementConfiguration.getRadioMap().keySet()) {
Map<String, String> hwConfig = new HashMap<>();
RfElementConfiguration rfElementConfig = rfConfig.getRfConfig(radioType);
ElementRadioConfiguration elementRadioConfig = apElementConfiguration.getRadioMap().get(radioType);
int channel = elementRadioConfig.getChannelNumber();
ChannelBandwidth bandwidth = elementRadioConfig.getChannelBandwidth();
ChannelBandwidth bandwidth = rfElementConfig.getChannelBandwidth();
String ht_mode = null;
switch (bandwidth) {
case is20MHz:
@@ -1738,10 +1742,10 @@ public class OvsdbDao {
default:
ht_mode = null;
}
elementRadioConfig.getAutoChannelSelection();
rfElementConfig.getAutoChannelSelection();
RadioConfiguration radioConfig = apElementConfiguration.getAdvancedRadioMap().get(radioType);
int beaconInterval = radioConfig.getBeaconInterval();
int beaconInterval = rfElementConfig.getBeaconInterval();
boolean enabled = radioConfig.getRadioAdminState().equals(StateSetting.enabled);
int txPower = 0;