mirror of
				https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
				synced 2025-11-04 04:27:59 +00:00 
			
		
		
		
	Disable monitor when handle config changed, optimization of handle Wifi_Radio_State changes
This commit is contained in:
		@@ -1724,8 +1724,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
 | 
				
			|||||||
        channelInfo.setBandwidth(((ApElementConfiguration) equipmentServiceInterface.get(equipmentId).getDetails())
 | 
					        channelInfo.setBandwidth(((ApElementConfiguration) equipmentServiceInterface.get(equipmentId).getDetails())
 | 
				
			||||||
                .getRadioMap().get(radioType).getChannelBandwidth());
 | 
					                .getRadioMap().get(radioType).getChannelBandwidth());
 | 
				
			||||||
        channelInfo.setNoiseFloor(-84); // TODO: when this
 | 
					        channelInfo.setNoiseFloor(-84); // TODO: when this
 | 
				
			||||||
                                                         // becomes available
 | 
					                                        // becomes available
 | 
				
			||||||
                                                         // add
 | 
					                                        // add
 | 
				
			||||||
        return channelInfo;
 | 
					        return channelInfo;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1778,6 +1778,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void wifiVIFStateDbTableUpdate(List<OpensyncAPVIFState> vifStateTables, String apId) {
 | 
					    public void wifiVIFStateDbTableUpdate(List<OpensyncAPVIFState> vifStateTables, String apId) {
 | 
				
			||||||
 | 
					        LOG.debug("Received Wifi_VIF_State table update for AP {}", apId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
 | 
					        OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1878,6 +1879,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
 | 
				
			|||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void wifiRadioStatusDbTableUpdate(List<OpensyncAPRadioState> radioStateTables, String apId) {
 | 
					    public void wifiRadioStatusDbTableUpdate(List<OpensyncAPRadioState> radioStateTables, String apId) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        LOG.debug("Received Wifi_Radio_State table update for AP {}", apId);
 | 
				
			||||||
        OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
 | 
					        OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (ovsdbSession == null) {
 | 
					        if (ovsdbSession == null) {
 | 
				
			||||||
@@ -1894,16 +1896,15 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId);
 | 
				
			||||||
 | 
					        if (ce == null) {
 | 
				
			||||||
 | 
					            LOG.debug("wifiRadioStatusDbTableUpdate::Cannot get Equipment for AP {}", apId);
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (OpensyncAPRadioState radioState : radioStateTables) {
 | 
					        for (OpensyncAPRadioState radioState : radioStateTables) {
 | 
				
			||||||
            Equipment ce = equipmentServiceInterface.getByInventoryIdOrNull(apId);
 | 
					 | 
				
			||||||
            if (ce == null) {
 | 
					 | 
				
			||||||
                LOG.debug("wifiRadioStatusDbTableUpdate::Cannot get Equipment for AP {}", apId);
 | 
					 | 
				
			||||||
                return;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            gatewayController.updateActiveCustomer(ce.getCustomerId());
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (radioState.getFreqBand().equals(RadioType.UNSUPPORTED)) {
 | 
					            if (radioState.getFreqBand().equals(RadioType.UNSUPPORTED)) {
 | 
				
			||||||
                LOG.debug("Could not get radio configuration for AP {}", apId);
 | 
					                LOG.debug("Could not get radio configuration for AP {}", apId);
 | 
				
			||||||
@@ -1911,7 +1912,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (radioState.getAllowedChannels() != null) {
 | 
					            if (radioState.getAllowedChannels() != null) {
 | 
				
			||||||
                apElementConfiguration = ((ApElementConfiguration) ce.getDetails());
 | 
					 | 
				
			||||||
                apElementConfiguration.getRadioMap().get(radioState.getFreqBand())
 | 
					                apElementConfiguration.getRadioMap().get(radioState.getFreqBand())
 | 
				
			||||||
                        .setAllowedChannels(new ArrayList<>(radioState.getAllowedChannels()));
 | 
					                        .setAllowedChannels(new ArrayList<>(radioState.getAllowedChannels()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1920,7 +1920,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (radioState.getTxPower() > 0) {
 | 
					            if (radioState.getTxPower() > 0) {
 | 
				
			||||||
                apElementConfiguration = ((ApElementConfiguration) ce.getDetails());
 | 
					 | 
				
			||||||
                apElementConfiguration.getRadioMap().get(radioState.getFreqBand())
 | 
					                apElementConfiguration.getRadioMap().get(radioState.getFreqBand())
 | 
				
			||||||
                        .setEirpTxPower(AutoOrManualValue.createManualInstance(radioState.getTxPower()));
 | 
					                        .setEirpTxPower(AutoOrManualValue.createManualInstance(radioState.getTxPower()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1941,17 +1940,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            ce.setDetails(apElementConfiguration);
 | 
					 | 
				
			||||||
            try {
 | 
					 | 
				
			||||||
                equipmentServiceInterface.update(ce);
 | 
					 | 
				
			||||||
            } catch (DsConcurrentModificationException e) {
 | 
					 | 
				
			||||||
                LOG.debug("Equipment reference changed, update instance and retry.", e.getMessage());
 | 
					 | 
				
			||||||
                ce = equipmentServiceInterface.getByInventoryIdOrNull(apId);
 | 
					 | 
				
			||||||
                ce.setDetails(apElementConfiguration);
 | 
					 | 
				
			||||||
                ce = equipmentServiceInterface.update(ce);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            initializeRadioUtilizationReport(customerId, equipmentId, radioState.getFreqBand());
 | 
					 | 
				
			||||||
            Status protocolStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.PROTOCOL);
 | 
					            Status protocolStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.PROTOCOL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (protocolStatus == null) {
 | 
					            if (protocolStatus == null) {
 | 
				
			||||||
@@ -1983,54 +1971,30 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
 | 
				
			|||||||
            protocolStatus = statusServiceInterface.update(protocolStatus);
 | 
					            protocolStatus = statusServiceInterface.update(protocolStatus);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					        ce = equipmentServiceInterface.getByInventoryIdOrNull(apId);
 | 
				
			||||||
 | 
					        if (ce == null) {
 | 
				
			||||||
    private void initializeRadioUtilizationReport(int customerId, long equipmentId, RadioType radioFreqBand) {
 | 
					            LOG.debug("wifiRadioStatusDbTableUpdate::Cannot get Equipment for AP {}", apId);
 | 
				
			||||||
        Status radioUtilizationStatus = statusServiceInterface.getOrNull(customerId, equipmentId,
 | 
					            return;
 | 
				
			||||||
                StatusDataType.RADIO_UTILIZATION);
 | 
					 | 
				
			||||||
        if (radioUtilizationStatus == null) {
 | 
					 | 
				
			||||||
            radioUtilizationStatus = new Status();
 | 
					 | 
				
			||||||
            radioUtilizationStatus.setCustomerId(customerId);
 | 
					 | 
				
			||||||
            radioUtilizationStatus.setEquipmentId(equipmentId);
 | 
					 | 
				
			||||||
            radioUtilizationStatus.setStatusDataType(StatusDataType.RADIO_UTILIZATION);
 | 
					 | 
				
			||||||
            RadioUtilizationReport radioUtilizationReport = new RadioUtilizationReport();
 | 
					 | 
				
			||||||
            radioUtilizationStatus.setDetails(radioUtilizationReport);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            radioUtilizationStatus = statusServiceInterface.update(radioUtilizationStatus);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        ((ApElementConfiguration) ce.getDetails()).setRadioMap(apElementConfiguration.getRadioMap());
 | 
				
			||||||
 | 
					        ((ApElementConfiguration) ce.getDetails()).setAdvancedRadioMap(apElementConfiguration.getAdvancedRadioMap());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        RadioUtilizationReport radioUtilizationReport = (RadioUtilizationReport) radioUtilizationStatus.getDetails();
 | 
					        try {
 | 
				
			||||||
 | 
					            equipmentServiceInterface.update(ce);
 | 
				
			||||||
        Map<RadioType, EquipmentPerRadioUtilizationDetails> radioEquipment = radioUtilizationReport
 | 
					        } catch (DsConcurrentModificationException e) {
 | 
				
			||||||
                .getRadioUtilization();
 | 
					            LOG.debug("Equipment reference changed, update instance and retry.", e.getMessage());
 | 
				
			||||||
        if (!radioEquipment.containsKey(radioFreqBand)) {
 | 
					            ce = equipmentServiceInterface.getByInventoryIdOrNull(apId);
 | 
				
			||||||
            radioEquipment.put(radioFreqBand, new EquipmentPerRadioUtilizationDetails());
 | 
					            ce.setDetails(apElementConfiguration);
 | 
				
			||||||
            radioUtilizationReport.setRadioUtilization(radioEquipment);
 | 
					            ce = equipmentServiceInterface.update(ce);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Map<RadioType, EquipmentCapacityDetails> capacityDetails = radioUtilizationReport.getCapacityDetails();
 | 
					 | 
				
			||||||
        if (!capacityDetails.containsKey(radioFreqBand)) {
 | 
					 | 
				
			||||||
            EquipmentCapacityDetails details = new EquipmentCapacityDetails();
 | 
					 | 
				
			||||||
            details.setTotalCapacity(100);
 | 
					 | 
				
			||||||
            capacityDetails.put(radioFreqBand, details);
 | 
					 | 
				
			||||||
            radioUtilizationReport.setCapacityDetails(capacityDetails);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        Map<RadioType, Integer> avgNoiseFloor = radioUtilizationReport.getAvgNoiseFloor();
 | 
					 | 
				
			||||||
        if (!avgNoiseFloor.containsKey(radioFreqBand)) {
 | 
					 | 
				
			||||||
            avgNoiseFloor.put(radioFreqBand, null);
 | 
					 | 
				
			||||||
            radioUtilizationReport.setAvgNoiseFloor(avgNoiseFloor);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        radioUtilizationStatus.setDetails(radioUtilizationReport);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        radioUtilizationStatus = statusServiceInterface.update(radioUtilizationStatus);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void wifiInetStateDbTableUpdate(List<OpensyncAPInetState> inetStateTables, String apId) {
 | 
					    public void wifiInetStateDbTableUpdate(List<OpensyncAPInetState> inetStateTables, String apId) {
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        LOG.debug("Received Wifi_Inet_State table update for AP {}", apId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
 | 
					        OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (ovsdbSession == null) {
 | 
					        if (ovsdbSession == null) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -142,17 +142,7 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
 | 
				
			|||||||
                String key = ConnectusOvsdbClient.this.ovsdbSessionMapInterface.lookupClientId(ovsdbClient);
 | 
					                String key = ConnectusOvsdbClient.this.ovsdbSessionMapInterface.lookupClientId(ovsdbClient);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (key != null) {
 | 
					                if (key != null) {
 | 
				
			||||||
                    try {
 | 
					                    cancelMonitors(ovsdbClient, key);
 | 
				
			||||||
                        ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + key).join();
 | 
					 | 
				
			||||||
                        ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_delete_" + key).join();
 | 
					 | 
				
			||||||
                        ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_" + key).join();
 | 
					 | 
				
			||||||
                        ovsdbClient.cancelMonitor(OvsdbDao.wifiInetStateDbTable + "_" + key).join();
 | 
					 | 
				
			||||||
                        ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable + "_" + key).join();
 | 
					 | 
				
			||||||
                        ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable + "_delete_" + key).join();
 | 
					 | 
				
			||||||
                        ovsdbClient.cancelMonitor(OvsdbDao.awlanNodeDbTable + "_" + key).join();
 | 
					 | 
				
			||||||
                    } catch (OvsdbClientException e) {
 | 
					 | 
				
			||||||
                        LOG.debug("Unable to cancel monitor for state table. {}", e.getMessage());
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    try {
 | 
					                    try {
 | 
				
			||||||
                        extIntegrationInterface.apDisconnected(key);
 | 
					                        extIntegrationInterface.apDisconnected(key);
 | 
				
			||||||
                        ConnectusOvsdbClient.this.ovsdbSessionMapInterface.removeSession(key);
 | 
					                        ConnectusOvsdbClient.this.ovsdbSessionMapInterface.removeSession(key);
 | 
				
			||||||
@@ -169,6 +159,8 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
 | 
				
			|||||||
                        ConnectusOvsdbClient.this.ovsdbSessionMapInterface.getNumSessions());
 | 
					                        ConnectusOvsdbClient.this.ovsdbSessionMapInterface.getNumSessions());
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					           
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        listener.startListeningWithSsl(ovsdbListenPort, sslContext, connectionCallback).join();
 | 
					        listener.startListeningWithSsl(ovsdbListenPort, sslContext, connectionCallback).join();
 | 
				
			||||||
@@ -176,6 +168,20 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
 | 
				
			|||||||
        LOG.info("Manager waiting for connection on port {}...", ovsdbListenPort);
 | 
					        LOG.info("Manager waiting for connection on port {}...", ovsdbListenPort);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					    private void cancelMonitors(OvsdbClient ovsdbClient, String key) {
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + key).join();
 | 
				
			||||||
 | 
					            ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_delete_" + key).join();
 | 
				
			||||||
 | 
					            ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_" + key).join();
 | 
				
			||||||
 | 
					            ovsdbClient.cancelMonitor(OvsdbDao.wifiInetStateDbTable + "_" + key).join();
 | 
				
			||||||
 | 
					            ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable + "_" + key).join();
 | 
				
			||||||
 | 
					            ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable + "_delete_" + key).join();
 | 
				
			||||||
 | 
					            ovsdbClient.cancelMonitor(OvsdbDao.awlanNodeDbTable + "_" + key).join();
 | 
				
			||||||
 | 
					        } catch (OvsdbClientException e) {
 | 
				
			||||||
 | 
					            LOG.debug("Unable to cancel monitor for state table. {}", e.getMessage());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private ConnectNodeInfo processConnectRequest(OvsdbClient ovsdbClient, String clientCn,
 | 
					    private ConnectNodeInfo processConnectRequest(OvsdbClient ovsdbClient, String clientCn,
 | 
				
			||||||
            ConnectNodeInfo connectNodeInfo) {
 | 
					            ConnectNodeInfo connectNodeInfo) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -251,19 +257,31 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
 | 
				
			|||||||
        OpensyncAPConfig opensyncAPConfig = extIntegrationInterface.getApConfig(apId);
 | 
					        OpensyncAPConfig opensyncAPConfig = extIntegrationInterface.getApConfig(apId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (opensyncAPConfig != null) {
 | 
					        if (opensyncAPConfig != null) {
 | 
				
			||||||
 | 
					            try {
 | 
				
			||||||
 | 
					                ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + apId).join();
 | 
				
			||||||
 | 
					                ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_" + apId).join();
 | 
				
			||||||
 | 
					                ovsdbDao.removeAllSsids(ovsdbClient);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            ovsdbDao.removeAllSsids(ovsdbClient);
 | 
					                ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
 | 
				
			||||||
 | 
					                ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig);
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
            ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
 | 
					 | 
				
			||||||
            ovsdbDao.configureSsids(ovsdbClient, opensyncAPConfig);
 | 
					 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
            ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
 | 
					                ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
 | 
				
			||||||
            ovsdbDao.configureStats(ovsdbClient);
 | 
					                ovsdbDao.configureStats(ovsdbClient);
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
            if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) {
 | 
					                if (ovsdbDao.getDeviceStatsReportingInterval(ovsdbClient) != collectionIntervalSecDeviceStats) {
 | 
				
			||||||
                ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats);
 | 
					                    ovsdbDao.updateDeviceStatsReportingInterval(ovsdbClient, collectionIntervalSecDeviceStats);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                monitorWifiRadioStateDbTable(ovsdbClient, apId);
 | 
				
			||||||
 | 
					                monitorWifiVifStateDbTable(ovsdbClient, apId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            } catch (OvsdbClientException e) {
 | 
				
			||||||
 | 
					                LOG.error("Could not enable/disable table state monitors, cannot proccess config change for AP {}", apId);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            LOG.warn("Could not get provisioned configuration for AP {}", apId);
 | 
					            LOG.warn("Could not get provisioned configuration for AP {}", apId);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -274,20 +292,61 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private void monitorOvsdbStateTables(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
 | 
					    private void monitorOvsdbStateTables(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
 | 
				
			||||||
        CompletableFuture<TableUpdates> rsCf = ovsdbClient
 | 
					        monitorWifiRadioStateDbTable(ovsdbClient, key);
 | 
				
			||||||
                .monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiRadioStateDbTable + "_" + key,
 | 
					//        monitorWifiInetStateDbTable(ovsdbClient, key);
 | 
				
			||||||
                        new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiRadioStateDbTable,
 | 
					
 | 
				
			||||||
 | 
					        monitorWifiVifStateDbTableDeletion(ovsdbClient, key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        monitorWifiVifStateDbTable(ovsdbClient, key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//        monitorWifiAssociatedClientsDbTableDeletion(ovsdbClient, key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//        monitorWifiAssociatedClientsDbTable(ovsdbClient, key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        monitorAwlanNodeDbTable(ovsdbClient, key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private void monitorAwlanNodeDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
 | 
				
			||||||
 | 
					        CompletableFuture<TableUpdates> awCf = ovsdbClient
 | 
				
			||||||
 | 
					                .monitor(OvsdbDao.ovsdbName, OvsdbDao.awlanNodeDbTable + "_" + key,
 | 
				
			||||||
 | 
					                        new MonitorRequests(ImmutableMap.of(OvsdbDao.awlanNodeDbTable,
 | 
				
			||||||
                                new MonitorRequest(new MonitorSelect(true, false, false, true)))),
 | 
					                                new MonitorRequest(new MonitorSelect(true, false, false, true)))),
 | 
				
			||||||
                        new MonitorCallback() {
 | 
					                        new MonitorCallback() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            @Override
 | 
					                            @Override
 | 
				
			||||||
                            public void update(TableUpdates tableUpdates) {
 | 
					                            public void update(TableUpdates tableUpdates) {
 | 
				
			||||||
                                extIntegrationInterface.wifiRadioStatusDbTableUpdate(
 | 
					                                extIntegrationInterface.awlanNodeDbTableUpdate(
 | 
				
			||||||
                                        ovsdbDao.getOpensyncAPRadioState(tableUpdates, key, ovsdbClient), key);
 | 
					                                        ovsdbDao.getOpensyncAWLANNode(tableUpdates, key, ovsdbClient), key);
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
        rsCf.join();
 | 
					        awCf.join();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private void monitorWifiAssociatedClientsDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
 | 
				
			||||||
 | 
					        CompletableFuture<TableUpdates> acCf = ovsdbClient
 | 
				
			||||||
 | 
					                .monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiAssociatedClientsDbTable + "_" + key,
 | 
				
			||||||
 | 
					                        new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiAssociatedClientsDbTable,
 | 
				
			||||||
 | 
					                                new MonitorRequest(new MonitorSelect(true, true, false, true)))),
 | 
				
			||||||
 | 
					                        new MonitorCallback() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                            @Override
 | 
				
			||||||
 | 
					                            public void update(TableUpdates tableUpdates) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                    extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(
 | 
				
			||||||
 | 
					                                            ovsdbDao.getOpensyncWifiAssociatedClients(tableUpdates, key, ovsdbClient),
 | 
				
			||||||
 | 
					                                            key);
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        });
 | 
				
			||||||
 | 
					        acCf.join();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private void monitorWifiInetStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
 | 
				
			||||||
        CompletableFuture<TableUpdates> isCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
 | 
					        CompletableFuture<TableUpdates> isCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
 | 
				
			||||||
                OvsdbDao.wifiInetStateDbTable + "_" + key,
 | 
					                OvsdbDao.wifiInetStateDbTable + "_" + key,
 | 
				
			||||||
                new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiInetStateDbTable,
 | 
					                new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiInetStateDbTable,
 | 
				
			||||||
@@ -304,7 +363,26 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
        isCf.join();
 | 
					        isCf.join();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private void monitorWifiRadioStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
 | 
				
			||||||
 | 
					        CompletableFuture<TableUpdates> rsCf = ovsdbClient
 | 
				
			||||||
 | 
					                .monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiRadioStateDbTable + "_" + key,
 | 
				
			||||||
 | 
					                        new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiRadioStateDbTable,
 | 
				
			||||||
 | 
					                                new MonitorRequest(new MonitorSelect(true, false, false, true)))),
 | 
				
			||||||
 | 
					                        new MonitorCallback() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                            @Override
 | 
				
			||||||
 | 
					                            public void update(TableUpdates tableUpdates) {
 | 
				
			||||||
 | 
					                                extIntegrationInterface.wifiRadioStatusDbTableUpdate(
 | 
				
			||||||
 | 
					                                        ovsdbDao.getOpensyncAPRadioState(tableUpdates, key, ovsdbClient), key);
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        });
 | 
				
			||||||
 | 
					        rsCf.join();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    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,
 | 
				
			||||||
@@ -362,24 +440,9 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
 | 
				
			|||||||
                        });
 | 
					                        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        vsdCf.join();
 | 
					        vsdCf.join();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        CompletableFuture<TableUpdates> vsCf = ovsdbClient
 | 
					    private void monitorWifiAssociatedClientsDbTableDeletion(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
 | 
				
			||||||
                .monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiVifStateDbTable + "_" + key,
 | 
					 | 
				
			||||||
                        new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiVifStateDbTable,
 | 
					 | 
				
			||||||
                                new MonitorRequest(new MonitorSelect(true, true, false, true)))),
 | 
					 | 
				
			||||||
                        new MonitorCallback() {
 | 
					 | 
				
			||||||
                            @Override
 | 
					 | 
				
			||||||
                            public void update(TableUpdates tableUpdates) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                                extIntegrationInterface.wifiVIFStateDbTableUpdate(
 | 
					 | 
				
			||||||
                                        ovsdbDao.getOpensyncAPVIFState(tableUpdates, key, ovsdbClient), key);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        vsCf.join();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        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,
 | 
				
			||||||
@@ -406,42 +469,25 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
        acdCf.join();
 | 
					        acdCf.join();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        CompletableFuture<TableUpdates> acCf = ovsdbClient
 | 
					    private void monitorWifiVifStateDbTable(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
 | 
				
			||||||
                .monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiAssociatedClientsDbTable + "_" + key,
 | 
					        CompletableFuture<TableUpdates> vsCf = ovsdbClient
 | 
				
			||||||
                        new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiAssociatedClientsDbTable,
 | 
					                .monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiVifStateDbTable + "_" + key,
 | 
				
			||||||
 | 
					                        new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiVifStateDbTable,
 | 
				
			||||||
                                new MonitorRequest(new MonitorSelect(true, true, false, true)))),
 | 
					                                new MonitorRequest(new MonitorSelect(true, true, false, true)))),
 | 
				
			||||||
                        new MonitorCallback() {
 | 
					                        new MonitorCallback() {
 | 
				
			||||||
 | 
					 | 
				
			||||||
                            @Override
 | 
					                            @Override
 | 
				
			||||||
                            public void update(TableUpdates tableUpdates) {
 | 
					                            public void update(TableUpdates tableUpdates) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
 | 
					                                extIntegrationInterface.wifiVIFStateDbTableUpdate(
 | 
				
			||||||
 | 
					                                        ovsdbDao.getOpensyncAPVIFState(tableUpdates, key, ovsdbClient), key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                    extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(
 | 
					 | 
				
			||||||
                                            ovsdbDao.getOpensyncWifiAssociatedClients(tableUpdates, key, ovsdbClient),
 | 
					 | 
				
			||||||
                                            key);
 | 
					 | 
				
			||||||
                                }
 | 
					 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
        acCf.join();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        CompletableFuture<TableUpdates> awCf = ovsdbClient
 | 
					 | 
				
			||||||
                .monitor(OvsdbDao.ovsdbName, OvsdbDao.awlanNodeDbTable + "_" + key,
 | 
					 | 
				
			||||||
                        new MonitorRequests(ImmutableMap.of(OvsdbDao.awlanNodeDbTable,
 | 
					 | 
				
			||||||
                                new MonitorRequest(new MonitorSelect(true, false, false, true)))),
 | 
					 | 
				
			||||||
                        new MonitorCallback() {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                            @Override
 | 
					 | 
				
			||||||
                            public void update(TableUpdates tableUpdates) {
 | 
					 | 
				
			||||||
                                extIntegrationInterface.awlanNodeDbTableUpdate(
 | 
					 | 
				
			||||||
                                        ovsdbDao.getOpensyncAWLANNode(tableUpdates, key, ovsdbClient), key);
 | 
					 | 
				
			||||||
                            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        });
 | 
					 | 
				
			||||||
        awCf.join();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        vsCf.join();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user