Compare commits

..

16 Commits

Author SHA1 Message Date
ralphlee
f65370a0dd [WIFI-7323] do not automatically delete PROTOCOL status on AP disconnect 2022-03-18 17:14:24 -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
Rahul Sharma
3a4561b323 Changing BE code to trim the name and inventoryId 2021-10-28 16:19:35 -04:00
norm-traxler
7abc4c8554 Merge pull request #167 from Telecominfraproject/WIFI-5112-bugfix-passpoint-ssid-association
[WIFI-5112] Changing associatedAccessSsidProfileIds to Set<Long>
2021-10-26 15:58:38 -04:00
ralphlee
34bec5009a [WIFI-5112] Changing associatedAccessSsidProfileIds to Set<Long> 2021-10-26 14:38:03 -04:00
Thomas-Leung2021
824568a128 Merge pull request #166 from Telecominfraproject/WIFI-3219
[WIFI-3219] throw exception when country code is being updated
2021-10-26 12:39:51 -04:00
Thomas Leung
5211ed7e68 Merged in NETEXP-3325 (pull request #25)
[NETEXP-3325] throw exception when country code is being updated

Approved-by: Norm Traxler
2021-10-26 12:07:06 -04:00
norm-traxler
1bffb4f96a Merge pull request #165 from Telecominfraproject/WIFI-4732-2
Wifi 4732 EquipmentPortalController resets to defaults channels for equipment country change
2021-10-20 16:20:24 -04:00
20 changed files with 207 additions and 145 deletions

View File

@@ -634,7 +634,7 @@ public class AllInOneStartListener implements ApplicationRunner {
((PasspointProfile) passpointHotspotConfig.getDetails()).setPasspointVenueProfileId(passpointVenueProfileId);
((PasspointProfile) passpointHotspotConfig.getDetails()).setOsuSsidProfileId(profileSsidOpenId);
((PasspointProfile) passpointHotspotConfig.getDetails())
.setAssociatedAccessSsidProfileIds(List.of(profileSsidPskId));
.setAssociatedAccessSsidProfileIds(Set.of(profileSsidPskId));
return profileServiceInterface.create(passpointHotspotConfig);
}

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

@@ -263,7 +263,8 @@ public class EquipmentDAO extends BaseJdbcDao {
},
keyHolder);
}catch (DuplicateKeyException e) {
throw new DsDuplicateEntityException(e);
LOG.error("Duplicate equipment found", e);
throw new DsDuplicateEntityException("Equipment with the assetId " + equipment.getInventoryId() + " already exists!");
}
// keyHolder.getKey() now contains the generated key

View File

