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 94eef33..141836d 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 @@ -71,16 +71,20 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr com.telecominfraproject.wlan.profile.models.Profile apProfile = com.telecominfraproject.wlan.profile.models.Profile .fromFile(apProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class); - com.telecominfraproject.wlan.profile.models.Profile ssidProfile = com.telecominfraproject.wlan.profile.models.Profile - .fromFile(ssidProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class); + List ssidProfiles = com.telecominfraproject.wlan.profile.models.Profile + .listFromFile(ssidProfileFileName, com.telecominfraproject.wlan.profile.models.Profile.class); + + ssidProfiles.stream().forEach(p -> apProfile.getChildProfileIds().add(p.getId())); + + equipment.setProfileId(apProfile.getId()); Location location = Location.fromFile(locationFileName, Location.class); + equipment.setLocationId(location.getId()); + ret = new OpensyncAPConfig(); ret.setCustomerEquipment(equipment); ret.setApProfile(apProfile); - List ssidProfiles = new ArrayList(); - ssidProfiles.add(ssidProfile); ret.setSsidProfile(ssidProfiles); ret.setEquipmentLocation(location); diff --git a/opensync-ext-static/src/main/resources/EquipmentExample.json b/opensync-ext-static/src/main/resources/EquipmentExample.json index c205ea1..2a7028f 100644 --- a/opensync-ext-static/src/main/resources/EquipmentExample.json +++ b/opensync-ext-static/src/main/resources/EquipmentExample.json @@ -2,7 +2,7 @@ "model_type" : "Equipment", "id" : 50, "customerId" : 2, - "profileId" : 2, + "profileId" : null, "locationId" : 8, "equipmentType" : "AP", "inventoryId" : "ap-50", @@ -100,8 +100,8 @@ }, "eirpTxPower" : { "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "auto" : false, + "value" : 10 }, "bestApEnabled" : null, "neighbouringListApConfig" : { @@ -203,7 +203,7 @@ "is5GHzU" : { "model_type" : "RadioConfiguration", "radioType" : "is5GHzU", - "radioAdminState" : "enabled", + "radioAdminState" : "disabled", "fragmentationThresholdBytes" : 2346, "rtsCtsThreshold" : 65535, "autoChannelSelection" : "disabled", diff --git a/opensync-ext-static/src/main/resources/ProfileAPExample.json b/opensync-ext-static/src/main/resources/ProfileAPExample.json index dc2d19a..04f8556 100644 --- a/opensync-ext-static/src/main/resources/ProfileAPExample.json +++ b/opensync-ext-static/src/main/resources/ProfileAPExample.json @@ -46,5 +46,5 @@ }, "createdTimestamp" : 1589567037365, "lastModifiedTimestamp" : 1589567037365, - "childProfileIds" : [ 1 ] + "childProfileIds" : [ ] } \ No newline at end of file diff --git a/opensync-ext-static/src/main/resources/ProfileSsid.json b/opensync-ext-static/src/main/resources/ProfileSsid.json index 1012fcf..24bdf27 100644 --- a/opensync-ext-static/src/main/resources/ProfileSsid.json +++ b/opensync-ext-static/src/main/resources/ProfileSsid.json @@ -1,3 +1,4 @@ +[ { "model_type" : "Profile", "id" : 1, @@ -55,4 +56,181 @@ "createdTimestamp" : 1589567130432, "lastModifiedTimestamp" : 1589567130432, "childProfileIds" : [ ] -} \ No newline at end of file +}, +{ + "model_type" : "Profile", + "id" : 2, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-2", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-2", + "appliedRadios" : [ "is5GHzL", "is5GHzU"], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +, +{ + "model_type" : "Profile", + "id" : 3, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-3u", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-3u", + "appliedRadios" : [ "is5GHzU" ], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +, +{ + "model_type" : "Profile", + "id" : 4, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-4l", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-4l", + "appliedRadios" : [ "is5GHzL" ], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +] \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/EquipmentExample.json b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/EquipmentExample.json index c205ea1..2a7028f 100644 --- a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/EquipmentExample.json +++ b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/EquipmentExample.json @@ -2,7 +2,7 @@ "model_type" : "Equipment", "id" : 50, "customerId" : 2, - "profileId" : 2, + "profileId" : null, "locationId" : 8, "equipmentType" : "AP", "inventoryId" : "ap-50", @@ -100,8 +100,8 @@ }, "eirpTxPower" : { "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "auto" : false, + "value" : 10 }, "bestApEnabled" : null, "neighbouringListApConfig" : { @@ -203,7 +203,7 @@ "is5GHzU" : { "model_type" : "RadioConfiguration", "radioType" : "is5GHzU", - "radioAdminState" : "enabled", + "radioAdminState" : "disabled", "fragmentationThresholdBytes" : 2346, "rtsCtsThreshold" : 65535, "autoChannelSelection" : "disabled", diff --git a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json index dc2d19a..04f8556 100644 --- a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json +++ b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json @@ -46,5 +46,5 @@ }, "createdTimestamp" : 1589567037365, "lastModifiedTimestamp" : 1589567037365, - "childProfileIds" : [ 1 ] + "childProfileIds" : [ ] } \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileSsid.json b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileSsid.json index 1012fcf..24bdf27 100644 --- a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileSsid.json +++ b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileSsid.json @@ -1,3 +1,4 @@ +[ { "model_type" : "Profile", "id" : 1, @@ -55,4 +56,181 @@ "createdTimestamp" : 1589567130432, "lastModifiedTimestamp" : 1589567130432, "childProfileIds" : [ ] -} \ No newline at end of file +}, +{ + "model_type" : "Profile", + "id" : 2, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-2", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-2", + "appliedRadios" : [ "is5GHzL", "is5GHzU"], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +, +{ + "model_type" : "Profile", + "id" : 3, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-3u", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-3u", + "appliedRadios" : [ "is5GHzU" ], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +, +{ + "model_type" : "Profile", + "id" : 4, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-4l", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-4l", + "appliedRadios" : [ "is5GHzL" ], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +] \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker/app/opensync/EquipmentExample.json b/opensync-gateway-static-docker/src/main/docker/app/opensync/EquipmentExample.json index c205ea1..2a7028f 100644 --- a/opensync-gateway-static-docker/src/main/docker/app/opensync/EquipmentExample.json +++ b/opensync-gateway-static-docker/src/main/docker/app/opensync/EquipmentExample.json @@ -2,7 +2,7 @@ "model_type" : "Equipment", "id" : 50, "customerId" : 2, - "profileId" : 2, + "profileId" : null, "locationId" : 8, "equipmentType" : "AP", "inventoryId" : "ap-50", @@ -100,8 +100,8 @@ }, "eirpTxPower" : { "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "auto" : false, + "value" : 10 }, "bestApEnabled" : null, "neighbouringListApConfig" : { @@ -203,7 +203,7 @@ "is5GHzU" : { "model_type" : "RadioConfiguration", "radioType" : "is5GHzU", - "radioAdminState" : "enabled", + "radioAdminState" : "disabled", "fragmentationThresholdBytes" : 2346, "rtsCtsThreshold" : 65535, "autoChannelSelection" : "disabled", diff --git a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json index dc2d19a..04f8556 100644 --- a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json +++ b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json @@ -46,5 +46,5 @@ }, "createdTimestamp" : 1589567037365, "lastModifiedTimestamp" : 1589567037365, - "childProfileIds" : [ 1 ] + "childProfileIds" : [ ] } \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileSsid.json b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileSsid.json index 1012fcf..24bdf27 100644 --- a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileSsid.json +++ b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileSsid.json @@ -1,3 +1,4 @@ +[ { "model_type" : "Profile", "id" : 1, @@ -55,4 +56,181 @@ "createdTimestamp" : 1589567130432, "lastModifiedTimestamp" : 1589567130432, "childProfileIds" : [ ] -} \ No newline at end of file +}, +{ + "model_type" : "Profile", + "id" : 2, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-2", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-2", + "appliedRadios" : [ "is5GHzL", "is5GHzU"], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +, +{ + "model_type" : "Profile", + "id" : 3, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-3u", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-3u", + "appliedRadios" : [ "is5GHzU" ], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +, +{ + "model_type" : "Profile", + "id" : 4, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-4l", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-4l", + "appliedRadios" : [ "is5GHzL" ], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +] \ No newline at end of file diff --git a/opensync-gateway-static-process/src/main/resources/app/opensync/EquipmentExample.json b/opensync-gateway-static-process/src/main/resources/app/opensync/EquipmentExample.json index c205ea1..2a7028f 100644 --- a/opensync-gateway-static-process/src/main/resources/app/opensync/EquipmentExample.json +++ b/opensync-gateway-static-process/src/main/resources/app/opensync/EquipmentExample.json @@ -2,7 +2,7 @@ "model_type" : "Equipment", "id" : 50, "customerId" : 2, - "profileId" : 2, + "profileId" : null, "locationId" : 8, "equipmentType" : "AP", "inventoryId" : "ap-50", @@ -100,8 +100,8 @@ }, "eirpTxPower" : { "model_type" : "AutoOrManualValue", - "auto" : true, - "value" : 18 + "auto" : false, + "value" : 10 }, "bestApEnabled" : null, "neighbouringListApConfig" : { @@ -203,7 +203,7 @@ "is5GHzU" : { "model_type" : "RadioConfiguration", "radioType" : "is5GHzU", - "radioAdminState" : "enabled", + "radioAdminState" : "disabled", "fragmentationThresholdBytes" : 2346, "rtsCtsThreshold" : 65535, "autoChannelSelection" : "disabled", diff --git a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json index dc2d19a..04f8556 100644 --- a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json +++ b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json @@ -46,5 +46,5 @@ }, "createdTimestamp" : 1589567037365, "lastModifiedTimestamp" : 1589567037365, - "childProfileIds" : [ 1 ] + "childProfileIds" : [ ] } \ No newline at end of file diff --git a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileSsid.json b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileSsid.json index 1012fcf..24bdf27 100644 --- a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileSsid.json +++ b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileSsid.json @@ -1,3 +1,4 @@ +[ { "model_type" : "Profile", "id" : 1, @@ -55,4 +56,181 @@ "createdTimestamp" : 1589567130432, "lastModifiedTimestamp" : 1589567130432, "childProfileIds" : [ ] -} \ No newline at end of file +}, +{ + "model_type" : "Profile", + "id" : 2, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-2", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-2", + "appliedRadios" : [ "is5GHzL", "is5GHzU"], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +, +{ + "model_type" : "Profile", + "id" : 3, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-3u", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-3u", + "appliedRadios" : [ "is5GHzU" ], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +, +{ + "model_type" : "Profile", + "id" : 4, + "customerId" : 2, + "profileType" : "ssid", + "name" : "Connectus-local-4l", + "details" : { + "model_type" : "SsidConfiguration", + "sampleDetailsStr" : null, + "ssid" : "Connectus-local-4l", + "appliedRadios" : [ "is5GHzL" ], + "ssidAdminState" : "enabled", + "secureMode" : "wpa2PSK", + "vlanId" : 1, + "keyStr" : "12345678", + "broadcastSsid" : "enabled", + "keyRefresh" : 0, + "noLocalSubnets" : false, + "radiusServiceName" : null, + "captivePortalId" : null, + "bandwidthLimitDown" : 0, + "bandwidthLimitUp" : 0, + "videoTrafficOnly" : false, + "radioBasedConfigs" : { + "is5GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is2dot4GHz" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzU" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + }, + "is5GHzL" : { + "model_type" : "RadioBasedSsidConfiguration", + "enable80211r" : null, + "enable80211k" : null, + "enable80211v" : null + } + }, + "bonjourGatewayProfileId" : null, + "enable80211w" : null, + "wepConfig" : null, + "forwardMode" : null + }, + "createdTimestamp" : 1589567130432, + "lastModifiedTimestamp" : 1589567130432, + "childProfileIds" : [ ] +} +] \ No newline at end of file diff --git a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java index 97e57a2..3d04474 100644 --- a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java +++ b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java @@ -1658,7 +1658,7 @@ public class OvsdbDao { if (txPower > 0) updateColumns.put("tx_power", new Atom(txPower)); else - updateColumns.put("tx_power", new Atom(1)); + updateColumns.put("tx_power", new com.vmware.ovsdb.protocol.operation.notation.Set()); Row row = new Row(updateColumns); operations.add(new Update(wifiRadioConfigDbTable, conditions, row)); @@ -1669,7 +1669,7 @@ public class OvsdbDao { LOG.debug("Provisioned channel {} for {}", channel, configName); for (OperationResult res : result) { - LOG.debug("MJH Op Result {}", res); + LOG.debug("Op Result {}", res); } } @@ -1693,7 +1693,8 @@ public class OvsdbDao { updateColumns.put("ssid", new Atom<>(ssid)); updateColumns.put("ssid_broadcast", new Atom<>(ssidBroadcast ? "enabled" : "disabled")); updateColumns.put("uapsd_enable", new Atom<>(true)); - updateColumns.put("vif_radio_idx", new Atom<>(vifRadioIdx)); + updateColumns.put("vif_radio_idx", new Atom(vifRadioIdx)); + updateColumns.put("vlan_id", new Atom<>(vlanId)); @SuppressWarnings("unchecked") @@ -1766,24 +1767,35 @@ public class OvsdbDao { public void configureSsids(OvsdbClient ovsdbClient, OpensyncAPConfig opensyncApConfig) { - Map provisionedWifiVifConfigs = getProvisionedWifiVifConfigs(ovsdbClient); - Map provisionedWifiRadioConfigs = getProvisionedWifiRadioConfigs(ovsdbClient); - LOG.debug("Existing WifiVifConfigs: {}", provisionedWifiVifConfigs.keySet()); - - boolean rrmEnabled = false; - if (opensyncApConfig.getEquipmentLocation() != null && - opensyncApConfig.getEquipmentLocation().getDetails() != null) { - rrmEnabled = opensyncApConfig.getEquipmentLocation().getDetails().isRrmEnabled(); - } + boolean rrmEnabled = false; + if (opensyncApConfig.getEquipmentLocation() != null + && opensyncApConfig.getEquipmentLocation().getDetails() != null) { + rrmEnabled = opensyncApConfig.getEquipmentLocation().getDetails().isRrmEnabled(); + } for (Profile ssidProfile : opensyncApConfig.getSsidProfile()) { + Map provisionedWifiVifConfigs = getProvisionedWifiVifConfigs(ovsdbClient); + LOG.debug("Existing WifiVifConfigs: {}", provisionedWifiVifConfigs.keySet()); + SsidConfiguration ssidConfig = (SsidConfiguration) ssidProfile.getDetails(); + for (RadioType radioType : ssidConfig.getAppliedRadios()) { + + Map provisionedWifiRadioConfigs = getProvisionedWifiRadioConfigs( + ovsdbClient); + boolean ssidBroadcast = ssidConfig.getBroadcastSsid() == StateSetting.enabled; Map security = new HashMap<>(); + String ssidSecurityMode = ssidConfig.getSecureMode().name(); + String opensyncSecurityMode = "OPEN"; - security.put("encryption", ssidConfig.getSecureMode().name()); + if (ssidSecurityMode.equalsIgnoreCase("wpaPSK") || ssidSecurityMode.equalsIgnoreCase("wpa2PSK")) + opensyncSecurityMode = "WPA-PSK"; + else if (ssidSecurityMode.equalsIgnoreCase("wep")) + opensyncSecurityMode = "WEP"; + + security.put("encryption", opensyncSecurityMode); security.put("key", ssidConfig.getKeyStr()); security.put("mode", Long.toString(ssidConfig.getSecureMode().getId())); String bridge = brHome;