Compare commits

...

17 Commits

Author SHA1 Message Date
ralphlee
d3079926ff [WIFI-7579] Fix remote firmware service 2022-04-11 20:18:56 -04:00
ralphlee
a914a18564 Merge branch 'release/v1.2' of github.com:Telecominfraproject/wlan-cloud-services into WIFI-7579-update-default-auto-upgrade 2022-04-11 20:18:31 -04:00
ralphlee3
0bfdfc2d56 [WIFI-7580] Force unique active client session (#177) 2022-04-11 15:39:11 -04:00
ralphlee3
f64816dbbe [WIFI-7579] Add API to update default auto-upgrade settings (#176) 2022-04-11 11:48:30 -04:00
ralphlee
3420a2c593 [WIFI-7579] Add API to update default auto-upgrade settings 2022-04-11 11:42:15 -04:00
Dmitry Toptygin
f87600d283 WIFI-7556 updated spring-boot version to 2.5.12 (spring 5.3.18) to cover for Springshell vulnerability (#175) 2022-04-05 13:56:25 -04:00
ralphlee3
9d19a6c436 [WIFI-7445] Clean up client sessions when equipment is deleted (#174) 2022-03-24 13:21:16 -04:00
ralphlee3
eb19907513 [WIFI-7323] do not automatically delete PROTOCOL status on AP disconnect (#173) 2022-03-18 17:19:03 -04:00
ralphlee3
1502913097 [WIFI-6855] Add support for when Passpoint profile is updated without any detail changes (#172) 2022-02-02 16:36:08 -05:00
ralphlee
27e7c0173a Adding additional radius proxy fields in yaml 2022-01-14 15:18:50 -05:00
norm-traxler
051458b9d4 Merge pull request #171 from Telecominfraproject/WIFI-6721-manual-radproxy
[WIFI-6721] Add support for manual radproxy, radproxy secret
2022-01-14 08:44:39 -05:00
ralphlee
d98d5a2ad3 [WIFI-6721] Add support for manual radproxy, radproxy secret 2022-01-13 23:00:39 -05:00
Thomas-Leung2021
dda25eac2e Merge pull request #170 from Telecominfraproject/WIFI-3589
[WIFI-3589] update EquipmentChannelStatusData and yaml files for supporting channelBandwidth status in AP
2021-11-15 13:59:11 -05:00
Thomas Leung
c8c3e85a55 Merged in NETEXP-3580 (pull request #34)
[NETEXP-3580] Opensync: update EquipmentChannelStatusData and yaml files for supporting channelBandwidth status in AP

Approved-by: mike.hansen
2021-11-15 13:55:45 -05:00
norm-traxler
d5df9485f6 Merge pull request #169 from Telecominfraproject/WIFI-5424
WIFI-5424 Max Auto Cell Size in RF Profile should be non-configurable…
2021-11-02 12:04:00 -04:00
Lynn Shi
83e4f3613a WIFI-5424 Max Auto Cell Size in RF Profile should be non-configurable parameter 2021-11-02 11:56:37 -04:00
norm-traxler
aa77c4a2d5 Merge pull request #168 from Telecominfraproject/InventoryIdFix
Changing BE code to trim the name and inventoryId
2021-10-28 16:34:16 -04:00
24 changed files with 375 additions and 119 deletions

View File

@@ -262,7 +262,7 @@ public class AlarmController {
public AlarmCounts getAlarmCounts(@RequestParam int customerId,
@RequestParam Set<Long> equipmentIdSet,
@RequestParam Set<AlarmCode> alarmCodeSet,
@RequestParam Boolean acknowledged) {
@RequestParam(required = false) Boolean acknowledged) {
LOG.debug("Getting Alarm counts for {} {} {} {}", customerId, equipmentIdSet, alarmCodeSet, acknowledged);

View File

@@ -24,6 +24,7 @@ import com.telecominfraproject.wlan.client.models.events.ClientChangedEvent;
import com.telecominfraproject.wlan.client.models.events.ClientRemovedEvent;
import com.telecominfraproject.wlan.client.models.events.ClientSessionChangedEvent;
import com.telecominfraproject.wlan.client.models.events.ClientSessionRemovedEvent;
import com.telecominfraproject.wlan.client.session.models.AssociationState;
import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherInterface;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
@@ -351,6 +352,8 @@ public class ClientController {
throw new DsDataValidationException("Client session contains unsupported value");
}
forceDisconnectOtherClientSessions(clientSession);
ClientSession ret = clientDatastore.updateSession(clientSession);
LOG.debug("Updated Client session {}", ret);
@@ -384,6 +387,8 @@ public class ClientController {
throw new DsDataValidationException("Client session contains unsupported value");
}
clientSessions.forEach(s -> forceDisconnectOtherClientSessions(s));
ListOfClientSessions ret = new ListOfClientSessions();
ret.addAll(clientDatastore.updateSessions(clientSessions));
@@ -460,5 +465,39 @@ public class ClientController {
}
}
/**
* Force disconnects other client sessions with the same client Mac address.
* In an ideal world, this doesn't happen often.
* This usually happens when a client is roaming from one AP to another and the AP does not send a
* disconnect until much later (5+ minutes timeout on the AP).
* Also happens if the AP was disconnected from the cloud from some time and we "missed" the disconnect event.
* @param clientSession
*/
private void forceDisconnectOtherClientSessions(ClientSession clientSession) {
if (clientSession.getDetails().getAssociationState() != AssociationState._802_11_Associated) {
// updating a session that is not associated should not disconnect other sessions
return;
}
List<ClientSession> allSessions = clientDatastore.getSessions(clientSession.getCustomerId(), Set.of(clientSession.getMacAddress()));
if (allSessions == null) {
return;
}
for (ClientSession cl : allSessions) {
if (cl.getEquipmentId() == clientSession.getEquipmentId()) {
// Don't disconnect ourselves!
continue;
}
if (cl.getDetails().getAssociationState() == AssociationState._802_11_Associated) {
// Force disconnect this client session:
LOG.info("Forcing a Disconnect of Client session {}", cl);
cl.getDetails().setAssociationState(AssociationState.Disconnected);
cl.setLastModifiedTimestamp(System.currentTimeMillis());
updateSession(cl);
}
}
}
}

View File

@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -32,8 +33,8 @@ public class CloudEventDispatcherController {
private static final Logger LOG = LoggerFactory.getLogger(CloudEventDispatcherController.class);
@Autowired @Qualifier("metricStreamInterface") private StreamInterface<ServiceMetric> metricStream;
@Autowired @Qualifier("eventStreamInterface") private StreamInterface<SystemEventRecord> systemEventStream;
@Autowired @Qualifier("metricStreamInterface") @Lazy private StreamInterface<ServiceMetric> metricStream;
@Autowired @Qualifier("eventStreamInterface") @Lazy private StreamInterface<SystemEventRecord> systemEventStream;
@Autowired private ServiceMetricServiceInterface serviceMetricInterface;
@Autowired private SystemEventServiceInterface systemEventInterface;

View File

@@ -3422,6 +3422,16 @@ components:
type: integer
format: int64
ChannelBandwidthPerRadioTypeMap:
properties:
is5GHz:
$ref: '#/components/schemas/ChannelBandwidth'
is5GHzU:
$ref: '#/components/schemas/ChannelBandwidth'
is5GHzL:
$ref: '#/components/schemas/ChannelBandwidth'
is2dot4GHz:
$ref: '#/components/schemas/ChannelBandwidth'
EquipmentAdminStatusData:
type: object
@@ -4381,6 +4391,8 @@ components:
- RADIO_CHANNEL
channelNumberStatusDataMap:
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
channelBandwidthStatusDataMap:
$ref: '#/components/schemas/ChannelBandwidthPerRadioTypeMap'
txPowerDataMap:
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
@@ -5675,28 +5687,5 @@ paths:
items:
$ref: '#/components/schemas/GenericResponse'
500:
$ref: '#/components/responses/GenericApiError'
$ref: '#/components/responses/GenericApiError'

View File

@@ -209,6 +209,7 @@ public class CustomerFirmwareTrackDAO extends BaseJdbcDao {
return copy;
}
@Transactional(noRollbackFor = { EmptyResultDataAccessException.class })
public CustomerFirmwareTrackRecord getCustomerFirmwareTrackRecord(int customerId) {
CustomerFirmwareTrackRecord ret = null;
try {

View File

@@ -57,6 +57,7 @@ public interface FirmwareServiceInterface {
CustomerFirmwareTrackRecord updateCustomerFirmwareTrackRecord(CustomerFirmwareTrackRecord record);
CustomerFirmwareTrackRecord deleteCustomerFirmwareTrackRecord(int customerId);
CustomerFirmwareTrackSettings getDefaultCustomerTrackSetting();
CustomerFirmwareTrackSettings updateDefaultCustomerTrackSetting(CustomerFirmwareTrackSettings defaultSettings);
/**
* @param equipmentType

View File

@@ -81,6 +81,9 @@ public class FirmwareServiceLocal implements FirmwareServiceInterface {
public CustomerFirmwareTrackSettings getDefaultCustomerTrackSetting() {
return firmwareController.getDefaultCustomerTrackSetting();
}
public CustomerFirmwareTrackSettings updateDefaultCustomerTrackSetting(CustomerFirmwareTrackSettings defaultSettings) {
return firmwareController.updateDefaultCustomerTrackSetting(defaultSettings);
}
public CustomerFirmwareTrackRecord getCustomerFirmwareTrackRecord(int customerId) {
return firmwareController.getCustomerFirmwareTrackRecord(customerId);
}

View File

@@ -387,6 +387,23 @@ public class FirmwareServiceRemote extends BaseRemoteClient implements FirmwareS
return ret;
}
@Override
public CustomerFirmwareTrackSettings updateDefaultCustomerTrackSetting(CustomerFirmwareTrackSettings defaultSettings) {
LOG.debug("calling updateDefaultCustomerTrackSetting {} ", defaultSettings);
HttpEntity<String> request = new HttpEntity<String>( defaultSettings.toString(), headers );
ResponseEntity<CustomerFirmwareTrackSettings> responseEntity = restTemplate.exchange(
getBaseUrl()
+"/customerTrack/default", HttpMethod.PUT, request,
CustomerFirmwareTrackSettings.class);
CustomerFirmwareTrackSettings ret = responseEntity.getBody();
LOG.debug("completed updateDefaultCustomerTrackSetting {} ", ret);
return ret;
}
}

View File

@@ -25,6 +25,7 @@ import com.telecominfraproject.wlan.datastore.exceptions.DsConcurrentModificatio
import com.telecominfraproject.wlan.datastore.exceptions.DsDuplicateEntityException;
import com.telecominfraproject.wlan.datastore.exceptions.DsEntityNotFoundException;
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackRecord;
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackSettings;
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackSettings.TrackFlag;
import com.telecominfraproject.wlan.firmware.models.FirmwareTrackAssignmentDetails;
import com.telecominfraproject.wlan.firmware.models.FirmwareTrackAssignmentRecord;
@@ -276,6 +277,47 @@ public class FirmwareServiceRemoteTest extends BaseRemoteTest {
assertNull(res);
}
@Test
public void testCreateUpdateDefaultCustomerFirmwareTrackSettings() {
// test initialization
FirmwareTrackRecord ftr = new FirmwareTrackRecord();
ftr.setTrackName("DEFAULT");
ftr = remoteInterface.createFirmwareTrack(ftr);
CustomerFirmwareTrackSettings track1 = remoteInterface.getDefaultCustomerTrackSetting();
assertEquals(TrackFlag.NEVER, track1.getAutoUpgradeDeprecatedOnBind());
assertEquals(TrackFlag.NEVER, track1.getAutoUpgradeUnknownOnBind());
assertEquals(TrackFlag.NEVER, track1.getAutoUpgradeDeprecatedDuringMaintenance());
assertEquals(TrackFlag.NEVER, track1.getAutoUpgradeUnknownDuringMaintenance());
// test persistent save
CustomerFirmwareTrackRecord defaultCustomerSettings = remoteInterface.getCustomerFirmwareTrackRecord(0);
assertEquals(track1, defaultCustomerSettings.getSettings());
// test update
track1.setAutoUpgradeDeprecatedOnBind(TrackFlag.ALWAYS);
CustomerFirmwareTrackSettings track2 = remoteInterface.updateDefaultCustomerTrackSetting(track1);
assertEquals(TrackFlag.ALWAYS, track2.getAutoUpgradeDeprecatedOnBind());
assertEquals(TrackFlag.NEVER, track2.getAutoUpgradeUnknownOnBind());
assertEquals(TrackFlag.NEVER, track2.getAutoUpgradeDeprecatedDuringMaintenance());
assertEquals(TrackFlag.NEVER, track2.getAutoUpgradeUnknownDuringMaintenance());
defaultCustomerSettings = remoteInterface.getCustomerFirmwareTrackRecord(0);
assertEquals(track2, defaultCustomerSettings.getSettings());
// Delete test
remoteInterface.deleteCustomerFirmwareTrackRecord(0);
// test update initialization
CustomerFirmwareTrackSettings track3 = remoteInterface.updateDefaultCustomerTrackSetting(track2);
assertEquals(track3, track2);
// Clean up test
remoteInterface.deleteCustomerFirmwareTrackRecord(0);
remoteInterface.deleteFirmwareTrackRecord(ftr.getRecordId());
}
@Test
public void testCreateUpdateDeleteFirmwareTrackAssignment() {

View File

@@ -2,8 +2,6 @@ package com.telecominfraproject.wlan.firmware.controller;
import java.util.List;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -22,11 +20,11 @@ import com.telecominfraproject.wlan.datastore.exceptions.DsEntityNotFoundExcepti
import com.telecominfraproject.wlan.firmware.datastore.FirmwareDatastore;
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackRecord;
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackSettings;
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackSettings.TrackFlag;
import com.telecominfraproject.wlan.firmware.models.FirmwareTrackAssignmentDetails;
import com.telecominfraproject.wlan.firmware.models.FirmwareTrackAssignmentRecord;
import com.telecominfraproject.wlan.firmware.models.FirmwareTrackRecord;
import com.telecominfraproject.wlan.firmware.models.FirmwareVersion;
import com.telecominfraproject.wlan.firmware.models.CustomerFirmwareTrackSettings.TrackFlag;
import com.telecominfraproject.wlan.systemevent.models.SystemEvent;
@@ -44,35 +42,11 @@ public class FirmwareController {
@Autowired private FirmwareDatastore firmwareDatastore;
@Autowired private CloudEventDispatcherInterface cloudEventDispatcher;
@Autowired Environment environment;
CustomerFirmwareTrackSettings defaultCustomerTrackSettings;
@PostConstruct
private void postConstruct() {
defaultCustomerTrackSettings = new CustomerFirmwareTrackSettings();
defaultCustomerTrackSettings.setAutoUpgradeDeprecatedOnBind(environment
.getProperty("whizcontrol.autoupgrade.deprecated", TrackFlag.class, TrackFlag.NEVER));
defaultCustomerTrackSettings.setAutoUpgradeUnknownOnBind(environment
.getProperty("whizcontrol.autoupgrade.unknown", TrackFlag.class, TrackFlag.NEVER));
defaultCustomerTrackSettings.setAutoUpgradeDeprecatedDuringMaintenance(environment.getProperty(
"whizcontrol.maintenanceupgrade.deprecated", TrackFlag.class, TrackFlag.NEVER));
defaultCustomerTrackSettings.setAutoUpgradeUnknownDuringMaintenance(environment
.getProperty("whizcontrol.maintenanceupgrade.unknown", TrackFlag.class, TrackFlag.NEVER));
LOG.info("Default CustomerFirmwareTrackSettings: {}", defaultCustomerTrackSettings);
}
private void publishEvent(SystemEvent event) {
if (event == null) {
return;
}
try {
cloudEventDispatcher.publishEvent(event);
} catch (Exception e) {
LOG.error("Failed to publish event : {}", event, e);
}
}
/*
* FirmwareVersion API
*/
@RequestMapping(value = "/version", method = RequestMethod.POST)
public FirmwareVersion createFirmwareVersion(@RequestBody FirmwareVersion firmwareVersion) {
@@ -149,6 +123,10 @@ public class FirmwareController {
return ret;
}
/*
* FirmwareTrackRecord API
*/
@RequestMapping(value = "/track", method = RequestMethod.POST)
public FirmwareTrackRecord createFirmwareTrack(@RequestBody FirmwareTrackRecord firmwareTrack) {
LOG.debug("calling createFirmwareTrack({})", firmwareTrack);
@@ -193,7 +171,10 @@ public class FirmwareController {
return result;
}
/*
* FirmwareTrackAssignmentDetails API
*/
@RequestMapping(value = "/trackAssignment", method = RequestMethod.GET)
public List<FirmwareTrackAssignmentDetails> getFirmwareTrackAssignments (
@RequestParam String firmwareTrackName) {
@@ -220,33 +201,50 @@ public class FirmwareController {
FirmwareTrackAssignmentDetails result = new FirmwareTrackAssignmentDetails(assignment, version);
return result;
}
/*
* CustomerFirmwareTrackSettings API
*/
@RequestMapping(value = "/customerTrack/default", method = RequestMethod.GET)
public CustomerFirmwareTrackSettings getDefaultCustomerTrackSetting() {
if (defaultCustomerTrackSettings == null) {
if (defaultCustomerTrackSettings == null) {
defaultCustomerTrackSettings = new CustomerFirmwareTrackSettings();
defaultCustomerTrackSettings.setAutoUpgradeDeprecatedOnBind(environment
.getProperty("whizcontrol.autoupgrade.deprecated", TrackFlag.class, TrackFlag.NEVER));
defaultCustomerTrackSettings.setAutoUpgradeUnknownOnBind(environment
.getProperty("whizcontrol.autoupgrade.unknown", TrackFlag.class, TrackFlag.NEVER));
defaultCustomerTrackSettings.setAutoUpgradeDeprecatedDuringMaintenance(environment.getProperty(
"whizcontrol.maintenanceupgrade.deprecated", TrackFlag.class, TrackFlag.NEVER));
defaultCustomerTrackSettings.setAutoUpgradeUnknownDuringMaintenance(environment
.getProperty("whizcontrol.maintenanceupgrade.unknown", TrackFlag.class, TrackFlag.NEVER));
LOG.info("Default CustomerFirmwareTrackSettings: {}", defaultCustomerTrackSettings);
}
CustomerFirmwareTrackRecord defaultRecord = firmwareDatastore.getCustomerFirmwareTrackRecord(0);
if (defaultRecord == null) {
LOG.debug("No default record exists, creating the default");
defaultRecord = new CustomerFirmwareTrackRecord();
defaultRecord.setCustomerId(0);
CustomerFirmwareTrackSettings defaultSettings = new CustomerFirmwareTrackSettings();
defaultSettings.setAutoUpgradeDeprecatedOnBind(TrackFlag.NEVER);
defaultSettings.setAutoUpgradeUnknownOnBind(TrackFlag.NEVER);
defaultSettings.setAutoUpgradeDeprecatedDuringMaintenance(TrackFlag.NEVER);
defaultSettings.setAutoUpgradeUnknownDuringMaintenance(TrackFlag.NEVER);
defaultRecord.setSettings(defaultSettings);
defaultRecord.setTrackRecordId(firmwareDatastore.getFirmwareTrackByName("DEFAULT").getRecordId());
defaultRecord = firmwareDatastore.createCustomerFirmwareTrackRecord(defaultRecord);
}
return defaultCustomerTrackSettings;
return defaultRecord.getSettings();
}
@RequestMapping(value = "/customerTrack/default", method = RequestMethod.PUT)
public CustomerFirmwareTrackSettings updateDefaultCustomerTrackSetting(@RequestBody CustomerFirmwareTrackSettings customerTrackSettings) {
CustomerFirmwareTrackRecord defaultRecord = firmwareDatastore.getCustomerFirmwareTrackRecord(0);
if (defaultRecord == null) {
defaultRecord = new CustomerFirmwareTrackRecord();
defaultRecord.setCustomerId(0);
defaultRecord.setSettings(customerTrackSettings);
defaultRecord.setTrackRecordId(firmwareDatastore.getFirmwareTrackByName("DEFAULT").getRecordId());
return firmwareDatastore.createCustomerFirmwareTrackRecord(defaultRecord).getSettings();
}
defaultRecord.setSettings(customerTrackSettings);
return firmwareDatastore.updateCustomerFirmwareTrackRecord(defaultRecord).getSettings();
}
@RequestMapping(value = "/customerTrack", method = RequestMethod.GET)
public CustomerFirmwareTrackRecord getCustomerFirmwareTrackRecord(@RequestParam int customerId) {
LOG.debug("calling getCustomerFirmwareTrackRecord({})", customerId);
return firmwareDatastore.getCustomerFirmwareTrackRecord(customerId);
}
@RequestMapping(value = "/customerTrack", method = RequestMethod.POST)
public CustomerFirmwareTrackRecord createCustomerFirmwareTrackRecord(@RequestBody CustomerFirmwareTrackRecord customerTrack) {
@@ -255,7 +253,6 @@ public class FirmwareController {
return result;
}
@RequestMapping(value = "/customerTrack", method = RequestMethod.PUT)
public CustomerFirmwareTrackRecord updateCustomerFirmwareTrackRecord(@RequestBody CustomerFirmwareTrackRecord customerTrack) {
LOG.debug("calling updateCustomerFirmwareTrackRecord({})", customerTrack);
@@ -270,8 +267,6 @@ public class FirmwareController {
}
return result;
}
@RequestMapping(value = "/customerTrack", method = RequestMethod.DELETE)
public CustomerFirmwareTrackRecord deleteCustomerFirmwareTrackRecord(@RequestParam int customerId) {
@@ -279,6 +274,17 @@ public class FirmwareController {
CustomerFirmwareTrackRecord result = firmwareDatastore.deleteCustomerFirmwareTrackRecord(customerId);
return result;
}
private void publishEvent(SystemEvent event) {
if (event == null) {
return;
}
try {
cloudEventDispatcher.publishEvent(event);
} catch (Exception e) {
LOG.error("Failed to publish event : {}", event, e);
}
}
}

View File

@@ -619,11 +619,12 @@ paths:
$ref: '#/components/schemas/FirmwareTrackAssignmentDetails'
500:
$ref: '#/components/responses/GenericApiError'
/api/firmware/customerTrack/default:
get:
tags:
- Firmware Data
summary: Get customer firmware track settings
summary: Get customer firmware track settings, if it doesn't exist, create it
operationId: getCustomerFirmwareTrackSettings
responses:
200:
@@ -634,6 +635,27 @@ paths:
$ref: '#/components/schemas/CustomerFirmwareTrackSettings'
500:
$ref: '#/components/responses/GenericApiError'
put:
tags:
- Firmware Data
summary: Update customer firmware track settings, if it doesn't exist, create it
operationId: updateCustomerFirmwareTrackSettings
requestBody:
description: CustomerFirmwareTrackSettings
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CustomerFirmwareTrackSettings'
responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/CustomerFirmwareTrackSettings'
500:
$ref: '#/components/responses/GenericApiError'
/api/firmware/customerTrack:
post:

View File

@@ -173,6 +173,11 @@ public class FirmwarePortalController {
return firmwareServiceInterface.getDefaultCustomerTrackSetting();
}
@RequestMapping(value = "/customerTrack/default", method = RequestMethod.PUT)
public CustomerFirmwareTrackSettings updateDefaultCustomerTrackSetting(@RequestBody CustomerFirmwareTrackSettings defaultSettings) {
LOG.debug("calling updateDefaultCustomerTrackSetting({})", defaultSettings);
return firmwareServiceInterface.updateDefaultCustomerTrackSetting(defaultSettings);
}
@RequestMapping(value = "/customerTrack", method = RequestMethod.GET)
public CustomerFirmwareTrackRecord getCustomerFirmwareTrackRecord(@RequestParam int customerId) {

View File

@@ -1804,6 +1804,8 @@ components:
type: boolean
equipmentDiscovery:
type: boolean
dynamicRadiusProxyEnabled:
type: boolean
greTunnelConfigurations:
type: array
items:
@@ -1867,6 +1869,9 @@ components:
sharedSecret:
type: string
format: password
radiusProxySecret:
type: string
format: password
dynamicDiscovery:
description: Dynamic discovery of HSP and IdPs (home service and identity providers). Regardless of configured value, this will only be set 'true' on the AP if useRadSec is also true.
type: boolean
@@ -3330,7 +3335,17 @@ components:
type: integer
format: int64
ChannelBandwidthPerRadioTypeMap:
properties:
is5GHz:
$ref: '#/components/schemas/ChannelBandwidth'
is5GHzU:
$ref: '#/components/schemas/ChannelBandwidth'
is5GHzL:
$ref: '#/components/schemas/ChannelBandwidth'
is2dot4GHz:
$ref: '#/components/schemas/ChannelBandwidth'
EquipmentAdminStatusData:
type: object
properties:
@@ -4318,6 +4333,8 @@ components:
- RADIO_CHANNEL
channelNumberStatusDataMap:
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
channelBandwidthStatusDataMap:
$ref: '#/components/schemas/ChannelBandwidthPerRadioTypeMap'
txPowerDataMap:
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
@@ -10354,7 +10371,7 @@ paths:
get:
tags:
- Firmware Management
summary: Get default settings for handling automatic firmware upgrades
summary: Get default settings for handling automatic firmware upgrades, if it doesn't exist, create it
operationId: getDefaultCustomerTrackSetting
responses:
200:
@@ -10365,6 +10382,27 @@ paths:
$ref: '#/components/schemas/CustomerFirmwareTrackSettings'
500:
$ref: '#/components/responses/GenericApiError'
put:
tags:
- Firmware Management
summary: Update default settings for handling automatic firmware upgrades, if it doesn't exist, create it
operationId: updateDefaultCustomerTrackSetting
requestBody:
description: CustomerFirmwareTrackSettings
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CustomerFirmwareTrackSettings'
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/CustomerFirmwareTrackSettings'
500:
$ref: '#/components/responses/GenericApiError'
/portal/firmware/customerTrack:
post:

View File

@@ -28,6 +28,7 @@ public class ApNetworkConfiguration extends CommonNetworkConfiguration
public static final Boolean DEFAULT_SYNTHETIC_CLIENT_ENABLED = Boolean.TRUE;
public static final Boolean DEFAULT_LED_CONTROL_ENABLED = Boolean.TRUE;
public static final Boolean DEFAULT_EQUIPMENT_DISCOVERY_ENABLED = Boolean.FALSE;
public static final Boolean DEFAULT_DYNAMIC_RADIUS_PROXY_ENABLED = Boolean.FALSE;
/**
* Added as a profile level setting that can be used to provide
@@ -59,6 +60,7 @@ public class ApNetworkConfiguration extends CommonNetworkConfiguration
setSyntheticClientEnabled(DEFAULT_SYNTHETIC_CLIENT_ENABLED);
setLedControlEnabled(DEFAULT_LED_CONTROL_ENABLED);
setEquipmentDiscovery(DEFAULT_EQUIPMENT_DISCOVERY_ENABLED);
setDynamicRadiusProxyEnabled(DEFAULT_DYNAMIC_RADIUS_PROXY_ENABLED);
// initialize the profile level radio map settings parameter
radioMap = new EnumMap<>(RadioType.class);

View File

@@ -23,6 +23,7 @@ public abstract class CommonNetworkConfiguration extends ProfileDetails {
private Boolean syntheticClientEnabled;
private Boolean ledControlEnabled;
private Boolean equipmentDiscovery;
private Boolean dynamicRadiusProxyEnabled;
public CommonNetworkConfiguration() {
}
@@ -67,7 +68,6 @@ public abstract class CommonNetworkConfiguration extends ProfileDetails {
this.vlanNative = bool;
}
public AutoOrManualString getNtpServer() {
return ntpServer;
}
@@ -92,7 +92,6 @@ public abstract class CommonNetworkConfiguration extends ProfileDetails {
this.syntheticClientEnabled = syntheticClientEnabled;
}
public Boolean isLedControlEnabled() {
return ledControlEnabled;
}
@@ -108,6 +107,23 @@ public abstract class CommonNetworkConfiguration extends ProfileDetails {
public void setRtlsSettings(RtlsSettings rtlsSettings) {
this.rtlsSettings = rtlsSettings;
}
public Boolean isDynamicRadiusProxyEnabled() {
return dynamicRadiusProxyEnabled;
}
public void setDynamicRadiusProxyEnabled(Boolean dynamicRadiusProxyEnabled) {
this.dynamicRadiusProxyEnabled = dynamicRadiusProxyEnabled;
}
public Boolean getEquipmentDiscovery() {
return equipmentDiscovery;
}
public void setEquipmentDiscovery(Boolean equipmentDiscovery) {
this.equipmentDiscovery = equipmentDiscovery;
}
@Override
public CommonNetworkConfiguration clone() {
@@ -124,7 +140,9 @@ public abstract class CommonNetworkConfiguration extends ProfileDetails {
ret.setVlan(getVlan());
ret.setVlanNative(isVlanNative());
ret.setSyntheticClientEnabled(getSyntheticClientEnabled());
ret.setLedControlEnabled(isLedControlEnabled());
ret.setEquipmentDiscovery(getEquipmentDiscovery());
ret.setDynamicRadiusProxyEnabled(isDynamicRadiusProxyEnabled());
return ret;
}
@@ -145,26 +163,10 @@ public abstract class CommonNetworkConfiguration extends ProfileDetails {
return false;
}
public Boolean getEquipmentDiscovery() {
return equipmentDiscovery;
}
public void setEquipmentDiscovery(Boolean equipmentDiscovery) {
this.equipmentDiscovery = equipmentDiscovery;
}
public Boolean getVlanNative() {
return vlanNative;
}
@Override
public int hashCode() {
return Objects.hash(equipmentDiscovery, equipmentType, ledControlEnabled, networkConfigVersion, ntpServer, rtlsSettings,
syntheticClientEnabled, syslogRelay, vlan, vlanNative);
syntheticClientEnabled, syslogRelay, vlan, vlanNative, dynamicRadiusProxyEnabled);
}
@Override
@@ -183,7 +185,8 @@ public abstract class CommonNetworkConfiguration extends ProfileDetails {
&& Objects.equals(ntpServer, other.ntpServer) && Objects.equals(rtlsSettings, other.rtlsSettings)
&& Objects.equals(syntheticClientEnabled, other.syntheticClientEnabled)
&& Objects.equals(syslogRelay, other.syslogRelay) && vlan == other.vlan
&& Objects.equals(vlanNative, other.vlanNative);
&& Objects.equals(vlanNative, other.vlanNative)
&& Objects.equals(dynamicRadiusProxyEnabled, other.dynamicRadiusProxyEnabled);
}

View File

@@ -28,6 +28,7 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
private Boolean useRadSec;
private String sharedSecret; // if useRadSec is false
private String acctSharedSecret; // if useRadSec is false
private String radiusProxySecret;
private Boolean dynamicDiscovery; // dynamic discovery of HSP and IdPs (home service and identity providers).
// regardless of configured value, this will only be set 'true' on the AP if useRadSec is also true.
@@ -145,6 +146,14 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
public void setAcctSharedSecret(String acctSharedSecret) {
this.acctSharedSecret = acctSharedSecret;
}
public String getRadiusProxySecret() {
return radiusProxySecret;
}
public void setRadiusProxySecret(String radiusProxySecret) {
this.radiusProxySecret = radiusProxySecret;
}
/**
* @return the dynamicDiscovery
@@ -174,7 +183,7 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
@Override
public int hashCode() {
return Objects.hash(acctPort, acctServer, acctSharedSecret, caCert, clientCert, clientKey, dynamicDiscovery, name, passphrase, port, realm, server,
sharedSecret, useRadSec);
sharedSecret, useRadSec, radiusProxySecret);
}
@Override
@@ -191,7 +200,8 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
&& Objects.equals(clientCert, other.clientCert) && Objects.equals(clientKey, other.clientKey)
&& Objects.equals(dynamicDiscovery, other.dynamicDiscovery) && Objects.equals(name, other.name) && Objects.equals(passphrase, other.passphrase)
&& Objects.equals(port, other.port) && Objects.equals(realm, other.realm) && Objects.equals(server, other.server)
&& Objects.equals(sharedSecret, other.sharedSecret) && Objects.equals(useRadSec, other.useRadSec);
&& Objects.equals(sharedSecret, other.sharedSecret) && Objects.equals(useRadSec, other.useRadSec)
&& Objects.equals(radiusProxySecret, other.radiusProxySecret);
}

View File

@@ -327,17 +327,16 @@ public class RfElementConfiguration extends BaseJsonModel {
this.minAutoCellSize = minAutoCellSize;
}
//Always return default value
public Integer getMaxAutoCellSize() {
if (maxAutoCellSize == null) {
if (MAX_CELL_SIZE_MAP.containsKey(this.radioType)) {
return MAX_CELL_SIZE_MAP.get(this.radioType);
} else {
return MAX_CELL_SIZE_MAP.get(RadioType.is2dot4GHz);
}
if (MAX_CELL_SIZE_MAP.containsKey(this.radioType)) {
return MAX_CELL_SIZE_MAP.get(this.radioType);
} else {
return MAX_CELL_SIZE_MAP.get(RadioType.is2dot4GHz);
}
return maxAutoCellSize;
}
// not allow user to configure
public void setMaxAutoCellSize(Integer maxAutoCellSize) {
this.maxAutoCellSize = maxAutoCellSize;
}

View File

@@ -93,4 +93,16 @@ public class RfConfigurationTests {
assertEquals(Integer.valueOf(23), list2.get(2));
assertEquals(Integer.valueOf(45), list2.get(3));
}
@Test
public void testMaxAutoCellSize() {
RfElementConfiguration rfConfig = RfElementConfiguration.createWithDefaults(RadioType.is5GHz);
assertNotNull(rfConfig.getMaxAutoCellSize());
assertEquals(RfElementConfiguration.DEFAULT_MAX_CELL_SIZE_DB, rfConfig.getMaxAutoCellSize().intValue());
rfConfig.setMaxAutoCellSize(-93);
//getMaxAutoCellSize always return default MaxAutoCellSize
assertEquals(RfElementConfiguration.DEFAULT_MAX_CELL_SIZE_DB, rfConfig.getMaxAutoCellSize().intValue());
}
}

View File

@@ -31,6 +31,7 @@ import com.telecominfraproject.wlan.profile.models.ProfileType;
import com.telecominfraproject.wlan.profile.models.events.ProfileAddedEvent;
import com.telecominfraproject.wlan.profile.models.events.ProfileChangedEvent;
import com.telecominfraproject.wlan.profile.models.events.ProfileRemovedEvent;
import com.telecominfraproject.wlan.profile.passpoint.models.PasspointProfile;
/**
@@ -209,6 +210,20 @@ public class ProfileController {
LOG.error("Failed to update Profile, request contains unsupported value: {}", profile);
throw new DsDataValidationException("Profile contains unsupported value");
}
// WIFI-6855: To handle SSID-Passpoint association update when SSID profiles are updated
// If the passpoint profile update is requested, but no change is made to the details, then skip the update
if (profile.getProfileType().equals(ProfileType.passpoint)) {
Profile existingProfile = profileDatastore.getOrNull(profile.getId());
if (existingProfile != null) {
PasspointProfile existingDetails = (PasspointProfile) existingProfile.getDetails();
PasspointProfile newDetails = (PasspointProfile) profile.getDetails();
if (existingDetails.equals(newDetails)) {
LOG.info("No change was made to this profile, skip update on profile {}", profile.getId());
return profile;
}
}
}
Profile ret = profileDatastore.update(profile);

View File

@@ -167,6 +167,7 @@ public class EquipmentConfigPushTrigger extends StreamProcessor {
private void process(EquipmentRemovedEvent model) {
LOG.debug("Processing EquipmentRemovedEvent");
equipmentGatewayInterface.sendCommand(new CEGWCloseSessionRequest(model.getPayload().getInventoryId(), model.getEquipmentId()));
cleanUpClientSessions(model.getPayload());
}
private void process(ProfileAddedEvent model) {
@@ -294,6 +295,21 @@ public class EquipmentConfigPushTrigger extends StreamProcessor {
} else {
LOG.info("There are no existing client sessions that are not already in Disconnected state.");
}
}
private void cleanUpClientSessions(Equipment ce) {
LOG.info("EquipmentConfigPushTrigger::cleanUpClientSessions for Equipment {}", ce);
PaginationResponse<ClientSession> clientSessions = clientServiceInterface.getSessionsForCustomer(
ce.getCustomerId(), Set.of(ce.getId()), Set.of(ce.getLocationId()), null, null,
new PaginationContext<ClientSession>(100));
if (clientSessions.getItems().isEmpty() || clientSessions == null) {
LOG.info("There are no existing client sessions to clean up.");
return;
}
clientSessions.getItems().stream().forEach(c -> clientServiceInterface.deleteSession(c.getCustomerId(), c.getEquipmentId(), c.getMacAddress()));
LOG.info("Cleaned up client sessions for deleted Equipment {}", ce.getId());
}
}

View File

@@ -4,6 +4,7 @@ import java.util.EnumMap;
import java.util.Map;
import java.util.Objects;
import com.telecominfraproject.wlan.core.model.equipment.ChannelBandwidth;
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
import com.telecominfraproject.wlan.status.models.StatusDataType;
import com.telecominfraproject.wlan.status.models.StatusDetails;
@@ -12,6 +13,7 @@ public class EquipmentChannelStatusData extends StatusDetails {
private static final long serialVersionUID = 470569467119609438L;
private Map<RadioType, Integer> channelNumberStatusDataMap = new EnumMap<>(RadioType.class);
private Map<RadioType, ChannelBandwidth> channelBandwidthStatusDataMap = new EnumMap<>(RadioType.class);
private Map<RadioType, Integer> txPowerDataMap = new EnumMap<>(RadioType.class);
@@ -29,6 +31,7 @@ public class EquipmentChannelStatusData extends StatusDetails {
{
if (data !=null) {
this.channelNumberStatusDataMap.putAll(data.channelNumberStatusDataMap);
this.channelBandwidthStatusDataMap.putAll(data.channelBandwidthStatusDataMap);
}
}
@@ -36,6 +39,10 @@ public class EquipmentChannelStatusData extends StatusDetails {
return channelNumberStatusDataMap;
}
public Map<RadioType, ChannelBandwidth> getChannelBandwidthStatusDataMap() {
return channelBandwidthStatusDataMap;
}
public Map<RadioType, Integer> getTxPowerDataMap() {
return txPowerDataMap;
}
@@ -44,6 +51,10 @@ public class EquipmentChannelStatusData extends StatusDetails {
this.channelNumberStatusDataMap = channelNumberStatusDataMap;
}
public void setChannelBandwidthStatusDataMap(Map<RadioType, ChannelBandwidth> channelBandwidthStatusDataMap) {
this.channelBandwidthStatusDataMap = channelBandwidthStatusDataMap;
}
public void setTxPowerDataMap(Map<RadioType, Integer> txPowerDataMap) {
this.txPowerDataMap = txPowerDataMap;
}
@@ -59,6 +70,14 @@ public class EquipmentChannelStatusData extends StatusDetails {
});
}
if (getChannelBandwidthStatusDataMap() != null) {
result.setChannelBandwidthStatusDataMap(new EnumMap<>(RadioType.class));
this.channelBandwidthStatusDataMap.forEach((k, v) -> {
result.channelBandwidthStatusDataMap.put(k, v);
});
}
if (getTxPowerDataMap() != null) {
result.setTxPowerDataMap(new EnumMap<>(RadioType.class));
@@ -71,7 +90,7 @@ public class EquipmentChannelStatusData extends StatusDetails {
@Override
public int hashCode() {
return Objects.hash(channelNumberStatusDataMap, txPowerDataMap);
return Objects.hash(channelNumberStatusDataMap, channelBandwidthStatusDataMap, txPowerDataMap);
}
@Override
@@ -84,6 +103,7 @@ public class EquipmentChannelStatusData extends StatusDetails {
return false;
EquipmentChannelStatusData other = (EquipmentChannelStatusData) obj;
return Objects.equals(channelNumberStatusDataMap, other.channelNumberStatusDataMap)
&& Objects.equals(channelBandwidthStatusDataMap, other.channelBandwidthStatusDataMap)
&& Objects.equals(txPowerDataMap, other.txPowerDataMap);
}

View File

@@ -64,7 +64,11 @@ public class StatusDataType implements EnumWithId {
/**
* Protocol status
*/
PROTOCOL = new StatusDataType(4, "PROTOCOL", Set.of(StatusTrait.DeleteOnEquipmentDisconnect)) ,
PROTOCOL = new StatusDataType(4, "PROTOCOL"
// some of the properties of this status need to be preserved across equipment connections
// example - reportedCfgDataVersion
//, Set.of(StatusTrait.DeleteOnEquipmentDisconnect)
) ,
/**
* Firmware upgrade status
*/

View File

@@ -257,7 +257,6 @@ public class SystemEventDatastoreInMemory extends BaseInMemoryDatastore implemen
if (mdl.getEventTimestamp() > eqptStats.getLastEventTime()) {
eqptStats.setLastEventTime(mdl.getEventTimestamp());
}
items.add(mdl);
}
List<EquipmentEventStats> equipmentStats = new ArrayList<>();

View File

@@ -3435,7 +3435,17 @@ components:
type: integer
format: int64
ChannelBandwidthPerRadioTypeMap:
properties:
is5GHz:
$ref: '#/components/schemas/ChannelBandwidth'
is5GHzU:
$ref: '#/components/schemas/ChannelBandwidth'
is5GHzL:
$ref: '#/components/schemas/ChannelBandwidth'
is2dot4GHz:
$ref: '#/components/schemas/ChannelBandwidth'
EquipmentAdminStatusData:
type: object
properties:
@@ -4395,6 +4405,8 @@ components:
- RADIO_CHANNEL
channelNumberStatusDataMap:
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
channelBandwidthStatusDataMap:
$ref: '#/components/schemas/ChannelBandwidthPerRadioTypeMap'
txPowerDataMap:
$ref: '#/components/schemas/IntegerPerRadioTypeMap'