mirror of
https://github.com/Telecominfraproject/wlan-cloud-services.git
synced 2026-03-20 17:39:19 +00:00
Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
936aeae135 | ||
|
|
5b3d05bc21 | ||
|
|
ee3c62559a | ||
|
|
d3bb9f6e51 | ||
|
|
a1ebf265f9 | ||
|
|
64b1432251 | ||
|
|
e74570121c | ||
|
|
b4b697376c | ||
|
|
b57fb2dd4f | ||
|
|
d25c1d6167 | ||
|
|
57c2d7d6f4 | ||
|
|
faf0a3a385 | ||
|
|
a7a836440e | ||
|
|
999e597493 | ||
|
|
5f4ed530fe | ||
|
|
0dca8bb943 | ||
|
|
c8c7217d38 | ||
|
|
b41e35a536 | ||
|
|
64bd468ade | ||
|
|
fe488e9d5f | ||
|
|
a79778b083 | ||
|
|
d5b86d0c8d | ||
|
|
15698e99cb | ||
|
|
e06c28e85a | ||
|
|
c307f59e8a | ||
|
|
1e23a691d7 | ||
|
|
015e662e68 | ||
|
|
9f3af6773b | ||
|
|
b7eedf6b8c | ||
|
|
468e7bcddb | ||
|
|
9b712d6fb5 | ||
|
|
99475d3f2f | ||
|
|
7216b08ac7 | ||
|
|
34da98b9a8 | ||
|
|
65aeadeaa7 | ||
|
|
148a6762dc | ||
|
|
178378f8b6 | ||
|
|
d0e6866345 | ||
|
|
a2b3e711ea | ||
|
|
b5f5c6d19f | ||
|
|
a5079d04a7 | ||
|
|
35d89a1cf0 | ||
|
|
534ed3e9c0 | ||
|
|
a6ec1d6e7f |
@@ -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:
|
||||
|
||||
@@ -1237,8 +1237,6 @@ public class AllInOneStartListener implements ApplicationRunner {
|
||||
clientMetrics.setNumRxBytes(getRandomLong(3000000, 7000000));
|
||||
clientMetrics.setNumTxBytes(getRandomLong(3000000, 7000000));
|
||||
|
||||
clientMetrics.setSessionId(Long.toUnsignedString(getRandomLong(3000000, 7000000)));
|
||||
|
||||
clientMetrics.setTxRetries(getRandomInt(30, 70));
|
||||
clientMetrics.setRxDuplicatePackets(getRandomInt(30, 70));
|
||||
clientMetrics.setSnr(getRandomInt(-70, -30));
|
||||
@@ -1264,8 +1262,6 @@ public class AllInOneStartListener implements ApplicationRunner {
|
||||
clientMetrics.setNumRxBytes(getRandomLong(3000000, 7000000));
|
||||
clientMetrics.setNumTxBytes(getRandomLong(3000000, 7000000));
|
||||
|
||||
clientMetrics.setSessionId(Long.toUnsignedString(getRandomLong(3000000, 7000000)));
|
||||
|
||||
clientMetrics.setTxRetries(getRandomInt(30, 70));
|
||||
clientMetrics.setRxDuplicatePackets(getRandomInt(30, 70));
|
||||
clientMetrics.setSnr(getRandomInt(-70, -30));
|
||||
@@ -1291,8 +1287,6 @@ public class AllInOneStartListener implements ApplicationRunner {
|
||||
clientMetrics.setNumRxBytes(getRandomLong(3000000, 7000000));
|
||||
clientMetrics.setNumTxBytes(getRandomLong(3000000, 7000000));
|
||||
|
||||
clientMetrics.setSessionId(Long.toUnsignedString(getRandomLong(3000000, 7000000)));
|
||||
|
||||
clientMetrics.setTxRetries(getRandomInt(30, 70));
|
||||
clientMetrics.setRxDuplicatePackets(getRandomInt(30, 70));
|
||||
clientMetrics.setSnr(getRandomInt(-70, -30));
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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:
|
||||
|
||||
@@ -309,5 +309,4 @@ public abstract class CommonElementConfiguration extends EquipmentDetails implem
|
||||
this.blinkAllLEDs = blinkAllLEDs;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
@@ -93,7 +93,7 @@ public abstract class CommonNetworkConfiguration extends ProfileDetails {
|
||||
}
|
||||
|
||||
|
||||
public Boolean getLedControlEnabled() {
|
||||
public Boolean isLedControlEnabled() {
|
||||
return ledControlEnabled;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -15,11 +15,8 @@ import org.springframework.util.CollectionUtils;
|
||||
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.servicemetric.models.McsStats;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDataType;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDetails;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.WmmQueueStats;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.WmmQueueStats.WmmQueueType;
|
||||
|
||||
/**
|
||||
* Node-level metric data from the Access Point.
|
||||
@@ -79,14 +76,8 @@ public class ApNodeMetrics extends ServiceMetricDetails
|
||||
|
||||
private Map<RadioType, List<RadioUtilization>> radioUtilizationPerRadio = new EnumMap<>(RadioType.class);
|
||||
|
||||
|
||||
private Map<RadioType, RadioStatistics> radioStatsPerRadio = new EnumMap<>(RadioType.class);
|
||||
|
||||
private Map<RadioType, List<McsStats>> mcsStatsPerRadio = new EnumMap<>(RadioType.class);
|
||||
|
||||
private Map<RadioType, Map<WmmQueueType, WmmQueueStats>> wmmQueuesPerRadio = new EnumMap<>(RadioType.class);
|
||||
|
||||
|
||||
public Integer getPeriodLengthSec() {
|
||||
return periodLengthSec;
|
||||
}
|
||||
@@ -262,25 +253,6 @@ public class ApNodeMetrics extends ServiceMetricDetails
|
||||
this.radioStatsPerRadio.put(radioType, radioStats);
|
||||
}
|
||||
|
||||
public List<McsStats> getMcsStats(RadioType radioType) {
|
||||
return mcsStatsPerRadio.get(radioType);
|
||||
}
|
||||
|
||||
public void setMcsStats(RadioType radioType, List<McsStats> mcsStats) {
|
||||
this.mcsStatsPerRadio.put(radioType, mcsStats);
|
||||
}
|
||||
|
||||
|
||||
public Map<WmmQueueType, WmmQueueStats> getWmmQueue(RadioType radioType) {
|
||||
return wmmQueuesPerRadio.get(radioType);
|
||||
}
|
||||
|
||||
public void setWmmQueue(RadioType radioType, Map<WmmQueueType, WmmQueueStats> wmmQueue) {
|
||||
this.wmmQueuesPerRadio.put(radioType, wmmQueue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Utility Functions
|
||||
//
|
||||
@@ -404,31 +376,14 @@ public class ApNodeMetrics extends ServiceMetricDetails
|
||||
this.radioStatsPerRadio = radioStatsPerRadio;
|
||||
}
|
||||
|
||||
public Map<RadioType, List<McsStats>> getMcsStatsPerRadio() {
|
||||
return mcsStatsPerRadio;
|
||||
}
|
||||
|
||||
public void setMcsStatsPerRadio(Map<RadioType, List<McsStats>> mcsStatsPerRadio) {
|
||||
this.mcsStatsPerRadio = mcsStatsPerRadio;
|
||||
}
|
||||
|
||||
public Map<RadioType, Map<WmmQueueType, WmmQueueStats>> getWmmQueuesPerRadio() {
|
||||
return wmmQueuesPerRadio;
|
||||
}
|
||||
|
||||
public void setWmmQueuesPerRadio(Map<RadioType, Map<WmmQueueType, WmmQueueStats>> wmmQueuesPerRadio) {
|
||||
this.wmmQueuesPerRadio = wmmQueuesPerRadio;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + Objects.hash(apPerformance, channelUtilizationPerRadio, clientMacAddressesPerRadio,
|
||||
cloudLinkAvailability, cloudLinkLatencyInMs, mcsStatsPerRadio, networkProbeMetrics, noiseFloorPerRadio,
|
||||
cloudLinkAvailability, cloudLinkLatencyInMs, networkProbeMetrics, noiseFloorPerRadio,
|
||||
periodLengthSec, radioStatsPerRadio, radioUtilizationPerRadio, radiusMetrics, rxBytesPerRadio,
|
||||
tunnelMetrics, txBytesPerRadio, vlanSubnet, wmmQueuesPerRadio);
|
||||
tunnelMetrics, txBytesPerRadio, vlanSubnet);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -449,7 +404,6 @@ public class ApNodeMetrics extends ServiceMetricDetails
|
||||
&& Objects.equals(clientMacAddressesPerRadio, other.clientMacAddressesPerRadio)
|
||||
&& Objects.equals(cloudLinkAvailability, other.cloudLinkAvailability)
|
||||
&& Objects.equals(cloudLinkLatencyInMs, other.cloudLinkLatencyInMs)
|
||||
&& Objects.equals(mcsStatsPerRadio, other.mcsStatsPerRadio)
|
||||
&& Objects.equals(networkProbeMetrics, other.networkProbeMetrics)
|
||||
&& Objects.equals(noiseFloorPerRadio, other.noiseFloorPerRadio)
|
||||
&& Objects.equals(periodLengthSec, other.periodLengthSec)
|
||||
@@ -459,8 +413,7 @@ public class ApNodeMetrics extends ServiceMetricDetails
|
||||
&& Objects.equals(rxBytesPerRadio, other.rxBytesPerRadio)
|
||||
&& Objects.equals(tunnelMetrics, other.tunnelMetrics)
|
||||
&& Objects.equals(txBytesPerRadio, other.txBytesPerRadio)
|
||||
&& Objects.equals(vlanSubnet, other.vlanSubnet)
|
||||
&& Objects.equals(wmmQueuesPerRadio, other.wmmQueuesPerRadio);
|
||||
&& Objects.equals(vlanSubnet, other.vlanSubnet);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -484,14 +437,6 @@ public class ApNodeMetrics extends ServiceMetricDetails
|
||||
radioStatsPerRadio.values().forEach(c -> { if (hasUnsupportedValue(c)) { ai.incrementAndGet();} });
|
||||
}
|
||||
|
||||
if(mcsStatsPerRadio!=null) {
|
||||
mcsStatsPerRadio.values().forEach(c -> { if (hasUnsupportedValue(c)) { ai.incrementAndGet();} });
|
||||
}
|
||||
|
||||
if(wmmQueuesPerRadio!=null) {
|
||||
wmmQueuesPerRadio.values().forEach(c -> { if (hasUnsupportedValue(c)) { ai.incrementAndGet();} });
|
||||
}
|
||||
|
||||
if(ai.get()>0) {
|
||||
return true;
|
||||
}
|
||||
@@ -518,25 +463,6 @@ public class ApNodeMetrics extends ServiceMetricDetails
|
||||
|
||||
}
|
||||
|
||||
if(this.wmmQueuesPerRadio!=null) {
|
||||
ret.wmmQueuesPerRadio = new EnumMap<>(RadioType.class);
|
||||
this.wmmQueuesPerRadio.forEach((rt, wq) -> {
|
||||
Map<WmmQueueStats.WmmQueueType, WmmQueueStats> newWm = new EnumMap<>(WmmQueueType.class);
|
||||
ret.wmmQueuesPerRadio.put(rt, newWm);
|
||||
wq.forEach((k, v) -> newWm.put(k, v.clone()));
|
||||
});
|
||||
}
|
||||
|
||||
if(this.mcsStatsPerRadio !=null) {
|
||||
ret.mcsStatsPerRadio = new EnumMap<>(RadioType.class);
|
||||
this.mcsStatsPerRadio.forEach((k, listV) -> {
|
||||
List<McsStats> newList = new ArrayList<>();
|
||||
ret.mcsStatsPerRadio.put(k, newList);
|
||||
listV.forEach(mcs -> newList.add(mcs.clone()));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if(this.networkProbeMetrics !=null) {
|
||||
ret.networkProbeMetrics = new ArrayList<>();
|
||||
for(NetworkProbeMetrics npm: this.networkProbeMetrics){
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,160 +0,0 @@
|
||||
package com.telecominfraproject.wlan.servicemetric.client.qoe.models;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDataType;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDetails;
|
||||
|
||||
/**
|
||||
* QoE related metrics which is independent of RadioType
|
||||
*
|
||||
* @author yongli
|
||||
*
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ClientQoEMetrics extends ServiceMetricDetails {
|
||||
|
||||
private static final long serialVersionUID = 5242617221447159480L;
|
||||
|
||||
/**
|
||||
* How many seconds the AP measured for the metric
|
||||
*/
|
||||
private Integer periodLengthSec = 5;
|
||||
private Integer secondsSinceLastRecv;
|
||||
|
||||
|
||||
// Connectivity QoE stats.
|
||||
private Long qoeEventualSuccessTimeTaken;
|
||||
private Long qoeNumOfAttempts;
|
||||
private Long qoeNumOfSuccess;
|
||||
private Long qoeAttemptDuration;
|
||||
private Long qoeAssociatedDuration;
|
||||
private Long qoeDeltaDuration;
|
||||
private Long qoeNumRepeatedAttempts;
|
||||
private Long qoeUserError;
|
||||
|
||||
@Override
|
||||
public ServiceMetricDataType getDataType() {
|
||||
return ServiceMetricDataType.ClientQoE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientQoEMetrics clone() {
|
||||
return (ClientQoEMetrics) super.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + Objects.hash(periodLengthSec, qoeAssociatedDuration, qoeAttemptDuration,
|
||||
qoeDeltaDuration, qoeEventualSuccessTimeTaken, qoeNumOfAttempts, qoeNumOfSuccess,
|
||||
qoeNumRepeatedAttempts, qoeUserError, secondsSinceLastRecv);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof ClientQoEMetrics)) {
|
||||
return false;
|
||||
}
|
||||
ClientQoEMetrics other = (ClientQoEMetrics) obj;
|
||||
return Objects.equals(periodLengthSec, other.periodLengthSec)
|
||||
&& Objects.equals(qoeAssociatedDuration, other.qoeAssociatedDuration)
|
||||
&& Objects.equals(qoeAttemptDuration, other.qoeAttemptDuration)
|
||||
&& Objects.equals(qoeDeltaDuration, other.qoeDeltaDuration)
|
||||
&& Objects.equals(qoeEventualSuccessTimeTaken, other.qoeEventualSuccessTimeTaken)
|
||||
&& Objects.equals(qoeNumOfAttempts, other.qoeNumOfAttempts)
|
||||
&& Objects.equals(qoeNumOfSuccess, other.qoeNumOfSuccess)
|
||||
&& Objects.equals(qoeNumRepeatedAttempts, other.qoeNumRepeatedAttempts)
|
||||
&& Objects.equals(qoeUserError, other.qoeUserError)
|
||||
&& Objects.equals(secondsSinceLastRecv, other.secondsSinceLastRecv);
|
||||
}
|
||||
|
||||
public Long getQoeAssociatedDuration() {
|
||||
return qoeAssociatedDuration;
|
||||
}
|
||||
|
||||
public Long getQoeAttemptDuration() {
|
||||
return qoeAttemptDuration;
|
||||
}
|
||||
|
||||
public Long getQoeDeltaDuration() {
|
||||
return qoeDeltaDuration;
|
||||
}
|
||||
|
||||
public Long getQoeEventualSuccessTimeTaken() {
|
||||
return qoeEventualSuccessTimeTaken;
|
||||
}
|
||||
|
||||
public Long getQoeNumOfAttempts() {
|
||||
return qoeNumOfAttempts;
|
||||
}
|
||||
|
||||
public Long getQoeNumOfSuccess() {
|
||||
return qoeNumOfSuccess;
|
||||
}
|
||||
|
||||
public Long getQoeNumRepeatedAttempts() {
|
||||
return qoeNumRepeatedAttempts;
|
||||
}
|
||||
|
||||
public Long getQoeUserError() {
|
||||
return qoeUserError;
|
||||
}
|
||||
|
||||
public void setQoeAssociatedDuration(Long qoeAssociatedDuration) {
|
||||
this.qoeAssociatedDuration = qoeAssociatedDuration;
|
||||
}
|
||||
|
||||
public void setQoeAttemptDuration(Long qoeAttemptDuration) {
|
||||
this.qoeAttemptDuration = qoeAttemptDuration;
|
||||
}
|
||||
|
||||
public void setQoeDeltaDuration(Long qoeDeltaDuration) {
|
||||
this.qoeDeltaDuration = qoeDeltaDuration;
|
||||
}
|
||||
|
||||
public void setQoeEventualSuccessTimeTaken(Long qoeEventualSuccessTimeTaken) {
|
||||
this.qoeEventualSuccessTimeTaken = qoeEventualSuccessTimeTaken;
|
||||
}
|
||||
|
||||
public void setQoeNumOfAttempts(Long qoeNumOfAttempts) {
|
||||
this.qoeNumOfAttempts = qoeNumOfAttempts;
|
||||
}
|
||||
|
||||
public void setQoeNumOfSuccess(Long qoeNumOfSuccess) {
|
||||
this.qoeNumOfSuccess = qoeNumOfSuccess;
|
||||
}
|
||||
|
||||
public void setQoeNumRepeatedAttempts(Long qoeNumRepeatedAttempts) {
|
||||
this.qoeNumRepeatedAttempts = qoeNumRepeatedAttempts;
|
||||
}
|
||||
|
||||
public void setQoeUserError(Long qoeUserError) {
|
||||
this.qoeUserError = qoeUserError;
|
||||
}
|
||||
|
||||
public Integer getPeriodLengthSec() {
|
||||
return periodLengthSec;
|
||||
}
|
||||
|
||||
public void setPeriodLengthSec(Integer periodLengthSec) {
|
||||
this.periodLengthSec = periodLengthSec;
|
||||
}
|
||||
|
||||
public Integer getSecondsSinceLastRecv() {
|
||||
return secondsSinceLastRecv;
|
||||
}
|
||||
|
||||
public void setSecondsSinceLastRecv(Integer secondsSinceLastRecv) {
|
||||
this.secondsSinceLastRecv = secondsSinceLastRecv;
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package com.telecominfraproject.wlan.servicemetric.models;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class McsStats extends BaseJsonModel
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 2366899901343104028L;
|
||||
|
||||
/**
|
||||
* The MCS number. This is table index.
|
||||
*/
|
||||
private McsType mcsNum;
|
||||
|
||||
/**
|
||||
* The number of successfully transmitted frames at this rate. Do not count failed transmission.
|
||||
*/
|
||||
private Integer txFrames;
|
||||
|
||||
/**
|
||||
* The number of received frames at this rate.
|
||||
*/
|
||||
private Integer rxFrames;
|
||||
|
||||
private Long rate;
|
||||
|
||||
|
||||
public McsStats()
|
||||
{
|
||||
// for serialization
|
||||
}
|
||||
|
||||
|
||||
public McsType getMcsNum() {
|
||||
return mcsNum;
|
||||
}
|
||||
|
||||
|
||||
public void setMcsNum(McsType mcsNum) {
|
||||
this.mcsNum = mcsNum;
|
||||
}
|
||||
|
||||
|
||||
public Integer getTxFrames() {
|
||||
return txFrames;
|
||||
}
|
||||
|
||||
|
||||
public void setTxFrames(Integer txFrames) {
|
||||
this.txFrames = txFrames;
|
||||
}
|
||||
|
||||
|
||||
public Integer getRxFrames() {
|
||||
return rxFrames;
|
||||
}
|
||||
|
||||
|
||||
public void setRxFrames(Integer rxFrames) {
|
||||
this.rxFrames = rxFrames;
|
||||
}
|
||||
|
||||
public Long getRate() {
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
public void setRate(Long rate) {
|
||||
this.rate = rate;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public McsStats clone() {
|
||||
McsStats ret = (McsStats) super.clone();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnsupportedValue() {
|
||||
if (super.hasUnsupportedValue()) {
|
||||
return true;
|
||||
}
|
||||
if (McsType.isUnsupported(mcsNum)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
package com.telecominfraproject.wlan.servicemetric.models;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.telecominfraproject.wlan.core.model.json.JsonDeserializationUtils;
|
||||
|
||||
/**
|
||||
* MCS index values
|
||||
* @author ekeddy
|
||||
*
|
||||
*/
|
||||
public enum McsType {
|
||||
|
||||
//McsType(int id, boolean isHt, boolean isVht, int numSpacialStreams, int mcsIndex)
|
||||
MCS_1 (0, false, false, 1, 1), // 2.4GHz only
|
||||
MCS_2 (1, false, false, 1, 2), // 2.4GHz only
|
||||
MCS_5dot5(2, false, false, 1, 5), // 2.4GHz only
|
||||
MCS_11 (3, false, false, 1, 11), // 2.4GHz only
|
||||
MCS_6 (4, false, false, 1, 13),
|
||||
MCS_9 (5, false, false, 1, 16),
|
||||
MCS_12 (6, false, false, 1, 5),
|
||||
MCS_18 (7, false, false, 1, 7),
|
||||
MCS_24 (8, false, false, 1, 9),
|
||||
MCS_36 (9, false, false, 1, 11),
|
||||
MCS_48 (10, false, false, 1, 1),
|
||||
MCS_54 (11, false, false, 1, 3),
|
||||
MCS_N_0 (12, true, false, 1, 0),
|
||||
MCS_N_1 (13, true, false, 1, 1),
|
||||
MCS_N_2 (14, true, false, 1, 2),
|
||||
MCS_N_3 (15, true, false, 1, 3),
|
||||
MCS_N_4 (16, true, false, 1, 4),
|
||||
MCS_N_5 (17, true, false, 1, 5),
|
||||
MCS_N_6 (18, true, false, 1, 6),
|
||||
MCS_N_7 (19, true, false, 1, 7),
|
||||
MCS_N_8 (20, true, false, 2, 8),
|
||||
MCS_N_9 (21, true, false, 2, 9),
|
||||
MCS_N_10(22, true, false, 2, 10),
|
||||
MCS_N_11(23, true, false, 2, 11),
|
||||
MCS_N_12(24, true, false, 2, 12),
|
||||
MCS_N_13(25, true, false, 2, 13),
|
||||
MCS_N_14(26, true, false, 2, 14),
|
||||
MCS_N_15(27, true, false, 2, 15),
|
||||
MCS_AC_1x1_0(28, false, true, 1, 0),
|
||||
MCS_AC_1x1_1(29, false, true, 1, 1),
|
||||
MCS_AC_1x1_2(30, false, true, 1, 2),
|
||||
MCS_AC_1x1_3(31, false, true, 1, 3),
|
||||
MCS_AC_1x1_4(32, false, true, 1, 4),
|
||||
MCS_AC_1x1_5(33, false, true, 1, 5),
|
||||
MCS_AC_1x1_6(34, false, true, 1, 6),
|
||||
MCS_AC_1x1_7(35, false, true, 1, 7),
|
||||
MCS_AC_1x1_8(36, false, true, 1, 8),
|
||||
MCS_AC_1x1_9(37, false, true, 1, 9),
|
||||
MCS_AC_2x2_0(38, false, true, 2, 0),
|
||||
MCS_AC_2x2_1(39, false, true, 2, 1),
|
||||
MCS_AC_2x2_2(40, false, true, 2, 2),
|
||||
MCS_AC_2x2_3(41, false, true, 2, 3),
|
||||
MCS_AC_2x2_4(42, false, true, 2, 4),
|
||||
MCS_AC_2x2_5(43, false, true, 2, 5),
|
||||
MCS_AC_2x2_6(44, false, true, 2, 6),
|
||||
MCS_AC_2x2_7(45, false, true, 2, 7),
|
||||
MCS_AC_2x2_8(46, false, true, 2, 8),
|
||||
MCS_AC_2x2_9(47, false, true, 2, 9),
|
||||
MCS_AC_3x3_0(48, false, true, 3, 0),
|
||||
MCS_AC_3x3_1(49, false, true, 3, 1),
|
||||
MCS_AC_3x3_2(50, false, true, 3, 2),
|
||||
MCS_AC_3x3_3(51, false, true, 3, 3),
|
||||
MCS_AC_3x3_4(52, false, true, 3, 4),
|
||||
MCS_AC_3x3_5(53, false, true, 3, 5),
|
||||
MCS_AC_3x3_6(54, false, true, 3, 6),
|
||||
MCS_AC_3x3_7(55, false, true, 3, 7),
|
||||
MCS_AC_3x3_8(56, false, true, 3, 8),
|
||||
MCS_AC_3x3_9(57, false, true, 3, 9),
|
||||
MCS_N_16(58, true, false, 3, 16),
|
||||
MCS_N_17(59, true, false, 3, 17),
|
||||
MCS_N_18(60, true, false, 3, 18),
|
||||
MCS_N_19(61, true, false, 3, 19),
|
||||
MCS_N_20(62, true, false, 3, 20),
|
||||
MCS_N_21(63, true, false, 3, 21),
|
||||
MCS_N_22(64, true, false, 3, 22),
|
||||
MCS_N_23(65, true, false, 3, 23),
|
||||
MCS_N_24(66, true, false, 4, 24),
|
||||
MCS_N_25(67, true, false, 4, 25),
|
||||
MCS_N_26(68, true, false, 4, 26),
|
||||
MCS_N_27(69, true, false, 4, 27),
|
||||
MCS_N_28(70, true, false, 4, 28),
|
||||
MCS_N_29(71, true, false, 4, 29),
|
||||
MCS_N_30(72, true, false, 4, 30),
|
||||
MCS_N_31(73, true, false, 4, 31),
|
||||
MCS_AC_4x4_0(74, false, true, 4, 0),
|
||||
MCS_AC_4x4_1(75, false, true, 4, 1),
|
||||
MCS_AC_4x4_2(76, false, true, 4, 2),
|
||||
MCS_AC_4x4_3(77, false, true, 4, 3),
|
||||
MCS_AC_4x4_4(78, false, true, 4, 4),
|
||||
MCS_AC_4x4_5(79, false, true, 4, 5),
|
||||
MCS_AC_4x4_6(80, false, true, 4, 6),
|
||||
MCS_AC_4x4_7(81, false, true, 4, 7),
|
||||
MCS_AC_4x4_8(82, false, true, 4, 8),
|
||||
MCS_AC_4x4_9(83, false, true, 4, 9),
|
||||
|
||||
//last used index 83
|
||||
|
||||
UNSUPPORTED(-1, false, false, 0, -1);
|
||||
|
||||
private final int id;
|
||||
private final boolean isHt;
|
||||
private final boolean isVht;
|
||||
private final int numSpacialStreams;
|
||||
private final int mcsIndex;
|
||||
|
||||
private static final Map<Integer, McsType> ELEMENTS = new HashMap<>();
|
||||
|
||||
private McsType(int id, boolean isHt, boolean isVht, int numSpacialStreams, int mcsIndex){
|
||||
this.id = id;
|
||||
this.isHt = isHt;
|
||||
this.isVht = isVht;
|
||||
this.numSpacialStreams = numSpacialStreams;
|
||||
this.mcsIndex = mcsIndex;
|
||||
}
|
||||
|
||||
public int getId(){
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public int getMcsIndex() {
|
||||
return mcsIndex;
|
||||
}
|
||||
|
||||
public int getNumSpacialStreams() {
|
||||
return numSpacialStreams;
|
||||
}
|
||||
|
||||
public boolean isHt() {
|
||||
return isHt;
|
||||
}
|
||||
|
||||
public boolean isVht() {
|
||||
return isVht;
|
||||
}
|
||||
|
||||
public static McsType getById(int enumId){
|
||||
if(ELEMENTS.isEmpty()){
|
||||
//initialize elements map
|
||||
for(McsType met : McsType.values()){
|
||||
ELEMENTS.put(met.getId(), met);
|
||||
}
|
||||
}
|
||||
|
||||
return ELEMENTS.get(enumId);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static McsType getByName(String value) {
|
||||
return JsonDeserializationUtils.deserializEnum(value, McsType.class, UNSUPPORTED);
|
||||
}
|
||||
|
||||
public static boolean isUnsupported(McsType value) {
|
||||
return UNSUPPORTED.equals(value);
|
||||
}
|
||||
}
|
||||
@@ -1,245 +0,0 @@
|
||||
package com.telecominfraproject.wlan.servicemetric.models;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.json.JsonDeserializationUtils;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class WmmQueueStats extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = 1784481171729854130L;
|
||||
|
||||
public static enum WmmQueueType {
|
||||
BE, BK, VI, VO, UNSUPPORTED;
|
||||
|
||||
@JsonCreator
|
||||
public static WmmQueueType getByName(String value) {
|
||||
return JsonDeserializationUtils.deserializEnum(value, WmmQueueType.class, UNSUPPORTED);
|
||||
}
|
||||
|
||||
public static boolean isUnsupported(WmmQueueType queueType) {
|
||||
return UNSUPPORTED.equals(queueType);
|
||||
}
|
||||
}
|
||||
|
||||
private WmmQueueType queueType;
|
||||
private long txFrames;
|
||||
private long txBytes;
|
||||
|
||||
private long txFailedFrames;
|
||||
private long txFailedBytes;
|
||||
|
||||
private long rxFrames;
|
||||
private long rxBytes;
|
||||
|
||||
private long rxFailedFrames;
|
||||
private long rxFailedBytes;
|
||||
|
||||
private long forwardFrames;
|
||||
private long forwardBytes;
|
||||
|
||||
private long txExpiredFrames;
|
||||
private long txExpiredBytes;
|
||||
|
||||
public WmmQueueStats() {
|
||||
// for serialization
|
||||
}
|
||||
|
||||
public WmmQueueStats(WmmQueueType queueType, long txFrames, long txBytes, long txFailedFrames, long txFailedBytes,
|
||||
long rxFrames, long rxBytes, long rxFailedFrames, long rxFailedBytes, long forwardFrames, long forwardBytes,
|
||||
long txExpiredFrames, long txExpiredBytes) {
|
||||
super();
|
||||
this.queueType = queueType;
|
||||
this.txFrames = txFrames;
|
||||
this.txBytes = txBytes;
|
||||
this.txFailedFrames = txFailedFrames;
|
||||
this.txFailedBytes = txFailedBytes;
|
||||
this.rxFrames = rxFrames;
|
||||
this.rxBytes = rxBytes;
|
||||
this.rxFailedFrames = rxFailedFrames;
|
||||
this.rxFailedBytes = rxFailedBytes;
|
||||
this.forwardFrames = forwardFrames;
|
||||
this.forwardBytes = forwardBytes;
|
||||
this.txExpiredFrames = txExpiredFrames;
|
||||
this.txExpiredBytes = txExpiredBytes;
|
||||
}
|
||||
|
||||
public WmmQueueType getQueueType() {
|
||||
return queueType;
|
||||
}
|
||||
|
||||
public void setQueueType(WmmQueueType queueType) {
|
||||
this.queueType = queueType;
|
||||
}
|
||||
|
||||
public long getTxFrames() {
|
||||
return txFrames;
|
||||
}
|
||||
|
||||
public void setTxFrames(long txFrames) {
|
||||
this.txFrames = txFrames;
|
||||
}
|
||||
|
||||
public long getTxBytes() {
|
||||
return txBytes;
|
||||
}
|
||||
|
||||
public void setTxBytes(long txBytes) {
|
||||
this.txBytes = txBytes;
|
||||
}
|
||||
|
||||
public long getTxFailedFrames() {
|
||||
return txFailedFrames;
|
||||
}
|
||||
|
||||
public void setTxFailedFrames(long txFailedFrames) {
|
||||
this.txFailedFrames = txFailedFrames;
|
||||
}
|
||||
|
||||
public long getTxFailedBytes() {
|
||||
return txFailedBytes;
|
||||
}
|
||||
|
||||
public void setTxFailedBytes(long txFailedBytes) {
|
||||
this.txFailedBytes = txFailedBytes;
|
||||
}
|
||||
|
||||
public long getRxFrames() {
|
||||
return rxFrames;
|
||||
}
|
||||
|
||||
public void setRxFrames(long rxFrames) {
|
||||
this.rxFrames = rxFrames;
|
||||
}
|
||||
|
||||
public long getRxBytes() {
|
||||
return rxBytes;
|
||||
}
|
||||
|
||||
public void setRxBytes(long rxBytes) {
|
||||
this.rxBytes = rxBytes;
|
||||
}
|
||||
|
||||
public long getRxFailedFrames() {
|
||||
return rxFailedFrames;
|
||||
}
|
||||
|
||||
public void setRxFailedFrames(long rxFailedFrames) {
|
||||
this.rxFailedFrames = rxFailedFrames;
|
||||
}
|
||||
|
||||
public long getRxFailedBytes() {
|
||||
return rxFailedBytes;
|
||||
}
|
||||
|
||||
public void setRxFailedBytes(long rxFailedBytes) {
|
||||
this.rxFailedBytes = rxFailedBytes;
|
||||
}
|
||||
|
||||
public long getForwardFrames() {
|
||||
return forwardFrames;
|
||||
}
|
||||
|
||||
public void setForwardFrames(long forwardFrames) {
|
||||
this.forwardFrames = forwardFrames;
|
||||
}
|
||||
|
||||
public long getForwardBytes() {
|
||||
return forwardBytes;
|
||||
}
|
||||
|
||||
public void setForwardBytes(long forwardBytes) {
|
||||
this.forwardBytes = forwardBytes;
|
||||
}
|
||||
|
||||
public long getTxExpiredFrames() {
|
||||
return txExpiredFrames;
|
||||
}
|
||||
|
||||
public void setTxExpiredFrames(long txExpiredFrames) {
|
||||
this.txExpiredFrames = txExpiredFrames;
|
||||
}
|
||||
|
||||
public long getTxExpiredBytes() {
|
||||
return txExpiredBytes;
|
||||
}
|
||||
|
||||
public void setTxExpiredBytes(long txExpiredBytes) {
|
||||
this.txExpiredBytes = txExpiredBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (int) (forwardBytes ^ (forwardBytes >>> 32));
|
||||
result = prime * result + (int) (forwardFrames ^ (forwardFrames >>> 32));
|
||||
result = prime * result + ((queueType == null) ? 0 : queueType.hashCode());
|
||||
result = prime * result + (int) (rxBytes ^ (rxBytes >>> 32));
|
||||
result = prime * result + (int) (rxFailedBytes ^ (rxFailedBytes >>> 32));
|
||||
result = prime * result + (int) (rxFailedFrames ^ (rxFailedFrames >>> 32));
|
||||
result = prime * result + (int) (rxFrames ^ (rxFrames >>> 32));
|
||||
result = prime * result + (int) (txBytes ^ (txBytes >>> 32));
|
||||
result = prime * result + (int) (txExpiredBytes ^ (txExpiredBytes >>> 32));
|
||||
result = prime * result + (int) (txExpiredFrames ^ (txExpiredFrames >>> 32));
|
||||
result = prime * result + (int) (txFailedBytes ^ (txFailedBytes >>> 32));
|
||||
result = prime * result + (int) (txFailedFrames ^ (txFailedFrames >>> 32));
|
||||
result = prime * result + (int) (txFrames ^ (txFrames >>> 32));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
WmmQueueStats other = (WmmQueueStats) obj;
|
||||
if (forwardBytes != other.forwardBytes)
|
||||
return false;
|
||||
if (forwardFrames != other.forwardFrames)
|
||||
return false;
|
||||
if (queueType != other.queueType)
|
||||
return false;
|
||||
if (rxBytes != other.rxBytes)
|
||||
return false;
|
||||
if (rxFailedBytes != other.rxFailedBytes)
|
||||
return false;
|
||||
if (rxFailedFrames != other.rxFailedFrames)
|
||||
return false;
|
||||
if (rxFrames != other.rxFrames)
|
||||
return false;
|
||||
if (txBytes != other.txBytes)
|
||||
return false;
|
||||
if (txExpiredBytes != other.txExpiredBytes)
|
||||
return false;
|
||||
if (txExpiredFrames != other.txExpiredFrames)
|
||||
return false;
|
||||
if (txFailedBytes != other.txFailedBytes)
|
||||
return false;
|
||||
if (txFailedFrames != other.txFailedFrames)
|
||||
return false;
|
||||
if (txFrames != other.txFrames)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnsupportedValue() {
|
||||
if (super.hasUnsupportedValue()) {
|
||||
return true;
|
||||
}
|
||||
if (WmmQueueType.isUnsupported(queueType)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WmmQueueStats clone() {
|
||||
return (WmmQueueStats) super.clone();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user