Compare commits

..

36 Commits

Author SHA1 Message Date
Lynn Shi
95a07188d5 WIFI-4732 Default 5G backup channel is not applicable to all countries 2021-10-06 15:21:43 -04:00
norm-traxler
6839ff3e97 Merge pull request #159 from Telecominfraproject/WIFI-4422
[WIFI-4422] Performance improvements for gateway
2021-09-27 15:26:13 -04:00
norm-traxler
299f59767e Merge pull request #158 from Telecominfraproject/WIFI-4415
[WIFI-4415] remove unnecessary code
2021-09-27 15:23:43 -04:00
Thomas-Leung2021
936aeae135 [NETEXP-2957] fix failed test 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
5b3d05bc21 [NETEXP-2957] remove numRxData attributes in ClientMetrics.java 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
ee3c62559a [NETEXP-2957] remove rxLastRssi attributes in ClientMetrics.java 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
d3bb9f6e51 [NETEXP-2957] remove classificationName and channelBandwidth attributes in ClientMetrics.java 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
a1ebf265f9 [NETEXP-2957] remove secondsSinceLastRecv attributes 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
64b1432251 [NETEXP-2957] remove rates attribute 2021-09-27 15:03:44 -04:00
Thomas-Leung2021
ccb7680933 [WIFI-4415] remove unnecessary code 2021-09-27 13:33:48 -04:00
norm-traxler
e74570121c Merge pull request #157 from Telecominfraproject/WIFI-4415
[Wifi 4415] Add Gateway and backend support to turn LED on/off
2021-09-27 11:06:09 -04:00
Thomas Leung
b4b697376c Merged in NETEXP-2959 (pull request #10)
NETEXP-2959 Undo blinkLEDs api

Approved-by: mike.hansen
2021-09-24 17:37:14 -04:00
Thomas-Leung2021
b57fb2dd4f Merge branch 'NETEXP-2959' of bitbucket.org:connectustechnologies/wlan-cloud-services into NETEXP-2959 2021-09-24 17:35:42 -04:00
Thomas-Leung2021
d25c1d6167 [WIFI-4415] Undo blinkLEDs api 2021-09-24 17:34:52 -04:00
Thomas-Leung2021
57c2d7d6f4 [NETEXP-2959] update Equipment Profile when blinkAllLEDs changed 2021-09-24 17:21:08 -04:00
norm-traxler
faf0a3a385 Merge pull request #155 from Telecominfraproject/WIFI-4339
WIFI-4339 Moving the AP from one location to another with different C…
2021-09-24 14:59:49 -04:00
norm-traxler
a7a836440e Merge pull request #156 from Telecominfraproject/WIFI-4340
WIFI-4340 Configure Auto Channel Exclusions in RF Profile
2021-09-24 14:59:34 -04:00
Lynn Shi
999e597493 WIFI-4340 Configure Auto Channel Exclusions in RF Profile 2021-09-23 17:19:53 -04:00
Lynn Shi
5f4ed530fe WIFI-4339 Moving the AP from one location to another with different Country code does not trigger reg domain changes on AP 2021-09-23 16:09:08 -04:00
Mike Hansen
0dca8bb943 Merge pull request #154 from Telecominfraproject/WIFI-4152-bugfix-alarm-forCustomer
[WIFI-4152] Removing null entries from alarm Cassandra forCustomer
2021-09-15 13:55:21 -04:00
ralphlee
c8c7217d38 [WIFI-4152] Removing null entries from alarm Cassandra forCustomer 2021-09-15 13:48:47 -04:00
Mike Hansen
b41e35a536 Merge pull request #151 from Telecominfraproject/WIFI-3404
[WIFI-3404] Clean up unused schema definition in yaml files
2021-08-11 08:33:02 -04:00
Mike Hansen
64bd468ade Merge pull request #149 from Telecominfraproject/WIFI-3358
[WIFI-3358] remove more unused attributes in ClientMetrics
2021-08-11 08:32:01 -04:00
Mike Hansen
fe488e9d5f Merge pull request #148 from Telecominfraproject/WIFI-3403
[WIFI-3403] remove unused attributes in RadioStatistics
2021-08-11 08:31:01 -04:00
norm-traxler
a79778b083 Merge pull request #150 from Telecominfraproject/WIFI-3397
Fix to not remove the active sessions.
2021-08-10 22:18:54 -04:00
Thomas-Leung2021
d5b86d0c8d [WIFI-3404] Clean up unused schema definitions for RadioStatistics 2021-08-10 18:43:02 -04:00
Rahul Sharma
15698e99cb Fix to not remove the active sessions.
Also added some more logging
2021-08-10 18:29:47 -04:00
Thomas-Leung2021
e06c28e85a [WIFI-3404] Clean up unused schema definition in yaml files 2021-08-10 18:08:13 -04:00
Thomas-Leung2021
1e23a691d7 [WIFI-3403] remove unused attributes in RadioStatistics 2021-08-10 14:11:32 -04:00
Mike Hansen
015e662e68 Merge pull request #147 from Telecominfraproject/revert-146-revert-144-WIFI-3358
Revert "Revert "[WIFI 3358] Client Metrics report performance improvements""
2021-08-09 19:26:14 -04:00
Mike Hansen
9f3af6773b Revert "Revert "[WIFI 3358] Client Metrics report performance improvements"" 2021-08-09 19:26:00 -04:00
Mike Hansen
b7eedf6b8c Merge pull request #146 from Telecominfraproject/revert-144-WIFI-3358
Revert "[WIFI 3358] Client Metrics report performance improvements"
2021-08-09 19:14:01 -04:00
Mike Hansen
468e7bcddb Revert "[WIFI 3358] Client Metrics report performance improvements" 2021-08-09 19:13:50 -04:00
Mike Hansen
9b712d6fb5 Merge pull request #145 from Telecominfraproject/WIFI-3397
Adding more logging to find the cause of Remote-SSH sessions drop
2021-08-09 18:52:01 -04:00
Mike Hansen
99475d3f2f Merge pull request #144 from Telecominfraproject/WIFI-3358
[WIFI 3358] Client Metrics report performance improvements
2021-08-09 18:49:46 -04:00
Rahul Sharma
7216b08ac7 Adding more logging to find the cause of Remote-SSH sessions drop 2021-08-09 18:35:33 -04:00
20 changed files with 158 additions and 13842 deletions

View File

@@ -795,7 +795,10 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
long equipmentIdPostQuery = row.getLong("equipmentId");
int alarmCodePostQuery = row.getInt("alarmCode");
long createdTimestampPostQuery = row.getLong("createdTimestamp");
pageItems.add(getOrNull(customerId, equipmentIdPostQuery, AlarmCode.getById(alarmCodePostQuery), createdTimestampPostQuery));
Alarm alarmToAdd = getOrNull(customerId, equipmentIdPostQuery, AlarmCode.getById(alarmCodePostQuery), createdTimestampPostQuery);
if (alarmToAdd != null) {
pageItems.add(alarmToAdd);
}
}
break;
default:

