mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-01 19:17:52 +00:00
WIFI-1696: Gateway: add models for the realm_config, radius_config, and radsec_proxy ovsdb tables
Adding models for realm_config and radius_config. Still awaiting definition of radsec proxy table.
This commit is contained in:
@@ -65,6 +65,8 @@ public class OvsdbDaoBase {
|
||||
public static final String hotspot20IconConfigDbTable = "Hotspot20_Icon_Config";
|
||||
public static final String hotspot20OsuProvidersDbTable = "Hotspot20_OSU_Providers";
|
||||
public static final String hotspot20ConfigDbTable = "Hotspot20_Config";
|
||||
public static final String radiusConfigDbTable = "radius_config";
|
||||
public static final String realmConfigDbTable = "realm_config";
|
||||
public static final String StartDebugEngineApCommand = "startPortForwardingSession";
|
||||
public static final String StopDebugEngineApCommand = "stopSession";
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.Hotspot20Config;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.Hotspot20IconConfig;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.Hotspot20OsuProviders;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.NodeConfigInfo;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.RadiusConfigInfo;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.RealmConfigInfo;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiInetConfigInfo;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiRadioConfigInfo;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiStatsConfigInfo;
|
||||
@@ -169,4 +171,21 @@ public class OvsdbGet extends OvsdbDaoBase {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Map<String, RadiusConfigInfo> getProvisionedRadiusConfigs(OvsdbClient ovsdbClient) {
|
||||
Map<String, RadiusConfigInfo> ret = new HashMap<>();
|
||||
for (Row row : getOvsdbTableRowsForCondition(ovsdbClient, radiusConfigDbTable, null)) {
|
||||
RadiusConfigInfo radiusConfigInfo = new RadiusConfigInfo(row);
|
||||
ret.put(radiusConfigInfo.radiusConfigName, radiusConfigInfo);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Map<String, RealmConfigInfo> getProvisionedRealmConfigs(OvsdbClient ovsdbClient) {
|
||||
Map<String, RealmConfigInfo> ret = new HashMap<>();
|
||||
for (Row row : getOvsdbTableRowsForCondition(ovsdbClient, realmConfigDbTable, null)) {
|
||||
RealmConfigInfo realmConfigInfo = new RealmConfigInfo(row);
|
||||
ret.put(realmConfigInfo.realmConfigName, realmConfigInfo);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.telecominfraproject.wlan.opensync.ovsdb.dao.models;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.OvsdbDaoBase;
|
||||
import com.vmware.ovsdb.protocol.operation.notation.Row;
|
||||
import com.vmware.ovsdb.protocol.operation.notation.Uuid;
|
||||
|
||||
public class RadiusConfigInfo implements Cloneable {
|
||||
|
||||
public Uuid uuid;
|
||||
public Uuid version;
|
||||
public String server;
|
||||
public String clientCert;
|
||||
public String radiusConfigName;
|
||||
public String passphrase;
|
||||
public String clientKey;
|
||||
public String caCert;
|
||||
|
||||
public RadiusConfigInfo() {
|
||||
|
||||
}
|
||||
|
||||
public RadiusConfigInfo(Row row) {
|
||||
this.uuid = row.getUuidColumn("_uuid");
|
||||
this.version = row.getUuidColumn("_version");
|
||||
this.server = row.getStringColumn("server");
|
||||
this.clientCert = OvsdbDaoBase.getSingleValueFromSet(row, "client_cert");
|
||||
this.caCert = OvsdbDaoBase.getSingleValueFromSet(row, "ca_cert");
|
||||
this.clientKey = OvsdbDaoBase.getSingleValueFromSet(row, "client_key");
|
||||
this.passphrase = OvsdbDaoBase.getSingleValueFromSet(row, "passphrase");
|
||||
this.radiusConfigName = row.getStringColumn("radius_config_name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusConfigInfo clone() {
|
||||
try {
|
||||
return (RadiusConfigInfo)super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new IllegalStateException("Cannot clone ", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(caCert, clientCert, clientKey, passphrase, radiusConfigName, server, uuid, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
RadiusConfigInfo other = (RadiusConfigInfo) obj;
|
||||
return Objects.equals(caCert, other.caCert) && Objects.equals(clientCert, other.clientCert)
|
||||
&& Objects.equals(clientKey, other.clientKey) && Objects.equals(passphrase, other.passphrase)
|
||||
&& Objects.equals(radiusConfigName, other.radiusConfigName) && Objects.equals(server, other.server)
|
||||
&& Objects.equals(uuid, other.uuid) && Objects.equals(version, other.version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RadiusConfigInfo [uuid=" + uuid + ", version=" + version + ", server=" + server + ", clientCert="
|
||||
+ clientCert + ", radiusConfigName=" + radiusConfigName + ", passphrase=" + passphrase + ", clientKey="
|
||||
+ clientKey + ", caCert=" + caCert + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.telecominfraproject.wlan.opensync.ovsdb.dao.models;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.OvsdbDaoBase;
|
||||
import com.vmware.ovsdb.protocol.operation.notation.Row;
|
||||
import com.vmware.ovsdb.protocol.operation.notation.Uuid;
|
||||
|
||||
public class RealmConfigInfo implements Cloneable {
|
||||
|
||||
public Uuid uuid;
|
||||
public Uuid server;
|
||||
public Uuid version;
|
||||
public String realm;
|
||||
public String realmConfigName;
|
||||
|
||||
public RealmConfigInfo() {
|
||||
|
||||
}
|
||||
|
||||
public RealmConfigInfo(Row row) {
|
||||
this.uuid = row.getUuidColumn("_uuid");
|
||||
this.version = row.getUuidColumn("_version");
|
||||
this.server = OvsdbDaoBase.getSingleValueFromSet(row, "server");
|
||||
this.realm = OvsdbDaoBase.getSingleValueFromSet(row, "realm");
|
||||
this.realmConfigName = row.getStringColumn("realm_config_name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public RealmConfigInfo clone() {
|
||||
try {
|
||||
return (RealmConfigInfo)super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new IllegalStateException("Cannot clone ", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(realm, realmConfigName, server, uuid, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
RealmConfigInfo other = (RealmConfigInfo) obj;
|
||||
return Objects.equals(realm, other.realm) && Objects.equals(realmConfigName, other.realmConfigName)
|
||||
&& Objects.equals(server, other.server) && Objects.equals(uuid, other.uuid)
|
||||
&& Objects.equals(version, other.version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RealmConfigInfo [uuid=" + uuid + ", server=" + server + ", version=" + version + ", realm=" + realm
|
||||
+ ", realmConfigName=" + realmConfigName + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user