mirror of
				https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
				synced 2025-10-31 18:47:57 +00:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			WIFI-3129
			...
			release/v1
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | af604289cc | 
| @@ -1,9 +1,27 @@ | |||||||
| package com.telecominfraproject.wlan.opensync.ovsdb.dao; | package com.telecominfraproject.wlan.opensync.ovsdb.dao; | ||||||
|  |  | ||||||
|  | import java.util.ArrayList; | ||||||
|  | import java.util.HashMap; | ||||||
|  | import java.util.HashSet; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  | import java.util.Set; | ||||||
|  | import java.util.concurrent.CompletableFuture; | ||||||
|  | import java.util.concurrent.ExecutionException; | ||||||
|  | import java.util.concurrent.TimeUnit; | ||||||
|  | import java.util.concurrent.TimeoutException; | ||||||
|  |  | ||||||
|  | import org.springframework.beans.factory.annotation.Autowired; | ||||||
|  | import org.springframework.stereotype.Component; | ||||||
|  |  | ||||||
| import com.telecominfraproject.wlan.core.model.equipment.ChannelBandwidth; | import com.telecominfraproject.wlan.core.model.equipment.ChannelBandwidth; | ||||||
| import com.telecominfraproject.wlan.core.model.equipment.RadioType; | import com.telecominfraproject.wlan.core.model.equipment.RadioType; | ||||||
| import com.telecominfraproject.wlan.core.model.equipment.SourceType; | import com.telecominfraproject.wlan.core.model.equipment.SourceType; | ||||||
| import com.telecominfraproject.wlan.equipment.models.*; | import com.telecominfraproject.wlan.equipment.models.ApElementConfiguration; | ||||||
|  | import com.telecominfraproject.wlan.equipment.models.ElementRadioConfiguration; | ||||||
|  | import com.telecominfraproject.wlan.equipment.models.MimoMode; | ||||||
|  | import com.telecominfraproject.wlan.equipment.models.RadioConfiguration; | ||||||
|  | import com.telecominfraproject.wlan.equipment.models.StateSetting; | ||||||
| import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPConfig; | import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPConfig; | ||||||
| import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiRadioConfigInfo; | import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiRadioConfigInfo; | ||||||
| import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiVifConfigInfo; | import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiVifConfigInfo; | ||||||
| @@ -12,19 +30,15 @@ import com.telecominfraproject.wlan.profile.rf.models.RfElementConfiguration; | |||||||
| import com.vmware.ovsdb.exception.OvsdbClientException; | import com.vmware.ovsdb.exception.OvsdbClientException; | ||||||
| import com.vmware.ovsdb.protocol.operation.Operation; | import com.vmware.ovsdb.protocol.operation.Operation; | ||||||
| import com.vmware.ovsdb.protocol.operation.Update; | import com.vmware.ovsdb.protocol.operation.Update; | ||||||
| import com.vmware.ovsdb.protocol.operation.notation.*; | import com.vmware.ovsdb.protocol.operation.notation.Atom; | ||||||
|  | import com.vmware.ovsdb.protocol.operation.notation.Condition; | ||||||
|  | import com.vmware.ovsdb.protocol.operation.notation.Function; | ||||||
|  | import com.vmware.ovsdb.protocol.operation.notation.Row; | ||||||
|  | import com.vmware.ovsdb.protocol.operation.notation.Uuid; | ||||||
|  | import com.vmware.ovsdb.protocol.operation.notation.Value; | ||||||
| import com.vmware.ovsdb.protocol.operation.result.OperationResult; | import com.vmware.ovsdb.protocol.operation.result.OperationResult; | ||||||
|  | import com.vmware.ovsdb.protocol.schema.DatabaseSchema; | ||||||
| import com.vmware.ovsdb.service.OvsdbClient; | import com.vmware.ovsdb.service.OvsdbClient; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; |  | ||||||
| import org.springframework.stereotype.Component; |  | ||||||
|  |  | ||||||
| import java.util.*; |  | ||||||
| import java.util.Map; |  | ||||||
| import java.util.Set; |  | ||||||
| import java.util.concurrent.CompletableFuture; |  | ||||||
| import java.util.concurrent.ExecutionException; |  | ||||||
| import java.util.concurrent.TimeUnit; |  | ||||||
| import java.util.concurrent.TimeoutException; |  | ||||||
|  |  | ||||||
| @Component | @Component | ||||||
| public class OvsdbRadioConfig extends OvsdbDaoBase { | public class OvsdbRadioConfig extends OvsdbDaoBase { | ||||||
| @@ -40,75 +54,80 @@ public class OvsdbRadioConfig extends OvsdbDaoBase { | |||||||
|         Map<String, WifiRadioConfigInfo> provisionedRadioConfigs = ovsdbGet.getProvisionedWifiRadioConfigs(ovsdbClient); |         Map<String, WifiRadioConfigInfo> provisionedRadioConfigs = ovsdbGet.getProvisionedWifiRadioConfigs(ovsdbClient); | ||||||
|         Map<String, WifiVifConfigInfo> vifConfigs = ovsdbGet.getProvisionedWifiVifConfigs(ovsdbClient); |         Map<String, WifiVifConfigInfo> vifConfigs = ovsdbGet.getProvisionedWifiVifConfigs(ovsdbClient); | ||||||
|         List<Operation> operations = new ArrayList<>(); |         List<Operation> operations = new ArrayList<>(); | ||||||
|         for (RadioType radioType : apElementConfiguration.getRadioMap().keySet()) { |         try { | ||||||
|             Map<String, String> hwConfig = new HashMap<>(); |             CompletableFuture<DatabaseSchema> cfDatabaseSchema = ovsdbClient.getSchema(ovsdbName); | ||||||
|             ElementRadioConfiguration elementRadioConfig = apElementConfiguration.getRadioMap().get(radioType); |             DatabaseSchema databaseSchema = cfDatabaseSchema.get(); | ||||||
|             RfElementConfiguration rfElementConfig = rfConfig.getRfConfig(radioType); |             Set<String> columnNames = databaseSchema.getTables().get(wifiRadioConfigDbTable).getColumns().keySet(); | ||||||
|             boolean autoChannelSelection = rfElementConfig.getAutoChannelSelection(); |  | ||||||
|             int channel = elementRadioConfig.getActiveChannel(autoChannelSelection); |             for (RadioType radioType : apElementConfiguration.getRadioMap().keySet()) { | ||||||
|             LOG.debug("configureWifiRadios autoChannelSelection {} activeChannel {} getChannelNumber {} ", |                 Map<String, String> hwConfig = new HashMap<>(); | ||||||
|                     autoChannelSelection, channel, elementRadioConfig.getChannelNumber()); |                 ElementRadioConfiguration elementRadioConfig = apElementConfiguration.getRadioMap().get(radioType); | ||||||
|             ChannelBandwidth bandwidth = rfElementConfig.getChannelBandwidth(); |                 RfElementConfiguration rfElementConfig = rfConfig.getRfConfig(radioType); | ||||||
|             String ht_mode = getBandwidth(bandwidth); |                 boolean autoChannelSelection = rfElementConfig.getAutoChannelSelection(); | ||||||
|             RadioConfiguration radioConfig = apElementConfiguration.getAdvancedRadioMap().get(radioType); |                 int channel = elementRadioConfig.getActiveChannel(autoChannelSelection); | ||||||
|             int beaconInterval = rfElementConfig.getBeaconInterval(); |                 LOG.debug("configureWifiRadios autoChannelSelection {} activeChannel {} getChannelNumber {} ", | ||||||
|             boolean enabled = radioConfig.getRadioAdminState().equals(StateSetting.enabled); |                         autoChannelSelection, channel, elementRadioConfig.getChannelNumber()); | ||||||
|             int txPower; |                 ChannelBandwidth bandwidth = rfElementConfig.getChannelBandwidth(); | ||||||
|             if (elementRadioConfig.getEirpTxPower().getSource() == SourceType.profile) { |                 String ht_mode = getBandwidth(bandwidth); | ||||||
|                 txPower = rfElementConfig.getEirpTxPower(); |                 RadioConfiguration radioConfig = apElementConfiguration.getAdvancedRadioMap().get(radioType); | ||||||
|             } else { |                 int beaconInterval = rfElementConfig.getBeaconInterval(); | ||||||
|                 txPower = elementRadioConfig.getEirpTxPower().getValue(); |                 boolean enabled = radioConfig.getRadioAdminState().equals(StateSetting.enabled); | ||||||
|             } |                 int txPower; | ||||||
|             String hwMode = getHwMode(rfElementConfig); |                 if (elementRadioConfig.getEirpTxPower().getSource() == SourceType.profile) { | ||||||
|             String freqBand = getHwConfigAndFreq(radioType, hwConfig); |                     txPower = rfElementConfig.getEirpTxPower(); | ||||||
|             String radioName = null; |                 } else { | ||||||
|             for (String key : provisionedRadioConfigs.keySet()) { |                     txPower = elementRadioConfig.getEirpTxPower().getValue(); | ||||||
|                 if (provisionedRadioConfigs.get(key).freqBand.equals(freqBand)) { |                 } | ||||||
|                     radioName = key; |                 String hwMode = getHwMode(rfElementConfig); | ||||||
|                     break; |                 String freqBand = getHwConfigAndFreq(radioType, hwConfig); | ||||||
|  |                 String radioName = null; | ||||||
|  |                 for (String key : provisionedRadioConfigs.keySet()) { | ||||||
|  |                     if (provisionedRadioConfigs.get(key).freqBand.equals(freqBand)) { | ||||||
|  |                         radioName = key; | ||||||
|  |                         break; | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |                 if (radioName == null) continue; | ||||||
|  |                 String ifName = null; // for vifConfigs | ||||||
|  |                 if (radioName.equals(radio0)) { | ||||||
|  |                     ifName = defaultRadio0; | ||||||
|  |                 } else if (radioName.equals(radio1)) { | ||||||
|  |                     ifName = defaultRadio1; | ||||||
|  |                 } else if (radioName.equals(radio2)) { | ||||||
|  |                     ifName = defaultRadio2; | ||||||
|  |                 } | ||||||
|  |                 if (ifName == null) continue; | ||||||
|  |                 Set<Uuid> vifUuidsForRadio = new HashSet<>(); | ||||||
|  |                 for (String key : vifConfigs.keySet()) { | ||||||
|  |                     if (key.contains(ifName)) | ||||||
|  |                         vifUuidsForRadio.add(vifConfigs.get(key).uuid); | ||||||
|  |                 } | ||||||
|  |                 int mimoMode = MimoMode.none.getId(); | ||||||
|  |                 if (rfElementConfig.getMimoMode() != null) { | ||||||
|  |                     mimoMode = rfElementConfig.getMimoMode().getId(); | ||||||
|  |                 }            | ||||||
|  |                 int maxNumClients = 0;           | ||||||
|  |                 if (rfElementConfig.getMaxNumClients() != null) { | ||||||
|  |                     maxNumClients = rfElementConfig.getMaxNumClients(); | ||||||
|  |                 } | ||||||
|  |                 try { | ||||||
|  |                     configureWifiRadios(freqBand, channel, hwConfig, country.toUpperCase(), beaconInterval, | ||||||
|  |                             enabled, hwMode, ht_mode, txPower, mimoMode, vifUuidsForRadio, operations, maxNumClients,columnNames); | ||||||
|  |                 } catch (OvsdbClientException e) { | ||||||
|  |                     LOG.error("ConfigureWifiRadios failed with OvsdbClient exception.", e); | ||||||
|  |                     throw new RuntimeException(e); | ||||||
|  |                 } catch (TimeoutException e) { | ||||||
|  |                     LOG.error("ConfigureWifiRadios failed with Timeout.", e); | ||||||
|  |                     throw new RuntimeException(e); | ||||||
|  |                 } catch (ExecutionException e) { | ||||||
|  |                     LOG.error("ConfigureWifiRadios excecution failed.", e); | ||||||
|  |                     throw new RuntimeException(e); | ||||||
|  |                 } catch (InterruptedException e) { | ||||||
|  |                     LOG.error("ConfigureWifiRadios interrupted.", e); | ||||||
|  |                     throw new RuntimeException(e); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             if (radioName == null) continue; |  | ||||||
|             String ifName = null; // for vifConfigs |  | ||||||
|             if (radioName.equals(radio0)) { |  | ||||||
|                 ifName = defaultRadio0; |  | ||||||
|             } else if (radioName.equals(radio1)) { |  | ||||||
|                 ifName = defaultRadio1; |  | ||||||
|             } else if (radioName.equals(radio2)) { |  | ||||||
|                 ifName = defaultRadio2; |  | ||||||
|             } |  | ||||||
|             if (ifName == null) continue; |  | ||||||
|             Set<Uuid> vifUuidsForRadio = new HashSet<>(); |  | ||||||
|             for (String key : vifConfigs.keySet()) { |  | ||||||
|                 if (key.contains(ifName)) |  | ||||||
|                     vifUuidsForRadio.add(vifConfigs.get(key).uuid); |  | ||||||
|             } |  | ||||||
|             int mimoMode = MimoMode.none.getId(); |  | ||||||
|             if (rfElementConfig.getMimoMode() != null) { |  | ||||||
|                 mimoMode = rfElementConfig.getMimoMode().getId(); |  | ||||||
|             }            |  | ||||||
|             int maxNumClients = 0;           |  | ||||||
|             if (rfElementConfig.getMaxNumClients() != null) { |  | ||||||
|                 maxNumClients = rfElementConfig.getMaxNumClients(); |  | ||||||
|             } |  | ||||||
|             try { |  | ||||||
|                 configureWifiRadios(freqBand, channel, hwConfig, country.toUpperCase(), beaconInterval, |  | ||||||
|                         enabled, hwMode, ht_mode, txPower, mimoMode, vifUuidsForRadio, operations, maxNumClients); |  | ||||||
|             } catch (OvsdbClientException e) { |  | ||||||
|                 LOG.error("ConfigureWifiRadios failed with OvsdbClient exception.", e); |  | ||||||
|                 throw new RuntimeException(e); |  | ||||||
|             } catch (TimeoutException e) { |  | ||||||
|                 LOG.error("ConfigureWifiRadios failed with Timeout.", e); |  | ||||||
|                 throw new RuntimeException(e); |  | ||||||
|             } catch (ExecutionException e) { |  | ||||||
|                 LOG.error("ConfigureWifiRadios excecution failed.", e); |  | ||||||
|                 throw new RuntimeException(e); |  | ||||||
|             } catch (InterruptedException e) { |  | ||||||
|                 LOG.error("ConfigureWifiRadios interrupted.", e); |  | ||||||
|                 throw new RuntimeException(e); |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|         try { |  | ||||||
|             CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations); |             CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations); | ||||||
|             OperationResult[] result = fResult.get(ovsdbTimeoutSec, TimeUnit.SECONDS); |             OperationResult[] result = fResult.get(ovsdbTimeoutSec, TimeUnit.SECONDS); | ||||||
|             for (OperationResult res : result) { |             for (OperationResult res : result) { | ||||||
| @@ -217,7 +236,7 @@ public class OvsdbRadioConfig extends OvsdbDaoBase { | |||||||
|  |  | ||||||
|     void configureWifiRadios(String freqBand, int channel, Map<String, String> hwConfig, |     void configureWifiRadios(String freqBand, int channel, Map<String, String> hwConfig, | ||||||
|                              String country, int beaconInterval, boolean enabled, String hwMode, String ht_mode, int txPower, |                              String country, int beaconInterval, boolean enabled, String hwMode, String ht_mode, int txPower, | ||||||
|                              int mimoMode, Set<Uuid> vifUuidsForRadio, List<Operation> operations, int maxNumClients) throws OvsdbClientException, TimeoutException, ExecutionException, InterruptedException { |                              int mimoMode, Set<Uuid> vifUuidsForRadio, List<Operation> operations, int maxNumClients, Set<String> tableColumns) throws OvsdbClientException, TimeoutException, ExecutionException, InterruptedException { | ||||||
|         Map<String, Value> updateColumns = new HashMap<>(); |         Map<String, Value> updateColumns = new HashMap<>(); | ||||||
|         List<Condition> conditions = new ArrayList<>(); |         List<Condition> conditions = new ArrayList<>(); | ||||||
|         conditions.add(new Condition("freq_band", Function.EQUALS, new Atom<>(freqBand))); |         conditions.add(new Condition("freq_band", Function.EQUALS, new Atom<>(freqBand))); | ||||||
| @@ -243,7 +262,7 @@ public class OvsdbRadioConfig extends OvsdbDaoBase { | |||||||
|             updateColumns.put("hw_mode", new Atom<>(hwMode)); |             updateColumns.put("hw_mode", new Atom<>(hwMode)); | ||||||
|         } |         } | ||||||
|         configureCustomOptionsMap(maxNumClients, updateColumns); |         configureCustomOptionsMap(maxNumClients, updateColumns); | ||||||
|         setTxAndRxChainmask(mimoMode, updateColumns); |         setTxAndRxChainmask(mimoMode, updateColumns,tableColumns); | ||||||
|         if (vifUuidsForRadio.size() > 0) { |         if (vifUuidsForRadio.size() > 0) { | ||||||
|             com.vmware.ovsdb.protocol.operation.notation.Set vifConfigUuids = com.vmware.ovsdb.protocol.operation.notation.Set |             com.vmware.ovsdb.protocol.operation.notation.Set vifConfigUuids = com.vmware.ovsdb.protocol.operation.notation.Set | ||||||
|                     .of(vifUuidsForRadio); |                     .of(vifUuidsForRadio); | ||||||
| @@ -262,23 +281,29 @@ public class OvsdbRadioConfig extends OvsdbDaoBase { | |||||||
|         updateColumns.put("custom_options", customOptionsMap);            |         updateColumns.put("custom_options", customOptionsMap);            | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     void setTxAndRxChainmask(int mimoMode, Map<String, Value> updateColumns) { |     void setTxAndRxChainmask(int mimoMode, Map<String, Value> updateColumns, Set<String> tableColumns) { | ||||||
|         /* |         /* | ||||||
|          * Chainmask is a bitmask, so map mimo mode values accordingly |          * Chainmask is a bitmask, so map mimo mode values accordingly | ||||||
|          * Note values 0, 1 remain unchanged  |          * Note values 0, 1 remain unchanged | ||||||
|          *  |          *  | ||||||
|          * mimoMode  bitmask  |          * mimoMode bitmask | ||||||
|          *    0         0  |          * 0 0 | ||||||
|          *    1         1  |          * 1 1 | ||||||
|          *    2         3  |          * 2 3 | ||||||
|          *    3         7  |          * 3 7 | ||||||
|          *    4        15 |          * 4 15 | ||||||
|          */ |          */ | ||||||
|         if (mimoMode == 2) {mimoMode = 3;} |         if (mimoMode == 2) { | ||||||
|         else if (mimoMode == 3) {mimoMode = 7;} |             mimoMode = 3; | ||||||
|         else if (mimoMode == 4) {mimoMode = 15;} |         } else if (mimoMode == 3) { | ||||||
|  |             mimoMode = 7; | ||||||
|  |         } else if (mimoMode == 4) { | ||||||
|  |             mimoMode = 15; | ||||||
|  |         } | ||||||
|         updateColumns.put("tx_chainmask", new Atom<>(mimoMode)); |         updateColumns.put("tx_chainmask", new Atom<>(mimoMode)); | ||||||
|         updateColumns.put("rx_chainmask", new Atom<>(mimoMode));        |         if (tableColumns.contains("rx_chainmask")) { | ||||||
|  |             updateColumns.put("rx_chainmask", new Atom<>(mimoMode)); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -4,6 +4,7 @@ import java.util.ArrayList; | |||||||
| import java.util.HashMap; | import java.util.HashMap; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| import java.util.Map; | import java.util.Map; | ||||||
|  | import java.util.Set; | ||||||
| import java.util.concurrent.CompletableFuture; | import java.util.concurrent.CompletableFuture; | ||||||
| import java.util.concurrent.ExecutionException; | import java.util.concurrent.ExecutionException; | ||||||
| import java.util.concurrent.TimeUnit; | import java.util.concurrent.TimeUnit; | ||||||
| @@ -39,6 +40,7 @@ import com.vmware.ovsdb.protocol.operation.result.ErrorResult; | |||||||
| import com.vmware.ovsdb.protocol.operation.result.InsertResult; | import com.vmware.ovsdb.protocol.operation.result.InsertResult; | ||||||
| import com.vmware.ovsdb.protocol.operation.result.OperationResult; | import com.vmware.ovsdb.protocol.operation.result.OperationResult; | ||||||
| import com.vmware.ovsdb.protocol.operation.result.UpdateResult; | import com.vmware.ovsdb.protocol.operation.result.UpdateResult; | ||||||
|  | import com.vmware.ovsdb.protocol.schema.DatabaseSchema; | ||||||
| import com.vmware.ovsdb.service.OvsdbClient; | import com.vmware.ovsdb.service.OvsdbClient; | ||||||
|  |  | ||||||
| @Component | @Component | ||||||
| @@ -138,60 +140,70 @@ public class OvsdbRrmConfig extends OvsdbDaoBase { | |||||||
|     void configureWifiRrm(OvsdbClient ovsdbClient, String freqBand, int backupChannel, |     void configureWifiRrm(OvsdbClient ovsdbClient, String freqBand, int backupChannel, | ||||||
|             AutoOrManualValue probeResponseThreshold, AutoOrManualValue clientDisconnectThreshold, |             AutoOrManualValue probeResponseThreshold, AutoOrManualValue clientDisconnectThreshold, | ||||||
|             ManagementRate managementRate, RadioBestApSettings bestApSettings, MulticastRate multicastRate) |             ManagementRate managementRate, RadioBestApSettings bestApSettings, MulticastRate multicastRate) | ||||||
|             throws OvsdbClientException, TimeoutException, ExecutionException, InterruptedException { |                     throws OvsdbClientException, TimeoutException, ExecutionException, InterruptedException { | ||||||
|  |  | ||||||
|  |         CompletableFuture<DatabaseSchema> cfDatabaseSchema = ovsdbClient.getSchema(ovsdbName); | ||||||
|  |         DatabaseSchema databaseSchema = cfDatabaseSchema.get(); | ||||||
|  |         Set<String> columnNames = databaseSchema.getTables().get(wifiRrmConfigDbTable).getColumns().keySet(); | ||||||
|  |  | ||||||
|         List<Operation> operations = new ArrayList<>(); |         List<Operation> operations = new ArrayList<>(); | ||||||
|         Map<String, Value> updateColumns = new HashMap<>(); |         Map<String, Value> updateColumns = new HashMap<>(); | ||||||
|  |  | ||||||
|         updateColumns.put("freq_band", new Atom<>(freqBand)); |         updateColumns.put("freq_band", new Atom<>(freqBand)); | ||||||
|         updateColumns.put("backup_channel", new Atom<>(backupChannel)); |         updateColumns.put("backup_channel", new Atom<>(backupChannel)); | ||||||
|  |         if (columnNames.contains("freq_band")) updateColumns.put("freq_band", new Atom<>(freqBand)); | ||||||
|         if (multicastRate == null || multicastRate == MulticastRate.auto) { |         if (columnNames.contains("backup_channel")) updateColumns.put("backup_channel", new Atom<>(backupChannel)); | ||||||
|             updateColumns.put("mcast_rate", new Atom<>(0)); |         if (columnNames.contains("mcast_rate")) { | ||||||
|         } else { |             if (multicastRate == null || multicastRate == MulticastRate.auto) { | ||||||
|             updateColumns.put("mcast_rate", new Atom<>(managementRate.getId())); |                 updateColumns.put("mcast_rate", new Atom<>(0)); | ||||||
|  |             } else { | ||||||
|  |                 updateColumns.put("mcast_rate", new Atom<>(managementRate.getId())); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|  |         if (columnNames.contains("probe_resp_threshold")) { | ||||||
|         if (probeResponseThreshold == null || probeResponseThreshold.isAuto()) { |             if (probeResponseThreshold == null || probeResponseThreshold.isAuto()) { | ||||||
|             updateColumns.put("probe_resp_threshold", new com.vmware.ovsdb.protocol.operation.notation.Set()); |                 updateColumns.put("probe_resp_threshold", new com.vmware.ovsdb.protocol.operation.notation.Set()); | ||||||
|         } else { |             } else { | ||||||
|             updateColumns.put("probe_resp_threshold", new Atom<>(probeResponseThreshold.getValue())); |                 updateColumns.put("probe_resp_threshold", new Atom<>(probeResponseThreshold.getValue())); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|  |         if (columnNames.contains("client_disconnect_threshold")) { | ||||||
|         if (clientDisconnectThreshold == null || clientDisconnectThreshold.isAuto()) { |             if (clientDisconnectThreshold == null || clientDisconnectThreshold.isAuto()) { | ||||||
|             updateColumns.put("client_disconnect_threshold", new com.vmware.ovsdb.protocol.operation.notation.Set()); |                 updateColumns.put("client_disconnect_threshold", new com.vmware.ovsdb.protocol.operation.notation.Set()); | ||||||
|         } else { |             } else { | ||||||
|             updateColumns.put("client_disconnect_threshold", new Atom<>(clientDisconnectThreshold.getValue())); |                 updateColumns.put("client_disconnect_threshold", new Atom<>(clientDisconnectThreshold.getValue())); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|  |         if (columnNames.contains("beacon_rate")) { | ||||||
|         if (managementRate == null || managementRate == ManagementRate.auto) { |             if (managementRate == null || managementRate == ManagementRate.auto) { | ||||||
|             updateColumns.put("beacon_rate", new Atom<>(0)); |                 updateColumns.put("beacon_rate", new Atom<>(0)); | ||||||
|         } else { |             } else { | ||||||
|             updateColumns.put("beacon_rate", new Atom<>(managementRate.getId() * 10)); |                 updateColumns.put("beacon_rate", new Atom<>(managementRate.getId() * 10)); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|  |         if (columnNames.contains("min_load") && columnNames.contains("snr_percentage_drop")) { | ||||||
|         if (bestApSettings == null) { |             if (bestApSettings == null) { | ||||||
|             updateColumns.put("min_load", new com.vmware.ovsdb.protocol.operation.notation.Set()); |                 updateColumns.put("min_load", new com.vmware.ovsdb.protocol.operation.notation.Set()); | ||||||
|             updateColumns.put("snr_percentage_drop", new com.vmware.ovsdb.protocol.operation.notation.Set()); |  | ||||||
|         } else { |  | ||||||
|             if (bestApSettings.getDropInSnrPercentage() == null) { |  | ||||||
|                 updateColumns.put("snr_percentage_drop", new com.vmware.ovsdb.protocol.operation.notation.Set()); |                 updateColumns.put("snr_percentage_drop", new com.vmware.ovsdb.protocol.operation.notation.Set()); | ||||||
|             } else { |             } else { | ||||||
|                 updateColumns.put("snr_percentage_drop", new Atom<>(bestApSettings.getDropInSnrPercentage())); |                 if (bestApSettings.getDropInSnrPercentage() == null) { | ||||||
|             } |                     updateColumns.put("snr_percentage_drop", new com.vmware.ovsdb.protocol.operation.notation.Set()); | ||||||
|             if (bestApSettings.getMinLoadFactor() == null) { |                 } else { | ||||||
|                 updateColumns.put("min_load", new com.vmware.ovsdb.protocol.operation.notation.Set()); |                     updateColumns.put("snr_percentage_drop", new Atom<>(bestApSettings.getDropInSnrPercentage())); | ||||||
|             } else { |                 } | ||||||
|                 updateColumns.put("min_load", new Atom<>(bestApSettings.getMinLoadFactor())); |                 if (bestApSettings.getMinLoadFactor() == null) { | ||||||
|  |                     updateColumns.put("min_load", new com.vmware.ovsdb.protocol.operation.notation.Set()); | ||||||
|  |                 } else { | ||||||
|  |                     updateColumns.put("min_load", new Atom<>(bestApSettings.getMinLoadFactor())); | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         Row row = new Row(updateColumns); |         Row row = new Row(updateColumns); | ||||||
|         operations.add(new Insert(wifiRrmConfigDbTable, row)); |         operations.add(new Insert(wifiRrmConfigDbTable, row)); | ||||||
|  |  | ||||||
|         CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations); |         CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations); | ||||||
|         OperationResult[] result = fResult.get(ovsdbTimeoutSec, TimeUnit.SECONDS); |         OperationResult[] result = fResult.get(ovsdbTimeoutSec, TimeUnit.SECONDS); | ||||||
|          |  | ||||||
|         LOG.debug("Provisioned rrm config with multicastRate {} Mbps for {}", multicastRate, freqBand); |         LOG.debug("Provisioned rrm config with multicastRate {} Mbps for {}", multicastRate, freqBand); | ||||||
|  |  | ||||||
|         for (OperationResult res : result) { |         for (OperationResult res : result) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user