View File

@@ -344,7 +344,6 @@ components:
- cyan
- white
- off
CEGWBlinkRequest:
description: Turn all LEDs on the AP to blinking, or turn off. The blinkAllLEDs attribute is the only currently supported functionality on the AP.
allOf:

View File

@@ -309,5 +309,4 @@ public abstract class CommonElementConfiguration extends EquipmentDetails implem
this.blinkAllLEDs = blinkAllLEDs;
}
}

View File

@@ -62,7 +62,7 @@ public class ElementRadioConfiguration extends BaseJsonModel
if (radioType == RadioType.is5GHz) {
returnValue.setChannelNumber(36);
returnValue.setBackupChannelNumber(149);
returnValue.setBackupChannelNumber(44);
} else if (radioType == RadioType.is5GHzL) {
returnValue.setChannelNumber(36);
returnValue.setBackupChannelNumber(44);

View File

@@ -932,9 +932,9 @@ public class EquipmentServiceRemoteTest extends BaseRemoteTest {
assertEquals(11, radioMap.get(RadioType.is2dot4GHz).getManualBackupChannelNumber().intValue());
assertEquals(36, radioMap.get(RadioType.is5GHz).getChannelNumber().intValue());
assertEquals(149, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
assertEquals(44, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
assertEquals(36, radioMap.get(RadioType.is5GHz).getManualChannelNumber().intValue());
assertEquals(149, radioMap.get(RadioType.is5GHz).getManualBackupChannelNumber().intValue());
assertEquals(44, radioMap.get(RadioType.is5GHz).getManualBackupChannelNumber().intValue());
Map<RadioType, Integer> primaryChannels = new EnumMap<>(RadioType.class);
Map<RadioType, Integer> backupChannels = new EnumMap<>(RadioType.class);
@@ -970,7 +970,7 @@ public class EquipmentServiceRemoteTest extends BaseRemoteTest {
assertEquals(6, radioMap.get(RadioType.is2dot4GHz).getManualBackupChannelNumber().intValue());
assertEquals(36, radioMap.get(RadioType.is5GHz).getChannelNumber().intValue());
assertEquals(149, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
assertEquals(44, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
assertEquals(40, radioMap.get(RadioType.is5GHz).getManualChannelNumber().intValue());
assertEquals(48, radioMap.get(RadioType.is5GHz).getManualBackupChannelNumber().intValue());
@@ -980,7 +980,7 @@ public class EquipmentServiceRemoteTest extends BaseRemoteTest {
backupChannels.clear();
backupChannels.put(RadioType.is2dot4GHz, 6);
backupChannels.put(RadioType.is5GHz, 44);
backupChannels.put(RadioType.is5GHz, 149);
autoChannelSelections.clear();
autoChannelSelections.put(RadioType.is2dot4GHz, true);
@@ -1007,7 +1007,7 @@ public class EquipmentServiceRemoteTest extends BaseRemoteTest {
assertEquals(6, radioMap.get(RadioType.is2dot4GHz).getManualBackupChannelNumber().intValue());
assertEquals(161, radioMap.get(RadioType.is5GHz).getChannelNumber().intValue());
assertEquals(44, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
assertEquals(149, radioMap.get(RadioType.is5GHz).getBackupChannelNumber().intValue());
assertEquals(40, radioMap.get(RadioType.is5GHz).getManualChannelNumber().intValue());
assertEquals(48, radioMap.get(RadioType.is5GHz).getManualBackupChannelNumber().intValue());

View File

@@ -283,7 +283,9 @@ public class EquipmentController {
if (ret.getCustomerId() != existingEquipment.getCustomerId()) {
publishEvent(new EquipmentCustomerChangedEvent(existingEquipment, ret));
}
if ((ret.getProfileId() != existingEquipment.getProfileId()) || (existingApElementConfig != null && updatedApElementConfig != null &&
if ((ret.getProfileId() != existingEquipment.getProfileId()) ||
ret.getLocationId() != existingEquipment.getLocationId() ||
(existingApElementConfig != null && updatedApElementConfig != null &&
updatedApElementConfig.needsToBeUpdatedOnDevice(existingApElementConfig))) {
event = new EquipmentApImpactingChangedEvent(ret);
} else if (existingApElementConfig != null && existingApElementConfig.isBlinkAllLEDs() != updatedApElementConfig.isBlinkAllLEDs()) {

View File

@@ -48,11 +48,12 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
* To test this method:
* curl --digest --user user:password --request POST --insecure --header "Content-Type: application/json; charset=utf-8" --data '' https://localhost:7072/api/portFwd/createSession/inventoryId/dev-ap-0001/port/22/
*
* @param inventoryId
* @param connectToPortOnEquipment
* @param inventoryId: Equipment's AssetId
* @param connectToPortOnEquipment: Port to connect on the AP
* @return session id of a newly created forwarder session
*/
public String startForwarderSession(final String inventoryId, int connectToPortOnEquipment){
LOG.debug("Received create Session request for inventoryId {} on port {}", inventoryId, connectToPortOnEquipment);
//inventoryId is used to tie ForwarderSession to WebSocketSession
try {
@@ -191,7 +192,7 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
LOG.debug("[{}] Stopped polling inputstream on local socket {}", inventoryId, localSocket.getPort());
} catch (IOException e) {
LOG.error("[{}] Session {} got exception {} for the socket on port {}", inventoryId, forwarderSession.getSessionId(), e, port);
LOG.error("[{}] Session {} got IOException {} for the socket on port {}", inventoryId, forwarderSession.getSessionId(), port, e);
} finally {
//notify the other end that forwarding session is terminated
@@ -209,7 +210,7 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
localSocket.close();
forwarderSession.getServerSocket().close();
} catch (IOException e) {
//do nothing here
LOG.error("IO Exception when closing socket", e);
}
sessionIdToForwarderSessionMap.remove(forwarderSession.getSessionId());
@@ -232,12 +233,12 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
socketInputStreamReaderThread.setDaemon(true);
forwarderSession.setSocketStreamReaderThread(socketInputStreamReaderThread);
} catch (IOException e) {
LOG.error("[{}] error accepting conection on port {} - closing forwarding session {}", inventoryId, listenOnLocalPort, forwarderSession.getSessionId());
} catch (Exception e) {
LOG.error("[{}] error accepting connection on port {} - closing forwarding session {}", inventoryId, listenOnLocalPort, forwarderSession.getSessionId(), e);
try {
serverSocket.close();
} catch (IOException e1) {
// do nothing here
LOG.error("IO Exception when closing socket", e1);
}
sessionIdToForwarderSessionMap.remove(forwarderSession.getSessionId());
}
@@ -259,6 +260,7 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
}
public void stopForwarderSession(String sessionId){
LOG.debug("Received stop forwarding Session request for sessionId {}", sessionId);
ForwarderSession forwarderSession = sessionIdToForwarderSessionMap.get(sessionId);
if(forwarderSession==null){
LOG.info("Could not find session {}", sessionId);
@@ -266,6 +268,7 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
}
try {
LOG.debug("Found forwarderSession {} for sessionId {}", forwarderSession, sessionId);
//find websocket session by inventoryId and send control messages to disconnect from target port on the client side of the port forwarder
WebSocketSession webSocketSession = webSocketSessionMap.get(forwarderSession.getInventoryId());
TextMessage message = new TextMessage(DISCONNECT_FROM_CE_PORT_COMMAND + forwarderSession.getConnectToPortOnEquipment());
@@ -274,11 +277,11 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
LOG.debug("[{}] Session {} sent command {}", forwarderSession.getInventoryId(), forwarderSession.getSessionId(), message.getPayload());
}
if(forwarderSession.getServerSocket()!=null){
if(forwarderSession.getServerSocket() != null){
forwarderSession.getServerSocket().close();
}
if(forwarderSession.getLocalSocket()!=null){
if(forwarderSession.getLocalSocket() != null){
forwarderSession.getLocalSocket().close();
}
//stream reader will stop in a separate thread by themselves
@@ -286,10 +289,9 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
sessionIdToForwarderSessionMap.remove(forwarderSession.getSessionId());
} catch (IOException e) {
// do nothing here
LOG.error("Encountered IOException when closing connection for forwarder session {}", forwarderSession, e);
sessionIdToForwarderSessionMap.remove(forwarderSession.getSessionId());
}
sessionIdToForwarderSessionMap.remove(forwarderSession.getSessionId());
LOG.info("[{}] Stopped forwarder session {}", forwarderSession.getInventoryId(), sessionId);
}
@@ -322,7 +324,6 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
if(payload.indexOf(':')>0){
port = Integer.parseInt(payload.substring(payload.indexOf(':')+1));
}
//find forwarderSession by inventoryId and CEPort
ForwarderSession forwarderSession = null;
for(ForwarderSession fs: sessionIdToForwarderSessionMap.values()){
@@ -332,7 +333,7 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
}
}
LOG.debug("[{}] Session {} got message {}", webSocketSessionKey, session, payload);
LOG.debug("[{}] Session {} got message {} with forwarderSession {}", webSocketSessionKey, session, payload, forwarderSession);
if(payload.startsWith(CONNECTED_TO_CE_PORT_MSG)){
//start reader thread to forward packets from local socket to websocket
@@ -371,10 +372,8 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
*/
@Override
protected void handleBinaryMessage(WebSocketSession session, BinaryMessage message) throws Exception {
//TODO: may need to have message ack for each binary packet, and do not send the next packet until previous one has been acknowledged
//DT: this has not been an issue so far
String webSocketSessionKey = getWebSocketSessionKey(session);
ByteBuffer payload = message.getPayload();
@@ -384,6 +383,7 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
//find forwarderSession by inventoryId and CEPort
ForwarderSession forwarderSession = null;
for(ForwarderSession fs: sessionIdToForwarderSessionMap.values()){
if(fs.getInventoryId().equals(webSocketSessionKey) && fs.getConnectToPortOnEquipment()==port){
forwarderSession = fs;
@@ -419,6 +419,14 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
}
} else {
LOG.debug("[{}] Session {} received message that cannot be delivered because local socket is inoperable {}", webSocketSessionKey, session, message);
if (forwarderSession == null) {
LOG.debug("forwarderSession not found for webSocketSessionKey {}", webSocketSessionKey);
} else if (forwarderSession.getLocalSocket() == null) {
LOG.debug("forwarderSession local socket is null for webSocketSessionKey {}", webSocketSessionKey);
} else {
LOG.debug("forwarderSession local socket for webSocketSessionKey {} is closed = {} and connected = {} ",
webSocketSessionKey, forwarderSession.getLocalSocket().isClosed(), forwarderSession.getLocalSocket().isConnected());
}
}
}
@@ -442,28 +450,29 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
}
@Override
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception {
LOG.info("[{}] Closed portForwarder websocket connection {} : {}", getWebSocketSessionKey(session), session, closeStatus);
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) {
String webSocketSessionKey = getWebSocketSessionKey(session);
webSocketSessionMap.remove(webSocketSessionKey);
//close and remove all forwarder sessions for that CE
LOG.info("[{}] Closed portForwarder websocket connection {} : {}", webSocketSessionKey, session, closeStatus);
Iterator<ForwarderSession> iter = sessionIdToForwarderSessionMap.values().iterator();
while(iter.hasNext()){
ForwarderSession fs = iter.next();
if(fs.getInventoryId().equals(webSocketSessionKey) ){
if(fs.getLocalSocket()!=null && !fs.getLocalSocket().isClosed()){
fs.getLocalSocket().close();
}
if(fs.getServerSocket()!=null && !fs.getServerSocket().isClosed()){
fs.getServerSocket().close();
webSocketSessionMap.remove(webSocketSessionKey);
//close and remove all forwarder sessions for that CE
try {
Iterator<ForwarderSession> iter = sessionIdToForwarderSessionMap.values().iterator();
while (iter.hasNext()) {
ForwarderSession fs = iter.next();
if (fs.getInventoryId().equals(webSocketSessionKey)) {
if (fs.getLocalSocket() != null && !fs.getLocalSocket().isClosed()) {
fs.getLocalSocket().close();
}
if (fs.getServerSocket() != null && !fs.getServerSocket().isClosed()) {
fs.getServerSocket().close();
}
iter.remove();
}
}
iter.remove();
} catch (Exception ex) {
LOG.error("Encountered exception when closing-sockets and removing sessions for Key {} ", webSocketSessionKey, ex);
}
}
private String getWebSocketSessionKey(WebSocketSession session) {

View File

@@ -12,8 +12,10 @@ import org.springframework.web.bind.annotation.RestController;
import com.telecominfraproject.wlan.core.model.json.GenericResponse;
import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
import com.telecominfraproject.wlan.equipment.models.ApElementConfiguration;
import com.telecominfraproject.wlan.equipment.models.Equipment;
import com.telecominfraproject.wlan.equipment.models.RadioChannelChangeSettings;
import com.telecominfraproject.wlan.equipment.models.events.EquipmentBlinkLEDsEvent;
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWBlinkRequest;
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWCommandResultCode;
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWFirmwareDownloadRequest;
@@ -140,9 +142,9 @@ public class EquipmentGatewayPortalController {
@RequestMapping(value = "/equipmentGateway/requestApBlinkLEDs", method = RequestMethod.POST)
public GenericResponse requestApBlinkLEDs(@RequestParam long equipmentId, @RequestParam boolean blinkAllLEDs) {
String action = "stop blinking LEDs on AP ";
String action = "stop blinking LEDs on AP";
if (blinkAllLEDs)
action = "start blinking LEDs on AP ";
action = "start blinking LEDs on AP";
Equipment equipment = equipmentServiceInterface.get(equipmentId);
LOG.debug("Request {} for AP {}", action, equipment.getInventoryId());
@@ -154,6 +156,9 @@ public class EquipmentGatewayPortalController {
LOG.debug("{} response {}", action, response);
if (response.getResultCode() == CEGWCommandResultCode.Success) {
ApElementConfiguration apElementConfig = (ApElementConfiguration) equipment.getDetails();
apElementConfig.setBlinkAllLEDs(blinkAllLEDs);
equipmentServiceInterface.update(equipment);
return new GenericResponse(true, "");
} else {
return new GenericResponse(false, "Failed to " + action + " for AP: " + response.getResultCode() + " " + response.getResultDetail());

File diff suppressed because it is too large Load Diff

View File

@@ -93,7 +93,7 @@ public abstract class CommonNetworkConfiguration extends ProfileDetails {
}
public Boolean getLedControlEnabled() {
public Boolean isLedControlEnabled() {
return ledControlEnabled;
}

View File

@@ -4,6 +4,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
import com.telecominfraproject.wlan.core.model.equipment.ChannelBandwidth;
import com.telecominfraproject.wlan.core.model.equipment.ChannelHopSettings;
@@ -80,6 +82,8 @@ public class RfElementConfiguration extends BaseJsonModel {
private Boolean useMaxTxPower;
private Integer eirpTxPower;
private RadioBestApSettings bestApSettings;
private Set<Integer> autoExclusionChannels = new TreeSet<Integer>();
private RfElementConfiguration() {
long timestamp = System.currentTimeMillis();
@@ -112,7 +116,7 @@ public class RfElementConfiguration extends BaseJsonModel {
ret.setMinAutoCellSize(MIN_CELL_SIZE_MAP.get(radioType));
ret.setMaxAutoCellSize(MAX_CELL_SIZE_MAP.get(radioType));
if (radioType == RadioType.is5GHz || radioType == RadioType.is5GHzL || radioType == RadioType.is5GHzU) {
ret.setChannelBandwidth(ChannelBandwidth.is80MHz);
ret.setChannelBandwidth(ChannelBandwidth.is40MHz);
ret.setRadioMode(RadioMode.modeAC);
} else {
ret.setChannelBandwidth(ChannelBandwidth.is20MHz);
@@ -362,9 +366,25 @@ public class RfElementConfiguration extends BaseJsonModel {
this.bestApSettings = bestApSettings;
}
public Set<Integer> getAutoExclusionChannels() {
return autoExclusionChannels;
}
public void setAutoExclusionChannels(Set<Integer> autoExclusionChannels) {
if (autoExclusionChannels != null) {
this.autoExclusionChannels.clear();
this.autoExclusionChannels.addAll(autoExclusionChannels);
}
}
@Override
public RfElementConfiguration clone() {
return (RfElementConfiguration) super.clone();
RfElementConfiguration ret = (RfElementConfiguration) super.clone();
if (autoExclusionChannels != null) {
ret.autoExclusionChannels = new TreeSet<>(autoExclusionChannels);
}
return ret;
}
@Override
@@ -409,7 +429,7 @@ public class RfElementConfiguration extends BaseJsonModel {
channelBandwidth, channelHopSettings, clientDisconnectThresholdDb, eirpTxPower, forceScanDuringVoice,
managementRate, maxNumClients, mimoMode, minAutoCellSize, multicastRate, neighbouringListApConfig,
perimeterDetectionEnabled, probeResponseThresholdDb, radioMode, radioType, rf, rtsCtsThreshold,
rxCellSizeDb, autoCellSizeSelection, maxAutoCellSize);
rxCellSizeDb, autoCellSizeSelection, maxAutoCellSize, autoExclusionChannels);
}
@Override
@@ -439,7 +459,8 @@ public class RfElementConfiguration extends BaseJsonModel {
&& Objects.equals(probeResponseThresholdDb, other.probeResponseThresholdDb)
&& radioMode == other.radioMode && radioType == other.radioType && Objects.equals(rf, other.rf)
&& Objects.equals(rtsCtsThreshold, other.rtsCtsThreshold)
&& Objects.equals(rxCellSizeDb, other.rxCellSizeDb);
&& Objects.equals(rxCellSizeDb, other.rxCellSizeDb)
&& Objects.equals(autoExclusionChannels, other.autoExclusionChannels);
}
}

View File

@@ -1,8 +1,16 @@
package com.telecominfraproject.wlan.profile.rf.models;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.junit.Test;
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
@@ -56,4 +64,33 @@ public class RfConfigurationTests {
rfConfig2_4.setRadioMode(RadioMode.modeGN);
rfConfig5.setRadioMode(RadioMode.modeGN);
}
@Test
public void testAutoExclusionChannels() {
RfElementConfiguration rfConfig = RfElementConfiguration.createWithDefaults(RadioType.is5GHz);
assertNotNull(rfConfig.getAutoExclusionChannels());
assertTrue(rfConfig.getAutoExclusionChannels().isEmpty());
Set<Integer> unsortedSet = new HashSet<Integer>(Arrays.asList(1, 23, 45, 12));
rfConfig.setAutoExclusionChannels(unsortedSet);
Set<Integer> sortedSet = rfConfig.getAutoExclusionChannels();
List<Integer> list = new ArrayList<Integer>(sortedSet);
assertEquals(Integer.valueOf(1), list.get(0));
assertEquals(Integer.valueOf(12), list.get(1));
assertEquals(Integer.valueOf(23), list.get(2));
assertEquals(Integer.valueOf(45), list.get(3));
Set<Integer> unsortedSet2 = new HashSet<Integer>(Arrays.asList(10, 45, 23, 12));
rfConfig.setAutoExclusionChannels(unsortedSet2);
Set<Integer> sortedSet2 = rfConfig.getAutoExclusionChannels();
List<Integer> list2 = new ArrayList<Integer>(sortedSet2);
assertEquals(Integer.valueOf(10), list2.get(0));
assertEquals(Integer.valueOf(12), list2.get(1));
assertEquals(Integer.valueOf(23), list2.get(2));
assertEquals(Integer.valueOf(45), list2.get(3));
}
}

View File

@@ -114,10 +114,6 @@ public abstract class BaseServiceMetricDatastoreTest {
serviceMetric.setEquipmentId(testSequence.incrementAndGet());
serviceMetric.setClientMac(testSequence.incrementAndGet());
serviceMetric.setCreatedTimestamp(baseTimestamp - 100000 + testSequence.incrementAndGet());
ClientMetrics details2 = new ClientMetrics();
details2.setClassificationName("qr_"+apNameIdx);
serviceMetric.setDetails(details2);
apNameIdx++;
@@ -132,10 +128,6 @@ public abstract class BaseServiceMetricDatastoreTest {
serviceMetric.setEquipmentId(testSequence.incrementAndGet());
serviceMetric.setClientMac(testSequence.incrementAndGet());
serviceMetric.setCreatedTimestamp(baseTimestamp + testSequence.incrementAndGet());
ClientMetrics details2 = new ClientMetrics();
details2.setClassificationName("qr_"+apNameIdx);
serviceMetric.setDetails(details2);
apNameIdx++;
@@ -150,10 +142,6 @@ public abstract class BaseServiceMetricDatastoreTest {
serviceMetric.setEquipmentId(testSequence.incrementAndGet());
serviceMetric.setClientMac(testSequence.incrementAndGet());
serviceMetric.setCreatedTimestamp(baseTimestamp - 100000 + testSequence.incrementAndGet());
ClientMetrics details2 = new ClientMetrics();
details2.setClassificationName("qr_"+apNameIdx);
serviceMetric.setDetails(details2);
apNameIdx++;
@@ -200,43 +188,18 @@ public abstract class BaseServiceMetricDatastoreTest {
assertTrue(page6.getContext().isLastPage());
assertTrue(page7.getContext().isLastPage());
List<String> expectedPage3Strings = new ArrayList<>(Arrays.asList(new String[]{"qr_20", "qr_21", "qr_22", "qr_23", "qr_24", "qr_25", "qr_26", "qr_27", "qr_28", "qr_29" }));
List<String> actualPage3Strings = new ArrayList<>();
page3.getItems().stream().forEach( ce -> actualPage3Strings.add(((ClientMetrics) ce.getDetails()).getClassificationName()) );
assertEquals(expectedPage3Strings, actualPage3Strings);
//test first page of the results with empty sort order -> default sort order (by createdTimestamp ascending)
PaginationResponse<ServiceMetric> page1EmptySort = testInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, Collections.emptyList(), context);
assertEquals(10, page1EmptySort.getItems().size());
List<String> expectedPage1EmptySortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
List<String> actualPage1EmptySortStrings = new ArrayList<>();
page1EmptySort.getItems().stream().forEach( ce -> actualPage1EmptySortStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
//test first page of the results with null sort order -> default sort order (by createdTimestamp ascending)
PaginationResponse<ServiceMetric> page1NullSort = testInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, null, context);
assertEquals(10, page1NullSort.getItems().size());
List<String> expectedPage1NullSortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
List<String> actualPage1NullSortStrings = new ArrayList<>();
page1NullSort.getItems().stream().forEach( ce -> actualPage1NullSortStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
assertEquals(expectedPage1NullSortStrings, actualPage1NullSortStrings);
//test first page of the results with sort descending order by a equipmentId property
PaginationResponse<ServiceMetric> page1SingleSortDesc = testInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, Collections.singletonList(new ColumnAndSort("equipmentId", SortOrder.desc)), context);
assertEquals(10, page1SingleSortDesc.getItems().size());
List<String> expectedPage1SingleSortDescStrings = getPagination_expectedPage1SingleSortDescStrings();
List<String> actualPage1SingleSortDescStrings = new ArrayList<>();
page1SingleSortDesc.getItems().stream().forEach( ce -> actualPage1SingleSortDescStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
assertEquals(expectedPage1SingleSortDescStrings, actualPage1SingleSortDescStrings);
used_equipmentIds.forEach(eqId -> testInterface.delete(customerId_1, eqId, System.currentTimeMillis()));
used_equipmentIds.forEach(eqId -> testInterface.delete(customerId_2, eqId, System.currentTimeMillis()));
@@ -336,9 +299,8 @@ public abstract class BaseServiceMetricDatastoreTest {
serviceMetric.setCreatedTimestamp(baseTimestamp - testSequence.incrementAndGet());
ClientMetrics details2 = new ClientMetrics();
details2.setClassificationName("qr_"+apNameIdx);
serviceMetric.setDetails(details2);
testInterface.create(serviceMetric);
//third metric - neighbour

View File

@@ -1,10 +1,8 @@
package com.telecominfraproject.wlan.servicemetric.client.models;
import java.util.Arrays;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.telecominfraproject.wlan.core.model.equipment.ChannelBandwidth;
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDataType;
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDetails;
@@ -18,19 +16,14 @@ public class ClientMetrics extends ServiceMetricDetails {
private static final long serialVersionUID = 7242365268669169773L;
private Integer secondsSinceLastRecv;
private Long numRxPackets;
private Long numTxPackets;
private Long numRxBytes;
private Long numTxBytes;
private Integer txRetries;
private Integer rxDuplicatePackets;
private int[] rates;
private Integer snr;
private Integer rssi;
private String classificationName;
ChannelBandwidth channelBandWidth;
private Double averageTxRate;
private Double averageRxRate;
@@ -38,21 +31,11 @@ public class ClientMetrics extends ServiceMetricDetails {
private Long numTxFramesTransmitted;
private Long numRxFramesReceived;
/**
* The RSSI of last frame received.
*/
private Integer rxLastRssi;
/**
* The number of received frames without FCS errors.
*/
private Integer numRxNoFcsErr;
/**
* The number of received data frames.
*/
private Integer numRxData;
/**
* The number of received bytes.
*/
@@ -90,13 +73,7 @@ public class ClientMetrics extends ServiceMetricDetails {
@Override
public ClientMetrics clone() {
ClientMetrics ret = (ClientMetrics) super.clone();
if(this.rates!=null){
ret.rates = this.rates.clone();
}
return ret;
return (ClientMetrics) super.clone();
}
@Override
@@ -112,15 +89,14 @@ public class ClientMetrics extends ServiceMetricDetails {
}
ClientMetrics other = (ClientMetrics) obj;
return Objects.equals(averageRxRate, other.averageRxRate) && Objects.equals(averageTxRate, other.averageTxRate)
&& this.channelBandWidth == other.channelBandWidth && Objects.equals(classificationName, other.classificationName)
&& Objects.equals(numRxBytes, other.numRxBytes) && Objects.equals(numRxData, other.numRxData)
&& Objects.equals(numRxBytes, other.numRxBytes)
&& Objects.equals(numRxFramesReceived, other.numRxFramesReceived) && Objects.equals(numRxNoFcsErr, other.numRxNoFcsErr)
&& Objects.equals(numRxPackets, other.numRxPackets) && Objects.equals(numRxRetry, other.numRxRetry)
&& Objects.equals(numTxBytes, other.numTxBytes) && Objects.equals(numTxDataRetries, other.numTxDataRetries)
&& Objects.equals(numTxDropped, other.numTxDropped) && Objects.equals(numTxFramesTransmitted, other.numTxFramesTransmitted)
&& Objects.equals(numTxPackets, other.numTxPackets) && this.radioType == other.radioType
&& Arrays.equals(rates, other.rates) && Objects.equals(rssi, other.rssi) && Objects.equals(rxBytes, other.rxBytes)
&& Objects.equals(rxDuplicatePackets, other.rxDuplicatePackets) && Objects.equals(rxLastRssi, other.rxLastRssi)
&& Objects.equals(rssi, other.rssi) && Objects.equals(rxBytes, other.rxBytes)
&& Objects.equals(rxDuplicatePackets, other.rxDuplicatePackets)
&& Objects.equals(snr, other.snr) && Objects.equals(txRetries, other.txRetries);
}
@@ -128,10 +104,6 @@ public class ClientMetrics extends ServiceMetricDetails {
return numRxBytes;
}
public Integer getNumRxData() {
return numRxData;
}
public Integer getNumRxNoFcsErr() {
return numRxNoFcsErr;
}
@@ -164,10 +136,6 @@ public class ClientMetrics extends ServiceMetricDetails {
return radioType;
}
public int[] getRates() {
return rates;
}
public Integer getRssi() {
return rssi;
}
@@ -180,10 +148,6 @@ public class ClientMetrics extends ServiceMetricDetails {
return rxDuplicatePackets;
}
public Integer getRxLastRssi() {
return rxLastRssi;
}
public Integer getSnr() {
return snr;
}
@@ -196,12 +160,11 @@ public class ClientMetrics extends ServiceMetricDetails {
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + Arrays.hashCode(this.rates);
result = prime * result + Objects.hash(averageRxRate, averageTxRate, channelBandWidth,
classificationName, numRxBytes, numRxData, numRxFramesReceived,
result = prime * result + Objects.hash(averageRxRate, averageTxRate,
numRxBytes, numRxFramesReceived,
numRxNoFcsErr, numRxPackets, numRxRetry, numTxBytes,
numTxDataRetries, numTxDropped, numTxFramesTransmitted, numTxPackets,
radioType, rssi, rxBytes, rxDuplicatePackets, rxLastRssi, snr, txRetries);
radioType, rssi, rxBytes, rxDuplicatePackets, snr, txRetries);
return result;
}
@@ -210,7 +173,7 @@ public class ClientMetrics extends ServiceMetricDetails {
if (super.hasUnsupportedValue()) {
return true;
}
if (RadioType.isUnsupported(radioType) || (ChannelBandwidth.isUnsupported(this.channelBandWidth))) {
if (RadioType.isUnsupported(radioType)) {
return true;
}
return false;
@@ -220,10 +183,6 @@ public class ClientMetrics extends ServiceMetricDetails {
this.numRxBytes = numRxBytes;
}
public void setNumRxData(Integer numRxData) {
this.numRxData = numRxData;
}
public void setNumRxNoFcsErr(Integer numRxNoFcsErr) {
this.numRxNoFcsErr = numRxNoFcsErr;
}
@@ -256,10 +215,6 @@ public class ClientMetrics extends ServiceMetricDetails {
this.radioType = radioType;
}
public void setRates(int[] rates) {
this.rates = rates;
}
public void setRssi(Integer rssi) {
this.rssi = rssi;
}
@@ -272,10 +227,6 @@ public class ClientMetrics extends ServiceMetricDetails {
this.rxDuplicatePackets = rxDuplicatePackets;
}
public void setRxLastRssi(Integer rxLastRssi) {
this.rxLastRssi = rxLastRssi;
}
public void setSnr(Integer snr) {
this.snr = snr;
}
@@ -300,22 +251,6 @@ public class ClientMetrics extends ServiceMetricDetails {
this.numRxFramesReceived = numRxFramesReceived;
}
public String getClassificationName() {
return classificationName;
}
public void setClassificationName(String classificationName) {
this.classificationName = classificationName;
}
public ChannelBandwidth getChannelBandWidth() {
return channelBandWidth;
}
public void setChannelBandWidth(ChannelBandwidth channelBandWidth) {
this.channelBandWidth = channelBandWidth;
}
public Double getAverageTxRate() {
return averageTxRate;
}
@@ -332,14 +267,6 @@ public class ClientMetrics extends ServiceMetricDetails {
this.averageRxRate = averageRxRate;
}
public Integer getSecondsSinceLastRecv() {
return secondsSinceLastRecv;
}
public void setSecondsSinceLastRecv(Integer secondsSinceLastRecv) {
this.secondsSinceLastRecv = secondsSinceLastRecv;
}
public Integer getPeriodLengthSec() {
return periodLengthSec;
}

View File

@@ -127,10 +127,6 @@ public class ServiceMetricServiceRemoteTest extends BaseRemoteTest {
serviceMetric.setClientMac(getNextEquipmentId());
serviceMetric.setCreatedTimestamp(baseTimestamp - 100000 + getNextEquipmentId());
ClientMetrics details2 = new ClientMetrics();
details2.setClassificationName("qr_"+apNameIdx);
serviceMetric.setDetails(details2);
apNameIdx++;
remoteInterface.create(serviceMetric);
@@ -144,10 +140,6 @@ public class ServiceMetricServiceRemoteTest extends BaseRemoteTest {
serviceMetric.setClientMac(getNextEquipmentId());
serviceMetric.setCreatedTimestamp(baseTimestamp + getNextEquipmentId());
ClientMetrics details2 = new ClientMetrics();
details2.setClassificationName("qr_"+apNameIdx);
serviceMetric.setDetails(details2);
apNameIdx++;
remoteInterface.create(serviceMetric);
@@ -161,10 +153,6 @@ public class ServiceMetricServiceRemoteTest extends BaseRemoteTest {
serviceMetric.setClientMac(getNextEquipmentId());
serviceMetric.setCreatedTimestamp(baseTimestamp - 100000 + getNextEquipmentId());
ClientMetrics details2 = new ClientMetrics();
details2.setClassificationName("qr_"+apNameIdx);
serviceMetric.setDetails(details2);
apNameIdx++;
remoteInterface.create(serviceMetric);
@@ -209,43 +197,18 @@ public class ServiceMetricServiceRemoteTest extends BaseRemoteTest {
assertTrue(page6.getContext().isLastPage());
assertTrue(page7.getContext().isLastPage());
List<String> expectedPage3Strings = new ArrayList<>(Arrays.asList(new String[]{"qr_20", "qr_21", "qr_22", "qr_23", "qr_24", "qr_25", "qr_26", "qr_27", "qr_28", "qr_29" }));
List<String> actualPage3Strings = new ArrayList<>();
page3.getItems().stream().forEach( ce -> actualPage3Strings.add(((ClientMetrics) ce.getDetails()).getClassificationName()) );
assertEquals(expectedPage3Strings, actualPage3Strings);
//test first page of the results with empty sort order -> default sort order (by createdTimestamp ascending)
PaginationResponse<ServiceMetric> page1EmptySort = remoteInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, Collections.emptyList(), context);
assertEquals(10, page1EmptySort.getItems().size());
List<String> expectedPage1EmptySortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
List<String> actualPage1EmptySortStrings = new ArrayList<>();
page1EmptySort.getItems().stream().forEach( ce -> actualPage1EmptySortStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
//test first page of the results with null sort order -> default sort order (by createdTimestamp ascending)
PaginationResponse<ServiceMetric> page1NullSort = remoteInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, null, context);
assertEquals(10, page1NullSort.getItems().size());
List<String> expectedPage1NullSortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
List<String> actualPage1NullSortStrings = new ArrayList<>();
page1NullSort.getItems().stream().forEach( ce -> actualPage1NullSortStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
assertEquals(expectedPage1NullSortStrings, actualPage1NullSortStrings);
//test first page of the results with sort descending order by a equipmentId property
PaginationResponse<ServiceMetric> page1SingleSortDesc = remoteInterface.getForCustomer(fromTime, toTime, customerId_1, null, null, null, null, Collections.singletonList(new ColumnAndSort("equipmentId", SortOrder.desc)), context);
assertEquals(10, page1SingleSortDesc.getItems().size());
List<String> expectedPage1SingleSortDescStrings = new ArrayList< >(Arrays.asList(new String[]{"qr_49", "qr_48", "qr_47", "qr_46", "qr_45", "qr_44", "qr_43", "qr_42", "qr_41", "qr_40" }));
List<String> actualPage1SingleSortDescStrings = new ArrayList<>();
page1SingleSortDesc.getItems().stream().forEach( ce -> actualPage1SingleSortDescStrings.add(((ClientMetrics) ce.getDetails()).getClassificationName() ) );
assertEquals(expectedPage1SingleSortDescStrings, actualPage1SingleSortDescStrings);
}
@@ -338,7 +301,6 @@ public class ServiceMetricServiceRemoteTest extends BaseRemoteTest {
serviceMetric.setCreatedTimestamp(baseTimestamp - getNextEquipmentId());
ClientMetrics details2 = new ClientMetrics();
details2.setClassificationName("qr_"+apNameIdx);
serviceMetric.setDetails(details2);
remoteInterface.create(serviceMetric);

View File

@@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import com.telecominfraproject.wlan.core.model.equipment.LedStatus;
import com.telecominfraproject.wlan.status.models.StatusCode;
import com.telecominfraproject.wlan.status.models.StatusDataType;
import com.telecominfraproject.wlan.status.models.StatusDetails;

View File

@@ -1,6 +0,0 @@
package com.telecominfraproject.wlan.status.equipment.models;
public enum LedStatus {
led_blink, led_off, UNKNOWN,
}