@@ -88,12 +88,7 @@ public class EquipmentController {
throw new DsDataValidationException("Equipment contains unsupported value");
}
long ts = System.currentTimeMillis();
if (equipment.getCreatedTimestamp() == 0) {
equipment.setCreatedTimestamp(ts);
}
equipment.setLastModifiedTimestamp(ts);
updateValuesIfNeeded(equipment);
Equipment ret = equipmentDatastore.create(equipment);
LOG.debug("Created Equipment {}", ret);
@@ -104,7 +99,24 @@ public class EquipmentController {
return ret;
}
private void updateValuesIfNeeded(Equipment equipment) {
// strip out whitespaces from user entered inventoryId and name strings
if (equipment.getName() != null) {
equipment.setName(equipment.getName().strip());
}
if (equipment.getInventoryId() != null) {
equipment.setInventoryId(equipment.getInventoryId().strip());
}
// Update timestamp
long ts = System.currentTimeMillis();
if (equipment.getCreatedTimestamp() == 0) {
equipment.setCreatedTimestamp(ts);
}
equipment.setLastModifiedTimestamp(ts);
}
/**
* Retrieves Equipment by id
* @param equipmentId

View File

@@ -71,11 +71,33 @@ public class EquipmentControllerTest {
equipmentController.delete(ret.getId());
}
private void assertEqualEquipments(
Equipment expected,
Equipment actual) {
@Test
public void testEquipmentCRUD_ValidateSpaceInInputString() {
//Create new Equipment - success
Equipment equipment = new Equipment();
equipment.setName(" nameAndInventoryIdWithTrailingSpaces ");
equipment.setInventoryId(" C4411EAA31F5 ");
equipment.setEquipmentType(EquipmentType.AP);
Equipment ret = equipmentController.create(equipment);
assertNotNull(ret);
ret = equipmentController.get(ret.getId());
assertEqualEquipments(equipment, ret);
ret = equipmentController.getOrNull(ret.getId());
assertEqualEquipments(equipment, ret);
assertNull(equipmentController.getOrNull(-1));
//Delete - success
equipmentController.delete(ret.getId());
}
private void assertEqualEquipments(Equipment expected, Equipment actual) {
assertEquals(expected.getName(), actual.getName());
//TODO: add more fields to check here
}

View File

@@ -1,30 +0,0 @@
package com.telecominfraproject.wlan.location.models.events;
import com.telecominfraproject.wlan.core.model.json.interfaces.HasLocationId;
import com.telecominfraproject.wlan.location.models.Location;
import com.telecominfraproject.wlan.systemevent.models.CustomerEventWithPayload;
public class LocationChangedApImpactingEvent extends CustomerEventWithPayload<Location> implements HasLocationId {
private static final long serialVersionUID = -8369849230866347412L;
public LocationChangedApImpactingEvent(Location location){
super(location.getCustomerId(), location);
}
@Override
public long getLocationId() {
if (getPayload() != null) {
return getPayload().getId();
}
return 0;
}
/**
* Constructor used by JSON
*/
public LocationChangedApImpactingEvent() {
super(0, 0, null);
}
}

View File

