mirror of
https://github.com/Telecominfraproject/wlan-cloud-services.git
synced 2026-03-20 22:39:22 +00:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa1fbfd645 | ||
|
|
9ee24beb64 | ||
|
|
95a07188d5 | ||
|
|
6839ff3e97 | ||
|
|
299f59767e | ||
|
|
936aeae135 | ||
|
|
5b3d05bc21 | ||
|
|
ee3c62559a | ||
|
|
d3bb9f6e51 | ||
|
|
a1ebf265f9 | ||
|
|
64b1432251 | ||
|
|
ccb7680933 | ||
|
|
e74570121c | ||
|
|
b4b697376c | ||
|
|
b57fb2dd4f | ||
|
|
d25c1d6167 | ||
|
|
57c2d7d6f4 | ||
|
|
faf0a3a385 | ||
|
|
a7a836440e | ||
|
|
999e597493 | ||
|
|
5f4ed530fe | ||
|
|
0dca8bb943 | ||
|
|
c8c7217d38 |
@@ -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:
|
||||
|
||||
@@ -4982,10 +4982,6 @@ components:
|
||||
|
||||
ClientMetrics:
|
||||
properties:
|
||||
secondsSinceLastRecv:
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxPackets:
|
||||
type: integer
|
||||
format: int64
|
||||
@@ -5026,12 +5022,6 @@ components:
|
||||
|
||||
sessionId:
|
||||
type: string
|
||||
|
||||
classificationName:
|
||||
type: string
|
||||
|
||||
channelBandWidth:
|
||||
$ref: '#/components/schemas/ChannelBandwidth'
|
||||
|
||||
averageTxRate:
|
||||
type: number
|
||||
@@ -5048,21 +5038,11 @@ components:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
rxLastRssi:
|
||||
description: The RSSI of last frame received.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxNoFcsErr:
|
||||
description: The number of received frames without FCS errors.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxData:
|
||||
description: The number of received data frames.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
|
||||
rxBytes:
|
||||
description: The number of received bytes.
|
||||
type: integer
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -5175,9 +5175,6 @@ components:
|
||||
properties:
|
||||
model_type:
|
||||
type: string
|
||||
secondsSinceLastRecv:
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxPackets:
|
||||
type: integer
|
||||
@@ -5216,12 +5213,6 @@ components:
|
||||
rssi:
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
classificationName:
|
||||
type: string
|
||||
|
||||
channelBandWidth:
|
||||
$ref: '#/components/schemas/ChannelBandwidth'
|
||||
|
||||
averageTxRate:
|
||||
type: number
|
||||
@@ -5238,21 +5229,11 @@ components:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
rxLastRssi:
|
||||
description: The RSSI of last frame received.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxNoFcsErr:
|
||||
description: The number of received frames without FCS errors.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxData:
|
||||
description: The number of received data frames.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
rxBytes:
|
||||
description: The number of received bytes.
|
||||
type: integer
|
||||
|
||||
@@ -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();
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,6 +269,11 @@ public class EquipmentConfigPushTrigger extends StreamProcessor {
|
||||
status.setCustomerId(equipment.getCustomerId());
|
||||
statusServiceInterface.update(status);
|
||||
}
|
||||
status = statusServiceInterface.getOrNull(existingEquipment.getCustomerId(), existingEquipment.getId(), StatusDataType.FIRMWARE);
|
||||
if (status != null) {
|
||||
status.setCustomerId(equipment.getCustomerId());
|
||||
statusServiceInterface.update(status);
|
||||
}
|
||||
|
||||
// Alarms has to move to new customerId as well
|
||||
List<Alarm> oldCustomerAlarms = alarmServiceInterface.get(existingEquipment.getCustomerId(), Set.of(existingEquipment.getId()), null);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -213,11 +213,7 @@ components:
|
||||
- SGI# Short Guard Interval
|
||||
|
||||
ClientMetrics:
|
||||
properties:
|
||||
secondsSinceLastRecv:
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
properties:
|
||||
numRxPackets:
|
||||
type: integer
|
||||
format: int64
|
||||
@@ -256,12 +252,6 @@ components:
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
classificationName:
|
||||
type: string
|
||||
|
||||
channelBandWidth:
|
||||
$ref: '#/components/schemas/ChannelBandwidth'
|
||||
|
||||
averageTxRate:
|
||||
type: number
|
||||
format: double
|
||||
@@ -277,22 +267,11 @@ components:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
rxLastRssi:
|
||||
description: The RSSI of last frame received.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxNoFcsErr:
|
||||
description: The number of received frames without FCS errors.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
numRxData:
|
||||
description: The number of received data frames.
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
|
||||
rxBytes:
|
||||
description: The number of received bytes.
|
||||
type: integer
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
package com.telecominfraproject.wlan.status.equipment.models;
|
||||
|
||||
public enum LedStatus {
|
||||
led_blink, led_off, UNKNOWN,
|
||||
}
|
||||
Reference in New Issue
Block a user