mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-22 04:45:08 +00:00
WIFI-862: Opensync Gateway: Add Table Models to OvsdbDao
This commit is contained in:
@@ -3315,32 +3315,80 @@ public class OvsdbDao {
|
|||||||
|
|
||||||
public void configureWifiPasspoints(OvsdbClient ovsdbClient, OpensyncAPConfig opensyncApConfig) {
|
public void configureWifiPasspoints(OvsdbClient ovsdbClient, OpensyncAPConfig opensyncApConfig) {
|
||||||
|
|
||||||
// TODO: Configure with information from Controller
|
try {
|
||||||
Map<String, WifiPasspointConfig> passpointConfigs = getProvisionedWifiPasspointConfigs(ovsdbClient);
|
DatabaseSchema schema = ovsdbClient.getSchema(ovsdbName).get(ovsdbTimeoutSec, TimeUnit.SECONDS);
|
||||||
LOG.info("Current WifiPasspointConfigs {}", passpointConfigs);
|
if (schema.getTables().containsKey(wifiPasspointConfigDbTable)
|
||||||
|
&& schema.getTables().get(wifiPasspointConfigDbTable) != null) {
|
||||||
|
Map<Uuid, WifiOsuProvider> osuProviders = getProvisionedWifiOsuProviders(ovsdbClient);
|
||||||
|
LOG.info("Current WifiPasspointConfigs {}", osuProviders);
|
||||||
|
} else {
|
||||||
|
LOG.info("Table {} not present in {}. Cannot perform configureWifiPasspoints", wifiPasspointConfigDbTable,
|
||||||
|
ovsdbName);
|
||||||
|
}
|
||||||
|
} catch (InterruptedException | ExecutionException | TimeoutException | OvsdbClientException e) {
|
||||||
|
LOG.error("Error in configureWifiPasspoints", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void configureWifiOsuProviders(OvsdbClient ovsdbClient, OpensyncAPConfig opensyncApConfig) {
|
public void configureWifiOsuProviders(OvsdbClient ovsdbClient, OpensyncAPConfig opensyncApConfig) {
|
||||||
|
|
||||||
// TODO: Configure with information from Controller
|
|
||||||
|
try {
|
||||||
|
DatabaseSchema schema = ovsdbClient.getSchema(ovsdbName).get(ovsdbTimeoutSec, TimeUnit.SECONDS);
|
||||||
|
if (schema.getTables().containsKey(wifiOsuProviderDbTable)
|
||||||
|
&& schema.getTables().get(wifiOsuProviderDbTable) != null) {
|
||||||
Map<Uuid, WifiOsuProvider> osuProviders = getProvisionedWifiOsuProviders(ovsdbClient);
|
Map<Uuid, WifiOsuProvider> osuProviders = getProvisionedWifiOsuProviders(ovsdbClient);
|
||||||
LOG.info("Current WifiOsuProviders {}", osuProviders);
|
LOG.info("Current WifiOsuProviders {}", osuProviders);
|
||||||
|
} else {
|
||||||
|
LOG.info("Table {} not present in {}. Cannot configure Wifi Osu Providers", wifiOsuProviderDbTable,
|
||||||
|
ovsdbName);
|
||||||
|
}
|
||||||
|
} catch (InterruptedException | ExecutionException | TimeoutException | OvsdbClientException e) {
|
||||||
|
LOG.error("Error in configureWifiOsuProviders", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAllWifiPasspointConfigs(OvsdbClient ovsdbClient) {
|
public void removeAllWifiPasspointConfigs(OvsdbClient ovsdbClient) {
|
||||||
// TODO: Delete PasspointConfigs
|
try {
|
||||||
Map<String, WifiPasspointConfig> passpointConfigs = getProvisionedWifiPasspointConfigs(ovsdbClient);
|
DatabaseSchema schema = ovsdbClient.getSchema(ovsdbName).get(ovsdbTimeoutSec, TimeUnit.SECONDS);
|
||||||
LOG.info("Current WifiPasspointConfigs {}", passpointConfigs);
|
if (schema.getTables().containsKey(wifiPasspointConfigDbTable)
|
||||||
|
&& schema.getTables().get(wifiPasspointConfigDbTable) != null) {
|
||||||
|
Map<Uuid, WifiOsuProvider> osuProviders = getProvisionedWifiOsuProviders(ovsdbClient);
|
||||||
|
LOG.info("Current WifiPasspointConfigs {}", osuProviders);
|
||||||
|
} else {
|
||||||
|
LOG.info("Table {} not present in {}. Cannot remove Wifi Passpoint Configs", wifiPasspointConfigDbTable,
|
||||||
|
ovsdbName);
|
||||||
|
}
|
||||||
|
} catch (InterruptedException | ExecutionException | TimeoutException | OvsdbClientException e) {
|
||||||
|
LOG.error("Error in removeAllWifiPasspointConfigs", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAllWifiOsuProviders(OvsdbClient ovsdbClient) {
|
public void removeAllWifiOsuProviders(OvsdbClient ovsdbClient) {
|
||||||
// TODO: Delete OsuProviders
|
try {
|
||||||
|
DatabaseSchema schema = ovsdbClient.getSchema(ovsdbName).get(ovsdbTimeoutSec, TimeUnit.SECONDS);
|
||||||
|
if (schema.getTables().containsKey(wifiOsuProviderDbTable)
|
||||||
|
&& schema.getTables().get(wifiOsuProviderDbTable) != null) {
|
||||||
Map<Uuid, WifiOsuProvider> osuProviders = getProvisionedWifiOsuProviders(ovsdbClient);
|
Map<Uuid, WifiOsuProvider> osuProviders = getProvisionedWifiOsuProviders(ovsdbClient);
|
||||||
LOG.info("Current WifiOsuProviders {}", osuProviders);
|
LOG.info("Current WifiOsuProviders {}", osuProviders);
|
||||||
|
} else {
|
||||||
|
LOG.info("Table {} not present in {}. Cannot remove Wifi Osu Providers", wifiOsuProviderDbTable,
|
||||||
|
ovsdbName);
|
||||||
|
}
|
||||||
|
} catch (InterruptedException | ExecutionException | TimeoutException | OvsdbClientException e) {
|
||||||
|
LOG.error("Error in removeAllWifiOsuProviders", e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user