@@ -80,7 +80,7 @@ public class LocationServiceRemoteTest extends BaseRemoteTest {
location.setLocationType(LocationType.FLOOR);
location.setCustomerId(getNextCustomerId());
location.setName("testName_updated");
location.setDetails(generateDetails(CountryCode.US));
location.setDetails(generateDetails(CountryCode.CA));
Location retFromUpdate = testInterface.update(location);
assertFieldEquals(location, retFromUpdate);
@@ -95,6 +95,14 @@ public class LocationServiceRemoteTest extends BaseRemoteTest {
// expected it
}
//UPDATE test - fail because country code cannot be modified once created
try {
location.setDetails(generateDetails(CountryCode.US));
testInterface.update(location);
fail("failed to detect country code update");
} catch (IllegalStateException e) {
// expected it
}
//DELETE Test
testInterface.delete(ret.getId());

View File

@@ -25,7 +25,6 @@ import com.telecominfraproject.wlan.datastore.exceptions.DsEntityNotFoundExcepti
import com.telecominfraproject.wlan.location.datastore.LocationDatastore;
import com.telecominfraproject.wlan.location.models.Location;
import com.telecominfraproject.wlan.location.models.events.LocationAddedEvent;
import com.telecominfraproject.wlan.location.models.events.LocationChangedApImpactingEvent;
import com.telecominfraproject.wlan.location.models.events.LocationChangedEvent;
import com.telecominfraproject.wlan.location.models.events.LocationRemovedEvent;
import com.telecominfraproject.wlan.systemevent.models.SystemEvent;
@@ -97,14 +96,15 @@ public class LocationServiceController {
}
Location existingLocation = locationDatastore.get(location.getId());
if (location.needsToBeUpdatedOnDevice(existingLocation)) {
throw new IllegalStateException("Cannot update location. Country code is not allow to modify once created.");
}
Location ret = locationDatastore.update(location);
List<SystemEvent> events = new ArrayList<>();
if (ret.needsToBeUpdatedOnDevice(existingLocation)) {
events.add(new LocationChangedApImpactingEvent(ret));
}
events.add(new LocationChangedEvent(ret));
publishEvents(events);

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'

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

@@ -63,7 +63,7 @@ public class PasspointProfile extends ProfileDetails implements PushableConfigur
private boolean enable2pt4GHz;
private boolean enable5GHz;
private List<Long> associatedAccessSsidProfileIds;
private Set<Long> associatedAccessSsidProfileIds;
private Long osuSsidProfileId;
@@ -321,11 +321,11 @@ public class PasspointProfile extends ProfileDetails implements PushableConfigur
this.passpointNetworkAuthenticationType = passpointNetworkAuthenticationType;
}
public List<Long> getAssociatedAccessSsidProfileIds() {
public Set<Long> getAssociatedAccessSsidProfileIds() {
return associatedAccessSsidProfileIds;
}
public void setAssociatedAccessSsidProfileIds(List<Long> associatedAccessSsidProfileIds) {
public void setAssociatedAccessSsidProfileIds(Set<Long> associatedAccessSsidProfileIds) {
this.associatedAccessSsidProfileIds = associatedAccessSsidProfileIds;
}

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

@@ -39,7 +39,6 @@ import com.telecominfraproject.wlan.equipmentgateway.models.CEGWConfigChangeNoti
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWNewChannelRequest;
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWCellSizeAttributesRequest;
import com.telecominfraproject.wlan.equipmentgateway.service.EquipmentGatewayServiceInterface;
import com.telecominfraproject.wlan.location.models.events.LocationChangedApImpactingEvent;
import com.telecominfraproject.wlan.profile.ProfileServiceInterface;
import com.telecominfraproject.wlan.profile.models.Profile;
import com.telecominfraproject.wlan.profile.models.events.ProfileAddedEvent;
@@ -92,7 +91,7 @@ public class EquipmentConfigPushTrigger extends StreamProcessor {
|| ser.getDetails() instanceof EquipmentChannelsChangedEvent || ser.getDetails() instanceof EquipmentCellSizeAttributesChangedEvent
|| ser.getDetails() instanceof EquipmentRemovedEvent || ser.getDetails() instanceof ProfileAddedEvent
|| ser.getDetails() instanceof ProfileChangedEvent || ser.getDetails() instanceof ProfileRemovedEvent
|| ser.getDetails() instanceof LocationChangedApImpactingEvent || ser.getDetails() instanceof EquipmentCustomerChangedEvent);
|| ser.getDetails() instanceof EquipmentCustomerChangedEvent);
} else {
ret = false;
}
@@ -133,9 +132,6 @@ public class EquipmentConfigPushTrigger extends StreamProcessor {
case "ProfileRemovedEvent":
process((ProfileRemovedEvent) se);
break;
case "LocationChangedApImpactingEvent":
process((LocationChangedApImpactingEvent) se);
break;
case "EquipmentCustomerChangedEvent":
process((EquipmentCustomerChangedEvent) se);
default:
@@ -222,36 +218,6 @@ public class EquipmentConfigPushTrigger extends StreamProcessor {
LOG.debug("Finished processing profile {}", profile.getId());
}
private void process(LocationChangedApImpactingEvent model) {
LOG.debug("Processing LocationChangedApImpactingEvent {}", model.getPayload().getId());
Set<Long> locationIds = new HashSet<>(Arrays.asList(model.getPayload().getId()));
// go through all equipmentIds that reside in the specified location and trigger change config notification on
// them
PaginationContext<PairLongLong> context = new PaginationContext<>(100);
while (!context.isLastPage()) {
PaginationResponse<PairLongLong> page = equipmentServiceInterface.getEquipmentIdsByLocationIds(locationIds, context);
context = page.getContext();
Set<Long> equipmentIds = new HashSet<>();
page.getItems().forEach(p -> equipmentIds.add(p.getValue2()));
// retrieve full equipment objects to get the inventory id
List<Equipment> equipmentForPage = equipmentServiceInterface.get(equipmentIds);
List<CEGWBaseCommand> commands = new ArrayList<>(equipmentForPage.size());
equipmentForPage.forEach(eq -> commands.add(new CEGWConfigChangeNotification(eq.getInventoryId(), eq.getId())));
equipmentGatewayInterface.sendCommands(commands);
LOG.debug("Page {} - sent {} commands to equipment gateway", context.getLastReturnedPageNumber(), commands.size());
}
LOG.debug("Finished processing LocationChangedApImpactingEvent {}", model.getPayload().getId());
}
private void process(EquipmentCustomerChangedEvent model) {
LOG.info("Processing EquipmentCustomerChangedEvent {}", model.getPayload().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

@@ -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'