mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-01 02:57:49 +00:00
WIFI-425: Cloud Back End for Events phase 2
Protobuf changes re AP handling events.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -83,6 +83,7 @@ import sts.OpensyncStats.AssocType;
|
||||
import sts.OpensyncStats.Client;
|
||||
import sts.OpensyncStats.ClientReport;
|
||||
import sts.OpensyncStats.EventReport;
|
||||
import sts.OpensyncStats.EventReport.ClientAssocEvent;
|
||||
import sts.OpensyncStats.EventType;
|
||||
import sts.OpensyncStats.RadioBandType;
|
||||
import sts.OpensyncStats.Report;
|
||||
@@ -769,6 +770,8 @@ public class OpensyncExternalIntegrationCloudTest {
|
||||
|
||||
private List<EventReport> getOpensyncStatsEventReportsList() {
|
||||
|
||||
|
||||
List<ClientAssocEvent> clientAssocEventList = new ArrayList<>();
|
||||
sts.OpensyncStats.EventReport.ClientAssocEvent.Builder clientAssocBuilder = EventReport.ClientAssocEvent
|
||||
.getDefaultInstance().toBuilder();
|
||||
clientAssocBuilder.setAssocType(AssocType.ASSOC);
|
||||
@@ -793,22 +796,29 @@ public class OpensyncExternalIntegrationCloudTest {
|
||||
clientAssocBuilder2.setSsid("ssid-1");
|
||||
clientAssocBuilder2.setStatus(1);
|
||||
|
||||
clientAssocEventList.add(clientAssocBuilder.build());
|
||||
clientAssocEventList.add(clientAssocBuilder2.build());
|
||||
|
||||
List<EventReport> eventReportList = new ArrayList<>();
|
||||
|
||||
EventReport.Builder eventReportBuilder = EventReport.getDefaultInstance().toBuilder();
|
||||
eventReportBuilder.setClientAssocEvent(clientAssocBuilder.build());
|
||||
eventReportBuilder.setEventType(EventType.CLIENT_ASSOC);
|
||||
|
||||
sts.OpensyncStats.EventReport.ClientSession.Builder clientSessionBuilder = sts.OpensyncStats.EventReport.ClientSession.getDefaultInstance().toBuilder();
|
||||
|
||||
clientSessionBuilder.setSessionId(1000L);
|
||||
|
||||
clientSessionBuilder.addAllClientAssocEvent(clientAssocEventList);
|
||||
List<sts.OpensyncStats.EventReport.ClientSession> clientSessionList = new ArrayList<>();
|
||||
clientSessionList.add(clientSessionBuilder.build());
|
||||
|
||||
eventReportBuilder.addAllClientSession(clientSessionList);
|
||||
|
||||
eventReportList.add(eventReportBuilder.build());
|
||||
|
||||
eventReportBuilder = EventReport.getDefaultInstance().toBuilder();
|
||||
eventReportBuilder.setClientAssocEvent(clientAssocBuilder2.build());
|
||||
eventReportBuilder.setEventType(EventType.CLIENT_ASSOC);
|
||||
|
||||
eventReportList.add(eventReportBuilder.build());
|
||||
|
||||
return eventReportList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private List<ClientReport> getOpensyncStatsClientReportsList() {
|
||||
|
||||
@@ -57,13 +57,13 @@ import sts.OpensyncStats.Client;
|
||||
import sts.OpensyncStats.ClientReport;
|
||||
import sts.OpensyncStats.DNSProbeMetric;
|
||||
import sts.OpensyncStats.EventReport;
|
||||
import sts.OpensyncStats.EventType;
|
||||
import sts.OpensyncStats.NetworkProbe;
|
||||
import sts.OpensyncStats.RADIUSMetrics;
|
||||
import sts.OpensyncStats.RadioBandType;
|
||||
import sts.OpensyncStats.Report;
|
||||
import sts.OpensyncStats.StateUpDown;
|
||||
import sts.OpensyncStats.VLANMetrics;
|
||||
import sts.OpensyncStats.EventReport.ClientAssocEvent;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@ActiveProfiles(profiles = { "integration_test", })
|
||||
@@ -300,6 +300,8 @@ public class OpensyncExternalIntegrationMqttMessageProcessorTest {
|
||||
|
||||
private List<EventReport> getOpensyncStatsEventReportsList() {
|
||||
|
||||
|
||||
List<ClientAssocEvent> clientAssocEventList = new ArrayList<>();
|
||||
sts.OpensyncStats.EventReport.ClientAssocEvent.Builder clientAssocBuilder = EventReport.ClientAssocEvent
|
||||
.getDefaultInstance().toBuilder();
|
||||
clientAssocBuilder.setAssocType(AssocType.ASSOC);
|
||||
@@ -324,22 +326,30 @@ public class OpensyncExternalIntegrationMqttMessageProcessorTest {
|
||||
clientAssocBuilder2.setSsid("ssid-1");
|
||||
clientAssocBuilder2.setStatus(1);
|
||||
|
||||
clientAssocEventList.add(clientAssocBuilder.build());
|
||||
clientAssocEventList.add(clientAssocBuilder2.build());
|
||||
|
||||
List<EventReport> eventReportList = new ArrayList<>();
|
||||
|
||||
EventReport.Builder eventReportBuilder = EventReport.getDefaultInstance().toBuilder();
|
||||
eventReportBuilder.setClientAssocEvent(clientAssocBuilder.build());
|
||||
eventReportBuilder.setEventType(EventType.CLIENT_ASSOC);
|
||||
|
||||
sts.OpensyncStats.EventReport.ClientSession.Builder clientSessionBuilder = sts.OpensyncStats.EventReport.ClientSession
|
||||
.getDefaultInstance().toBuilder();
|
||||
|
||||
clientSessionBuilder.setSessionId(1000L);
|
||||
|
||||
clientSessionBuilder.addAllClientAssocEvent(clientAssocEventList);
|
||||
List<sts.OpensyncStats.EventReport.ClientSession> clientSessionList = new ArrayList<>();
|
||||
clientSessionList.add(clientSessionBuilder.build());
|
||||
|
||||
eventReportBuilder.addAllClientSession(clientSessionList);
|
||||
|
||||
eventReportList.add(eventReportBuilder.build());
|
||||
|
||||
eventReportBuilder = EventReport.getDefaultInstance().toBuilder();
|
||||
eventReportBuilder.setClientAssocEvent(clientAssocBuilder2.build());
|
||||
eventReportBuilder.setEventType(EventType.CLIENT_ASSOC);
|
||||
|
||||
eventReportList.add(eventReportBuilder.build());
|
||||
|
||||
return eventReportList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private List<ClientReport> getOpensyncStatsClientReportsList() {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.telecominfraproject.wlan.opensync.ovsdb.dao.utilities;
|
||||
|
||||
import com.telecominfraproject.wlan.client.models.ClientType;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.SecurityType;
|
||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.enumerations.DhcpFpDeviceType;
|
||||
|
||||
import com.telecominfraproject.wlan.servicemetric.apnode.models.StateUpDownError;
|
||||
@@ -242,4 +243,17 @@ public class OvsdbToWlanCloudTypeMappingUtility {
|
||||
|
||||
}
|
||||
|
||||
public static SecurityType getCloudSecurityTypeFromOpensyncStats(sts.OpensyncStats.SecurityType statsSecurityType) {
|
||||
switch (statsSecurityType) {
|
||||
case SEC_OPEN:
|
||||
return SecurityType.OPEN;
|
||||
case SEC_PSK:
|
||||
return SecurityType.PSK;
|
||||
case SEC_RADIUS:
|
||||
return SecurityType.RADIUS;
|
||||
default:
|
||||
return SecurityType.UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user