diff --git a/opensync_ext_interface/pom.xml b/opensync-ext-interface/pom.xml
similarity index 58%
rename from opensync_ext_interface/pom.xml
rename to opensync-ext-interface/pom.xml
index eace527..71346d5 100644
--- a/opensync_ext_interface/pom.xml
+++ b/opensync-ext-interface/pom.xml
@@ -1,27 +1,26 @@
4.0.0
- com.whizcontrol
- root-pom
+ com.telecominfraproject.wlan
+ tip-wlan-cloud-root-pom
0.0.1-SNAPSHOT
- ai.connectus
- opensync_ext_interface
- opensync_ext_interface
+ opensync-ext-interface
+ opensync-ext-interface
Interface that defines how opensync gateway gets the AP config
-
- com.whizcontrol
+
+ com.telecominfraproject.wlan
base-models
- 0.0.1-SNAPSHOT
-
-
- ai.connectus
- opensync_protobuf
- 0.0.1-SNAPSHOT
-
+ ${tip-wlan-cloud.release.version}
+
+
+ com.telecominfraproject.wlan
+ opensync_protobuf
+ ${tip-wlan-cloud.release.version}
+
-
+
com.vmware.ovsdb
ovsdb-client
1.0.1
@@ -31,7 +30,7 @@
org.slf4j
-
+
-
\ No newline at end of file
+
diff --git a/opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/ConnectusOvsdbClientInterface.java b/opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/ConnectusOvsdbClientInterface.java
similarity index 100%
rename from opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/ConnectusOvsdbClientInterface.java
rename to opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/ConnectusOvsdbClientInterface.java
diff --git a/opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationInterface.java b/opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationInterface.java
similarity index 100%
rename from opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationInterface.java
rename to opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationInterface.java
diff --git a/opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/OvsdbSession.java b/opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/OvsdbSession.java
similarity index 100%
rename from opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/OvsdbSession.java
rename to opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/OvsdbSession.java
diff --git a/opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/OvsdbSessionMapInterface.java b/opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/OvsdbSessionMapInterface.java
similarity index 100%
rename from opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/OvsdbSessionMapInterface.java
rename to opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/OvsdbSessionMapInterface.java
diff --git a/opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/models/ConnectNodeInfo.java b/opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/models/ConnectNodeInfo.java
similarity index 100%
rename from opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/models/ConnectNodeInfo.java
rename to opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/models/ConnectNodeInfo.java
diff --git a/opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPConfig.java b/opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPConfig.java
similarity index 100%
rename from opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPConfig.java
rename to opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPConfig.java
diff --git a/opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPRadioConfig.java b/opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPRadioConfig.java
similarity index 100%
rename from opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPRadioConfig.java
rename to opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPRadioConfig.java
diff --git a/opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPSsidConfig.java b/opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPSsidConfig.java
similarity index 100%
rename from opensync_ext_interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPSsidConfig.java
rename to opensync-ext-interface/src/main/java/ai/connectus/opensync/external/integration/models/OpensyncAPSsidConfig.java
diff --git a/opensync_ext_static/pom.xml b/opensync-ext-static/pom.xml
similarity index 55%
rename from opensync_ext_static/pom.xml
rename to opensync-ext-static/pom.xml
index de1966f..2d5ca52 100644
--- a/opensync_ext_static/pom.xml
+++ b/opensync-ext-static/pom.xml
@@ -1,19 +1,18 @@
4.0.0
- com.whizcontrol
- root-pom
+ com.telecominfraproject.wlan
+ tip-wlan-cloud-root-pom
0.0.1-SNAPSHOT
-
- ai.connectus
- opensync_ext_static
- opensync_ext_static
+
+ opensync-ext-static
+ opensync-ext-static
Configuration interface that provides static config from the file
- ai.connectus
- opensync_ext_interface
- 0.0.1-SNAPSHOT
+ com.telecominfraproject.wlan
+ opensync-ext-interface
+ ${tip-wlan-cloud.release.version}
-
\ No newline at end of file
+
diff --git a/opensync_ext_static/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationSimple.java b/opensync-ext-static/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationSimple.java
similarity index 100%
rename from opensync_ext_static/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationSimple.java
rename to opensync-ext-static/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationSimple.java
diff --git a/opensync_ext_static/src/main/resources/config_2_ssids.json b/opensync-ext-static/src/main/resources/config_2_ssids.json
similarity index 100%
rename from opensync_ext_static/src/main/resources/config_2_ssids.json
rename to opensync-ext-static/src/main/resources/config_2_ssids.json
diff --git a/opensync_gateway_build/pom.xml b/opensync-gateway-build/pom.xml
similarity index 52%
rename from opensync_gateway_build/pom.xml
rename to opensync-gateway-build/pom.xml
index 8f28a51..6081529 100644
--- a/opensync_gateway_build/pom.xml
+++ b/opensync-gateway-build/pom.xml
@@ -1,14 +1,13 @@
4.0.0
- com.whizcontrol
- root-pom
- 0.0.1-SNAPSHOT
+ com.telecominfraproject.wlan
+ tip-wlan-cloud-root-pom
+ 0.0.1-SNAPSHOT
- ai.connectus
- opensync_gateway_build
+ opensync-gateway-build
pom
- opensync_gateway_build
+ opensync-gateway-build
Aggregation of modules, to build everything related to Opensync Gateway
@@ -19,13 +18,11 @@
- ../opensync_ext_interface
- ../opensync_ext_kdc
- ../opensync_ext_static
- ../opensync_gateway
- ../opensync_gateway_kdc_process
- ../opensync_gateway_static_process
+ ../opensync-ext-interface
+ ../opensync-ext-static
+ ../opensync-gateway
+ ../opensync-gateway-static-process
-
\ No newline at end of file
+
diff --git a/opensync_gateway_static_process/pom.xml b/opensync-gateway-static-process/pom.xml
similarity index 56%
rename from opensync_gateway_static_process/pom.xml
rename to opensync-gateway-static-process/pom.xml
index 696d000..93dadfb 100644
--- a/opensync_gateway_static_process/pom.xml
+++ b/opensync-gateway-static-process/pom.xml
@@ -1,14 +1,13 @@
4.0.0
- com.whizcontrol
- root-pom
+ com.telecominfraproject.wlan
+ tip-wlan-cloud-root-pom
0.0.1-SNAPSHOT
-
- ai.connectus
- opensync_gateway_static_process
- opensync_gateway_static_process
- Process definition for opensync_gateway that uses static configuration
+
+ opensync-gateway-static-process
+ opensync-gateway-static-process
+ Process definition for opensync gateway that uses static configuration
ai.connectus.opensync.experiment.OpenSyncProcess
@@ -16,14 +15,14 @@
- ai.connectus
- opensync_gateway
- 0.0.1-SNAPSHOT
+ com.telecominfraproject.wlan
+ opensync-gateway
+ ${tip-wlan-cloud.release.version}
- ai.connectus
- opensync_ext_static
- 0.0.1-SNAPSHOT
+ com.telecominfraproject.wlan
+ opensync-ext-static
+ ${tip-wlan-cloud.release.version}
@@ -37,4 +36,4 @@
-
\ No newline at end of file
+
diff --git a/opensync_gateway_static_process/src/main/resources/application.properties b/opensync-gateway-static-process/src/main/resources/application.properties
similarity index 100%
rename from opensync_gateway_static_process/src/main/resources/application.properties
rename to opensync-gateway-static-process/src/main/resources/application.properties
diff --git a/opensync_gateway_static_process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) static.launch b/opensync-gateway-static-process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) static.launch
similarity index 100%
rename from opensync_gateway_static_process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) static.launch
rename to opensync-gateway-static-process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) static.launch
diff --git a/opensync-gateway/pom.xml b/opensync-gateway/pom.xml
new file mode 100644
index 0000000..07b30f4
--- /dev/null
+++ b/opensync-gateway/pom.xml
@@ -0,0 +1,58 @@
+
+ 4.0.0
+
+ com.telecominfraproject.wlan
+ tip-wlan-cloud-root-pom
+ 0.0.1-SNAPSHOT
+
+ opensync-gateway
+ opensync-gateway
+ Redirector and Controller for OpenSync
+
+
+
+ base-container
+ com.telecominfraproject.wlan
+ ${tip-wlan-cloud.release.version}
+
+
+ com.telecominfraproject.wlan
+ opensync-ext-interface
+ ${tip-wlan-cloud.release.version}
+
+
+
+ com.vmware.ovsdb
+ ovsdb-client
+ 1.0.1
+
+
+ slf4j-log4j12
+ org.slf4j
+
+
+
+
+
+
+ com.telecominfraproject.wlan
+ opensync_protobuf
+ ${tip-wlan-cloud.release.version}
+
+
+
+ com.google.protobuf
+ protobuf-java-util
+ 3.11.1
+
+
+
+ org.fusesource.mqtt-client
+ mqtt-client
+ 1.12
+
+
+
+
+
+
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/experiment/OpenSyncConnectusController.java b/opensync-gateway/src/main/java/ai/connectus/opensync/experiment/OpenSyncConnectusController.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/experiment/OpenSyncConnectusController.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/experiment/OpenSyncConnectusController.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/experiment/OpenSyncProcess.java b/opensync-gateway/src/main/java/ai/connectus/opensync/experiment/OpenSyncProcess.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/experiment/OpenSyncProcess.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/experiment/OpenSyncProcess.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/mqtt/OpensyncMqttClient.java b/opensync-gateway/src/main/java/ai/connectus/opensync/mqtt/OpensyncMqttClient.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/mqtt/OpensyncMqttClient.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/mqtt/OpensyncMqttClient.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/ConnectusOvsdbClient.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/ConnectusOvsdbClient.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/ConnectusOvsdbClient.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/ConnectusOvsdbClient.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/ConnectusOvsdbRedirector.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/ConnectusOvsdbRedirector.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/ConnectusOvsdbRedirector.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/ConnectusOvsdbRedirector.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/NettySslContextConfig.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/NettySslContextConfig.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/NettySslContextConfig.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/NettySslContextConfig.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/OvsdbListenerConfig.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/OvsdbListenerConfig.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/OvsdbListenerConfig.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/OvsdbListenerConfig.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/OvsdbSessionMap.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/OvsdbSessionMap.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/OvsdbSessionMap.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/OvsdbSessionMap.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/OvsdbDao.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/OvsdbDao.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/OvsdbDao.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/OvsdbDao.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/BridgeInfo.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/BridgeInfo.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/BridgeInfo.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/BridgeInfo.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/InterfaceInfo.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/InterfaceInfo.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/InterfaceInfo.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/InterfaceInfo.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/PortInfo.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/PortInfo.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/PortInfo.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/PortInfo.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiInetConfigInfo.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiInetConfigInfo.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiInetConfigInfo.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiInetConfigInfo.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiRadioConfigInfo.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiRadioConfigInfo.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiRadioConfigInfo.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiRadioConfigInfo.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiStatsConfigInfo.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiStatsConfigInfo.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiStatsConfigInfo.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiStatsConfigInfo.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiVifConfigInfo.java b/opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiVifConfigInfo.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiVifConfigInfo.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/ovsdb/dao/models/WifiVifConfigInfo.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/util/SslUtil.java b/opensync-gateway/src/main/java/ai/connectus/opensync/util/SslUtil.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/util/SslUtil.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/util/SslUtil.java
diff --git a/opensync_gateway/src/main/java/ai/connectus/opensync/util/ZlibUtil.java b/opensync-gateway/src/main/java/ai/connectus/opensync/util/ZlibUtil.java
similarity index 100%
rename from opensync_gateway/src/main/java/ai/connectus/opensync/util/ZlibUtil.java
rename to opensync-gateway/src/main/java/ai/connectus/opensync/util/ZlibUtil.java
diff --git a/opensync_gateway/src/main/resources/application.properties b/opensync-gateway/src/main/resources/application.properties
similarity index 100%
rename from opensync_gateway/src/main/resources/application.properties
rename to opensync-gateway/src/main/resources/application.properties
diff --git a/opensync_gateway/src/main/resources/launchers/OpenSyncProcess (local, KDC certs).launch b/opensync-gateway/src/main/resources/launchers/OpenSyncProcess (local, KDC certs).launch
similarity index 100%
rename from opensync_gateway/src/main/resources/launchers/OpenSyncProcess (local, KDC certs).launch
rename to opensync-gateway/src/main/resources/launchers/OpenSyncProcess (local, KDC certs).launch
diff --git a/opensync_gateway/src/main/resources/logback.xml b/opensync-gateway/src/main/resources/logback.xml
similarity index 100%
rename from opensync_gateway/src/main/resources/logback.xml
rename to opensync-gateway/src/main/resources/logback.xml
diff --git a/opensync_gateway/src/main/resources/run.sh b/opensync-gateway/src/main/resources/run.sh
similarity index 100%
rename from opensync_gateway/src/main/resources/run.sh
rename to opensync-gateway/src/main/resources/run.sh
diff --git a/opensync_ext_kdc/pom.xml b/opensync_ext_kdc/pom.xml
deleted file mode 100644
index b6777d9..0000000
--- a/opensync_ext_kdc/pom.xml
+++ /dev/null
@@ -1,157 +0,0 @@
-
- 4.0.0
-
- com.whizcontrol
- root-pom
- 0.0.1-SNAPSHOT
-
- ai.connectus
- opensync_ext_kdc
- opensync_ext_kdc
- Component that reads AP configuration from the KDC deployment, and registers/deregisters APs in there.
-
-
- ai.connectus
- opensync_ext_interface
- 0.0.1-SNAPSHOT
-
-
- base-container
- com.whizcontrol
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- equipment-configuration-manager-service-remote
- 0.0.1-SNAPSHOT
-
-
- com.whizcontrol
- equipment-and-network-management-service-remote
- 0.0.1-SNAPSHOT
-
-
- com.whizcontrol
- equipment-routing-service-remote
- 0.0.1-SNAPSHOT
-
-
- com.whizcontrol
- order-and-subscription-management-service-remote
- 0.0.1-SNAPSHOT
-
-
- com.whizcontrol
- equipment-metrics-collector-service-remote
- 0.0.1-SNAPSHOT
-
-
- com.whizcontrol
- equipment-status-and-alarm-collector-service-remote
- 0.0.1-SNAPSHOT
-
-
-
-
- com.whizcontrol
- service-metrics-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- rule-engine-partitioning-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- equipment-and-network-status-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- customer-account-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- service-subscription-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- equipment-inventory-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- equipment-routing-info-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- equipment-and-network-config-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- radio-resource-planner-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- system-event-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- issue-and-action-report-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- preferences-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- cami-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- ml-results-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- client-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- rogue-ap-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- msp-account-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- equipment-configuration-manager-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- email-notification-models
- ${whizcontrol.release.version}
-
-
- com.whizcontrol
- recommendation-models
- ${whizcontrol.release.version}
-
-
-
-
\ No newline at end of file
diff --git a/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationKDC.java b/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationKDC.java
deleted file mode 100644
index eb1f4a4..0000000
--- a/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/OpensyncExternalIntegrationKDC.java
+++ /dev/null
@@ -1,910 +0,0 @@
-package ai.connectus.opensync.external.integration;
-
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Callable;
-
-import javax.annotation.PostConstruct;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.cache.Cache;
-import org.springframework.cache.CacheManager;
-import org.springframework.context.annotation.Profile;
-import org.springframework.stereotype.Component;
-
-import com.whizcontrol.core.model.equipment.DetectedAuthMode;
-import com.whizcontrol.core.model.equipment.EquipmentType;
-import com.whizcontrol.core.model.equipment.MacAddress;
-import com.whizcontrol.core.model.equipment.NeighboreScanPacketType;
-import com.whizcontrol.core.model.equipment.NetworkType;
-import com.whizcontrol.core.model.equipment.RadioType;
-import com.whizcontrol.core.model.equipment.Toggle;
-import com.whizcontrol.equipmentandnetworkconfig.models.ApElementConfiguration;
-import com.whizcontrol.equipmentandnetworkconfig.models.ApElementConfiguration.ApModel;
-import com.whizcontrol.equipmentandnetworkconfig.models.CountryCode;
-import com.whizcontrol.equipmentandnetworkconfig.models.DeviceMode;
-import com.whizcontrol.equipmentandnetworkconfig.models.ElementRadioConfiguration;
-import com.whizcontrol.equipmentandnetworkconfig.models.EquipmentElementConfiguration;
-import com.whizcontrol.equipmentandnetworkconfig.models.GettingDNS;
-import com.whizcontrol.equipmentandnetworkconfig.models.GettingIP;
-import com.whizcontrol.equipmentandnetworkconfig.models.SsidConfiguration;
-import com.whizcontrol.equipmentandnetworkconfig.models.SsidConfiguration.AppliedRadio;
-import com.whizcontrol.equipmentandnetworkconfig.models.SsidConfiguration.SecureMode;
-import com.whizcontrol.equipmentandnetworkconfig.models.StateSetting;
-import com.whizcontrol.equipmentandnetworkmanagement.EquipmentAndNetworkManagementInterface;
-import com.whizcontrol.equipmentandnetworkstatus.models.EquipmentProtocolState;
-import com.whizcontrol.equipmentandnetworkstatus.models.StatusCode;
-import com.whizcontrol.equipmentandnetworkstatus.models.equipment.CustomerEquipmentStatusRecord;
-import com.whizcontrol.equipmentandnetworkstatus.models.equipment.EquipmentAdminStatusData;
-import com.whizcontrol.equipmentandnetworkstatus.models.equipment.EquipmentLANStatusData;
-import com.whizcontrol.equipmentandnetworkstatus.models.equipment.EquipmentProtocolStatusData;
-import com.whizcontrol.equipmentandnetworkstatus.models.equipment.VLANStatusData;
-import com.whizcontrol.equipmentconfigurationmanager.EquipmentConfigurationManagerInterface;
-import com.whizcontrol.equipmentconfigurationmanager.models.ResolvedEquipmentConfiguration;
-import com.whizcontrol.equipmentinventory.models.CustomerEquipment;
-import com.whizcontrol.equipmentmetricscollector.EquipmentMetricsCollectorInterface;
-import com.whizcontrol.equipmentrouting.EquipmentRoutingInterface;
-import com.whizcontrol.equipmentroutinginfo.models.EquipmentRoutingRecord;
-import com.whizcontrol.equipmentstatusandalarmcollector.EquipmentStatusAndAlarmCollectorInterface;
-import com.whizcontrol.orderandsubscriptionmanagement.OrderAndSubscriptionManagementInterface;
-import com.whizcontrol.servicemetrics.models.APDemoMetric;
-import com.whizcontrol.servicemetrics.models.ApClientMetrics;
-import com.whizcontrol.servicemetrics.models.ApPerformance;
-import com.whizcontrol.servicemetrics.models.ClientMetrics;
-import com.whizcontrol.servicemetrics.models.EthernetLinkState;
-import com.whizcontrol.servicemetrics.models.NeighbourReport;
-import com.whizcontrol.servicemetrics.models.NeighbourScanReports;
-import com.whizcontrol.servicemetrics.models.RadioUtilization;
-import com.whizcontrol.servicemetrics.models.SingleMetricRecord;
-
-import ai.connectus.opensync.external.integration.controller.OpensyncKDCGatewayController;
-import ai.connectus.opensync.external.integration.models.ConnectNodeInfo;
-import ai.connectus.opensync.external.integration.models.OpensyncAPConfig;
-import ai.connectus.opensync.external.integration.models.OpensyncAPRadioConfig;
-import ai.connectus.opensync.external.integration.models.OpensyncAPSsidConfig;
-
-import sts.PlumeStats.Client;
-import sts.PlumeStats.ClientReport;
-import sts.PlumeStats.Device;
-import sts.PlumeStats.Device.RadioTemp;
-import sts.PlumeStats.Neighbor;
-import sts.PlumeStats.Neighbor.NeighborBss;
-import sts.PlumeStats.RadioBandType;
-import sts.PlumeStats.Report;
-import sts.PlumeStats.Survey;
-import sts.PlumeStats.Survey.SurveySample;
-import traffic.NetworkMetadata.FlowReport;
-import wc.stats.IpDnsTelemetry.WCStatsReport;
-
-@Profile("opensync_kdc_config")
-@Component
-public class OpensyncExternalIntegrationKDC implements OpensyncExternalIntegrationInterface {
-
- private static final Logger LOG = LoggerFactory.getLogger(OpensyncExternalIntegrationKDC.class);
-
- @Autowired
- private EquipmentAndNetworkManagementInterface eqNetworkManagementInterface;
-
- @Autowired
- private EquipmentConfigurationManagerInterface eqConfigurationManagerInterface;
-
- @Autowired
- private OrderAndSubscriptionManagementInterface orderAndSubscriptionManagementInterface;
-
- @Autowired
- private EquipmentMetricsCollectorInterface equipmentMetricsCollectorInterface;
-
- @Autowired
- private EquipmentStatusAndAlarmCollectorInterface equipmentStatusInterface;
-
- /**
- * Equipment routing provide the qrCode to CE gateway mapping
- */
- @Autowired
- private EquipmentRoutingInterface eqRoutingInterface;
-
- @Autowired
- private OpensyncKDCGatewayController kdcGwController;
-
- @Autowired
- private OvsdbSessionMapInterface ovsdbSessionMapInterface;
-
- @Autowired
- private CacheManager cacheManagerShortLived;
-
- @Value("${connectus.ovsdb.autoProvisionedCustomerId:1004}")
- private int autoProvisionedCustomerId;
- @Value("${connectus.ovsdb.autoProvisionedLocationId:2}")
- private int autoProvisionedLocationId;
- @Value("${connectus.ovsdb.autoProvisionedNetworkConfigId:3}")
- private long autoProvisionedNetworkConfigId;
-
- private Cache kdcEquipmentRecordCache;
-
- @PostConstruct
- private void postCreate(){
- LOG.info("Using KDC integration");
- kdcEquipmentRecordCache = cacheManagerShortLived.getCache("KDC_equipment_record_cache");
- }
-
- public CustomerEquipment getCustomerEquipment(String apId) {
- CustomerEquipment ce = null;
-
- try {
- ce = kdcEquipmentRecordCache.get(apId, new Callable() {
- @Override
- public CustomerEquipment call() throws Exception {
- return eqNetworkManagementInterface.getCustomerEquipmentByQrCode(apId);
- }
- });
- }catch (Exception e) {
- //do nothing
- }
-
- return ce;
- }
-
- public void apConnected(String apId, ConnectNodeInfo connectNodeInfo) {
- LOG.info("AP {} got connected to the gateway", apId);
- try {
-
- CustomerEquipment ce = getCustomerEquipment(apId);
-
- if(ce == null) {
-
- //auto-provision APs for the demo
- //we'll use hardcoded customerId/locationId/networkConfigId for the new equipment
-
- ce = new CustomerEquipment();
- ce.setEquipmentType(EquipmentType.AP);
- ce.setModelId("plume");
- ce.setQrCode(apId);
- ce = eqNetworkManagementInterface.createCustomerEquipment(ce);
-
- //bind newly created CE to specified customer
- Set equipmentIdsToAdd = new HashSet();
- equipmentIdsToAdd.add(ce.getId());
- orderAndSubscriptionManagementInterface.bindEquipment(autoProvisionedCustomerId, equipmentIdsToAdd);
-
- // now update CE record itself
- ce.setName(apId);
- ce.setCustomerId(autoProvisionedCustomerId);
- ce.setEquipmentNetworkConfigId(autoProvisionedNetworkConfigId);
- ce.setLocation(autoProvisionedLocationId);
-
- ce = eqNetworkManagementInterface.updateCustomerEquipment(ce);
-
- // create the element configuration
- LOG.debug("Creating element configuration for AP({})", apId);
-
- EquipmentElementConfiguration equipmentElementConfiguration = new EquipmentElementConfiguration();
- EquipmentType equipmentType = ce.getEquipmentType();
-
- equipmentElementConfiguration.setEquipmentId(ce.getId());
- equipmentElementConfiguration.setEquipmentType(equipmentType);
- equipmentElementConfiguration.setCustomerId(ce.getCustomerId());
- equipmentElementConfiguration.setElementConfigVersion("" + equipmentType + "-V1");
-
- ApElementConfiguration apElementConfiguration = ApElementConfiguration.createWithDefaults(
- equipmentElementConfiguration.getElementConfigVersion(),
- ApModel.INDOOR);
-
- apElementConfiguration.setGettingIP(GettingIP.dhcp);
- apElementConfiguration.setGettingDNS(GettingDNS.dhcp);
- apElementConfiguration.setDeviceMode(DeviceMode.standaloneAP);
-
- equipmentElementConfiguration.setApElementConfig(apElementConfiguration);
-
- equipmentElementConfiguration = eqNetworkManagementInterface
- .createEquipmentElementConfiguration(equipmentElementConfiguration);
-
- // Establish admin status for the new equipment.
- try {
- CustomerEquipmentStatusRecord statusRecord = new CustomerEquipmentStatusRecord();
- statusRecord.setCustomerId(ce.getCustomerId());
- statusRecord.setEquipmentId(ce.getId());
- EquipmentAdminStatusData statusData = new EquipmentAdminStatusData();
- statusData.setStatusCode(StatusCode.normal);
- statusData.setCustomerLevelStatusCode(StatusCode.normal);
- statusRecord.setStatusData(statusData);
-
- // Update the equipment status
- equipmentStatusInterface.updateEquipmentAdminStatus(statusRecord);
- } catch (Exception e) {
- //do nothing
- }
-
- //cache newly created AP
- kdcEquipmentRecordCache.put(apId, ce);
- }
-
-
- //register equipment routing record
- EquipmentRoutingRecord equipmentRoutingRecord = new EquipmentRoutingRecord();
- equipmentRoutingRecord.setGatewayRecordId(kdcGwController.getRegisteredGwId());
- equipmentRoutingRecord.setCustomerId(ce.getCustomerId());
- equipmentRoutingRecord.setEquipmentId(ce.getId());
- EquipmentRoutingRecord ret = eqRoutingInterface.registerUERoute(equipmentRoutingRecord);
- OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
- ovsdbSession.setRoutingId(ret.getId());
- ovsdbSession.setEquipmentId(ce.getId());
- ovsdbSession.setCustomerId(ce.getCustomerId());
-
- //update equipment status
- // Establish admin status for the connected equipment.
- CustomerEquipmentStatusRecord statusRecord = equipmentStatusInterface.getEquipmentAdminStatusByEquipmentId(ce.getCustomerId(), ce.getId(), false);
- if(statusRecord==null) {
- statusRecord = new CustomerEquipmentStatusRecord();
- statusRecord.setCustomerId(ce.getCustomerId());
- statusRecord.setEquipmentId(ce.getId());
-
- EquipmentAdminStatusData statusData = new EquipmentAdminStatusData();
- statusRecord.setStatusData(statusData);
- }
-
- ((EquipmentAdminStatusData)statusRecord.getStatusData()).setStatusCode(StatusCode.normal);
- ((EquipmentAdminStatusData)statusRecord.getStatusData()).setCustomerLevelStatusCode(StatusCode.normal);
-
- // Update the equipment status
- equipmentStatusInterface.updateEquipmentAdminStatus(statusRecord);
-
- //update LAN status - nothing to do here for now
- statusRecord = equipmentStatusInterface.getEquipmentLANStatusByEquipmentId(ce.getCustomerId(), ce.getId(), false);
- if(statusRecord==null) {
- statusRecord = new CustomerEquipmentStatusRecord();
- statusRecord.setCustomerId(ce.getCustomerId());
- statusRecord.setEquipmentId(ce.getId());
-
- EquipmentLANStatusData statusData = new EquipmentLANStatusData();
- statusRecord.setStatusData(statusData);
- }
-
- Map vlanStatusDataMap = new HashMap<>();
- ((EquipmentLANStatusData)statusRecord.getStatusData()).setVlanStatusDataMap(vlanStatusDataMap );
-
- equipmentStatusInterface.updateEquipmentLANStatus(statusRecord);
-
- //update protocol status
- statusRecord = equipmentStatusInterface.getEquipmentProtocolStatusByEquipmentId(ce.getCustomerId(), ce.getId(), false);
- if(statusRecord==null) {
- statusRecord = new CustomerEquipmentStatusRecord();
- statusRecord.setCustomerId(ce.getCustomerId());
- statusRecord.setEquipmentId(ce.getId());
-
- EquipmentProtocolStatusData statusData = new EquipmentProtocolStatusData();
- statusRecord.setStatusData(statusData);
- }
-
- EquipmentProtocolStatusData protocolStatusData = ((EquipmentProtocolStatusData)statusRecord.getStatusData());
- protocolStatusData.setPoweredOn(true);
- protocolStatusData.setCloudProtocolVersion("1100");
- protocolStatusData.setProtocolState(EquipmentProtocolState.ready);
- protocolStatusData.setBandPlan("FCC");
- protocolStatusData.setBaseMacAddress(MacAddress.valueOf(connectNodeInfo.macAddress));
- protocolStatusData.setCloudCfgDataVersion(42L);
- protocolStatusData.setReportedCfgDataVersion(42L);
- protocolStatusData.setCountryCode("CA");
- protocolStatusData.setReportedCC(CountryCode.ca);
- protocolStatusData.setReportedHwVersion(connectNodeInfo.platformVersion);
- protocolStatusData.setReportedSwVersion(connectNodeInfo.firmwareVersion);
- protocolStatusData.setReportedSwAltVersion(connectNodeInfo.firmwareVersion);
- protocolStatusData.setReportedIpV4Addr(InetAddress.getByName(connectNodeInfo.ipV4Address));
- if(connectNodeInfo.macAddress!=null && MacAddress.valueOf(connectNodeInfo.macAddress)!=null) {
- protocolStatusData.setReportedMacAddr(MacAddress.valueOf(connectNodeInfo.macAddress).getAddress());
- }
- protocolStatusData.setReportedSku(connectNodeInfo.skuNumber);
- protocolStatusData.setSerialNumber(connectNodeInfo.serialNumber);
- protocolStatusData.setSystemName(connectNodeInfo.model);
-
- equipmentStatusInterface.updateEquipmentProtocolStatus(statusRecord);
-
- //TODO: continue from here --->>>
-
-//TODO: equipmentStatusInterface.updateEquipmentFirmwareStatus(statusRecord);
-//TODO: equipmentStatusInterface.updateEquipmentNeighbouringStatusRecord(record);
-//TODO: equipmentStatusInterface.updateEquipmentPeerStatus(statusRecord);
-
-//TODO: equipmentStatusInterface.updateNetworkAdminStatus(networkAdminStatusRecord);
- //dtop: this one populates traffic capacity and usage dial on the main dashboard
- //from APDemoMetric properties getPeriodLengthSec, getRxBytes2G, getTxBytes2G, getRxBytes5G, getTxBytes5G
-//TODO: equipmentStatusInterface.updateNetworkAggregateStatus(networkAggregateStatusRecord);
-
-
-
- }catch(Exception e) {
- LOG.error("Exception when registering ap routing {}", apId, e);
- }
- }
-
- public void apDisconnected(String apId) {
- LOG.info("AP {} got disconnected from the gateway", apId);
- try {
- OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
-
- if(ovsdbSession!=null) {
- eqRoutingInterface.deregisterUserEquipment(ovsdbSession.getEquipmentId());
- } else {
- LOG.warn("Cannot find ap {} in KDC inventory", apId);
- }
- }catch(Exception e) {
- LOG.error("Exception when registering ap routing {}", apId, e);
- }
-
- }
-
- public OpensyncAPConfig getApConfig(String apId) {
- LOG.info("Retrieving config for AP {} ", apId);
- OpensyncAPConfig ret = null;
-
- try {
-
- OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
- if(ovsdbSession == null) {
- throw new IllegalStateException("AP is not connected " + apId);
- }
- long equipmentId = ovsdbSession.getEquipmentId();
- ResolvedEquipmentConfiguration resolvedEqCfg = eqConfigurationManagerInterface.getResolvedEquipmentConfiguration(equipmentId, null, null);
-
- if(resolvedEqCfg==null) {
- throw new IllegalStateException("Cannot retrieve configuration for " + apId);
- }
- ret = new OpensyncAPConfig();
-
- //extract country, radio channels from resolvedEqCfg
- String country = "CA";
- CountryCode countryCode = resolvedEqCfg.getEquipmentCountryCode();
- if(countryCode!=null && countryCode!=CountryCode.UNSUPPORTED) {
- country = countryCode.toString().toUpperCase();
- }
-
- int radioChannel24G = 1;
- int radioChannel5LG = 44;
-
- Map erc = resolvedEqCfg.getEquipmentElementConfiguration().getApElementConfig().getRadioMap();
- if(erc!=null) {
- ElementRadioConfiguration erc24 = erc.get(1);
- ElementRadioConfiguration erc5 = erc.get(0);
-
- if(erc24!=null) {
- radioChannel24G = erc24.getChannelNumber();
- }
-
- if(erc5!=null) {
- radioChannel5LG = erc5.getChannelNumber();
- }
- }
-
- OpensyncAPRadioConfig radioConfig = new OpensyncAPRadioConfig();
- radioConfig.setCountry(country);
- radioConfig.setRadioChannel24G(radioChannel24G);
- radioConfig.setRadioChannel5LG(radioChannel5LG);
- //hardcoding this one, as there are no config for it in KDC
- radioConfig.setRadioChannel5HG(108);
-
- ret.setRadioConfig(radioConfig);
-
- //extract ssid parameters from resolvedEqCfg
- List ssidConfigs = new ArrayList<>();
- ret.setSsidConfigs(ssidConfigs);
-
- List resolvedSsids = resolvedEqCfg.getSsidConfigurations();
- if(resolvedSsids!=null) {
- for(SsidConfiguration ssidCfg : resolvedSsids) {
- OpensyncAPSsidConfig osSsidCfg = new OpensyncAPSsidConfig();
- osSsidCfg.setSsid(ssidCfg.getSsid());
-
- AppliedRadio ar = ssidCfg.getAppliedRadio();
- if(ar == AppliedRadio.radioA) {
- osSsidCfg.setRadioType(RadioType.is5GHz);
- } else if (ar == AppliedRadio.radioB ){
- osSsidCfg.setRadioType(RadioType.is2dot4GHz);
- } else if (ar == AppliedRadio.radioAandB ){
- osSsidCfg.setRadioType(RadioType.is5GHz);
- }
-
- osSsidCfg.setBroadcast(ssidCfg.getBroadcastSsid() == StateSetting.enabled);
-
- if(ssidCfg.getSecureMode() == SecureMode.wpa2OnlyPSK || ssidCfg.getSecureMode() == SecureMode.wpa2PSK) {
- osSsidCfg.setEncryption("WPA-PSK");
- osSsidCfg.setMode("2");
- } else if(ssidCfg.getSecureMode() == SecureMode.wpaPSK ) {
- osSsidCfg.setEncryption("WPA-PSK");
- osSsidCfg.setMode("1");
- } else {
- LOG.warn("Unsupported encryption mode {} - will use WPA-PSK instead", ssidCfg.getSecureMode());
- osSsidCfg.setEncryption("WPA-PSK");
- osSsidCfg.setMode("2");
- }
-
- osSsidCfg.setKey(ssidCfg.getKeyStr());
-
- ssidConfigs.add(osSsidCfg);
-
- if( ar==AppliedRadio.radioAandB ) {
- //configure the same ssid on the second radio
- osSsidCfg = osSsidCfg.clone();
- osSsidCfg.setRadioType(RadioType.is2dot4GHz);
- ssidConfigs.add(osSsidCfg);
- }
- }
- }
-
- } catch (Exception e) {
- LOG.error("Cannot read config for AP {}", apId, e);
- }
-
- LOG.debug("Config content : {}", ret);
-
- return ret;
- }
-
-
- /**
- * @param topic
- * @return apId extracted from the topic name, or null if it cannot be extracted
- */
- public static String extractApIdFromTopic(String topic) {
- //Topic is formatted as "/ap/"+clientCn+"_"+ret.serialNumber+"/opensync"
- if(topic==null) {
- return null;
- }
-
- String[] parts = topic.split("/");
- if(parts.length<3) {
- return null;
- }
-
- //apId is the third element in the topic
- return parts[2];
- }
-
-
- /**
- * @param topic
- * @return customerId looked up from the topic name, or -1 if it cannot be extracted
- */
- public int extractCustomerIdFromTopic(String topic) {
-
- String apId = extractApIdFromTopic(topic);
- if(apId == null) {
- return -1;
- }
-
- OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
-
- if(ovsdbSession!=null) {
- return ovsdbSession.getCustomerId();
- }
-
- CustomerEquipment ce = getCustomerEquipment(apId);
- if(ce!=null) {
- return ce.getCustomerId();
- }
-
- return -1;
-
- }
-
- public long extractEquipmentIdFromTopic(String topic) {
-
- String apId = extractApIdFromTopic(topic);
- if(apId == null) {
- return -1;
- }
-
- OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
-
- if(ovsdbSession!=null) {
- return ovsdbSession.getEquipmentId();
- }
-
- CustomerEquipment ce = getCustomerEquipment(apId);
- if(ce!=null) {
- return ce.getId();
- }
-
- return -1;
-
- }
-
- public void processMqttMessage(String topic, Report report) {
- LOG.info("Received report on topic {} for ap {}", topic, report.getNodeID());
- int customerId = extractCustomerIdFromTopic(topic);
- if(customerId>0) {
- kdcGwController.updateActiveCustomer(customerId);
- }
-
- long equipmentId = extractEquipmentIdFromTopic(topic);
- if(equipmentId <= 0 || customerId <=0) {
- LOG.warn("Cannot determine equipment ids from topic {} - customerId {} equipmentId {}", topic, customerId, equipmentId);
- return;
- }
-
- List metricRecordList = new ArrayList<>();
-
- populateAPDemoMetrics(metricRecordList, report, customerId, equipmentId);
- populateApClientMetrics(metricRecordList, report, customerId, equipmentId);
- populateNeighbourScanReports(metricRecordList, report, customerId, equipmentId);
-
- populateApSsidMetrics(metricRecordList, report, customerId, equipmentId);
- populateChannelInfoReports(metricRecordList, report, customerId, equipmentId);
-
- if(!metricRecordList.isEmpty()) {
- equipmentMetricsCollectorInterface.createRecordList(metricRecordList);
- }
-
- }
-
- private void populateNeighbourScanReports(List metricRecordList, Report report, int customerId, long equipmentId) {
-
- for(Neighbor neighbor: report.getNeighborsList()){
-
- SingleMetricRecord smr = new SingleMetricRecord(customerId, equipmentId);
- metricRecordList.add(smr);
- NeighbourScanReports neighbourScanReports = new NeighbourScanReports();
- smr.setData(neighbourScanReports);
-
- smr.setCreatedTimestamp(neighbor.getTimestampMs());
-
- List neighbourReports = new ArrayList<>();
- neighbourScanReports.setNeighbourReports(neighbourReports);
-
- for(NeighborBss nBss: neighbor.getBssListList()) {
- NeighbourReport nr = new NeighbourReport();
- neighbourReports.add(nr);
-
- // "band": "BAND5GL",
- // "scanType": "ONCHAN_SCAN",
- // "timestampMs": "1581118421629",
- // "bssList": [
- // {
- // "bssid": "80:D0:4A:E6:66:C9",
- // "ssid": "",
- // "rssi": 4,
- // "tsf": "0",
- // "chanWidth": "CHAN_WIDTH_80MHZ",
- // "channel": 44,
- // "status": "ADDED"
- // },
-
- if(neighbor.getBand()==RadioBandType.BAND2G) {
- nr.setAcMode(Toggle.off);
- nr.setbMode(Toggle.off);
- nr.setnMode(Toggle.on);
- nr.setRadioType(RadioType.is2dot4GHz);
- } else {
- nr.setAcMode(Toggle.on);
- nr.setbMode(Toggle.off);
- nr.setnMode(Toggle.off);
- nr.setRadioType(RadioType.is5GHz);
- }
-
- nr.setChannel(nBss.getChannel());
- nr.setMacAddress(MacAddress.valueOf(nBss.getBssid()).getAddress());
- nr.setNetworkType(NetworkType.AP);
- nr.setPacketType(NeighboreScanPacketType.BEACON);
- nr.setPrivacy((nBss.getSsid()==null || nBss.getSsid().isEmpty())?Toggle.on:Toggle.off);
- //nr.setRate(rate);
- nr.setRssi(nBss.getRssi());
- //nr.setScanTimeInSeconds(scanTimeInSeconds);
- nr.setSecureMode(DetectedAuthMode.WPA);
- //nr.setSignal(signal);
- nr.setSsid(nBss.getSsid());
- }
- }
- }
-
- private void populateChannelInfoReports(List metricRecordList, Report report, int customerId, long equipmentId) {
-
- //TODO: implement me!
- //TODO: continue from here --->>>
-
-
-// {
-// SingleMetricRecord smr = new SingleMetricRecord(customerId, equipmentId);
-// metricRecordList.add(smr);
-// ChannelInfoReports channelInfoReports = new ChannelInfoReports();
-// smr.setData(channelInfoReports);
-//
-// List channelInformationReports2g = new ArrayList<>();
-// channelInfoReports.setChannelInformationReports2g(channelInformationReports2g);
-//
-// List channelInformationReports5g = new ArrayList<>();
-// channelInfoReports.setChannelInformationReports5g(channelInformationReports5g);
-//
-// ChannelInfo chInfo = new ChannelInfo();
-// chInfo.setBandwidth(bandwidth);
-// chInfo.setChanNumber(chanNumber);
-// chInfo.setNoiseFloor(noiseFloor);
-// chInfo.setTotalUtilization(totalUtilization);
-// chInfo.setWifiUtilization(wifiUtilization);
-//
-// channelInformationReports2g.add(chInfo);
-//
-// chInfo = new ChannelInfo();
-// chInfo.setBandwidth(bandwidth);
-// chInfo.setChanNumber(chanNumber);
-// chInfo.setNoiseFloor(noiseFloor);
-// chInfo.setTotalUtilization(totalUtilization);
-// chInfo.setWifiUtilization(wifiUtilization);
-//
-// channelInformationReports5g.add(chInfo);
-//
-// }
- }
-
- private void populateApSsidMetrics(List metricRecordList, Report report, int customerId, long equipmentId) {
- //TODO: implement me!
-// {
-// SingleMetricRecord smr = new SingleMetricRecord(customerId, equipmentId);
-// metricRecordList.add(smr);
-//
-// ApSsidMetrics apSsidMetrics = new ApSsidMetrics();
-// smr.setData(apSsidMetrics);
-//
-// List ssidStats2g = new ArrayList<>();
-// apSsidMetrics.setSsidStats2g(ssidStats2g );
-//
-// List ssidStats5g = new ArrayList<>();
-// apSsidMetrics.setSsidStats5g(ssidStats5g );
-//
-// SsidStatistics ssidStat = new SsidStatistics();
-// ssidStats2g.add(ssidStat);
-// ssidStat.setBssid(bssid);
-// ssidStat.setSsid(ssid);
-// ssidStat.setNumClient(numClient);
-// ssidStat.setRxBytes(rxBytes);
-// ssidStat.setRxLastRssi(rxLastRssi);
-// ssidStat.setNumTxBytesSucc(numTxBytesSucc);
-//
-// ssidStat = new SsidStatistics();
-// ssidStats5g.add(ssidStat);
-// ssidStat.setBssid(bssid);
-// ssidStat.setSsid(ssid);
-// ssidStat.setNumClient(numClient);
-// ssidStat.setRxBytes(rxBytes);
-// ssidStat.setRxLastRssi(rxLastRssi);
-// ssidStat.setNumTxBytesSucc(numTxBytesSucc);
-// }
- }
-
- private void populateApClientMetrics(List metricRecordList, Report report, int customerId, long equipmentId) {
-
- for(ClientReport clReport: report.getClientsList()){
- SingleMetricRecord smr = new SingleMetricRecord(customerId, equipmentId);
- metricRecordList.add(smr);
-
- ApClientMetrics apClientMetrics = new ApClientMetrics();
- smr.setData(apClientMetrics);
- smr.setCreatedTimestamp(clReport.getTimestampMs());
-
- Integer periodLengthSec = 60; //matches what's configured by OvsdbDao.configureStats(OvsdbClient)
- apClientMetrics.setPeriodLengthSec(periodLengthSec);
-
- List clientMetrics = new ArrayList<>();
-
- for(Client cl: clReport.getClientListList()) {
- //clReport.getChannel();
- ClientMetrics cMetrics = new ClientMetrics();
- clientMetrics.add(cMetrics);
- cMetrics.setRadioType((clReport.getBand() == RadioBandType.BAND2G)?RadioType.is2dot4GHz:RadioType.is5GHz);
- cMetrics.setDeviceMacAddress(new MacAddress(cl.getMacAddress()));
-
- if(cl.hasStats()) {
- if(cl.getStats().hasRssi()) {
- cMetrics.setRssi(cl.getStats().getRssi());
- }
-
- //we'll report each device as having a single (very long) session
- cMetrics.setSessionId(cMetrics.getDeviceMacAddress().getAddressAsLong());
-
- //populate Rx stats
- if(cl.getStats().hasRxBytes()) {
- cMetrics.setRxBytes(cl.getStats().getRxBytes());
- }
-
- if(cl.getStats().hasRxRate()) {
- //cMetrics.setAverageRxRate(cl.getStats().getRxRate());
- }
-
- if(cl.getStats().hasRxErrors()) {
- cMetrics.setNumRxNoFcsErr((int)cl.getStats().getRxErrors());
- }
-
- if(cl.getStats().hasRxFrames()) {
- //cMetrics.setNumRxFramesReceived(cl.getStats().getRxFrames());
- cMetrics.setNumRxPackets(cl.getStats().getRxFrames());
- }
-
- if(cl.getStats().hasRxRetries()) {
- cMetrics.setNumRxRetry((int)cl.getStats().getRxRetries());
- }
-
- //populate Tx stats
- if(cl.getStats().hasTxBytes()) {
- cMetrics.setNumTxBytes(cl.getStats().getTxBytes());
- }
-
- if(cl.getStats().hasTxRate()) {
- //cMetrics.setAverageTxRate(cl.getStats().getTxRate());
- }
-
- if(cl.getStats().hasTxRate() && cl.getStats().hasRxRate()) {
- cMetrics.setRates(new byte[]{(byte) (cl.getStats().getTxRate()), (byte) (cl.getStats().getRxRate())});
- }
-
- if(cl.getStats().hasTxErrors()) {
- cMetrics.setNumTxDropped((int)cl.getStats().getTxErrors());
- }
-
- if(cl.getStats().hasTxFrames()) {
- //cMetrics.setNumTxFramesTransmitted(cl.getStats().getTxFrames());
- cMetrics.setNumTxPackets(cl.getStats().getRxFrames());
- }
-
- if(cl.getStats().hasTxRetries()) {
- cMetrics.setNumTxDataRetries((int)cl.getStats().getTxRetries());
- }
-
- }
- }
-
- if(clReport.getBand() == RadioBandType.BAND2G) {
- apClientMetrics.setClientMetrics2g(clientMetrics.toArray(new ClientMetrics[0]));
- } else {
- apClientMetrics.setClientMetrics5g(clientMetrics.toArray(new ClientMetrics[0]));
- }
-
- }
- }
-
- private void populateAPDemoMetrics(List metricRecordList, Report report, int customerId, long equipmentId) {
- APDemoMetric data = null;
-
- for(Device deviceReport : report.getDeviceList()) {
-
- SingleMetricRecord smr = new SingleMetricRecord(customerId, equipmentId);
- metricRecordList.add(smr);
-
- data = new APDemoMetric();
- smr.setData(data);
- ApPerformance apPerformance = new ApPerformance();
- data.setApPerformance(apPerformance);
-
- smr.setCreatedTimestamp(deviceReport.getTimestampMs());
-// data.setChannelUtilization2G(channelUtilization2G);
-// data.setChannelUtilization5G(channelUtilization5G);
-
- if(deviceReport.getRadioTempCount()>0) {
- int cpuTemperature = 0;
- int numSamples = 0;
- for(RadioTemp r: deviceReport.getRadioTempList()) {
- if(r.hasValue()) {
- cpuTemperature += r.getValue();
- numSamples++;
- }
- }
-
- if(numSamples>0) {
- apPerformance.setCpuTemperature( cpuTemperature / numSamples );
- }
- }
-
- if(deviceReport.hasCpuUtil() && deviceReport.getCpuUtil().hasCpuUtil()) {
- apPerformance.setCpuUtilized(new byte[]{(byte) (deviceReport.getCpuUtil().getCpuUtil()), (byte) (0)});
- }
-
- apPerformance.setEthLinkState(EthernetLinkState.UP1000_FULL_DUPLEX);
-
- if(deviceReport.hasMemUtil() && deviceReport.getMemUtil().hasMemTotal() && deviceReport.getMemUtil().hasMemUsed()) {
- apPerformance.setFreeMemory(deviceReport.getMemUtil().getMemTotal() - deviceReport.getMemUtil().getMemUsed());
- }
- apPerformance.setUpTime(new Long(deviceReport.getUptime()));
-
- }
-
- if(data != null) {
- //Main Network dashboard shows Traffic and Capacity values that are calculated from
- // APDemoMetric properties getPeriodLengthSec, getRxBytes2G, getTxBytes2G, getRxBytes5G, getTxBytes5G
-
- //go over all the clients to aggregate per-client tx/rx stats - we want to do this
- //only once per batch of APDemoMetrics - so we do not repeat values over and over again
- long rxBytes2g = 0;
- long txBytes2g = 0;
- long rxBytes5g = 0;
- long txBytes5g = 0;
-
- for(ClientReport clReport: report.getClientsList()){
- for(Client cl: clReport.getClientListList()) {
-
- if(clReport.getBand() == RadioBandType.BAND2G) {
- if(cl.getStats().hasTxBytes()) {
- txBytes2g += cl.getStats().getTxBytes();
- }
-
- if(cl.getStats().hasRxBytes()) {
- rxBytes2g += cl.getStats().getRxBytes();
- }
- } else {
- if(cl.getStats().hasTxBytes()) {
- txBytes5g += cl.getStats().getTxBytes();
- }
-
- if(cl.getStats().hasRxBytes()) {
- rxBytes5g += cl.getStats().getRxBytes();
- }
- }
- }
- }
-
- data.setRxBytes2G(rxBytes2g);
- data.setTxBytes2G(txBytes2g);
- data.setRxBytes5G(rxBytes5g);
- data.setTxBytes5G(txBytes5g);
- data.setPeriodLengthSec(60);
-
- //Now try to populate metrics for calculation of radio capacity
- //see com.whizcontrol.metrics.streaming.spark.equipmentreport.CapacityDStreamsConfig.toAggregatedStats(int, long, APDemoMetric data)
- //result.stats2g = toAggregatedRadioStats(data.getNoiseFloor2G(),data.getRadioUtilization2G());
- //result.stats5g = toAggregatedRadioStats(data.getNoiseFloor5G(),data.getRadioUtilization5G());
-// RadioUtilization
-// private Integer assocClientTx;
-// private Integer unassocClientTx;
-// private Integer assocClientRx;
-// private Integer unassocClientRx;
-// private Integer nonWifi;
-// private Integer timestampSeconds;
-
- data.setRadioUtilization2G(new ArrayList<>());
- data.setRadioUtilization5G(new ArrayList<>());
-
- //populate it from report.survey
- for(Survey survey: report.getSurveyList()){
- for(SurveySample surveySample: survey.getSurveyListList()) {
- if(surveySample.getDurationMs()==0) {
- continue;
- }
- RadioUtilization radioUtil = new RadioUtilization();
- radioUtil.setTimestampSeconds((int)((survey.getTimestampMs() + surveySample.getOffsetMs())/1000));
- radioUtil.setAssocClientTx(100 * surveySample.getBusyTx()/surveySample.getDurationMs());
- radioUtil.setAssocClientRx(100 * surveySample.getBusyRx()/surveySample.getDurationMs());
- radioUtil.setNonWifi(100 * (surveySample.getBusy() - surveySample.getBusyTx() - surveySample.getBusyRx())/surveySample.getDurationMs());
-
- if(survey.getBand() == RadioBandType.BAND2G) {
- data.getRadioUtilization2G().add(radioUtil);
- } else {
- data.getRadioUtilization5G().add(radioUtil);
- }
- }
- }
-
- }
- }
-
- public void processMqttMessage(String topic, FlowReport flowReport) {
- LOG.info("Received flowReport on topic {} for ap {}", topic, flowReport.getObservationPoint().getNodeId());
- int customerId = extractCustomerIdFromTopic(topic);
- if(customerId>0) {
- kdcGwController.updateActiveCustomer(customerId);
- }
- //TODO: implement me
- }
-
- public void processMqttMessage(String topic, WCStatsReport wcStatsReport) {
- LOG.info("Received wcStatsReport on topic {} for ap {}", topic, wcStatsReport.getObservationPoint().getNodeId());
- int customerId = extractCustomerIdFromTopic(topic);
- if(customerId>0) {
- kdcGwController.updateActiveCustomer(customerId);
- }
- //TODO: implement me
- }
-
-}
diff --git a/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncGatewayControllerStartListener.java b/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncGatewayControllerStartListener.java
deleted file mode 100644
index 7708cf0..0000000
--- a/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncGatewayControllerStartListener.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package ai.connectus.opensync.external.integration.controller;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.event.ContextStartedEvent;
-
-/**
- * Listen for context started event so that we are register with routing service
- *
- * @author yongli
- *
- */
-public class OpensyncGatewayControllerStartListener implements ApplicationListener {
-
- private static final Logger LOG = LoggerFactory.getLogger(OpensyncGatewayControllerStartListener.class);
-
- OpensyncKDCGatewayController controller;
-
- public OpensyncGatewayControllerStartListener(OpensyncKDCGatewayController controller) {
- this.controller = controller;
- }
-
- @Override
- public void onApplicationEvent(ContextStartedEvent event) {
- LOG.debug("Processing ContextStartedEvent event");
- controller.registerWithRoutingService();
- }
-}
diff --git a/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncGatewayControllerStopListener.java b/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncGatewayControllerStopListener.java
deleted file mode 100644
index 8d10598..0000000
--- a/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncGatewayControllerStopListener.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package ai.connectus.opensync.external.integration.controller;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.event.ContextClosedEvent;
-
-/**
- * Register for stop event so that we can de-register from routing service
- *
- * @author yongli
- *
- */
-public class OpensyncGatewayControllerStopListener implements ApplicationListener {
- OpensyncKDCGatewayController controller;
-
- private static final Logger LOG = LoggerFactory.getLogger(OpensyncGatewayControllerStopListener.class);
-
- public OpensyncGatewayControllerStopListener(OpensyncKDCGatewayController controller) {
- this.controller = controller;
- }
-
- @Override
- public void onApplicationEvent(ContextClosedEvent event) {
- LOG.debug("Processing ContextClosedEvent event");
- controller.deregisterFromRoutingService();
- }
-
-}
diff --git a/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncGatewayListenerConfiguration.java b/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncGatewayListenerConfiguration.java
deleted file mode 100644
index 95c7933..0000000
--- a/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncGatewayListenerConfiguration.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package ai.connectus.opensync.external.integration.controller;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.event.ContextClosedEvent;
-import org.springframework.context.event.ContextStartedEvent;
-import org.springframework.stereotype.Component;
-
-@Component
-public class OpensyncGatewayListenerConfiguration {
- @Autowired
- OpensyncKDCGatewayController controller;
- private static final Logger LOG = LoggerFactory.getLogger(OpensyncGatewayControllerStartListener.class);
-
- @Bean
- public ApplicationListener myStopEventListner() {
- LOG.debug("Creating stop event listener");
- return new OpensyncGatewayControllerStopListener(controller);
- }
-
- @Bean
- public ApplicationListener myStartedEventListener() {
- LOG.debug("Creating start event listener");
- return new OpensyncGatewayControllerStartListener(controller);
- }
-}
diff --git a/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncKDCGatewayController.java b/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncKDCGatewayController.java
deleted file mode 100644
index 4beead7..0000000
--- a/opensync_ext_kdc/src/main/java/ai/connectus/opensync/external/integration/controller/OpensyncKDCGatewayController.java
+++ /dev/null
@@ -1,457 +0,0 @@
-package ai.connectus.opensync.external.integration.controller;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.function.BiFunction;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.security.core.userdetails.User;
-import org.springframework.security.web.bind.annotation.AuthenticationPrincipal;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.whizcontrol.core.model.json.BaseJsonModel;
-import com.whizcontrol.core.model.service.ServiceInstanceInformation;
-import com.whizcontrol.core.server.container.ConnectorProperties;
-import com.whizcontrol.customerequipmentgateway.models.CEGWBaseCommand;
-import com.whizcontrol.customerequipmentgateway.models.CEGWBlinkRequest;
-import com.whizcontrol.customerequipmentgateway.models.CEGWCloseSessionRequest;
-import com.whizcontrol.customerequipmentgateway.models.CEGWCommandResultCode;
-import com.whizcontrol.customerequipmentgateway.models.CEGWConfigChangeNotification;
-import com.whizcontrol.customerequipmentgateway.models.CEGWRouteCheck;
-import com.whizcontrol.customerequipmentgateway.models.CEGWStartDebugEngine;
-import com.whizcontrol.customerequipmentgateway.models.CustomerEquipmentCommand;
-import com.whizcontrol.customerequipmentgateway.models.CustomerEquipmentCommandResponse;
-import com.whizcontrol.customerequipmentgateway.models.GatewayDefaults;
-import com.whizcontrol.equipmentrouting.EquipmentRoutingInterface;
-import com.whizcontrol.equipmentroutinginfo.models.CustomerEquipmentGwRecord;
-import com.whizcontrol.equipmentroutinginfo.models.EquipmentRoutingRecord;
-import com.whizcontrol.equipmentroutinginfo.models.RoutingRegisterResponse;
-import com.whizcontrol.server.exceptions.ConfigurationException;
-
-import ai.connectus.opensync.external.integration.ConnectusOvsdbClientInterface;
-import ai.connectus.opensync.external.integration.OvsdbSession;
-import ai.connectus.opensync.external.integration.OvsdbSessionMapInterface;
-
-/**
- * Opensync Gateway Controller - integration code for Kodacloud deployment
- *
- * @author yongli
- * @author dtop
- *
- */
-@RestController
-@EnableScheduling
-public class OpensyncKDCGatewayController {
-
- @Autowired
- EquipmentRoutingInterface eqRoutingSvc;
-
- @Autowired
- ConnectorProperties connectorProperties;
-
- @Autowired
- private ServiceInstanceInformation serviceInstanceInfo;
-
- @Autowired
- private ConnectusOvsdbClientInterface connectusOvsdbClient;
-
- /**
- * Flag indicates if this gateway has registered with routing service
- */
- private boolean registeredWithRoutingService = false;
-
- private long registeredGwId = -1;
-
- /**
- * Lock used to protected {@link #activeCustomerLock}
- */
- private final ReadWriteLock activeCustomerLock = new ReentrantReadWriteLock();
- private final Lock activeCustomerReadLock = activeCustomerLock.readLock();
- private final Lock activeCustomerWriteLock = activeCustomerLock.writeLock();
-
- @Autowired
- private OvsdbSessionMapInterface ovsdbSessionMapInterface;
-
- /**
- * Map
- */
- private ConcurrentMap activeCustomerMap = new ConcurrentHashMap<>();
-
- /**
- * latestTimetamp used when updating {@link #activeCustomerMap}
- */
- private final BiFunction latestTimestamp = new BiFunction() {
- @Override
- public Long apply(Long oldValue, Long newValue) {
- if (newValue.compareTo(oldValue) > 0) {
- return newValue;
- }
- return oldValue;
- }
- };
-
- private static final Logger LOG = LoggerFactory.getLogger(OpensyncKDCGatewayController.class);
-
- @RequestMapping(value = "/command", method = RequestMethod.POST)
- public CustomerEquipmentCommandResponse sendCommand(@RequestBody CEGWBaseCommand command) {
- LOG.debug("sendCommand({})", command);
- String qrCode = command.getEquipmentQRCode();
- if (BaseJsonModel.hasUnsupportedValue(command)) {
- LOG.error("[{}] Failed to deliver command {}, command contains unsupported value", qrCode, command);
- return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.UnsupportedCommand.ordinal(),
- "Unsupported value in command for " + qrCode);
- }
- OvsdbSession session = ovsdbSessionMapInterface.getSession(qrCode);
- if (session == null) {
- LOG.warn("[{}] Failed to deliver command {}, websocket session not found", qrCode, command);
- return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.NoRouteToCE.ordinal(),
- "No session found for " + qrCode);
- }
-
- switch (command.getCommandType()) {
- case ConfigChangeNotification:
- return sendConfigChangeNotification(session, (CEGWConfigChangeNotification) command);
- case CloseSessionRequest:
- return closeSession(session, (CEGWCloseSessionRequest) command);
- case CheckRouting:
- return checkEquipmentRouting(session, (CEGWRouteCheck) command);
- case BlinkRequest:
- return processBlinkRequest(session, (CEGWBlinkRequest) command);
- case StartDebugEngine:
- return processChangeRedirector(session, (CEGWStartDebugEngine) command);
- case StopDebugEngine:
- case FirmwareDownloadRequest:
- case FirmwareFlashRequest:
- case RebootRequest:
- case NeighbourhoodReport:
- case ClientDeauthRequest:
- case CellSizeRequest:
- case NewChannelRequest:
- case ReportCurrentAPCRequest:
- case FileUpdateRequest:
- case InterferenceThresholdUpdateRequest:
- case BestApConfigurationUpdateRequest:
- case StartPacketFileCapture:
- case StopPacketCapture:
- case ReportCurrentVLANRequest:
- case BSSIDToMacMonitoringRequest:
- case ChannelChangeAnnouncementRequest:
- case UploadLogFile:
- case TogglePoERequest:
- case RadioReset:
- case ClearScanTable:
- case WdsRequest:
- default:
- LOG.warn("[{}] Failed to deliver command {}, unsupported command type", qrCode, command);
- return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.UnsupportedCommand.ordinal(),
- "Invalid command type (" + command.getCommandType() + ") for equipment (" + qrCode + ")");
- }
- }
-
- @RequestMapping(value = "/defaults", method = RequestMethod.GET)
- public GatewayDefaults retrieveGatewayDefaults()
- {
- return new GatewayDefaults();
- }
-
-
-
- /**
- * Verify a route to customer equipment
- *
- * @param session
- * @param command
- * @param protocolVersion
- * @return NoRouteToCE if route Id does not match or Success
- */
- private CustomerEquipmentCommandResponse checkEquipmentRouting(OvsdbSession session, CEGWRouteCheck command) {
- if (null != command.getRoutingId()) {
- if (!command.getRoutingId().equals(session.getRoutingId())) {
-
- LOG.info("[C:{} E:{} R:{}] Stale routing entry ({}) detected",
- session.getCustomerId(), command.getEquipmentQRCode(),
- session.getRoutingId(), command.getRoutingId());
-
- return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.NoRouteToCE.ordinal(),
- "Inactive Route Identifer");
- }
- }
- return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.Success.ordinal(), "Route active");
- }
-
- private CustomerEquipmentCommandResponse sendConfigChangeNotification(OvsdbSession session,
- CEGWConfigChangeNotification command) {
-
- return sendMessage(session, command.getEquipmentQRCode(), command);
- }
-
- private CustomerEquipmentCommandResponse closeSession(OvsdbSession session, CEGWCloseSessionRequest command) {
- try {
- session.getOvsdbClient().shutdown();
- } catch (Exception e) {
- LOG.error("[{}] Failed to close session on CE: {}", command.getEquipmentQRCode(), e.getLocalizedMessage());
- return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.FailedToSend.ordinal(),
- "Failed to send command " + command.getCommandType() + " to " + command.getEquipmentQRCode() + ": "
- + e.getMessage());
- }
- LOG.debug("[{}] Closed session to CE", command.getEquipmentQRCode());
- return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.Success.ordinal(),
- "Closed session to " + command.getEquipmentQRCode());
-
- }
-
- /**
- * Deliver a message in payload to the CE
- *
- * @param session
- * @param qrCode
- * @param command
- * @param request
- * @return
- */
- private CustomerEquipmentCommandResponse sendMessage(OvsdbSession session, String qrCode,
- CustomerEquipmentCommand command) {
-
- LOG.debug("Received command {} for {}", command.getCommandType(), qrCode);
- CustomerEquipmentCommandResponse response = new CustomerEquipmentCommandResponse(CEGWCommandResultCode.Success.ordinal(),
- "Received Command " + command.getCommandType() + " for " + qrCode);
-
- if(command instanceof CEGWConfigChangeNotification) {
- connectusOvsdbClient.processConfigChanged(qrCode);
- } else if(command instanceof CEGWStartDebugEngine) {
- //dtop: we will be using CEGWStartDebugEngine command to deliver request to change redirector
- //TODO: after the demo introduce a specialized command for this!
- String newRedirectorAddress = ((CEGWStartDebugEngine) command).getGatewayHostname();
- connectusOvsdbClient.changeRedirectorAddress(qrCode, newRedirectorAddress );
- }
-
- return response;
- }
-
- private CustomerEquipmentCommandResponse processChangeRedirector(OvsdbSession session, CEGWStartDebugEngine command) {
- return sendMessage(session, command.getEquipmentQRCode(), command);
- }
-
- private CustomerEquipmentCommandResponse processBlinkRequest(OvsdbSession session,
- CEGWBlinkRequest command) {
-
- return sendMessage(session, command.getEquipmentQRCode(), command);
- }
-
-
- @RequestMapping(value = "/commandWithUser", method = RequestMethod.POST)
- public CustomerEquipmentCommandResponse sendCommandWithAuthUser(@RequestBody CustomerEquipmentCommand command,
- @AuthenticationPrincipal Object requestUser, HttpServletRequest httpServletRequest) {
-
- // use these properties to get address and port where request has
- // arrived
- httpServletRequest.getLocalAddr();
- httpServletRequest.getLocalPort();
-
- // requestUser will be instance of
- // org.springframework.security.core.userdetails.User for client auth
- // and digest auth,
- // although other auth providers may return something entirely different
- if (requestUser instanceof User) {
- LOG.debug("calling command with auth principal: {}", ((User) requestUser).getUsername());
- } else {
- LOG.debug("calling command with auth principal: {}", requestUser);
- }
-
- // This is a test method to show how to get access to the auth user
- // object for a given request
-
- return sendCommand(command);
- }
-
- /**
- * Register this controller with Equipment Routing Service
- */
- public void registerWithRoutingService() {
- synchronized (this) {
- if (registeredWithRoutingService) {
- return;
- }
-
- if (eqRoutingSvc == null) {
- throw new ConfigurationException(
- "Unabled to register gateway with routing service: routing service interface not initialized");
- }
- CustomerEquipmentGwRecord gwRecord = new CustomerEquipmentGwRecord();
- gwRecord.setDeploymentId(getDeploymentId());
-
- // Internal facing service
- gwRecord.setGatewayId(getGatewayName());
- gwRecord.setIpAddr(connectorProperties.getInternalIpAddress().getHostAddress());
- gwRecord.setPort(connectorProperties.getInternalPort());
-
- try {
- CustomerEquipmentGwRecord result = this.eqRoutingSvc.registerGateway(gwRecord);
- this.registeredGwId = result.getId();
- LOG.info("Successfully registered (name={}, id={}) with Routing Service", result.getGatewayId(),
- registeredGwId);
- registeredWithRoutingService = true;
- } catch (RuntimeException e) {
- // failed
- LOG.error("Failed to register Customer Equipment Gateway (name={}) with Routing Service : {}",
- getGatewayName(), e.getLocalizedMessage());
- }
- }
- }
-
- /**
- * Return the current deployment identifier
- *
- * @return
- */
- public int getDeploymentId() {
- return serviceInstanceInfo.getDeploymentId();
- }
-
- /**
- * De-register from Routing service
- */
- public void deregisterFromRoutingService() {
- if (registeredWithRoutingService) {
- try {
- eqRoutingSvc.deregisterGateway(registeredGwId);
- LOG.info("Deregistered Customer Equipment Gateway (name={},id={}) with Routing Service",
- getGatewayName(), this.registeredGwId);
- } catch (Exception e) {
- // failed
- LOG.error("Failed to deregister Customer Equipment Gateway (name={},id={}) with Routing Service: {}",
- getGatewayName(), this.registeredGwId, e.getLocalizedMessage());
- }
- registeredWithRoutingService = false;
- }
- }
-
- public long getRegisteredGwId() {
- return this.registeredGwId;
- }
-
- /**
- * Register a customer equipment with this gateway
- *
- * @param equipmentName
- * @param customerId
- * @param equipmentId
- * @return associationId
- */
- public RoutingRegisterResponse registerCustomerEquipment(String equipmentName, Integer customerId,
- Long equipmentId) {
- registerWithRoutingService();
- if (!registeredWithRoutingService) {
- LOG.error("Unable to register customer equipement (name={},id={}): gateway not registered.", equipmentName,
- equipmentId);
- return null;
- }
- EquipmentRoutingRecord routingRecord = new EquipmentRoutingRecord();
- routingRecord.setCustomerId(customerId);
- routingRecord.setEquipmentId(equipmentId);
- routingRecord.setGatewayRecordId(this.registeredGwId);
- try {
- RoutingRegisterResponse result = eqRoutingSvc.registerUERouteForDeployment(routingRecord,
- getDeploymentId());
- LOG.debug("Registered customer equipment (name={},id={}) with route id={}", equipmentName, equipmentId,
- result.getRoutingRecord().getId());
- return result;
-
- } catch (Exception e) {
- LOG.error("Failed to register customer equipement (name={},id={}): {}", equipmentName, equipmentId,
- e.getLocalizedMessage());
- }
- return null;
- }
-
- public void deregisterCustomerEquipment(Long routingId, String equipmentName, Long equipmentId) {
- if (!registeredWithRoutingService) {
- LOG.error("Unable to deregister customer equipement (name={},id={}): gateway not registered", equipmentName,
- equipmentId);
- return;
- }
- try {
- LOG.debug("Deregistering customer equipment (name={},id={}) with route id={}", equipmentName, equipmentId,
- routingId);
-
- eqRoutingSvc.deregisterUERoute(routingId);
- } catch (Exception e) {
- LOG.error("Failed to deregister customer equipement (name={},id={}) with route id={}: {}", equipmentName,
- equipmentId, routingId, e.getLocalizedMessage());
- }
- }
-
-
- /**
- * Run every 5 minutes
- */
- @Scheduled(initialDelay = 5 * 60 * 1000, fixedRate = 5 * 60 * 1000)
- public void updateActiveCustomer() {
- try {
- Map activeMap = this.getActiveCustomerMapForUpdate();
- if (null != activeMap) {
- LOG.info("Updating active customer records, total record size {}", activeMap.size());
- this.eqRoutingSvc.updateActiveCustomer(activeMap, getDeploymentId());
- }
- } catch (RuntimeException exp) {
- LOG.error("Failed to update active customer records due to exception {}", exp.getLocalizedMessage());
- }
- }
-
-
- /**
- * Use connection internal hostname as the gateway name
- *
- * @return
- */
- private String getGatewayName() {
- return connectorProperties.getInternalHostName();
- }
-
- /**
- * Update the active timestamp for the customer
- *
- * @param customerId
- */
- public void updateActiveCustomer(int customerId) {
- this.activeCustomerReadLock.lock();
- try {
- this.activeCustomerMap.merge(customerId, System.currentTimeMillis(), latestTimestamp);
- } finally {
- this.activeCustomerReadLock.unlock();
- }
- }
-
- /**
- * Swap the active customer map for reporting if it contains records.
- *
- * @return null if no records.
- */
- protected Map getActiveCustomerMapForUpdate() {
- this.activeCustomerWriteLock.lock();
- try {
- Map map = null;
- if (!this.activeCustomerMap.isEmpty()) {
- map = this.activeCustomerMap;
- this.activeCustomerMap = new ConcurrentHashMap<>();
- }
-
- return map;
- } finally {
- this.activeCustomerWriteLock.unlock();
- }
- }
-}
diff --git a/opensync_gateway/pom.xml b/opensync_gateway/pom.xml
deleted file mode 100644
index 3d073e9..0000000
--- a/opensync_gateway/pom.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
- 4.0.0
-
- com.whizcontrol
- root-pom
- 0.0.1-SNAPSHOT
-
- ai.connectus
- opensync_gateway
- opensync_gateway
- Redirector and Controller for OpenSync
-
-
-
- base-container
- com.whizcontrol
- ${whizcontrol.release.version}
-
-
- ai.connectus
- opensync_ext_interface
- 0.0.1-SNAPSHOT
-
-
-
- com.vmware.ovsdb
- ovsdb-client
- 1.0.1
-
-
- slf4j-log4j12
- org.slf4j
-
-
-
-
-
-
- ai.connectus
- opensync_protobuf
- 0.0.1-SNAPSHOT
-
-
-
- com.google.protobuf
- protobuf-java-util
- 3.11.1
-
-
-
- org.fusesource.mqtt-client
- mqtt-client
- 1.12
-
-
-
-
-
-
diff --git a/opensync_gateway_kdc_process/pom.xml b/opensync_gateway_kdc_process/pom.xml
deleted file mode 100644
index c140b4d..0000000
--- a/opensync_gateway_kdc_process/pom.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
- 4.0.0
-
- com.whizcontrol
- root-pom
- 0.0.1-SNAPSHOT
-
- ai.connectus
- opensync_gateway_kdc_process
- opensync_gateway_kdc_process
- Process definition for opensync_gateway that talks to KDC
-
- ai.connectus.opensync.experiment.OpenSyncProcess
-
-
-
-
- ai.connectus
- opensync_gateway
- 0.0.1-SNAPSHOT
-
-
- ai.connectus
- opensync_ext_kdc
- 0.0.1-SNAPSHOT
-
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
\ No newline at end of file
diff --git a/opensync_gateway_kdc_process/src/main/resources/application.properties b/opensync_gateway_kdc_process/src/main/resources/application.properties
deleted file mode 100644
index 4972ba2..0000000
--- a/opensync_gateway_kdc_process/src/main/resources/application.properties
+++ /dev/null
@@ -1,122 +0,0 @@
-# see http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#common-application-properties-security for details
-
-app.name=OpenSyncManager
-
-#
-#Select spring profiles
-#
-# valid values for security profiles are: no_ssl, use_ssl
-# valid values for auth profiles are: no_auth, form_based_auth, http_basic_auth, http_digest_auth, client_certificate_auth
-#
-# this property can be overridden by application.properties in the following locations:
-# classpath root
-# current directory
-# classpath /config package
-# /config subdir of the current directory.
-# System property -Dspring.profiles.active=production
-# or specified on the command line using the switch --spring.profiles.active=dev,hsqldb
-#
-# This does not work: spring.profiles.active=${whizcontrol.core.server.security},${whizcontrol.core.server.auth},Extra_${app.name}
-# Substitution of ${} in application.properties works in general, but not for spring.profiles.active and not for spring.profiles.include properties
-#
-# *** Do not set spring.profiles.active property in this file, or be prepared for the World of Weird.
-#spring.profiles.active=a_1,a_2,integration_test
-# Example: with application.properties:spring.profiles.active=a_1,a_2,dev,integration_test and @ActiveProfiles(profiles = "test1")
-# active profiles: [profile_it_1, profile_it_2, profile_dev_1, profile_dev_2, p_1, p_2, a_1, a_2, dev, integration_test, test1]
-# What happens:
-# RealActiveProfiles.addAll(application.properties:spring.profiles.active)
-# RealActiveProfiles.addAll(application.properties:spring.profiles.include)
-# Find all other files named application-${profileName}.properties based on content of RealActiveProfiles
-# All application-${profileName}.properties:spring.profiles.include are read, and for each file:
-# RealActiveProfiles.addAll(application-${profileName}.properties:spring.profiles.include)
-# Recursively process other files named application-${profileName}.properties based on content of RealActiveProfiles
-#
-# Note that application-${profileName}.properties:spring.profiles.active values are NOT added to the RealActiveProfiles in this case.
-#
-# Another Example: with application.properties:spring.profiles.active NOT SET and @ActiveProfiles(profiles = "integration_test")
-# active profiles: [profile_it_1, profile_it_2, active_it_1, active_it_2, p_1, p_2, integration_test]
-# What happens:
-# application.properties:spring.profiles.active is read and not found
-# RealActiveProfiles.addAll(application.properties:spring.profiles.include)
-# Find all other files named application-${profileName}.properties based on content of RealActiveProfiles
-# Found application-integration_test.properties file
-# RealActiveProfiles.addAll(application-integration_test.properties:spring.profiles.active)
-# RealActiveProfiles.addAll(application-integration_test.properties:spring.profiles.include)
-# Find all other files named application-${profileName}.properties based on content of RealActiveProfiles
-# All application-${profileName}.properties:spring.profiles.include are read, and for each file:
-# RealActiveProfiles.addAll(application-${profileName}.properties:spring.profiles.include)
-# Recursively process other files named application-${profileName}.properties based on content of RealActiveProfiles
-#
-# Note that only application-integration_test.properties:spring.profiles.active is read,
-# all other application-${profileName}.properties:spring.profiles.active values
-# are NOT added to the RealActiveProfiles in this case.
-#
-# Summary:
-# 1. Only the first available property application*.properties:spring.profiles.active is read and added to RealActiveProfiles
-# 2. All properties application*.properties:spring.profiles.include are read, and their values are added to RealActiveProfiles
-# 3. Many application*.properties can be read during initialization (i.e. one can include a profile name that is referring to another)
-#
-# ***
-#
-# Use spring.profiles.active property for unit/integration tests to select proper application-*.properties file
-# - this can be done by placing annotation @ActiveProfiles(profiles = "integration_test") on the test classes
-#
-# Use spring.profiles.active property for specific deployments - staging/cloud to select proper application-*.properties file
-# - this can be done by using SystemProperty -Dspring.profiles.active=cloud
-#
-# Deployment-specific properties can be configured in other property files, like persistence-${envTarget:dev}.properties
-# where value for property envTarget can be set using any mechanism, including placing it in the application-*.properties
-#
-#
-# Use spring.profiles.include property to specify static collection of profiles that are
-# always present in this configuration, regardless of spring.profiles.active property
-# Note: this property is additive, its value is always added to the list of active profiles
-#spring.profiles.include=use_ssl,http_digest_auth,customer-credential-datastore-inmemory
-#spring.profiles.include=no_ssl,no_auth
-#spring.profiles.include=use_ssl,client_certificate_auth
-spring.profiles.include=use_ssl_with_client_cert_and_basic_auth,client_certificate_and_basic_auth,rest-template-single-user-per-service-digest-auth,use_single_ds,opensync_kdc_config
-
-whizcontrol.equipmentAndNetworkManagementServiceBaseUrl=https://localhost:9094
-
-#used by *-remote client classes when they authenticate their requests
-whizcontrol.httpClientConfig=classpath:httpClientConfig.json
-
-#this user/password is used together with http_digest_auth and http_basic_auth spring profiles
-whizcontrol.serviceUser=user
-whizcontrol.servicePassword=password
-
-spring.main.show-banner=false
-server.port=9096
-
-#this port is used by secondary server connector, it is protected by digest authentication, while primary server.port is protected by client certificate auth
-whizcontrol.secondaryPort=7071
-
-#this server only supports REST requests, CSRF would get in the way
-whizcontrol.csrf-enabled=false
-whizcontrol.emailVerificationTokenExpiryMs=600
-whizcontrol.passwordResetTokenExpiryMs=3600
-
-whizcontrol.customerAccountManagementServiceBaseUrl=https://localhost:9092
-whizcontrol.orderAndSubscriptionManagementServiceBaseUrl=https://localhost:9093
-whizcontrol.equipmentAndNetworkManagementServiceBaseUrl=https://localhost:9094
-whizcontrol.equipmentConfigurationManagerServiceBaseUrl=https://localhost:9082
-whizcontrol.equipmentStatusAndAlarmCollectorServiceBaseUrl=https://localhost:9083
-whizcontrol.equipmentMetricsCollectorServiceBaseUrl=https://localhost:9085
-whizcontrol.equipmentRoutingServiceBaseUrl=https://localhost:9081
-whizcontrol.firmwareManagementServiceBaseUrl=https://localhost:9072
-whizcontrol.equipmentEventCollectorServiceBaseUrl=https://localhost:9076
-
-#server.session-timeout= # session timeout in seconds
-#server.tomcat.max-threads = 0 # number of threads in protocol handler
-
-#server.context-path= # the context path, defaults to '/'
-#server.servlet-path= # the servlet path, defaults to '/'
-#server.tomcat.access-log-pattern= # log pattern of the access log
-#server.tomcat.access-log-enabled=false # is access logging enabled
-
-# pretty print JSON
-spring.jackson.serialization.INDENT_OUTPUT=TRUE
-# sort keys
-#http.mappers.json-sort-keys=false
-
-#spring.jmx.enabled=true # Expose MBeans from Spring
diff --git a/opensync_gateway_kdc_process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) - prod KDC.launch b/opensync_gateway_kdc_process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) - prod KDC.launch
deleted file mode 100644
index 7591717..0000000
--- a/opensync_gateway_kdc_process/src/main/resources/launchers/OpenSyncProcess (local, KDC certs) - prod KDC.launch
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-