mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2026-03-21 11:39:16 +00:00
initial commit
This commit is contained in:
20
opensync_ext_interface/pom.xml
Normal file
20
opensync_ext_interface/pom.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>ai.connectus</groupId>
|
||||
<artifactId>opensync_ext_interface</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>opensync_ext_interface</name>
|
||||
<description>Interface that defines how opensync gateway gets the AP config</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.whizcontrol</groupId>
|
||||
<artifactId>base-models</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ai.connectus</groupId>
|
||||
<artifactId>opensync_protobuf</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,15 @@
|
||||
package ai.connectus.opensync.external.integration;
|
||||
|
||||
import ai.connectus.opensync.external.integration.models.OpensyncAPConfig;
|
||||
import sts.PlumeStats.Report;
|
||||
import traffic.NetworkMetadata.FlowReport;
|
||||
import wc.stats.IpDnsTelemetry.WCStatsReport;
|
||||
|
||||
public interface OpensyncExternalIntegrationInterface {
|
||||
void apConnected(String apId);
|
||||
void apDisconnected(String apId);
|
||||
OpensyncAPConfig getApConfig(String apId);
|
||||
void processMqttMessage(String topic, Report report);
|
||||
void processMqttMessage(String topic, FlowReport flowReport);
|
||||
void processMqttMessage(String topic, WCStatsReport wcStatsReport);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package ai.connectus.opensync.external.integration.models;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.whizcontrol.core.model.equipment.RadioType;
|
||||
import com.whizcontrol.core.model.json.BaseJsonModel;
|
||||
|
||||
public class OpensyncAPConfig extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = 3917975477206236668L;
|
||||
|
||||
private OpensyncAPRadioConfig radioConfig;
|
||||
private List<OpensyncAPSsidConfig> ssidConfigs;
|
||||
|
||||
|
||||
public OpensyncAPRadioConfig getRadioConfig() {
|
||||
return radioConfig;
|
||||
}
|
||||
|
||||
|
||||
public void setRadioConfig(OpensyncAPRadioConfig radioConfig) {
|
||||
this.radioConfig = radioConfig;
|
||||
}
|
||||
|
||||
|
||||
public List<OpensyncAPSsidConfig> getSsidConfigs() {
|
||||
return ssidConfigs;
|
||||
}
|
||||
|
||||
|
||||
public void setSsidConfigs(List<OpensyncAPSsidConfig> ssidConfigs) {
|
||||
this.ssidConfigs = ssidConfigs;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public OpensyncAPConfig clone() {
|
||||
OpensyncAPConfig ret = (OpensyncAPConfig)super.clone();
|
||||
if(radioConfig!=null) {
|
||||
ret.radioConfig = radioConfig.clone();
|
||||
}
|
||||
|
||||
if(ssidConfigs!=null) {
|
||||
ret.ssidConfigs = new ArrayList<OpensyncAPSsidConfig>();
|
||||
for(OpensyncAPSsidConfig s: ssidConfigs) {
|
||||
ret.ssidConfigs.add(s.clone());
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
OpensyncAPConfig cfg = new OpensyncAPConfig();
|
||||
cfg.radioConfig = new OpensyncAPRadioConfig();
|
||||
cfg.ssidConfigs = new ArrayList<OpensyncAPSsidConfig>();
|
||||
|
||||
cfg.radioConfig.setRadioChannel24G(1);
|
||||
cfg.radioConfig.setRadioChannel5LG(44);
|
||||
cfg.radioConfig.setRadioChannel5HG(108);
|
||||
|
||||
OpensyncAPSsidConfig ssidCfg = new OpensyncAPSsidConfig();
|
||||
ssidCfg.setRadioType(RadioType.is2dot4GHz);
|
||||
ssidCfg.setSsid("Connectus-standalone");
|
||||
ssidCfg.setEncryption("WPA-PSK");
|
||||
ssidCfg.setKey("12345678");
|
||||
ssidCfg.setMode("2");
|
||||
cfg.ssidConfigs.add(ssidCfg);
|
||||
|
||||
ssidCfg = new OpensyncAPSsidConfig();
|
||||
ssidCfg.setRadioType(RadioType.is5GHz);
|
||||
ssidCfg.setSsid("Connectus-standalone-5");
|
||||
ssidCfg.setEncryption("WPA-PSK");
|
||||
ssidCfg.setKey("12345678");
|
||||
ssidCfg.setMode("2");
|
||||
cfg.ssidConfigs.add(ssidCfg);
|
||||
|
||||
System.out.println(cfg.toPrettyString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package ai.connectus.opensync.external.integration.models;
|
||||
|
||||
import com.whizcontrol.core.model.json.BaseJsonModel;
|
||||
|
||||
public class OpensyncAPRadioConfig extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = 5683558403622855381L;
|
||||
|
||||
private String country;
|
||||
private int radioChannel24G;
|
||||
private int radioChannel5LG;
|
||||
private int radioChannel5HG;
|
||||
|
||||
public int getRadioChannel24G() {
|
||||
return radioChannel24G;
|
||||
}
|
||||
|
||||
public void setRadioChannel24G(int radioChannel24G) {
|
||||
this.radioChannel24G = radioChannel24G;
|
||||
}
|
||||
|
||||
public int getRadioChannel5LG() {
|
||||
return radioChannel5LG;
|
||||
}
|
||||
|
||||
public void setRadioChannel5LG(int radioChannel5LG) {
|
||||
this.radioChannel5LG = radioChannel5LG;
|
||||
}
|
||||
|
||||
public int getRadioChannel5HG() {
|
||||
return radioChannel5HG;
|
||||
}
|
||||
|
||||
public void setRadioChannel5HG(int radioChannel5HG) {
|
||||
this.radioChannel5HG = radioChannel5HG;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpensyncAPRadioConfig clone() {
|
||||
return (OpensyncAPRadioConfig)super.clone();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package ai.connectus.opensync.external.integration.models;
|
||||
|
||||
import com.whizcontrol.core.model.equipment.RadioType;
|
||||
import com.whizcontrol.core.model.json.BaseJsonModel;
|
||||
|
||||
public class OpensyncAPSsidConfig extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = -8540144450360788799L;
|
||||
|
||||
private RadioType radioType;
|
||||
private String ssid;
|
||||
private String encryption;
|
||||
private String key;
|
||||
private String mode;
|
||||
private boolean broadcast;
|
||||
|
||||
public RadioType getRadioType() {
|
||||
return radioType;
|
||||
}
|
||||
|
||||
public void setRadioType(RadioType radioType) {
|
||||
this.radioType = radioType;
|
||||
}
|
||||
|
||||
public String getSsid() {
|
||||
return ssid;
|
||||
}
|
||||
|
||||
public void setSsid(String ssid) {
|
||||
this.ssid = ssid;
|
||||
}
|
||||
|
||||
public String getEncryption() {
|
||||
return encryption;
|
||||
}
|
||||
|
||||
public void setEncryption(String encryption) {
|
||||
this.encryption = encryption;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public void setMode(String mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public boolean isBroadcast() {
|
||||
return broadcast;
|
||||
}
|
||||
|
||||
public void setBroadcast(boolean broadcast) {
|
||||
this.broadcast = broadcast;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpensyncAPSsidConfig clone() {
|
||||
return (OpensyncAPSsidConfig)super.clone();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user