From f2ded11a0be81f68179bcb0ef20eafe325bcb530 Mon Sep 17 00:00:00 2001 From: Lynn Shi Date: Wed, 22 Jul 2020 11:50:16 -0400 Subject: [PATCH] Static GW handles captive portal profile --- .../OpensyncExternalIntegrationSimple.java | 18 +++++++++++++++++- ...yncProcess (local, KDC certs) static.launch | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java b/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java index c83770f..7e9efff 100644 --- a/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java +++ b/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java @@ -1,5 +1,7 @@ package com.telecominfraproject.wlan.opensync.external.integration; +import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.List; @@ -42,6 +44,9 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr @Value("${tip.wlan.ovsdb.radiusProfileFileName:/app/config/ProfileRadius.json}") private String radiusProfileFileName; + + @Value("${tip.wlan.ovsdb.captiveProfileFileName:/app/config/ProfileCaptive.json}") + private String captiveProfileFileName; @Value("${tip.wlan.ovsdb.locationFileName:/app/config/LocationBuildingExample.json}") private String locationFileName; @@ -86,6 +91,16 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr List radiusProfiles = com.telecominfraproject.wlan.profile.models.Profile .listFromFile(radiusProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class); + + + List captiveProfiles = null; + File captiveFile = new File(captiveProfileFileName); + if (captiveFile.exists()) { + captiveProfiles = com.telecominfraproject.wlan.profile.models.Profile + .listFromFile(captiveProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class); + } else { + LOG.info("Captive file is not provided"); + } equipment.setProfileId(apProfile.getId()); @@ -99,6 +114,7 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr ret.setSsidProfile(ssidProfiles); ret.setRadiusProfiles(radiusProfiles); ret.setEquipmentLocation(location); + ret.setCaptiveProfiles(captiveProfiles); } catch (IOException e) { LOG.error("Cannot read config file", e); @@ -110,7 +126,7 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr } public void processMqttMessage(String topic, Report report) { - LOG.info("Received PlumeStatsReport on topic {} for ap {}\n{}", topic, report.getNodeID(), report); + LOG.info("LYNN Received PlumeStatsReport on topic {} for ap {}\n{}", topic, report.getNodeID(), report); } public void processMqttMessage(String topic, FlowReport flowReport) { 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 index bf00161..a198a4d 100644 --- 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 @@ -14,5 +14,5 @@ - +