mirror of
https://github.com/Telecominfraproject/wlan-cloud-services.git
synced 2026-03-20 17:39:19 +00:00
Compare commits
17 Commits
InventoryI
...
release/v1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df522d58ee | ||
|
|
2f791e1364 | ||
|
|
a792c602df | ||
|
|
0bfdfc2d56 | ||
|
|
f64816dbbe | ||
|
|
f87600d283 | ||
|
|
9d19a6c436 | ||
|
|
eb19907513 | ||
|
|
1502913097 | ||
|
|
27e7c0173a | ||
|
|
051458b9d4 | ||
|
|
d98d5a2ad3 | ||
|
|
dda25eac2e | ||
|
|
c8c3e85a55 | ||
|
|
d5df9485f6 | ||
|
|
83e4f3613a | ||
|
|
aa77c4a2d5 |
@@ -48,16 +48,16 @@ public class AlarmCode implements EnumWithId {
|
||||
private static final Map<Integer, AlarmCode> ELEMENTS = new ConcurrentHashMap<>();
|
||||
private static final Map<String, AlarmCode> ELEMENTS_BY_NAME = new ConcurrentHashMap<>();
|
||||
private static final Map<Integer, AlarmCode> VALID_VALUES = new ConcurrentHashMap<>();
|
||||
|
||||
private static final Map<Integer, AlarmCode> USER_VISIBLE_VALUES = new ConcurrentHashMap<>();
|
||||
|
||||
public static final AlarmCode
|
||||
LimitedCloudConnectivity = new AlarmCode(3, "LimitedCloudConnectivity", "Equipment is connected, however it's not reporting status or metrics", StatusCode.error, "Service AP and verify networking path to cloud"),
|
||||
AccessPointIsUnreachable = new AlarmCode(4, "AccessPointIsUnreachable", "Equipment is not reachable from cloud", StatusCode.error, "Service AP and verify networking path to cloud"),
|
||||
NoMetricsReceived = new AlarmCode(6, "NoMetricsReceived", "Metrics are not received from the equipment"),
|
||||
NoiseFloor2G = new AlarmCode(7, "NoiseFloor2G", "Noise floor is too high on 2G radio", StatusCode.requiresAttention, "Investigate interference sources"),
|
||||
ChannelUtilization2G = new AlarmCode(8, "ChannelUtilization2G", "Channel utilization is too high on 2G radio", StatusCode.requiresAttention, "Consider adding more APs"),
|
||||
NoiseFloor5G = new AlarmCode(9, "NoiseFloor5G", "Noise floor is too high on 5G radio", StatusCode.requiresAttention, "Investigate interference sources"),
|
||||
ChannelUtilization5G = new AlarmCode(10, "ChannelUtilization5G", "Channel utilization is too high on 5G radio", StatusCode.requiresAttention, "Consider adding more APs"),
|
||||
NoMetricsReceived = new AlarmCode(6, "NoMetricsReceived", "Metrics are not received from the equipment", true),
|
||||
NoiseFloor2G = new AlarmCode(7, "NoiseFloor2G", "Noise floor is too high on 2G radio", StatusCode.requiresAttention, "Investigate interference sources", true),
|
||||
ChannelUtilization2G = new AlarmCode(8, "ChannelUtilization2G", "Channel utilization is too high on 2G radio", StatusCode.requiresAttention, "Consider adding more APs", true),
|
||||
NoiseFloor5G = new AlarmCode(9, "NoiseFloor5G", "Noise floor is too high on 5G radio", StatusCode.requiresAttention, "Investigate interference sources", true),
|
||||
ChannelUtilization5G = new AlarmCode(10, "ChannelUtilization5G", "Channel utilization is too high on 5G radio", StatusCode.requiresAttention, "Consider adding more APs", true),
|
||||
DNS = new AlarmCode(11, "DNS", "Issue with Domain Name System (DNS)", StatusCode.error, "Service DNS server and network path"),
|
||||
DNSLatency = new AlarmCode(12, "DNSLatency", "DNS query takes too long", StatusCode.requiresAttention, "Service DNS server and network path"),
|
||||
DHCP = new AlarmCode(13, "DHCP", "Issue with DHCP", StatusCode.error, "Service DHCP server and network path"),
|
||||
@@ -66,10 +66,10 @@ public class AlarmCode implements EnumWithId {
|
||||
RadiusLatency = new AlarmCode(16, "RadiusLatency", "RADIUS request takes too long", StatusCode.requiresAttention, "Service RADIUS server and network path"),
|
||||
CloudLink = new AlarmCode(17, "CloudLink", "Issue reported by equipment with connection with Cloud", StatusCode.error, "Investigate networking path to Cloud"),
|
||||
CloudLinkLatency = new AlarmCode(18, "CloudLinkLatency", "Cloud request take too long", StatusCode.requiresAttention, "Investigate networking path to Cloud"),
|
||||
CPUUtilization = new AlarmCode(19, "CPUUtilization", "CPU utilization is too high", StatusCode.requiresAttention, "Contact Tech Suport"),
|
||||
MemoryUtilization = new AlarmCode(20, "MemoryUtilization", "Memory utilization is too high", StatusCode.requiresAttention, "Contact Tech Suport"),
|
||||
Disconnected = new AlarmCode(22, "Disconnected", "Equipment is not connected to the cloud", StatusCode.error, "Service AP and verify networking path to cloud"),
|
||||
CPUTemperature = new AlarmCode(23, "CPUTemperature", "CPU Temperature is too high", StatusCode.requiresAttention, "Verify AP location"),
|
||||
CPUUtilization = new AlarmCode(19, "CPUUtilization", "CPU utilization is too high", StatusCode.requiresAttention, "Contact Tech Suport", true),
|
||||
MemoryUtilization = new AlarmCode(20, "MemoryUtilization", "Memory utilization is too high", StatusCode.requiresAttention, "Contact Tech Suport", true),
|
||||
Disconnected = new AlarmCode(22, "Disconnected", "Equipment is not connected to the cloud", StatusCode.error, "Service AP and verify networking path to cloud", true),
|
||||
CPUTemperature = new AlarmCode(23, "CPUTemperature", "CPU Temperature is too high", StatusCode.requiresAttention, "Verify AP location", true),
|
||||
LowMemoryReboot = new AlarmCode(25, "LowMemoryReboot", "Equipment rebooted due to low memory"),
|
||||
CountryCodeMisMatch = new AlarmCode(26, "CountryCodeMisMatch", "Equipment country code does not match with location", StatusCode.error, "Service AP"),
|
||||
HardwareIssueDiagnostic = new AlarmCode(29, "HardwareIssueDiagnostic", "Hardware issue encountered on equipment", StatusCode.error, "Reboot AP and contact tech support for RMA"),
|
||||
@@ -131,17 +131,29 @@ public class AlarmCode implements EnumWithId {
|
||||
private final StatusCode severity;
|
||||
private final String recommendedAction;
|
||||
private final AlarmCategory category;
|
||||
private final boolean propagateFast;
|
||||
private final boolean propagateFast;
|
||||
private final boolean userVisible;
|
||||
|
||||
protected AlarmCode(int id, String name, String description){
|
||||
this(id, name, description, StatusCode.error, "", AlarmCategory.CustomerNetworkAffecting, false);
|
||||
this(id, name, description, StatusCode.error, "", AlarmCategory.CustomerNetworkAffecting, false, false);
|
||||
}
|
||||
|
||||
protected AlarmCode(int id, String name, String description, boolean userVisible){
|
||||
|
||||
this(id, name, description, StatusCode.error, "", AlarmCategory.CustomerNetworkAffecting, false, userVisible);
|
||||
|
||||
}
|
||||
|
||||
protected AlarmCode(int id, String name, String description, StatusCode severity, String recommendedAction){
|
||||
this(id, name, description, severity, recommendedAction, AlarmCategory.CustomerNetworkAffecting, false);
|
||||
this(id, name, description, severity, recommendedAction, AlarmCategory.CustomerNetworkAffecting, false, false);
|
||||
}
|
||||
|
||||
protected AlarmCode(int id, String name, String description, StatusCode severity, String recommendedAction, boolean userVisible){
|
||||
this(id, name, description, severity, recommendedAction, AlarmCategory.CustomerNetworkAffecting, false, userVisible);
|
||||
}
|
||||
|
||||
protected AlarmCode(int id, String name, String description, StatusCode severity, String recommendedAction, AlarmCategory category, boolean propagateFast){
|
||||
protected AlarmCode(int id, String name, String description, StatusCode severity, String recommendedAction,
|
||||
AlarmCategory category, boolean propagateFast, boolean userVisible){
|
||||
|
||||
synchronized(lock) {
|
||||
|
||||
@@ -154,6 +166,7 @@ public class AlarmCode implements EnumWithId {
|
||||
this.recommendedAction = recommendedAction;
|
||||
this.category = category;
|
||||
this.propagateFast = propagateFast;
|
||||
this.userVisible = userVisible;
|
||||
|
||||
ELEMENTS_BY_NAME.values().forEach(s -> {
|
||||
if(s.getName().equals(name)) {
|
||||
@@ -179,6 +192,9 @@ public class AlarmCode implements EnumWithId {
|
||||
|
||||
if (!field.isAnnotationPresent(Deprecated.class)) {
|
||||
VALID_VALUES.put(id, this);
|
||||
if (userVisible) {
|
||||
USER_VISIBLE_VALUES.put(id, this);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -232,6 +248,11 @@ public class AlarmCode implements EnumWithId {
|
||||
public boolean isPropagateFast() {
|
||||
return propagateFast;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isUserVisible() {
|
||||
return userVisible;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String name() {
|
||||
@@ -269,6 +290,10 @@ public class AlarmCode implements EnumWithId {
|
||||
public static boolean isUnsupported(AlarmCode value) {
|
||||
return (UNSUPPORTED.equals(value));
|
||||
}
|
||||
|
||||
public static List<AlarmCode> getUserVisibleValues() {
|
||||
return new ArrayList<>(USER_VISIBLE_VALUES.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.SecurityType;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.SteerType;
|
||||
@@ -32,6 +33,7 @@ public class ClientSessionDetails extends BaseJsonModel {
|
||||
private InetAddress ipAddress;
|
||||
private String radiusUsername;
|
||||
private String ssid;
|
||||
private MacAddress bssid;
|
||||
private RadioType radioType;
|
||||
private Long lastEventTimestamp;
|
||||
private String hostname;
|
||||
@@ -410,6 +412,14 @@ public class ClientSessionDetails extends BaseJsonModel {
|
||||
public void setFirstFailureDetails(ClientFailureDetails firstFailureDetails) {
|
||||
this.firstFailureDetails = firstFailureDetails;
|
||||
}
|
||||
|
||||
public MacAddress getBssid() {
|
||||
return bssid;
|
||||
}
|
||||
|
||||
public void setBssid(MacAddress bssid) {
|
||||
this.bssid = bssid;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isTerminated() {
|
||||
@@ -526,7 +536,7 @@ public class ClientSessionDetails extends BaseJsonModel {
|
||||
lastEventTimestamp, lastFailureDetails, lastRxTimestamp, lastTxTimestamp,
|
||||
portEnabledTimestamp, previousValidSessionId, priorEquipmentId, priorSessionId, radioType,
|
||||
radiusUsername, securityType, sessionId, ssid, steerType, timeoutTimestamp, userAgentStr,
|
||||
associationState);
|
||||
associationState, bssid);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -571,7 +581,8 @@ public class ClientSessionDetails extends BaseJsonModel {
|
||||
&& sessionId == other.sessionId && Objects.equals(ssid, other.ssid) && steerType == other.steerType
|
||||
&& Objects.equals(timeoutTimestamp, other.timeoutTimestamp)
|
||||
&& Objects.equals(userAgentStr, other.userAgentStr)
|
||||
&& Objects.equals(associationState, other.associationState);
|
||||
&& Objects.equals(associationState, other.associationState)
|
||||
&& Objects.equals(bssid, other.bssid);
|
||||
|
||||
}
|
||||
|
||||
@@ -724,6 +735,10 @@ public class ClientSessionDetails extends BaseJsonModel {
|
||||
if (null != latest.getUserAgentStr()) {
|
||||
this.userAgentStr = latest.getUserAgentStr();
|
||||
}
|
||||
|
||||
if (null != latest.getBssid()) {
|
||||
this.bssid = latest.bssid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,6 +181,8 @@ components:
|
||||
type: string
|
||||
ssid:
|
||||
type: string
|
||||
bssid:
|
||||
$ref: '#/components/schemas/MacAddress'
|
||||
radioType:
|
||||
$ref: '#/components/schemas/RadioType'
|
||||
lastEventTimestamp:
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -209,6 +209,7 @@ public class CustomerFirmwareTrackDAO extends BaseJdbcDao {
|
||||
return copy;
|
||||
}
|
||||
|
||||
@Transactional(noRollbackFor = { EmptyResultDataAccessException.class })
|
||||
public CustomerFirmwareTrackRecord getCustomerFirmwareTrackRecord(int customerId) {
|
||||
CustomerFirmwareTrackRecord ret = null;
|
||||
try {
|
||||
|
||||
@@ -57,6 +57,7 @@ public interface FirmwareServiceInterface {
|
||||
CustomerFirmwareTrackRecord updateCustomerFirmwareTrackRecord(CustomerFirmwareTrackRecord record);
|
||||
CustomerFirmwareTrackRecord deleteCustomerFirmwareTrackRecord(int customerId);
|
||||
CustomerFirmwareTrackSettings getDefaultCustomerTrackSetting();
|
||||
CustomerFirmwareTrackSettings updateDefaultCustomerTrackSetting(CustomerFirmwareTrackSettings defaultSettings);
|
||||
|
||||
/**
|
||||
* @param equipmentType
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -4381,6 +4398,8 @@ components:
|
||||
type: string
|
||||
ssid:
|
||||
type: string
|
||||
bssid:
|
||||
$ref: '#/components/schemas/MacAddress'
|
||||
radioType:
|
||||
$ref: '#/components/schemas/RadioType'
|
||||
lastEventTimestamp:
|
||||
@@ -10354,7 +10373,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 +10384,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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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<>();
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user