WIFI-862: Opensync Gateway: Add Table Models to OvsdbDao

Update Dao/Java table models for Ovsdb tables Wifi_Passpoint_Config and
Wifi_Osu_Provider based on AP schema changes.
This commit is contained in:
Mike Hansen
2020-09-29 17:20:22 -04:00
parent c485f0284d
commit 647e201647
2 changed files with 70 additions and 82 deletions

View File

@@ -1,8 +1,8 @@
package com.telecominfraproject.wlan.opensync.ovsdb.dao.models;
import java.util.HashMap;
import java.util.Map;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import com.vmware.ovsdb.protocol.operation.notation.Row;
import com.vmware.ovsdb.protocol.operation.notation.Uuid;
@@ -12,13 +12,13 @@ public class WifiOsuProvider implements Cloneable {
public static String[] ovsdbColumns = { "_version", "osu_nai", "icon", "server_uri", "method_list", "_uuid",
"osu_friendly_name", "service_description" };
public Uuid version;
public Map<String, String> osuNai;
public Map<String, String> icon;
public Set<String> osuNai;
public Set<String> icon;
public String serverUri;
public int methodList;
public Set<Integer> methodList;
public Uuid uuid;
public Map<String, String> osuFriendlyName;
public Map<String, String> serviceDescription;
public Set<String> osuFriendlyName;
public Set<String> serviceDescription;
public WifiOsuProvider() {
@@ -27,18 +27,15 @@ public class WifiOsuProvider implements Cloneable {
public WifiOsuProvider(Row row) {
this.version = row.getUuidColumn("_version");
this.uuid = row.getUuidColumn("_uuid");
this.osuNai = row.getMapColumn("osu_nai");
this.icon = row.getMapColumn("icon");
this.osuNai = row.getSetColumn("osu_nai");
this.icon = row.getSetColumn("icon");
if ((row.getColumns().get("server_uri") != null) && row.getColumns().get("server_uri").getClass()
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.serverUri = row.getStringColumn("server_uri");
}
if ((row.getColumns().get("method_list") != null) && row.getColumns().get("method_list").getClass()
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.methodList = row.getIntegerColumn("method_list").intValue();
}
this.osuFriendlyName = row.getMapColumn("osu_friendly_name");
this.serviceDescription = row.getMapColumn("service_description");
this.methodList = row.getSetColumn("method_list");
this.osuFriendlyName = row.getSetColumn("osu_friendly_name");
this.serviceDescription = row.getSetColumn("service_description");
}
@@ -48,16 +45,19 @@ public class WifiOsuProvider implements Cloneable {
WifiOsuProvider ret = (WifiOsuProvider) super.clone();
if (osuNai != null) {
ret.osuNai = new HashMap<>(this.osuNai);
ret.osuNai = new HashSet<>(this.osuNai);
}
if (icon != null) {
ret.icon = new HashMap<>(this.icon);
ret.icon = new HashSet<>(this.icon);
}
if (methodList != null) {
ret.methodList = new HashSet<>(this.methodList);
}
if (osuFriendlyName != null) {
ret.osuFriendlyName = new HashMap<>(this.osuFriendlyName);
ret.osuFriendlyName = new HashSet<>(this.osuFriendlyName);
}
if (serviceDescription != null) {
ret.serviceDescription = new HashMap<>(this.serviceDescription);
ret.serviceDescription = new HashSet<>(this.serviceDescription);
}
return ret;
@@ -87,7 +87,7 @@ public class WifiOsuProvider implements Cloneable {
return false;
}
WifiOsuProvider other = (WifiOsuProvider) obj;
return Objects.equals(icon, other.icon) && methodList == other.methodList
return Objects.equals(icon, other.icon) && Objects.equals(methodList, other.methodList)
&& Objects.equals(osuFriendlyName, other.osuFriendlyName) && Objects.equals(osuNai, other.osuNai)
&& Objects.equals(serverUri, other.serverUri)
&& Objects.equals(serviceDescription, other.serviceDescription) && Objects.equals(uuid, other.uuid)

View File

@@ -1,8 +1,6 @@
package com.telecominfraproject.wlan.opensync.ovsdb.dao.models;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
@@ -20,33 +18,32 @@ public class WifiPasspointConfig implements Cloneable {
};
public String osuSsid;
public String networkAuthType;
public Set<Uuid> osuProviders;
public String hessid;
public int deauthRequestTimeout;
public Map<String, String> venueUrl;
public Set<String> venueUrl;
public String ipAddrType;
public String venueGroupType;
public Uuid uuid;
public Map<String, String> venueName;
public Map<String, String> domainName;
public Set<String> venueName;
public Set<String> domainName;
public int anqpDomainId;
public Map<String, String> osuIcons;
public Map<String, String> naiRealm;
public Set<String> naiRealm;
public boolean osen;
public Map<String, String> mccMnc;
public Set<String> mccMnc;
public boolean enable;
public Set<Uuid> vifConfig;
public Map<String, String> roamingOi;
public Set<String> roamingOi;
public Uuid version;
public Map<String, String> connectionCapability;
public Set<String> connectionCapability;
public int operatingClass;
public Map<String, String> operatorIcons;
public Set<String> operatorIcons;
public int gasAddr3Behaviour;
public String tos;
public Map<String, String> operatorFriendlyName;
public Set<String> operatorFriendlyName;
@Override
public WifiPasspointConfig clone() {
@@ -56,34 +53,31 @@ public class WifiPasspointConfig implements Cloneable {
ret.osuProviders = new HashSet<>(this.osuProviders);
}
if (venueUrl != null) {
ret.venueUrl = new HashMap<>(this.venueUrl);
ret.venueUrl = new HashSet<>(this.venueUrl);
}
if (venueName != null) {
ret.venueName = new HashMap<>(this.venueName);
ret.venueName = new HashSet<>(this.venueName);
}
if (domainName != null) {
ret.domainName = new HashMap<>(this.domainName);
}
if (osuIcons != null) {
ret.osuIcons = new HashMap<>(this.osuIcons);
ret.domainName = new HashSet<>(this.domainName);
}
if (naiRealm != null) {
ret.naiRealm = new HashMap<>(this.naiRealm);
ret.naiRealm = new HashSet<>(this.naiRealm);
}
if (mccMnc != null) {
ret.mccMnc = new HashMap<>(this.mccMnc);
ret.mccMnc = new HashSet<>(this.mccMnc);
}
if (roamingOi != null) {
ret.roamingOi = new HashMap<>(this.roamingOi);
ret.roamingOi = new HashSet<>(this.roamingOi);
}
if (connectionCapability != null) {
ret.connectionCapability = new HashMap<>(this.connectionCapability);
ret.connectionCapability = new HashSet<>(this.connectionCapability);
}
if (operatorIcons != null) {
ret.operatorIcons = new HashMap<>(this.operatorIcons);
ret.operatorIcons = new HashSet<>(this.operatorIcons);
}
if (operatorFriendlyName != null) {
ret.operatorFriendlyName = new HashMap<>(this.operatorFriendlyName);
ret.operatorFriendlyName = new HashSet<>(this.operatorFriendlyName);
}
if (osuProviders != null) {
ret.osuProviders = new HashSet<>(this.osuProviders);
@@ -101,8 +95,8 @@ public class WifiPasspointConfig implements Cloneable {
public WifiPasspointConfig(Row row) {
this.osuSsid = row.getStringColumn("osu_ssid");
if ((row.getColumns().get("network_auth_type") != null) && row.getColumns().get("network_auth_type")
.getClass().equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
if ((row.getColumns().get("network_auth_type") != null) && row.getColumns().get("network_auth_type").getClass()
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.networkAuthType = row.getStringColumn("network_auth_type");
}
this.osuProviders = row.getSetColumn("osu_providers");
@@ -110,54 +104,51 @@ public class WifiPasspointConfig implements Cloneable {
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.hessid = row.getStringColumn("hessid");
}
if ((row.getColumns().get("deauth_request_timeout") != null)
&& row.getColumns().get("deauth_request_timeout").getClass()
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.deauthRequestTimeout = row.getIntegerColumn("deauth_request_timeout")
.intValue();
if ((row.getColumns().get("deauth_request_timeout") != null) && row.getColumns().get("deauth_request_timeout")
.getClass().equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.deauthRequestTimeout = row.getIntegerColumn("deauth_request_timeout").intValue();
}
this.venueUrl = row.getMapColumn("venue_url");
this.venueUrl = row.getSetColumn("venue_url");
if ((row.getColumns().get("ip_addr_type") != null) && row.getColumns().get("ip_addr_type").getClass()
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.ipAddrType = row.getStringColumn("ip_addr_type");
}
if ((row.getColumns().get("venue_group_type") != null) && row.getColumns().get("venue_group_type")
.getClass().equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
if ((row.getColumns().get("venue_group_type") != null) && row.getColumns().get("venue_group_type").getClass()
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.venueGroupType = row.getStringColumn("venue_group_type");
}
this.uuid = row.getUuidColumn("_uuid");
this.venueName = row.getMapColumn("venue_name");
this.domainName = row.getMapColumn("domain_name");
if ((row.getColumns().get("anqp_domain_id") != null) && row.getColumns().get("anqp_domain_id")
.getClass().equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.venueName = row.getSetColumn("venue_name");
this.domainName = row.getSetColumn("domain_name");
if ((row.getColumns().get("anqp_domain_id") != null) && row.getColumns().get("anqp_domain_id").getClass()
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.anqpDomainId = row.getIntegerColumn("anqp_domain_id").intValue();
}
this.osuIcons = row.getMapColumn("osu_icons");
this.naiRealm = row.getMapColumn("nai_realm");
this.naiRealm = row.getSetColumn("nai_realm");
if ((row.getColumns().get("osen") != null) && row.getColumns().get("osen").getClass()
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.osen = row.getBooleanColumn("osen");
}
this.mccMnc = row.getMapColumn("mcc_mnc");
this.mccMnc = row.getSetColumn("mcc_mnc");
if ((row.getColumns().get("enable") != null) && row.getColumns().get("enable").getClass()
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.enable = row.getBooleanColumn("enable");
}
this.vifConfig = row.getSetColumn("vif_config");
this.roamingOi = row.getMapColumn("roaming_oi");
this.roamingOi = row.getSetColumn("roaming_oi");
this.version = row.getUuidColumn("_version");
this.connectionCapability = row.getMapColumn("connection_capability");
if ((row.getColumns().get("operating_class") != null) && row.getColumns().get("operating_class")
.getClass().equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.connectionCapability = row.getSetColumn("connection_capability");
if ((row.getColumns().get("operating_class") != null) && row.getColumns().get("operating_class").getClass()
.equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.operatingClass = row.getIntegerColumn("operating_class").intValue();
}
this.operatorIcons = row.getMapColumn("operator_icons");
this.operatorIcons = row.getSetColumn("operator_icons");
if ((row.getColumns().get("gas_addr3_behavior") != null) && row.getColumns().get("gas_addr3_behavior")
.getClass().equals(com.vmware.ovsdb.protocol.operation.notation.Atom.class)) {
this.gasAddr3Behaviour = row.getIntegerColumn("gas_addr3_behavior").intValue();
}
this.tos = row.getStringColumn("tos");
this.operatorFriendlyName = row.getMapColumn("operator_friendly_name");
this.operatorFriendlyName = row.getSetColumn("operator_friendly_name");
}
public WifiPasspointConfig() {
@@ -168,11 +159,11 @@ public class WifiPasspointConfig implements Cloneable {
@Override
public String toString() {
return String.format(
"WifiPasspointConfig [osuSsid=%s, networkAuthType=%s, osuProviders=%s, hessid=%s, deauthRequestTimeout=%s, venueUrl=%s, ipAddrType=%s, venueGroupType=%s, uuid=%s, venueName=%s, domainName=%s, anqpDomainId=%s, osuIcons=%s, naiRealm=%s, osen=%s, mccMnc=%s, enable=%s, vifConfig=%s, roamingOi=%s, version=%s, connectionCapability=%s, operatingClass=%s, operatorIcons=%s, gasAddr3Behaviour=%s, tos=%s, operatorFriendlyName=%s]",
"WifiPasspointConfig [osuSsid=%s, networkAuthType=%s, osuProviders=%s, hessid=%s, deauthRequestTimeout=%s, venueUrl=%s, ipAddrType=%s, venueGroupType=%s, uuid=%s, venueName=%s, domainName=%s, anqpDomainId=%s, naiRealm=%s, osen=%s, mccMnc=%s, enable=%s, vifConfig=%s, roamingOi=%s, version=%s, connectionCapability=%s, operatingClass=%s, operatorIcons=%s, gasAddr3Behaviour=%s, tos=%s, operatorFriendlyName=%s]",
osuSsid, networkAuthType, osuProviders, hessid, deauthRequestTimeout, venueUrl, ipAddrType,
venueGroupType, uuid, venueName, domainName, anqpDomainId, osuIcons, naiRealm, osen, mccMnc, enable,
vifConfig, roamingOi, version, connectionCapability, operatingClass, operatorIcons, gasAddr3Behaviour,
tos, operatorFriendlyName);
venueGroupType, uuid, venueName, domainName, anqpDomainId, naiRealm, osen, mccMnc, enable, vifConfig,
roamingOi, version, connectionCapability, operatingClass, operatorIcons, gasAddr3Behaviour, tos,
operatorFriendlyName);
}
@@ -180,8 +171,8 @@ public class WifiPasspointConfig implements Cloneable {
public int hashCode() {
return Objects.hash(anqpDomainId, connectionCapability, deauthRequestTimeout, domainName, enable,
gasAddr3Behaviour, hessid, ipAddrType, mccMnc, naiRealm, networkAuthType, operatingClass,
operatorFriendlyName, operatorIcons, osen, osuIcons, osuProviders, osuSsid, roamingOi, tos, uuid,
venueGroupType, venueName, venueUrl, version, vifConfig);
operatorFriendlyName, operatorIcons, osen, osuProviders, osuSsid, roamingOi, tos, uuid, venueGroupType,
venueName, venueUrl, version, vifConfig);
}
@@ -202,15 +193,12 @@ public class WifiPasspointConfig implements Cloneable {
&& Objects.equals(networkAuthType, other.networkAuthType) && operatingClass == other.operatingClass
&& Objects.equals(operatorFriendlyName, other.operatorFriendlyName)
&& Objects.equals(operatorIcons, other.operatorIcons) && osen == other.osen
&& Objects.equals(osuIcons, other.osuIcons) && Objects.equals(osuProviders, other.osuProviders)
&& Objects.equals(osuSsid, other.osuSsid) && Objects.equals(roamingOi, other.roamingOi)
&& Objects.equals(tos, other.tos) && Objects.equals(uuid, other.uuid)
&& Objects.equals(venueGroupType, other.venueGroupType) && Objects.equals(venueName, other.venueName)
&& Objects.equals(venueUrl, other.venueUrl) && Objects.equals(version, other.version)
&& Objects.equals(vifConfig, other.vifConfig);
&& Objects.equals(osuProviders, other.osuProviders) && Objects.equals(osuSsid, other.osuSsid)
&& Objects.equals(roamingOi, other.roamingOi) && Objects.equals(tos, other.tos)
&& Objects.equals(uuid, other.uuid) && Objects.equals(venueGroupType, other.venueGroupType)
&& Objects.equals(venueName, other.venueName) && Objects.equals(venueUrl, other.venueUrl)
&& Objects.equals(version, other.version) && Objects.equals(vifConfig, other.vifConfig);
}
}