mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-02 19:47:52 +00:00
Define Opensync AP State Tables as Objects in models
This commit is contained in:
@@ -4,22 +4,9 @@ import java.util.Set;
|
||||
|
||||
public interface ConnectusOvsdbClientInterface {
|
||||
|
||||
static final String[] AWLAN_NODE_DB_TABLE_COLUMNS = new String[] { "device_mode", "id", "model",
|
||||
"serial_number", "firmware_version", "platform_version", "redirector_addr" };
|
||||
|
||||
static final String[] WIFI_VIF_STATE_DB_TABLE_COLUMNS = new String[] { "min_hw_mode", "if_name", "security",
|
||||
"bridge", "channel", "enabled", "ssid_broadcast", "mac", "ssid" };
|
||||
|
||||
static final String[] WIFI_INET_STATE_DB_TABLE_COLUMNS = new String[] { "hwaddr", "if_type", "if_name",
|
||||
"inet_addr", "dhcpc", "network" };
|
||||
|
||||
static final String[] WIFI_RADIO_STATE_DB_TABLE_COLUMNS = new String[] { "ht_mode", "hw_mode", "hw_params",
|
||||
"hw_type", "mac", "if_name", "freq_band", "country", "channel" };
|
||||
|
||||
static final String[] WIFI_ASSOCIATED_CLIENTS_DB_TABLE_COLUMNS = new String[] { "mac" };
|
||||
|
||||
|
||||
Set<String> getConnectedClientIds();
|
||||
|
||||
String changeRedirectorAddress(String apId, String newRedirectorAddress);
|
||||
|
||||
void processConfigChanged(String apId);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
package com.telecominfraproject.wlan.opensync.external.integration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.ConnectNodeInfo;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPConfig;
|
||||
import com.vmware.ovsdb.protocol.methods.TableUpdates;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPInetState;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPRadioState;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPVIFState;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAWLANNode;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncWifiAssociatedClients;
|
||||
|
||||
import sts.PlumeStats.Report;
|
||||
import traffic.NetworkMetadata.FlowReport;
|
||||
@@ -19,11 +25,11 @@ public interface OpensyncExternalIntegrationInterface {
|
||||
|
||||
OpensyncAPConfig getApConfig(String apId);
|
||||
|
||||
void wifiVIFStateDbTableUpdate(TableUpdates tableUpdates, String apId);
|
||||
void wifiVIFStateDbTableUpdate(List<OpensyncAPVIFState> vifStateTables, String apId);
|
||||
|
||||
void wifiRadioStatusDbTableUpdate(TableUpdates tableUpdates, String apId);
|
||||
void wifiRadioStatusDbTableUpdate(List<OpensyncAPRadioState> radioStateTables, String apId);
|
||||
|
||||
void wifiInetStateDbTableUpdate(TableUpdates tableUpdates, String apId);
|
||||
void wifiInetStateDbTableUpdate(List<OpensyncAPInetState> inetStateTables, String apId);
|
||||
|
||||
void processMqttMessage(String topic, Report report);
|
||||
|
||||
@@ -31,7 +37,7 @@ public interface OpensyncExternalIntegrationInterface {
|
||||
|
||||
void processMqttMessage(String topic, WCStatsReport wcStatsReport);
|
||||
|
||||
void wifiAssociatedClientsDbTableUpdate(TableUpdates tableUpdates, String apId);
|
||||
void wifiAssociatedClientsDbTableUpdate(List<OpensyncWifiAssociatedClients> wifiAssociatedClients, String apId);
|
||||
|
||||
void awlanNodeDbTableUpdate(TableUpdates tableUpdates, String connectedClientId);
|
||||
void awlanNodeDbTableUpdate(OpensyncAWLANNode opensyncAPState, String apId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
package com.telecominfraproject.wlan.opensync.external.integration.models;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.vmware.ovsdb.protocol.operation.notation.Uuid;
|
||||
|
||||
public class OpensyncAPInetState extends BaseJsonModel {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1707053648715030173L;
|
||||
|
||||
public String ifName;
|
||||
public String dhcpd;
|
||||
public String unpnpMode;
|
||||
public String ifType;
|
||||
public String softwdsMacAddr;
|
||||
public boolean enabled;
|
||||
public boolean sofwdsWrap;
|
||||
public int vlanId;
|
||||
public String netmask;
|
||||
public boolean nat;
|
||||
public String greRemoteInetAddr;
|
||||
public String ifUuid;
|
||||
public String inetAddr;
|
||||
public String hwAddr;
|
||||
public int mtw;
|
||||
public boolean network;
|
||||
public Map<String, String> dns;
|
||||
public String parentIfName;
|
||||
public String greIfName;
|
||||
public String broadcast;
|
||||
public Map<String, String> dhcpc;
|
||||
public String gateway;
|
||||
public String ipAssignScheme;
|
||||
public String inetConfig;
|
||||
public Uuid _uuid;
|
||||
public Uuid version;
|
||||
|
||||
public String getIfName() {
|
||||
return ifName;
|
||||
}
|
||||
public void setIfName(String ifName) {
|
||||
this.ifName = ifName;
|
||||
}
|
||||
public String getDhcpd() {
|
||||
return dhcpd;
|
||||
}
|
||||
public void setDhcpd(String dhcpd) {
|
||||
this.dhcpd = dhcpd;
|
||||
}
|
||||
public String getUnpnpMode() {
|
||||
return unpnpMode;
|
||||
}
|
||||
public void setUnpnpMode(String unpnpMode) {
|
||||
this.unpnpMode = unpnpMode;
|
||||
}
|
||||
public String getIfType() {
|
||||
return ifType;
|
||||
}
|
||||
public void setIfType(String ifType) {
|
||||
this.ifType = ifType;
|
||||
}
|
||||
public String getSoftwdsMacAddr() {
|
||||
return softwdsMacAddr;
|
||||
}
|
||||
public void setSoftwdsMacAddr(String softwdsMacAddr) {
|
||||
this.softwdsMacAddr = softwdsMacAddr;
|
||||
}
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
public boolean isSofwdsWrap() {
|
||||
return sofwdsWrap;
|
||||
}
|
||||
public void setSofwdsWrap(boolean sofwdsWrap) {
|
||||
this.sofwdsWrap = sofwdsWrap;
|
||||
}
|
||||
public int getVlanId() {
|
||||
return vlanId;
|
||||
}
|
||||
public void setVlanId(int vlanId) {
|
||||
this.vlanId = vlanId;
|
||||
}
|
||||
public String getNetmask() {
|
||||
return netmask;
|
||||
}
|
||||
public void setNetmask(String netmask) {
|
||||
this.netmask = netmask;
|
||||
}
|
||||
public boolean isNat() {
|
||||
return nat;
|
||||
}
|
||||
public void setNat(boolean nat) {
|
||||
this.nat = nat;
|
||||
}
|
||||
public String getGreRemoteInetAddr() {
|
||||
return greRemoteInetAddr;
|
||||
}
|
||||
public void setGreRemoteInetAddr(String greRemoteInetAddr) {
|
||||
this.greRemoteInetAddr = greRemoteInetAddr;
|
||||
}
|
||||
public String getIfUuid() {
|
||||
return ifUuid;
|
||||
}
|
||||
public void setIfUuid(String ifUuid) {
|
||||
this.ifUuid = ifUuid;
|
||||
}
|
||||
public String getInetAddr() {
|
||||
return inetAddr;
|
||||
}
|
||||
public void setInetAddr(String inetAddr) {
|
||||
this.inetAddr = inetAddr;
|
||||
}
|
||||
public String getHwAddr() {
|
||||
return hwAddr;
|
||||
}
|
||||
public void setHwAddr(String hwAddr) {
|
||||
this.hwAddr = hwAddr;
|
||||
}
|
||||
public int getMtw() {
|
||||
return mtw;
|
||||
}
|
||||
public void setMtw(int mtw) {
|
||||
this.mtw = mtw;
|
||||
}
|
||||
public boolean isNetwork() {
|
||||
return network;
|
||||
}
|
||||
public void setNetwork(boolean network) {
|
||||
this.network = network;
|
||||
}
|
||||
public Map<String, String> getDns() {
|
||||
return dns;
|
||||
}
|
||||
public void setDns(Map<String, String> dns) {
|
||||
this.dns = dns;
|
||||
}
|
||||
public String getParentIfName() {
|
||||
return parentIfName;
|
||||
}
|
||||
public void setParentIfName(String parentIfName) {
|
||||
this.parentIfName = parentIfName;
|
||||
}
|
||||
public String getGreIfName() {
|
||||
return greIfName;
|
||||
}
|
||||
public void setGreIfName(String greIfName) {
|
||||
this.greIfName = greIfName;
|
||||
}
|
||||
public String getBroadcast() {
|
||||
return broadcast;
|
||||
}
|
||||
public void setBroadcast(String broadcast) {
|
||||
this.broadcast = broadcast;
|
||||
}
|
||||
public Map<String, String> getDhcpc() {
|
||||
return dhcpc;
|
||||
}
|
||||
public void setDhcpc(Map<String, String> dhcpc) {
|
||||
this.dhcpc = dhcpc;
|
||||
}
|
||||
public String getGateway() {
|
||||
return gateway;
|
||||
}
|
||||
public void setGateway(String gateway) {
|
||||
this.gateway = gateway;
|
||||
}
|
||||
public String getIpAssignScheme() {
|
||||
return ipAssignScheme;
|
||||
}
|
||||
public void setIpAssignScheme(String ipAssignScheme) {
|
||||
this.ipAssignScheme = ipAssignScheme;
|
||||
}
|
||||
public String getInetConfig() {
|
||||
return inetConfig;
|
||||
}
|
||||
public void setInetConfig(String inetConfig) {
|
||||
this.inetConfig = inetConfig;
|
||||
}
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
public Uuid get_uuid() {
|
||||
return _uuid;
|
||||
}
|
||||
public void set_uuid(Uuid _uuid) {
|
||||
this._uuid = _uuid;
|
||||
}
|
||||
public Uuid getVersion() {
|
||||
return version;
|
||||
}
|
||||
public void setVersion(Uuid version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.telecominfraproject.wlan.opensync.external.integration.models;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.vmware.ovsdb.protocol.operation.notation.Uuid;
|
||||
|
||||
/**
|
||||
* @author mikehansen
|
||||
*
|
||||
*/
|
||||
public class OpensyncAPRadioState extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = 5003143778489404219L;
|
||||
|
||||
public int temperatureControl;
|
||||
public boolean thermalDowngraded;
|
||||
public boolean dfsDemo;
|
||||
public String ifName;
|
||||
public String mac;
|
||||
public int bcnInt;
|
||||
public int thermalTxChainmask;
|
||||
public int[] allowedChannels;
|
||||
public int thermalShutdown;
|
||||
public int channelSync;
|
||||
public int hwType;
|
||||
public int txChainmask;
|
||||
public String radar;
|
||||
public String country;
|
||||
public Map<String, String> hwConfig;
|
||||
public int channel;
|
||||
public int txPower;
|
||||
public String htMode;
|
||||
public int thermalDowngradeTemp;
|
||||
public String hwMode;
|
||||
public boolean enabled;
|
||||
public Map<String, String> channels;
|
||||
public int thermalUpgradeTemp;
|
||||
public Map<String, String> hwParams;
|
||||
public String freqBand;
|
||||
public int thermalIntegration;
|
||||
public String channelMode;
|
||||
public Uuid _uuid;
|
||||
public Uuid version;
|
||||
|
||||
public int getTemperatureControl() {
|
||||
return temperatureControl;
|
||||
}
|
||||
|
||||
public void setTemperatureControl(int temperatureControl) {
|
||||
this.temperatureControl = temperatureControl;
|
||||
}
|
||||
|
||||
public boolean isThermalDowngraded() {
|
||||
return thermalDowngraded;
|
||||
}
|
||||
|
||||
public void setThermalDowngraded(boolean thermalDowngraded) {
|
||||
this.thermalDowngraded = thermalDowngraded;
|
||||
}
|
||||
|
||||
public boolean isDfsDemo() {
|
||||
return dfsDemo;
|
||||
}
|
||||
|
||||
public void setDfsDemo(boolean dfsDemo) {
|
||||
this.dfsDemo = dfsDemo;
|
||||
}
|
||||
|
||||
public String getIfName() {
|
||||
return ifName;
|
||||
}
|
||||
|
||||
public void setIfName(String ifName) {
|
||||
this.ifName = ifName;
|
||||
}
|
||||
|
||||
public String getMac() {
|
||||
return mac;
|
||||
}
|
||||
|
||||
public void setMac(String mac) {
|
||||
this.mac = mac;
|
||||
}
|
||||
|
||||
public int getBcnInt() {
|
||||
return bcnInt;
|
||||
}
|
||||
|
||||
public void setBcnInt(int bcnInt) {
|
||||
this.bcnInt = bcnInt;
|
||||
}
|
||||
|
||||
public int getThermalTxChainmask() {
|
||||
return thermalTxChainmask;
|
||||
}
|
||||
|
||||
public void setThermalTxChainmask(int thermalTxChainmask) {
|
||||
this.thermalTxChainmask = thermalTxChainmask;
|
||||
}
|
||||
|
||||
public int[] getAllowedChannels() {
|
||||
return allowedChannels;
|
||||
}
|
||||
|
||||
public void setAllowedChannels(int[] allowedChannels) {
|
||||
this.allowedChannels = allowedChannels;
|
||||
}
|
||||
|
||||
public int getThermalShutdown() {
|
||||
return thermalShutdown;
|
||||
}
|
||||
|
||||
public void setThermalShutdown(int thermalShutdown) {
|
||||
this.thermalShutdown = thermalShutdown;
|
||||
}
|
||||
|
||||
public int getChannelSync() {
|
||||
return channelSync;
|
||||
}
|
||||
|
||||
public void setChannelSync(int channelSync) {
|
||||
this.channelSync = channelSync;
|
||||
}
|
||||
|
||||
public int getHwType() {
|
||||
return hwType;
|
||||
}
|
||||
|
||||
public void setHwType(int hwType) {
|
||||
this.hwType = hwType;
|
||||
}
|
||||
|
||||
public int getTxChainmask() {
|
||||
return txChainmask;
|
||||
}
|
||||
|
||||
public void setTxChainmask(int txChainmask) {
|
||||
this.txChainmask = txChainmask;
|
||||
}
|
||||
|
||||
public String getRadar() {
|
||||
return radar;
|
||||
}
|
||||
|
||||
public void setRadar(String radar) {
|
||||
this.radar = radar;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public Map<String, String> getHwConfig() {
|
||||
return hwConfig;
|
||||
}
|
||||
|
||||
public void setHwConfig(Map<String, String> hwConfig) {
|
||||
this.hwConfig = hwConfig;
|
||||
}
|
||||
|
||||
public int getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(int channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public int getTxPower() {
|
||||
return txPower;
|
||||
}
|
||||
|
||||
public void setTxPower(int txPower) {
|
||||
this.txPower = txPower;
|
||||
}
|
||||
|
||||
public String getHtMode() {
|
||||
return htMode;
|
||||
}
|
||||
|
||||
public void setHtMode(String htMode) {
|
||||
this.htMode = htMode;
|
||||
}
|
||||
|
||||
public int getThermalDowngradeTemp() {
|
||||
return thermalDowngradeTemp;
|
||||
}
|
||||
|
||||
public void setThermalDowngradeTemp(int thermalDowngradeTemp) {
|
||||
this.thermalDowngradeTemp = thermalDowngradeTemp;
|
||||
}
|
||||
|
||||
public String getHwMode() {
|
||||
return hwMode;
|
||||
}
|
||||
|
||||
public void setHwMode(String hwMode) {
|
||||
this.hwMode = hwMode;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public Map<String, String> getChannels() {
|
||||
return channels;
|
||||
}
|
||||
|
||||
public void setChannels(Map<String, String> channels) {
|
||||
this.channels = channels;
|
||||
}
|
||||
|
||||
public int getThermalUpgradeTemp() {
|
||||
return thermalUpgradeTemp;
|
||||
}
|
||||
|
||||
public void setThermalUpgradeTemp(int thermalUpgradeTemp) {
|
||||
this.thermalUpgradeTemp = thermalUpgradeTemp;
|
||||
}
|
||||
|
||||
public Map<String, String> getHwParams() {
|
||||
return hwParams;
|
||||
}
|
||||
|
||||
public void setHwParams(Map<String, String> hwParams) {
|
||||
this.hwParams = hwParams;
|
||||
}
|
||||
|
||||
public String getFreqBand() {
|
||||
return freqBand;
|
||||
}
|
||||
|
||||
public void setFreqBand(String freqBand) {
|
||||
this.freqBand = freqBand;
|
||||
}
|
||||
|
||||
public int getThermalIntegration() {
|
||||
return thermalIntegration;
|
||||
}
|
||||
|
||||
public void setThermalIntegration(int thermalIntegration) {
|
||||
this.thermalIntegration = thermalIntegration;
|
||||
}
|
||||
|
||||
public String getChannelMode() {
|
||||
return channelMode;
|
||||
}
|
||||
|
||||
public void setChannelMode(String channelMode) {
|
||||
this.channelMode = channelMode;
|
||||
}
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
public Uuid get_uuid() {
|
||||
return _uuid;
|
||||
}
|
||||
|
||||
public void set_uuid(Uuid _uuid) {
|
||||
this._uuid = _uuid;
|
||||
}
|
||||
|
||||
public Uuid getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Uuid version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
package com.telecominfraproject.wlan.opensync.external.integration.models;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.vmware.ovsdb.protocol.operation.notation.Uuid;
|
||||
|
||||
public class OpensyncAPVIFState extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = -4916251246542770881L;
|
||||
|
||||
public String ifName;
|
||||
public int vifRadioIdx;
|
||||
public String parent;
|
||||
public String state;
|
||||
public String mac;
|
||||
public boolean apBridge;
|
||||
public boolean uapsdEnable;
|
||||
public boolean wds;
|
||||
public String ssid;
|
||||
public Map<String, String> security;
|
||||
public String macList;
|
||||
public Set<Uuid> associatedClients;
|
||||
public boolean enabled;
|
||||
public int vlanId;
|
||||
public int btm;
|
||||
public String minHwMode;
|
||||
public String ssidBroadcast;
|
||||
public String mode;
|
||||
public String bridge;
|
||||
public int groupRekey;
|
||||
public int ftMobilityDomain;
|
||||
public int ftPsk;
|
||||
public int rrm;
|
||||
public boolean dynamicBeacon;
|
||||
public int channel;
|
||||
public Uuid _uuid;
|
||||
public Uuid version;
|
||||
|
||||
public String getIfName() {
|
||||
return ifName;
|
||||
}
|
||||
|
||||
public void setIfName(String ifName) {
|
||||
this.ifName = ifName;
|
||||
}
|
||||
|
||||
public int getVifRadioIdx() {
|
||||
return vifRadioIdx;
|
||||
}
|
||||
|
||||
public void setVifRadioIdx(int vifRadioIdx) {
|
||||
this.vifRadioIdx = vifRadioIdx;
|
||||
}
|
||||
|
||||
public String getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(String parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getMac() {
|
||||
return mac;
|
||||
}
|
||||
|
||||
public void setMac(String mac) {
|
||||
this.mac = mac;
|
||||
}
|
||||
|
||||
public boolean isApBridge() {
|
||||
return apBridge;
|
||||
}
|
||||
|
||||
public void setApBridge(boolean apBridge) {
|
||||
this.apBridge = apBridge;
|
||||
}
|
||||
|
||||
public boolean isUapsdEnable() {
|
||||
return uapsdEnable;
|
||||
}
|
||||
|
||||
public void setUapsdEnable(boolean uapsdEnable) {
|
||||
this.uapsdEnable = uapsdEnable;
|
||||
}
|
||||
|
||||
public boolean isWds() {
|
||||
return wds;
|
||||
}
|
||||
|
||||
public void setWds(boolean wds) {
|
||||
this.wds = wds;
|
||||
}
|
||||
|
||||
public String getSsid() {
|
||||
return ssid;
|
||||
}
|
||||
|
||||
public void setSsid(String ssid) {
|
||||
this.ssid = ssid;
|
||||
}
|
||||
|
||||
public Map<String, String> getSecurity() {
|
||||
return security;
|
||||
}
|
||||
|
||||
public void setSecurity(Map<String, String> security) {
|
||||
this.security = security;
|
||||
}
|
||||
|
||||
public String getMacList() {
|
||||
return macList;
|
||||
}
|
||||
|
||||
public void setMacList(String macList) {
|
||||
this.macList = macList;
|
||||
}
|
||||
|
||||
public Set<Uuid> getAssociatedClients() {
|
||||
return associatedClients;
|
||||
}
|
||||
|
||||
public void setAssociatedClients(Set<Uuid> list) {
|
||||
this.associatedClients = list;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public int getVlanId() {
|
||||
return vlanId;
|
||||
}
|
||||
|
||||
public void setVlanId(int vlanId) {
|
||||
this.vlanId = vlanId;
|
||||
}
|
||||
|
||||
public int getBtm() {
|
||||
return btm;
|
||||
}
|
||||
|
||||
public void setBtm(int btm) {
|
||||
this.btm = btm;
|
||||
}
|
||||
|
||||
public String getMinHwMode() {
|
||||
return minHwMode;
|
||||
}
|
||||
|
||||
public void setMinHwMode(String minHwMode) {
|
||||
this.minHwMode = minHwMode;
|
||||
}
|
||||
|
||||
public String getSsidBroadcast() {
|
||||
return ssidBroadcast;
|
||||
}
|
||||
|
||||
public void setSsidBroadcast(String ssidBroadcast) {
|
||||
this.ssidBroadcast = ssidBroadcast;
|
||||
}
|
||||
|
||||
public String getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public void setMode(String mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public String getBridge() {
|
||||
return bridge;
|
||||
}
|
||||
|
||||
public void setBridge(String bridge) {
|
||||
this.bridge = bridge;
|
||||
}
|
||||
|
||||
public int getGroupRekey() {
|
||||
return groupRekey;
|
||||
}
|
||||
|
||||
public void setGroupRekey(int groupRekey) {
|
||||
this.groupRekey = groupRekey;
|
||||
}
|
||||
|
||||
public int getFtMobilityDomain() {
|
||||
return ftMobilityDomain;
|
||||
}
|
||||
|
||||
public void setFtMobilityDomain(int ftMobilityDomain) {
|
||||
this.ftMobilityDomain = ftMobilityDomain;
|
||||
}
|
||||
|
||||
public int getFtPsk() {
|
||||
return ftPsk;
|
||||
}
|
||||
|
||||
public void setFtPsk(int ftPsk) {
|
||||
this.ftPsk = ftPsk;
|
||||
}
|
||||
|
||||
public int getRrm() {
|
||||
return rrm;
|
||||
}
|
||||
|
||||
public void setRrm(int rrm) {
|
||||
this.rrm = rrm;
|
||||
}
|
||||
|
||||
public boolean isDynamicBeacon() {
|
||||
return dynamicBeacon;
|
||||
}
|
||||
|
||||
public void setDynamicBeacon(boolean dynamicBeacon) {
|
||||
this.dynamicBeacon = dynamicBeacon;
|
||||
}
|
||||
|
||||
public int getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public void setChannel(int channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
public Uuid get_uuid() {
|
||||
return _uuid;
|
||||
}
|
||||
|
||||
public void set_uuid(Uuid _uuid) {
|
||||
this._uuid = _uuid;
|
||||
}
|
||||
|
||||
public Uuid getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Uuid version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.telecominfraproject.wlan.opensync.external.integration.models;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.vmware.ovsdb.protocol.operation.notation.Uuid;
|
||||
|
||||
/**
|
||||
* @author mikehansen
|
||||
*
|
||||
*/
|
||||
public class OpensyncAWLANNode extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = -6172956297643126710L;
|
||||
|
||||
public String mqttSettings;
|
||||
public String model;
|
||||
public String skuNumber;
|
||||
public String id;
|
||||
public Map<String, String> versionMatrix;
|
||||
public String firmwareVersion;
|
||||
public String firmwareUrl;
|
||||
public int upgradeDlTimer;
|
||||
public String platformVersion;
|
||||
public String firmwarePass;
|
||||
public int upgradeTimer;
|
||||
public int maxBackoff;
|
||||
public Map<String, String> ledConfig;
|
||||
public String redirectorAddr;
|
||||
public Map<String, String> mqttHeaders;
|
||||
public String serialNumber;
|
||||
public int upgradeStatus;
|
||||
public String deviceMode;
|
||||
public int minBackoff;
|
||||
public Map<String, String> mqttTopics;
|
||||
public String revision;
|
||||
public String managerAddr;
|
||||
public boolean factoryReset;
|
||||
public Uuid _uuid;
|
||||
public Uuid version;
|
||||
|
||||
public String getMqttSettings() {
|
||||
return mqttSettings;
|
||||
}
|
||||
|
||||
public void setMqttSettings(String mqttSettings) {
|
||||
this.mqttSettings = mqttSettings;
|
||||
}
|
||||
|
||||
public String getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(String model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public String getSkuNumber() {
|
||||
return skuNumber;
|
||||
}
|
||||
|
||||
public void setSkuNumber(String skuNumber) {
|
||||
this.skuNumber = skuNumber;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Map<String, String> getVersionMatrix() {
|
||||
return versionMatrix;
|
||||
}
|
||||
|
||||
public void setVersionMatrix(Map<String, String> versionMatrix) {
|
||||
this.versionMatrix = versionMatrix;
|
||||
}
|
||||
|
||||
public String getFirmwareVersion() {
|
||||
return firmwareVersion;
|
||||
}
|
||||
|
||||
public void setFirmwareVersion(String firmwareVersion) {
|
||||
this.firmwareVersion = firmwareVersion;
|
||||
}
|
||||
|
||||
public String getFirmwareUrl() {
|
||||
return firmwareUrl;
|
||||
}
|
||||
|
||||
public void setFirmwareUrl(String firmwareUrl) {
|
||||
this.firmwareUrl = firmwareUrl;
|
||||
}
|
||||
|
||||
public int getUpgradeDlTimer() {
|
||||
return upgradeDlTimer;
|
||||
}
|
||||
|
||||
public void setUpgradeDlTimer(int upgradeDlTimer) {
|
||||
this.upgradeDlTimer = upgradeDlTimer;
|
||||
}
|
||||
|
||||
public String getPlatformVersion() {
|
||||
return platformVersion;
|
||||
}
|
||||
|
||||
public void setPlatformVersion(String platformVersion) {
|
||||
this.platformVersion = platformVersion;
|
||||
}
|
||||
|
||||
public String getFirmwarePass() {
|
||||
return firmwarePass;
|
||||
}
|
||||
|
||||
public void setFirmwarePass(String firmwarePass) {
|
||||
this.firmwarePass = firmwarePass;
|
||||
}
|
||||
|
||||
public int getUpgradeTimer() {
|
||||
return upgradeTimer;
|
||||
}
|
||||
|
||||
public void setUpgradeTimer(int upgradeTimer) {
|
||||
this.upgradeTimer = upgradeTimer;
|
||||
}
|
||||
|
||||
public int getMaxBackoff() {
|
||||
return maxBackoff;
|
||||
}
|
||||
|
||||
public void setMaxBackoff(int maxBackoff) {
|
||||
this.maxBackoff = maxBackoff;
|
||||
}
|
||||
|
||||
public Map<String, String> getLedConfig() {
|
||||
return ledConfig;
|
||||
}
|
||||
|
||||
public void setLedConfig(Map<String, String> ledConfig) {
|
||||
this.ledConfig = ledConfig;
|
||||
}
|
||||
|
||||
public String getRedirectorAddr() {
|
||||
return redirectorAddr;
|
||||
}
|
||||
|
||||
public void setRedirectorAddr(String redirectorAddr) {
|
||||
this.redirectorAddr = redirectorAddr;
|
||||
}
|
||||
|
||||
public Map<String, String> getMqttHeaders() {
|
||||
return mqttHeaders;
|
||||
}
|
||||
|
||||
public void setMqttHeaders(Map<String, String> mqttHeaders) {
|
||||
this.mqttHeaders = mqttHeaders;
|
||||
}
|
||||
|
||||
public String getSerialNumber() {
|
||||
return serialNumber;
|
||||
}
|
||||
|
||||
public void setSerialNumber(String serialNumber) {
|
||||
this.serialNumber = serialNumber;
|
||||
}
|
||||
|
||||
public int getUpgradeStatus() {
|
||||
return upgradeStatus;
|
||||
}
|
||||
|
||||
public void setUpgradeStatus(int upgradeStatus) {
|
||||
this.upgradeStatus = upgradeStatus;
|
||||
}
|
||||
|
||||
public String getDeviceMode() {
|
||||
return deviceMode;
|
||||
}
|
||||
|
||||
public void setDeviceMode(String deviceMode) {
|
||||
this.deviceMode = deviceMode;
|
||||
}
|
||||
|
||||
public int getMinBackoff() {
|
||||
return minBackoff;
|
||||
}
|
||||
|
||||
public void setMinBackoff(int minBackoff) {
|
||||
this.minBackoff = minBackoff;
|
||||
}
|
||||
|
||||
public Map<String, String> getMqttTopics() {
|
||||
return mqttTopics;
|
||||
}
|
||||
|
||||
public void setMqttTopics(Map<String, String> mqttTopics) {
|
||||
this.mqttTopics = mqttTopics;
|
||||
}
|
||||
|
||||
public String getRevision() {
|
||||
return revision;
|
||||
}
|
||||
|
||||
public void setRevision(String revision) {
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public String getManagerAddr() {
|
||||
return managerAddr;
|
||||
}
|
||||
|
||||
public void setManagerAddr(String managerAddr) {
|
||||
this.managerAddr = managerAddr;
|
||||
}
|
||||
|
||||
public boolean isFactoryReset() {
|
||||
return factoryReset;
|
||||
}
|
||||
|
||||
public void setFactoryReset(boolean factoryReset) {
|
||||
this.factoryReset = factoryReset;
|
||||
}
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
public Uuid get_uuid() {
|
||||
return _uuid;
|
||||
}
|
||||
|
||||
public void set_uuid(Uuid _uuid) {
|
||||
this._uuid = _uuid;
|
||||
}
|
||||
|
||||
public Uuid getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Uuid version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.telecominfraproject.wlan.opensync.external.integration.models;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.vmware.ovsdb.protocol.operation.notation.Uuid;
|
||||
|
||||
/**
|
||||
* @author mikehansen
|
||||
*
|
||||
*/
|
||||
public class OpensyncWifiAssociatedClients extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = -7088651136971662138L;
|
||||
|
||||
public String keyId;
|
||||
public String mac;
|
||||
public String state;
|
||||
public Set<String> capabilities;
|
||||
public int uapsd;
|
||||
public String kick;
|
||||
public String oftag;
|
||||
public Uuid _uuid;
|
||||
public Uuid version;
|
||||
|
||||
public String getKeyId() {
|
||||
return keyId;
|
||||
}
|
||||
|
||||
public void setKeyId(String keyId) {
|
||||
this.keyId = keyId;
|
||||
}
|
||||
|
||||
public String getMac() {
|
||||
return mac;
|
||||
}
|
||||
|
||||
public void setMac(String mac) {
|
||||
this.mac = mac;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Set<String> getCapabilities() {
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
public void setCapabilities(Set<String> set) {
|
||||
this.capabilities = set;
|
||||
}
|
||||
|
||||
public int getUapsd() {
|
||||
return uapsd;
|
||||
}
|
||||
|
||||
public void setUapsd(int uapsd) {
|
||||
this.uapsd = uapsd;
|
||||
}
|
||||
|
||||
public String getKick() {
|
||||
return kick;
|
||||
}
|
||||
|
||||
public void setKick(String kick) {
|
||||
this.kick = kick;
|
||||
}
|
||||
|
||||
public String getOftag() {
|
||||
return oftag;
|
||||
}
|
||||
|
||||
public void setOftag(String oftag) {
|
||||
this.oftag = oftag;
|
||||
}
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
public Uuid get_uuid() {
|
||||
return _uuid;
|
||||
}
|
||||
|
||||
public void set_uuid(Uuid _uuid) {
|
||||
this._uuid = _uuid;
|
||||
}
|
||||
|
||||
public Uuid getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Uuid version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.telecominfraproject.wlan.opensync.external.integration;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@@ -12,6 +13,11 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.ConnectNodeInfo;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPConfig;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPInetState;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPRadioState;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPVIFState;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAWLANNode;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncWifiAssociatedClients;
|
||||
import com.vmware.ovsdb.protocol.methods.TableUpdates;
|
||||
|
||||
import sts.PlumeStats.Report;
|
||||
@@ -42,8 +48,6 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr
|
||||
LOG.info("AP {} got disconnected from the gateway", apId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public OpensyncAPConfig getApConfig(String apId) {
|
||||
LOG.info("Retrieving config for AP {} from file {}", apId, configFileName);
|
||||
OpensyncAPConfig ret = null;
|
||||
@@ -95,37 +99,34 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wifiVIFStateDbTableUpdate(TableUpdates tableUpdates,
|
||||
public void wifiVIFStateDbTableUpdate(List<OpensyncAPVIFState> vifStateTables, String apId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wifiRadioStatusDbTableUpdate(List<OpensyncAPRadioState> radioStateTable, String apId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wifiInetStateDbTableUpdate(List<OpensyncAPInetState> inetStateTable, String apId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wifiAssociatedClientsDbTableUpdate(List<OpensyncWifiAssociatedClients> wifiAssociatedClients,
|
||||
String apId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wifiRadioStatusDbTableUpdate(TableUpdates tableUpdates, String apId) {
|
||||
public void awlanNodeDbTableUpdate(OpensyncAWLANNode opensyncAPState, String apId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wifiInetStateDbTableUpdate(TableUpdates tableUpdates, String apId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wifiAssociatedClientsDbTableUpdate(TableUpdates tableUpdates,
|
||||
String apId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void awlanNodeDbTableUpdate(TableUpdates tableUpdates, String connectedClientId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -138,10 +138,12 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
||||
}
|
||||
// turn off monitor
|
||||
try {
|
||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable);
|
||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable);
|
||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiInetStateDbTable);
|
||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable);
|
||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiRadioStateDbTable + "_" + key);
|
||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiVifStateDbTable + "_" + key);
|
||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiInetStateDbTable + "_" + key);
|
||||
ovsdbClient.cancelMonitor(OvsdbDao.wifiAssociatedClientsDbTable + "_" + key);
|
||||
ovsdbClient.cancelMonitor(OvsdbDao.awlanNodeDbTable + "_" + key);
|
||||
|
||||
} catch (OvsdbClientException e) {
|
||||
LOG.warn("Could not cancel Monitor {}", e);
|
||||
}
|
||||
@@ -236,77 +238,90 @@ public class ConnectusOvsdbClient implements ConnectusOvsdbClientInterface {
|
||||
|
||||
private void monitorOvsdbStateTables(OvsdbClient ovsdbClient, String key) throws OvsdbClientException {
|
||||
CompletableFuture<TableUpdates> rsCf = ovsdbClient
|
||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiRadioStateDbTable,
|
||||
.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(tableUpdates, key);
|
||||
|
||||
extIntegrationInterface.wifiRadioStatusDbTableUpdate(
|
||||
ovsdbDao.getOpensyncAPRadioState(tableUpdates, key, ovsdbClient), key);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
extIntegrationInterface.wifiRadioStatusDbTableUpdate(rsCf.join(), key);
|
||||
extIntegrationInterface
|
||||
.wifiRadioStatusDbTableUpdate(ovsdbDao.getOpensyncAPRadioState(rsCf.join(), key, ovsdbClient), key);
|
||||
|
||||
CompletableFuture<TableUpdates> isCf = ovsdbClient
|
||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiInetStateDbTable,
|
||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiInetStateDbTable + "_" + key,
|
||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiInetStateDbTable,
|
||||
new MonitorRequest(new MonitorSelect(true, false, false, true)))),
|
||||
new MonitorCallback() {
|
||||
|
||||
@Override
|
||||
public void update(TableUpdates tableUpdates) {
|
||||
extIntegrationInterface.wifiInetStateDbTableUpdate(tableUpdates, key);
|
||||
|
||||
extIntegrationInterface.wifiInetStateDbTableUpdate(
|
||||
ovsdbDao.getOpensyncAPInetState(tableUpdates, key, ovsdbClient), key);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
extIntegrationInterface.wifiInetStateDbTableUpdate(isCf.join(), key);
|
||||
extIntegrationInterface
|
||||
.wifiInetStateDbTableUpdate(ovsdbDao.getOpensyncAPInetState(isCf.join(), key, ovsdbClient), key);
|
||||
|
||||
CompletableFuture<TableUpdates> vsCf = ovsdbClient
|
||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiVifStateDbTable,
|
||||
.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);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
extIntegrationInterface.wifiVIFStateDbTableUpdate(ovsdbDao.getOpensyncAPVIFState(vsCf.join(), key, ovsdbClient),
|
||||
key);
|
||||
|
||||
CompletableFuture<TableUpdates> acCf = ovsdbClient
|
||||
.monitor(OvsdbDao.ovsdbName, OvsdbDao.wifiAssociatedClientsDbTable + "_" + key,
|
||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiAssociatedClientsDbTable,
|
||||
new MonitorRequest(new MonitorSelect(true, true, true, true)))),
|
||||
new MonitorCallback() {
|
||||
|
||||
@Override
|
||||
public void update(TableUpdates tableUpdates) {
|
||||
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(
|
||||
ovsdbDao.getOpensyncWifiAssociatedClients(tableUpdates, key, ovsdbClient), key);
|
||||
}
|
||||
|
||||
});
|
||||
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(
|
||||
ovsdbDao.getOpensyncWifiAssociatedClients(acCf.join(), key, ovsdbClient), key);
|
||||
|
||||
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.wifiVIFStateDbTableUpdate(tableUpdates, key);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
extIntegrationInterface.wifiVIFStateDbTableUpdate(vsCf.join(), key);
|
||||
|
||||
CompletableFuture<TableUpdates> acCf = ovsdbClient.monitor(OvsdbDao.ovsdbName,
|
||||
OvsdbDao.wifiAssociatedClientsDbTable,
|
||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.wifiAssociatedClientsDbTable, new MonitorRequest())),
|
||||
new MonitorCallback() {
|
||||
|
||||
@Override
|
||||
public void update(TableUpdates tableUpdates) {
|
||||
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(tableUpdates, key);
|
||||
extIntegrationInterface.awlanNodeDbTableUpdate(
|
||||
ovsdbDao.getOpensyncAWLANNode(tableUpdates, key, ovsdbClient), key);
|
||||
}
|
||||
|
||||
});
|
||||
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(acCf.join(), key);
|
||||
|
||||
CompletableFuture<TableUpdates> awCf = ovsdbClient.monitor(OvsdbDao.ovsdbName, OvsdbDao.awlanNodeDbTable,
|
||||
new MonitorRequests(ImmutableMap.of(OvsdbDao.awlanNodeDbTable, new MonitorRequest())),
|
||||
new MonitorCallback() {
|
||||
|
||||
@Override
|
||||
public void update(TableUpdates tableUpdates) {
|
||||
extIntegrationInterface.awlanNodeDbTableUpdate(tableUpdates, key);
|
||||
}
|
||||
|
||||
});
|
||||
extIntegrationInterface.awlanNodeDbTableUpdate(awCf.join(), key);
|
||||
extIntegrationInterface.awlanNodeDbTableUpdate(ovsdbDao.getOpensyncAWLANNode(awCf.join(), key, ovsdbClient),
|
||||
key);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -15,11 +16,15 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.ConnectNodeInfo;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPInetState;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPRadioConfig;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPRadioState;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPSsidConfig;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAWLANNode;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPVIFState;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncWifiAssociatedClients;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.BridgeInfo;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.InterfaceInfo;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.PortInfo;
|
||||
@@ -27,11 +32,10 @@ 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;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.WifiVifConfigInfo;
|
||||
import com.vmware.ovsdb.callback.MonitorCallback;
|
||||
import com.vmware.ovsdb.exception.OvsdbClientException;
|
||||
import com.vmware.ovsdb.protocol.methods.MonitorRequest;
|
||||
import com.vmware.ovsdb.protocol.methods.MonitorRequests;
|
||||
import com.vmware.ovsdb.protocol.methods.MonitorSelect;
|
||||
import com.vmware.ovsdb.protocol.methods.RowUpdate;
|
||||
import com.vmware.ovsdb.protocol.methods.TableUpdate;
|
||||
import com.vmware.ovsdb.protocol.methods.TableUpdates;
|
||||
import com.vmware.ovsdb.protocol.operation.Delete;
|
||||
import com.vmware.ovsdb.protocol.operation.Insert;
|
||||
import com.vmware.ovsdb.protocol.operation.Operation;
|
||||
@@ -1108,6 +1112,214 @@ public class OvsdbDao {
|
||||
|
||||
}
|
||||
|
||||
public List<OpensyncAPRadioState> getOpensyncAPRadioState(TableUpdates tableUpdates, String apId,
|
||||
OvsdbClient ovsdbClient) {
|
||||
List<OpensyncAPRadioState> ret = new ArrayList<OpensyncAPRadioState>();
|
||||
|
||||
try {
|
||||
tableUpdates.getTableUpdates().values().stream().forEach(tu -> {
|
||||
tu.getRowUpdates().values().stream().forEach(ru -> {
|
||||
|
||||
Row newRow = ru.getNew();
|
||||
|
||||
if (newRow != null) {
|
||||
|
||||
OpensyncAPRadioState apRadioState = new OpensyncAPRadioState();
|
||||
|
||||
apRadioState.setMac(newRow.getStringColumn("mac"));
|
||||
Long channelTmp = getSingleValueFromSet(newRow, "channel");
|
||||
if (channelTmp == null) {
|
||||
channelTmp = -1L;
|
||||
}
|
||||
apRadioState.setChannel(channelTmp.intValue());
|
||||
apRadioState.setFreqBand(newRow.getStringColumn("freq_band"));
|
||||
apRadioState.setIfName(newRow.getStringColumn("if_name"));
|
||||
apRadioState.setChannelMode(getSingleValueFromSet(newRow, "channel_mode"));
|
||||
apRadioState.setCountry(getSingleValueFromSet(newRow, "country"));
|
||||
Boolean tmp = getSingleValueFromSet(newRow, "enabled");
|
||||
apRadioState.setEnabled(tmp != null ? tmp : false);
|
||||
apRadioState.setHtMode(getSingleValueFromSet(newRow, "ht_mode"));
|
||||
if (newRow.getIntegerColumn("txPower") != null)
|
||||
apRadioState.setTxPower(newRow.getIntegerColumn("txPower").intValue());
|
||||
// apRadioState.setTxPower(getSingleValueFromSet(newRow,
|
||||
// "txPower"));
|
||||
apRadioState.setHwConfig(newRow.getMapColumn("hw_config"));
|
||||
apRadioState.setVersion(newRow.getUuidColumn("_version"));
|
||||
if (newRow.getUuidColumn("_uuid") != null)
|
||||
apRadioState.set_uuid(newRow.getUuidColumn("_uuid"));
|
||||
ret.add(apRadioState);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
} catch (Exception e) {
|
||||
LOG.error("Could not parse update for Wifi_Radio_State", e);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<OpensyncAPInetState> getOpensyncAPInetState(TableUpdates tableUpdates, String apId,
|
||||
OvsdbClient ovsdbClient) {
|
||||
List<OpensyncAPInetState> ret = new ArrayList<OpensyncAPInetState>();
|
||||
|
||||
try {
|
||||
tableUpdates.getTableUpdates().values().stream().forEach(tu -> {
|
||||
tu.getRowUpdates().values().stream().forEach(ru -> {
|
||||
|
||||
Row row = ru.getNew();
|
||||
|
||||
if (row != null) {
|
||||
|
||||
OpensyncAPInetState apInetState = new OpensyncAPInetState();
|
||||
Boolean natTmp = getSingleValueFromSet(row, "NAT");
|
||||
apInetState.setNat(natTmp != null ? natTmp : false);
|
||||
apInetState.setEnabled(row.getBooleanColumn("enabled"));
|
||||
apInetState.setIfName(row.getStringColumn("if_name"));
|
||||
apInetState.setIfType(row.getStringColumn("if_type"));
|
||||
apInetState.setIpAssignScheme(row.getStringColumn("ip_assign_scheme"));
|
||||
apInetState.setNetwork(row.getBooleanColumn("network"));
|
||||
apInetState.setHwAddr(row.getStringColumn("hwaddr"));
|
||||
apInetState.setVersion(row.getUuidColumn("_version"));
|
||||
if (row.getUuidColumn("_uuid") != null)
|
||||
apInetState.set_uuid(row.getUuidColumn("_uuid"));
|
||||
|
||||
ret.add(apInetState);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
} catch (Exception e) {
|
||||
LOG.error("Could not parse update for Wifi_Inet_State", e);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<OpensyncAPVIFState> getOpensyncAPVIFState(TableUpdates tableUpdates, String apId,
|
||||
OvsdbClient ovsdbClient) {
|
||||
List<OpensyncAPVIFState> ret = new ArrayList<OpensyncAPVIFState>();
|
||||
try {
|
||||
tableUpdates.getTableUpdates().values().stream().forEach(tu -> {
|
||||
tu.getRowUpdates().values().stream().forEach(ru -> {
|
||||
|
||||
Row row = ru.getNew();
|
||||
if (row != null) {
|
||||
OpensyncAPVIFState apVifState = new OpensyncAPVIFState();
|
||||
apVifState.setBridge(row.getStringColumn("bridge"));
|
||||
apVifState.setBtm(row.getIntegerColumn("btm").intValue());
|
||||
Long channelTmp = getSingleValueFromSet(row, "channel");
|
||||
if (channelTmp == null) {
|
||||
channelTmp = -1L;
|
||||
}
|
||||
apVifState.setChannel(channelTmp.intValue());
|
||||
apVifState.setEnabled(row.getBooleanColumn("enabled"));
|
||||
apVifState.setFtPsk(row.getIntegerColumn("ft_psk").intValue());
|
||||
apVifState.setGroupRekey(row.getIntegerColumn("group_rekey").intValue());
|
||||
apVifState.setIfName(row.getStringColumn("if_name"));
|
||||
apVifState.setMode(row.getStringColumn("mode"));
|
||||
apVifState.setRrm(row.getIntegerColumn("rrm").intValue());
|
||||
apVifState.setSsid(row.getStringColumn("ssid"));
|
||||
apVifState.setSsidBroadcast(row.getStringColumn("ssid_broadcast"));
|
||||
apVifState.setUapsdEnable(row.getBooleanColumn("uapsd_enable"));
|
||||
apVifState.setVifRadioIdx(row.getIntegerColumn("vif_radio_idx").intValue());
|
||||
apVifState.setAssociatedClients(row.getSetColumn("associated_clients"));
|
||||
apVifState.setSecurity(row.getMapColumn("security"));
|
||||
apVifState.setVersion(row.getUuidColumn("_version"));
|
||||
if (row.getUuidColumn("_uuid") != null)
|
||||
apVifState.set_uuid(row.getUuidColumn("_uuid"));
|
||||
ret.add(apVifState);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
} catch (Exception e) {
|
||||
LOG.error("Could not parse update for Wifi_VIF_State", e);
|
||||
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<OpensyncWifiAssociatedClients> getOpensyncWifiAssociatedClients(TableUpdates tableUpdates, String apId,
|
||||
OvsdbClient ovsdbClient) {
|
||||
List<OpensyncWifiAssociatedClients> ret = new ArrayList<OpensyncWifiAssociatedClients>();
|
||||
|
||||
try {
|
||||
tableUpdates.getTableUpdates().values().stream().forEach(tu -> {
|
||||
tu.getRowUpdates().values().stream().forEach(ru -> {
|
||||
|
||||
Row row = ru.getNew();
|
||||
|
||||
if (row != null) {
|
||||
OpensyncWifiAssociatedClients wifiClient = new OpensyncWifiAssociatedClients();
|
||||
wifiClient.setMac(row.getStringColumn("mac"));
|
||||
wifiClient.setCapabilities(row.getSetColumn("capabilities"));
|
||||
wifiClient.setState(getSingleValueFromSet(row, "state"));
|
||||
wifiClient.setVersion(row.getUuidColumn("_version"));
|
||||
if (row.getUuidColumn("_uuid") != null)
|
||||
wifiClient.set_uuid(row.getUuidColumn("_uuid"));
|
||||
|
||||
ret.add(wifiClient);
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (Exception e) {
|
||||
LOG.error("Could not get Wifi_Associated_Clients list from table update", e);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public OpensyncAWLANNode getOpensyncAWLANNode(TableUpdates tableUpdates, String apId, OvsdbClient ovsdbClient) {
|
||||
OpensyncAWLANNode ret = new OpensyncAWLANNode();
|
||||
|
||||
Map<String, TableUpdate> updates = tableUpdates.getTableUpdates();
|
||||
|
||||
for (TableUpdate update : updates.values()) {
|
||||
|
||||
Map<UUID, RowUpdate> rowUpdates = update.getRowUpdates();
|
||||
|
||||
for (RowUpdate rowUpdate : rowUpdates.values()) {
|
||||
|
||||
Row row = rowUpdate.getNew();
|
||||
|
||||
if (row != null) {
|
||||
ret.setMqttSettings(row.getMapColumn("mqtt_settings").toString());
|
||||
ret.setModel(row.getStringColumn("model"));
|
||||
ret.setSkuNumber(row.getStringColumn("sku_number"));
|
||||
ret.setId(row.getStringColumn("id"));
|
||||
ret.setVersionMatrix(row.getMapColumn("version_matrix"));
|
||||
ret.setFirmwareVersion(row.getStringColumn("firmware_version"));
|
||||
ret.setFirmwareUrl(row.getStringColumn("firmware_url"));
|
||||
if (row.getUuidColumn("_uuid") != null)
|
||||
ret.set_uuid(row.getUuidColumn("_uuid"));
|
||||
ret.setUpgradeDlTimer(row.getIntegerColumn("upgrade_dl_timer").intValue());
|
||||
ret.setPlatformVersion(row.getStringColumn("platform_version"));
|
||||
ret.setFirmwarePass(row.getStringColumn("firmware_pass"));
|
||||
ret.setUpgradeTimer(row.getIntegerColumn("upgrade_timer").intValue());
|
||||
ret.setMaxBackoff(row.getIntegerColumn("max_backoff").intValue());
|
||||
ret.setLedConfig(row.getMapColumn("led_config"));
|
||||
ret.setRedirectorAddr(row.getStringColumn("redirector_addr"));
|
||||
ret.setMqttHeaders(row.getMapColumn("mqtt_headers"));
|
||||
ret.setSerialNumber(row.getStringColumn("serial_number"));
|
||||
ret.setVersion(row.getUuidColumn("_version"));
|
||||
ret.setUpgradeStatus(row.getIntegerColumn("upgrade_status").intValue());
|
||||
ret.setDeviceMode(getSingleValueFromSet(row, "device_mode"));
|
||||
ret.setMinBackoff(row.getIntegerColumn("min_backoff").intValue());
|
||||
ret.setMqttTopics(row.getMapColumn("mqtt_topics"));
|
||||
ret.setRevision(row.getStringColumn("revision"));
|
||||
ret.setManagerAddr(row.getStringColumn("manager_addr"));
|
||||
Boolean factoryReset = getSingleValueFromSet(row, "factory_reset");
|
||||
ret.setFactoryReset(factoryReset != null ? factoryReset : false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
public void configureWifiRadios(OvsdbClient ovsdbClient, String configName,
|
||||
Map<String, WifiRadioConfigInfo> provisionedWifiRadios, int channel, Map<String, String> hwConfig,
|
||||
String country) throws OvsdbClientException, TimeoutException, ExecutionException, InterruptedException {
|
||||
|
||||
Reference in New Issue
Block a user