mirror of
https://github.com/Telecominfraproject/wlan-cloud-services.git
synced 2026-03-20 17:39:19 +00:00
Compare commits
35 Commits
WIFI-3403
...
wifi-4417_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1551babca2 | ||
|
|
70bd1f5eda | ||
|
|
88fa6ca8a5 | ||
|
|
e090bd6b00 | ||
|
|
aa1fbfd645 | ||
|
|
9ee24beb64 | ||
|
|
95a07188d5 | ||
|
|
6839ff3e97 | ||
|
|
299f59767e | ||
|
|
936aeae135 | ||
|
|
5b3d05bc21 | ||
|
|
ee3c62559a | ||
|
|
d3bb9f6e51 | ||
|
|
a1ebf265f9 | ||
|
|
64b1432251 | ||
|
|
ccb7680933 | ||
|
|
e74570121c | ||
|
|
b4b697376c | ||
|
|
b57fb2dd4f | ||
|
|
d25c1d6167 | ||
|
|
57c2d7d6f4 | ||
|
|
faf0a3a385 | ||
|
|
a7a836440e | ||
|
|
999e597493 | ||
|
|
5f4ed530fe | ||
|
|
0dca8bb943 | ||
|
|
c8c7217d38 | ||
|
|
b41e35a536 | ||
|
|
64bd468ade | ||
|
|
fe488e9d5f | ||
|
|
a79778b083 | ||
|
|
d5b86d0c8d | ||
|
|
15698e99cb | ||
|
|
e06c28e85a | ||
|
|
c307f59e8a |
@@ -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:
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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());
|
||||
@@ -233,11 +234,11 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
|
||||
forwarderSession.setSocketStreamReaderThread(socketInputStreamReaderThread);
|
||||
|
||||
} catch (Exception e) {
|
||||
LOG.error("[{}] error accepting conection on port {} - closing forwarding session {}", inventoryId, listenOnLocalPort, forwarderSession.getSessionId());
|
||||
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());
|
||||
}
|
||||
@@ -278,20 +279,17 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
|
||||
|
||||
if(forwarderSession.getServerSocket() != null){
|
||||
forwarderSession.getServerSocket().close();
|
||||
LOG.debug("Closed forwarderSession server socket for sessionId {}", sessionId);
|
||||
}
|
||||
|
||||
if(forwarderSession.getLocalSocket() != null){
|
||||
forwarderSession.getLocalSocket().close();
|
||||
LOG.debug("Closed forwarderSession local socket for sessionId {}", sessionId);
|
||||
}
|
||||
//stream reader will stop in a separate thread by themselves
|
||||
|
||||
sessionIdToForwarderSessionMap.remove(forwarderSession.getSessionId());
|
||||
|
||||
} catch (Exception e) {
|
||||
// do nothing here
|
||||
LOG.error("Encountered exception when closing connection for forwarder session {}", forwarderSession, e);
|
||||
} catch (IOException e) {
|
||||
LOG.error("Encountered IOException when closing connection for forwarder session {}", forwarderSession, e);
|
||||
sessionIdToForwarderSessionMap.remove(forwarderSession.getSessionId());
|
||||
}
|
||||
|
||||
@@ -326,7 +324,6 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
|
||||
if(payload.indexOf(':')>0){
|
||||
port = Integer.parseInt(payload.substring(payload.indexOf(':')+1));
|
||||
}
|
||||
LOG.debug("handleTextMessage: Port {} is used on Equipment {}", port, webSocketSessionKey);
|
||||
//find forwarderSession by inventoryId and CEPort
|
||||
ForwarderSession forwarderSession = null;
|
||||
for(ForwarderSession fs: sessionIdToForwarderSessionMap.values()){
|
||||
@@ -375,20 +372,18 @@ 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();
|
||||
int msgPayloadLength = message.getPayloadLength();
|
||||
|
||||
int port = payload.getInt();
|
||||
LOG.debug("handleBinaryMessage: Port {} is used on Equipment {}", port, webSocketSessionKey);
|
||||
|
||||
//find forwarderSession by inventoryId and CEPort
|
||||
ForwarderSession forwarderSession = null;
|
||||
|
||||
for(ForwarderSession fs: sessionIdToForwarderSessionMap.values()){
|
||||
if(fs.getInventoryId().equals(webSocketSessionKey) && fs.getConnectToPortOnEquipment()==port){
|
||||
forwarderSession = fs;
|
||||
@@ -425,14 +420,13 @@ 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 fpr webSocketSessionKey {}", webSocketSessionKey);
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -456,32 +450,29 @@ public class PortForwarderWebSocketHandler extends AbstractWebSocketHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception {
|
||||
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) {
|
||||
String webSocketSessionKey = getWebSocketSessionKey(session);
|
||||
LOG.info("[{}] Closed portForwarder websocket connection {} : {}", webSocketSessionKey, session, closeStatus);
|
||||
|
||||
webSocketSessionMap.remove(webSocketSessionKey);
|
||||
|
||||
LOG.debug(" Removed key {} from webSocketSessionMap", webSocketSessionKey);
|
||||
//close and remove all forwarder sessions for that CE
|
||||
|
||||
Iterator<ForwarderSession> iter = sessionIdToForwarderSessionMap.values().iterator();
|
||||
while(iter.hasNext()){
|
||||
ForwarderSession fs = iter.next();
|
||||
if (fs.getInventoryId().equals(webSocketSessionKey)) {
|
||||
LOG.debug("Closing webSocketSession for forwarderSession: {} ", fs);
|
||||
if(fs.getLocalSocket()!=null && !fs.getLocalSocket().isClosed()){
|
||||
fs.getLocalSocket().close();
|
||||
LOG.debug("Closing local Socket for fs {}", fs);
|
||||
}
|
||||
if(fs.getServerSocket()!=null && !fs.getServerSocket().isClosed()){
|
||||
fs.getServerSocket().close();
|
||||
LOG.debug("Closing Server Socket for fs {}", fs);
|
||||
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
@@ -0,0 +1,94 @@
|
||||
package com.telecominfraproject.wlan.profile.ethernetport.models;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.equipment.PushableConfiguration;
|
||||
import com.telecominfraproject.wlan.profile.models.ProfileDetails;
|
||||
import com.telecominfraproject.wlan.profile.models.ProfileType;
|
||||
import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author rsharma
|
||||
*/
|
||||
public class WiredEthernetPortConfiguration extends ProfileDetails implements PushableConfiguration<WiredEthernetPortConfiguration> {
|
||||
|
||||
private static final long serialVersionUID = 5326345492525165619L;
|
||||
|
||||
private String equipmentModel; // e.g., MR8300-CA, EC420-G1
|
||||
|
||||
private Set<WiredPort> ethPorts;
|
||||
|
||||
public WiredEthernetPortConfiguration() {
|
||||
// for Serialization
|
||||
}
|
||||
|
||||
public WiredEthernetPortConfiguration(String equipmentModel, Set<WiredPort> ethPorts) {
|
||||
this.equipmentModel = equipmentModel;
|
||||
this.ethPorts = ethPorts;
|
||||
}
|
||||
|
||||
public static WiredEthernetPortConfiguration createWithDefaults() {
|
||||
return new WiredEthernetPortConfiguration();
|
||||
}
|
||||
|
||||
public String getEquipmentModel() {
|
||||
return equipmentModel;
|
||||
}
|
||||
|
||||
public void setEquipmentModel(String equipmentModel) {
|
||||
this.equipmentModel = equipmentModel;
|
||||
}
|
||||
|
||||
public Set<WiredPort> getEthPorts() {
|
||||
return ethPorts;
|
||||
}
|
||||
|
||||
public void setEthPorts(Set<WiredPort> ethPorts) {
|
||||
this.ethPorts = ethPorts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsToBeUpdatedOnDevice(WiredEthernetPortConfiguration previousVersion) {
|
||||
if (previousVersion != null) {
|
||||
return !Objects.equals(this, previousVersion);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProfileType getProfileType() {
|
||||
return ProfileType.wired_ethernet_port;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof WiredEthernetPortConfiguration)) {
|
||||
return false;
|
||||
}
|
||||
WiredEthernetPortConfiguration that = (WiredEthernetPortConfiguration) o;
|
||||
return Objects.equals(getEquipmentModel(), that.getEquipmentModel()) &&
|
||||
Objects.equals(getEthPorts(), that.getEthPorts());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getEquipmentModel(), getEthPorts());
|
||||
}
|
||||
|
||||
@Override
|
||||
public WiredEthernetPortConfiguration clone() {
|
||||
WiredEthernetPortConfiguration ret = (WiredEthernetPortConfiguration)super.clone();
|
||||
|
||||
if (ethPorts != null) {
|
||||
ret.ethPorts = new HashSet<>(ethPorts);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.telecominfraproject.wlan.profile.ethernetport.models;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author rsharma
|
||||
*/
|
||||
public class WiredPort extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = 6595665507927422135L;
|
||||
|
||||
private String name; //eth0 or eth1
|
||||
private String displayName; // LAN-1, WAN-0 etc
|
||||
private String ifName; // lan, wan etc
|
||||
private String ifType; // bridge/Nat
|
||||
private int vlanId; // native vlanId/tagged vlanId
|
||||
private boolean trunkEnabled; // trunk enabled or disabled
|
||||
private List<Integer> allowedVlanIds; // allowed vlanIds
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getIfName() {
|
||||
return ifName;
|
||||
}
|
||||
|
||||
public void setIfName(String ifName) {
|
||||
this.ifName = ifName;
|
||||
}
|
||||
|
||||
public String getIfType() {
|
||||
return ifType;
|
||||
}
|
||||
|
||||
public void setIfType(String ifType) {
|
||||
this.ifType = ifType;
|
||||
}
|
||||
|
||||
public int getVlanId() {
|
||||
return vlanId;
|
||||
}
|
||||
|
||||
public void setVlanId(int vlanId) {
|
||||
this.vlanId = vlanId;
|
||||
}
|
||||
|
||||
public boolean isTrunkEnabled() {
|
||||
return trunkEnabled;
|
||||
}
|
||||
|
||||
public void setTrunkEnabled(boolean trunkEnabled) {
|
||||
this.trunkEnabled = trunkEnabled;
|
||||
}
|
||||
|
||||
public List<Integer> getAllowedVlanIds() {
|
||||
return allowedVlanIds;
|
||||
}
|
||||
|
||||
public void setAllowedVlanIds(List<Integer> allowedVlanIds) {
|
||||
this.allowedVlanIds = allowedVlanIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof WiredPort)) {
|
||||
return false;
|
||||
}
|
||||
WiredPort wiredPort = (WiredPort) o;
|
||||
return getVlanId() == wiredPort.getVlanId() && isTrunkEnabled() == wiredPort.isTrunkEnabled()
|
||||
&& Objects.equals(getName(), wiredPort.getName())
|
||||
&& Objects.equals(getDisplayName(), wiredPort.getDisplayName())
|
||||
&& Objects.equals(getIfName(), wiredPort.getIfName())
|
||||
&& Objects.equals(getIfType(), wiredPort.getIfType())
|
||||
&& Objects.equals(getAllowedVlanIds(), wiredPort.getAllowedVlanIds());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getName(), getDisplayName(), getIfName(), getIfType(), getVlanId(), isTrunkEnabled(), getAllowedVlanIds());
|
||||
}
|
||||
|
||||
@Override
|
||||
public WiredPort clone() {
|
||||
WiredPort port = (WiredPort) super.clone();
|
||||
|
||||
if (getAllowedVlanIds() != null) {
|
||||
port.allowedVlanIds = new ArrayList<>(getAllowedVlanIds());
|
||||
}
|
||||
|
||||
return port;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.telecominfraproject.wlan.profile.ethernetport.models.WiredEthernetPortConfiguration;
|
||||
|
||||
/**
|
||||
* @author dtop
|
||||
* Utility class for dealing with profiles
|
||||
@@ -40,6 +42,26 @@ public class ProfileContainer {
|
||||
return ret.get(0);
|
||||
}
|
||||
|
||||
public Profile getChildOfTypeOrNullByEquipmentModel(long profileId, ProfileType childProfileType,
|
||||
String equipmentModel) {
|
||||
// The profile type of the profileId should be equipment_ap
|
||||
Profile apProfile = profileMap.get(profileId);
|
||||
if (apProfile != null && apProfile.getProfileType() == ProfileType.equipment_ap) {
|
||||
|
||||
List<Profile> profiles = getChildrenOfType(profileId, childProfileType);
|
||||
for (Profile ret : profiles) {
|
||||
WiredEthernetPortConfiguration config = (WiredEthernetPortConfiguration) ret.getDetails();
|
||||
if (config != null && config.getEquipmentModel() != null
|
||||
&& config.getEquipmentModel().equals(equipmentModel)) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("Profile Id " + profileId + " is not of type equipment_ap");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Profile> getChildrenOfType(long profileId, ProfileType childProfileType) {
|
||||
Profile parent = profileMap.get(profileId);
|
||||
List<Profile> ret = new ArrayList<>();
|
||||
|
||||
@@ -62,6 +62,8 @@ public class ProfileType implements EnumWithId {
|
||||
passpoint_venue = new ProfileType(12,"passpoint_venue"),
|
||||
passpoint_osu_id_provider = new ProfileType(13,"passpoint_osu_id_provider"),
|
||||
ap_event_rate = new ProfileType(14,"ap_event_rate"),
|
||||
metrics = new ProfileType(15,"metrics"),
|
||||
wired_ethernet_port = new ProfileType(16, "wired_ethernet_port"),
|
||||
UNSUPPORTED = new ProfileType(-1, "UNSUPPORTED");
|
||||
|
||||
static {
|
||||
|
||||
@@ -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,218 +31,31 @@ 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 management frames.
|
||||
*/
|
||||
private Integer numRxManagement;
|
||||
|
||||
/**
|
||||
* The number of received control frames.
|
||||
*/
|
||||
private Integer numRxControl;
|
||||
|
||||
/**
|
||||
* The number of received bytes.
|
||||
*/
|
||||
private Long rxBytes;
|
||||
|
||||
/**
|
||||
* The number of received data bytes.
|
||||
*/
|
||||
private Long rxDataBytes;
|
||||
|
||||
/**
|
||||
* The number of received RTS frames.
|
||||
*/
|
||||
private Integer numRxRts;
|
||||
|
||||
/**
|
||||
* The number of received CTS frames.
|
||||
*/
|
||||
private Integer numRxCts;
|
||||
|
||||
/**
|
||||
* The number of all received ACK frames (Acks + BlockAcks).
|
||||
*/
|
||||
private Integer numRxAck;
|
||||
|
||||
/**
|
||||
* The number of received probe request frames.
|
||||
*/
|
||||
private Integer numRxProbeReq;
|
||||
|
||||
/**
|
||||
* The number of received retry frames.
|
||||
*/
|
||||
private Integer numRxRetry;
|
||||
|
||||
/**
|
||||
* The number of received duplicated frames.
|
||||
*/
|
||||
private Integer numRxDup;
|
||||
|
||||
/**
|
||||
* The number of received null data frames.
|
||||
*/
|
||||
private Integer numRxNullData;
|
||||
|
||||
/**
|
||||
* The number of received ps-poll frames.
|
||||
*/
|
||||
private Integer numRxPspoll;
|
||||
|
||||
/**
|
||||
* The number of received STBC frames.
|
||||
*/
|
||||
private Integer numRxStbc;
|
||||
|
||||
/**
|
||||
* The number of received LDPC frames.
|
||||
*/
|
||||
private Integer numRxLdpc;
|
||||
|
||||
/**
|
||||
* The timestamp of last received layer three user traffic (IP data)
|
||||
*/
|
||||
private Long lastRecvLayer3Ts;
|
||||
|
||||
/**
|
||||
* The number of received ethernet and local generated frames for transmit.
|
||||
*/
|
||||
private Long numRcvFrameForTx;
|
||||
|
||||
/**
|
||||
* The number of TX frames queued.
|
||||
*/
|
||||
private Long numTxQueued;
|
||||
|
||||
/**
|
||||
* The number of every TX frame dropped.
|
||||
*/
|
||||
private Integer numTxDropped;
|
||||
|
||||
/**
|
||||
* The number of TX frame dropped due to retries.
|
||||
*/
|
||||
private Integer numTxRetryDropped;
|
||||
|
||||
/**
|
||||
* The number of frames successfully transmitted.
|
||||
*/
|
||||
private Integer numTxSucc;
|
||||
|
||||
/**
|
||||
* The Number of Tx bytes successfully transmitted.
|
||||
*/
|
||||
private Long numTxByteSucc;
|
||||
|
||||
/**
|
||||
* The number of successfully transmitted frames at first attempt.
|
||||
*/
|
||||
private Integer numTxSuccNoRetry;
|
||||
|
||||
/**
|
||||
* The number of successfully transmitted frames with retries.
|
||||
*/
|
||||
private Integer numTxSuccRetries;
|
||||
|
||||
/**
|
||||
* The number of Tx frames with retries.
|
||||
*/
|
||||
private Integer numTxMultiRetries;
|
||||
|
||||
/**
|
||||
* The number of TX management frames.
|
||||
*/
|
||||
private Integer numTxManagement;
|
||||
|
||||
/**
|
||||
* The number of Tx control frames.
|
||||
*/
|
||||
private Integer numTxControl;
|
||||
|
||||
/**
|
||||
* The number of Tx action frames.
|
||||
*/
|
||||
private Integer numTxAction;
|
||||
|
||||
/**
|
||||
* The number of TX probe response.
|
||||
*/
|
||||
private Integer numTxPropResp;
|
||||
|
||||
/**
|
||||
* The number of Tx data frames.
|
||||
*/
|
||||
private Integer numTxData;
|
||||
|
||||
/**
|
||||
* The number of Tx data frames with retries,done.
|
||||
*/
|
||||
private Integer numTxDataRetries;
|
||||
|
||||
/**
|
||||
* The number of RTS frames sent successfully, done.
|
||||
*/
|
||||
private Integer numTxRtsSucc;
|
||||
|
||||
/**
|
||||
* The number of RTS frames failed transmission.
|
||||
*/
|
||||
private Integer numTxRtsFail;
|
||||
|
||||
/**
|
||||
* The number of TX frames failed because of not Acked.
|
||||
*/
|
||||
private Integer numTxNoAck;
|
||||
|
||||
/**
|
||||
* The number of EAPOL frames sent.
|
||||
*/
|
||||
private Integer numTxEapol;
|
||||
|
||||
/**
|
||||
* The number of total LDPC frames sent.
|
||||
*/
|
||||
private Integer numTxLdpc;
|
||||
|
||||
/**
|
||||
* The number of total STBC frames sent.
|
||||
*/
|
||||
private Integer numTxStbc;
|
||||
|
||||
/**
|
||||
* The number of aggregation frames sent successfully.
|
||||
*/
|
||||
private Integer numTxAggrSucc;
|
||||
|
||||
/**
|
||||
* The number of aggregation frames sent using single MPDU (where the A-MPDU
|
||||
* contains only one MPDU. ).
|
||||
*/
|
||||
private Integer numTxAggrOneMpdu;
|
||||
|
||||
/**
|
||||
* The timestamp of last successfully sent layer three user traffic (IP
|
||||
* data).
|
||||
*/
|
||||
private Long lastSentLayer3Ts;
|
||||
|
||||
/**
|
||||
* Radio Type
|
||||
*/
|
||||
@@ -267,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
|
||||
@@ -289,151 +89,37 @@ 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(lastRecvLayer3Ts, other.lastRecvLayer3Ts)
|
||||
&& Objects.equals(classificationName, other.classificationName)
|
||||
&& Objects.equals(lastSentLayer3Ts, other.lastSentLayer3Ts)
|
||||
&& Objects.equals(numRcvFrameForTx, other.numRcvFrameForTx)
|
||||
&& Objects.equals(numRxAck, other.numRxAck) && Objects.equals(numRxBytes, other.numRxBytes)
|
||||
&& Objects.equals(numRxControl, other.numRxControl) && Objects.equals(numRxCts, other.numRxCts)
|
||||
&& Objects.equals(numRxData, other.numRxData)
|
||||
&& Objects.equals(numRxDup, other.numRxDup)
|
||||
&& Objects.equals(numRxFramesReceived, other.numRxFramesReceived)
|
||||
&& Objects.equals(numRxLdpc, other.numRxLdpc) && Objects.equals(numRxManagement, other.numRxManagement)
|
||||
&& Objects.equals(numRxNoFcsErr, other.numRxNoFcsErr)
|
||||
&& Objects.equals(numRxNullData, other.numRxNullData)
|
||||
&& Objects.equals(numRxPackets, other.numRxPackets)
|
||||
&& Objects.equals(numRxProbeReq, other.numRxProbeReq) && Objects.equals(numRxPspoll, other.numRxPspoll)
|
||||
&& Objects.equals(numRxRetry, other.numRxRetry) && Objects.equals(numRxRts, other.numRxRts)
|
||||
&& Objects.equals(numRxStbc, other.numRxStbc)
|
||||
&& Objects.equals(numTxAction, other.numTxAction)
|
||||
&& Objects.equals(numTxAggrOneMpdu, other.numTxAggrOneMpdu)
|
||||
&& Objects.equals(numTxAggrSucc, other.numTxAggrSucc)
|
||||
&& Objects.equals(numTxByteSucc, other.numTxByteSucc) && Objects.equals(numTxBytes, other.numTxBytes)
|
||||
&& Objects.equals(numTxControl, other.numTxControl) && Objects.equals(numTxData, other.numTxData)
|
||||
&& Objects.equals(numTxDataRetries, other.numTxDataRetries)
|
||||
&& Objects.equals(numTxDropped, other.numTxDropped) && Objects.equals(numTxEapol, other.numTxEapol)
|
||||
&& Objects.equals(numTxFramesTransmitted, other.numTxFramesTransmitted)
|
||||
&& Objects.equals(numTxLdpc, other.numTxLdpc) && Objects.equals(numTxManagement, other.numTxManagement)
|
||||
&& Objects.equals(numTxMultiRetries, other.numTxMultiRetries)
|
||||
&& Objects.equals(numTxNoAck, other.numTxNoAck) && Objects.equals(numTxPackets, other.numTxPackets)
|
||||
&& Objects.equals(numTxPropResp, other.numTxPropResp) && Objects.equals(numTxQueued, other.numTxQueued)
|
||||
&& Objects.equals(numTxRetryDropped, other.numTxRetryDropped)
|
||||
&& Objects.equals(numTxRtsFail, other.numTxRtsFail) && Objects.equals(numTxRtsSucc, other.numTxRtsSucc)
|
||||
&& Objects.equals(numTxStbc, other.numTxStbc) && Objects.equals(numTxSucc, other.numTxSucc)
|
||||
&& Objects.equals(numTxSuccNoRetry, other.numTxSuccNoRetry)
|
||||
&& Objects.equals(numTxSuccRetries, other.numTxSuccRetries)
|
||||
&& this.radioType == other.radioType
|
||||
&& Arrays.equals(rates, other.rates) && Objects.equals(rssi, other.rssi)
|
||||
&& Objects.equals(rxBytes, other.rxBytes) && Objects.equals(rxDataBytes, other.rxDataBytes)
|
||||
&& 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
|
||||
&& Objects.equals(rssi, other.rssi) && Objects.equals(rxBytes, other.rxBytes)
|
||||
&& Objects.equals(rxDuplicatePackets, other.rxDuplicatePackets)
|
||||
&& Objects.equals(rxLastRssi, other.rxLastRssi)
|
||||
&& Objects.equals(snr, other.snr) && Objects.equals(txRetries, other.txRetries);
|
||||
}
|
||||
|
||||
public Long getLastRecvLayer3Ts() {
|
||||
return lastRecvLayer3Ts;
|
||||
}
|
||||
|
||||
public Long getLastSentLayer3Ts() {
|
||||
return lastSentLayer3Ts;
|
||||
}
|
||||
|
||||
public Long getNumRcvFrameForTx() {
|
||||
return numRcvFrameForTx;
|
||||
}
|
||||
|
||||
public Integer getNumRxAck() {
|
||||
return numRxAck;
|
||||
}
|
||||
|
||||
public Long getNumRxBytes() {
|
||||
return numRxBytes;
|
||||
}
|
||||
|
||||
public Integer getNumRxControl() {
|
||||
return numRxControl;
|
||||
}
|
||||
|
||||
public Integer getNumRxCts() {
|
||||
return numRxCts;
|
||||
}
|
||||
|
||||
public Integer getNumRxData() {
|
||||
return numRxData;
|
||||
}
|
||||
|
||||
public Integer getNumRxDup() {
|
||||
return numRxDup;
|
||||
}
|
||||
|
||||
public Integer getNumRxLdpc() {
|
||||
return numRxLdpc;
|
||||
}
|
||||
|
||||
public Integer getNumRxManagement() {
|
||||
return numRxManagement;
|
||||
}
|
||||
|
||||
public Integer getNumRxNoFcsErr() {
|
||||
return numRxNoFcsErr;
|
||||
}
|
||||
|
||||
public Integer getNumRxNullData() {
|
||||
return numRxNullData;
|
||||
}
|
||||
|
||||
public Long getNumRxPackets() {
|
||||
return numRxPackets;
|
||||
}
|
||||
|
||||
public Integer getNumRxProbeReq() {
|
||||
return numRxProbeReq;
|
||||
}
|
||||
|
||||
public Integer getNumRxPspoll() {
|
||||
return numRxPspoll;
|
||||
}
|
||||
|
||||
public Integer getNumRxRetry() {
|
||||
return numRxRetry;
|
||||
}
|
||||
|
||||
public Integer getNumRxRts() {
|
||||
return numRxRts;
|
||||
}
|
||||
|
||||
public Integer getNumRxStbc() {
|
||||
return numRxStbc;
|
||||
}
|
||||
|
||||
public Integer getNumTxAction() {
|
||||
return numTxAction;
|
||||
}
|
||||
|
||||
public Integer getNumTxAggrOneMpdu() {
|
||||
return numTxAggrOneMpdu;
|
||||
}
|
||||
|
||||
public Integer getNumTxAggrSucc() {
|
||||
return numTxAggrSucc;
|
||||
}
|
||||
|
||||
public Long getNumTxBytes() {
|
||||
return numTxBytes;
|
||||
}
|
||||
|
||||
public Long getNumTxByteSucc() {
|
||||
return numTxByteSucc;
|
||||
}
|
||||
|
||||
public Integer getNumTxControl() {
|
||||
return numTxControl;
|
||||
}
|
||||
|
||||
public Integer getNumTxData() {
|
||||
return numTxData;
|
||||
}
|
||||
|
||||
public Integer getNumTxDataRetries() {
|
||||
return numTxDataRetries;
|
||||
}
|
||||
@@ -442,74 +128,14 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
return numTxDropped;
|
||||
}
|
||||
|
||||
public Integer getNumTxEapol() {
|
||||
return numTxEapol;
|
||||
}
|
||||
|
||||
public Integer getNumTxLdpc() {
|
||||
return numTxLdpc;
|
||||
}
|
||||
|
||||
public Integer getNumTxManagement() {
|
||||
return numTxManagement;
|
||||
}
|
||||
|
||||
public Integer getNumTxMultiRetries() {
|
||||
return numTxMultiRetries;
|
||||
}
|
||||
|
||||
public Integer getNumTxNoAck() {
|
||||
return numTxNoAck;
|
||||
}
|
||||
|
||||
public Long getNumTxPackets() {
|
||||
return numTxPackets;
|
||||
}
|
||||
|
||||
public Integer getNumTxPropResp() {
|
||||
return numTxPropResp;
|
||||
}
|
||||
|
||||
public Long getNumTxQueued() {
|
||||
return numTxQueued;
|
||||
}
|
||||
|
||||
public Integer getNumTxRetryDropped() {
|
||||
return numTxRetryDropped;
|
||||
}
|
||||
|
||||
public Integer getNumTxRtsFail() {
|
||||
return numTxRtsFail;
|
||||
}
|
||||
|
||||
public Integer getNumTxRtsSucc() {
|
||||
return numTxRtsSucc;
|
||||
}
|
||||
|
||||
public Integer getNumTxStbc() {
|
||||
return numTxStbc;
|
||||
}
|
||||
|
||||
public Integer getNumTxSucc() {
|
||||
return numTxSucc;
|
||||
}
|
||||
|
||||
public Integer getNumTxSuccNoRetry() {
|
||||
return numTxSuccNoRetry;
|
||||
}
|
||||
|
||||
public Integer getNumTxSuccRetries() {
|
||||
return numTxSuccRetries;
|
||||
}
|
||||
|
||||
public RadioType getRadioType() {
|
||||
return radioType;
|
||||
}
|
||||
|
||||
public int[] getRates() {
|
||||
return rates;
|
||||
}
|
||||
|
||||
public Integer getRssi() {
|
||||
return rssi;
|
||||
}
|
||||
@@ -518,18 +144,10 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
return rxBytes;
|
||||
}
|
||||
|
||||
public Long getRxDataBytes() {
|
||||
return rxDataBytes;
|
||||
}
|
||||
|
||||
public Integer getRxDuplicatePackets() {
|
||||
return rxDuplicatePackets;
|
||||
}
|
||||
|
||||
public Integer getRxLastRssi() {
|
||||
return rxLastRssi;
|
||||
}
|
||||
|
||||
public Integer getSnr() {
|
||||
return snr;
|
||||
}
|
||||
@@ -542,18 +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, lastRecvLayer3Ts, lastSentLayer3Ts,
|
||||
numRcvFrameForTx, numRxAck, numRxBytes, numRxControl, numRxCts, numRxData,
|
||||
numRxDup, numRxFramesReceived, numRxLdpc, numRxManagement,
|
||||
numRxNoFcsErr, numRxNullData, numRxPackets, numRxProbeReq, numRxPspoll, numRxRetry, numRxRts, numRxStbc,
|
||||
numTxAction, numTxAggrOneMpdu, numTxAggrSucc, numTxByteSucc, numTxBytes,
|
||||
numTxControl, numTxData, numTxDataRetries, numTxDropped, numTxEapol, numTxFramesTransmitted,
|
||||
numTxLdpc, numTxManagement,
|
||||
numTxMultiRetries, numTxNoAck, numTxPackets, numTxPropResp, numTxQueued,
|
||||
numTxRetryDropped, numTxRtsFail, numTxRtsSucc, numTxStbc, numTxSucc, numTxSuccNoRetry, numTxSuccRetries,
|
||||
radioType, rssi, rxBytes, rxDataBytes, rxDuplicatePackets, rxLastRssi, snr, txRetries);
|
||||
result = prime * result + Objects.hash(averageRxRate, averageTxRate,
|
||||
numRxBytes, numRxFramesReceived,
|
||||
numRxNoFcsErr, numRxPackets, numRxRetry, numTxBytes,
|
||||
numTxDataRetries, numTxDropped, numTxFramesTransmitted, numTxPackets,
|
||||
radioType, rssi, rxBytes, rxDuplicatePackets, snr, txRetries);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -562,116 +173,32 @@ 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;
|
||||
}
|
||||
|
||||
public void setLastRecvLayer3Ts(Long lastRecvLayer3Ts) {
|
||||
this.lastRecvLayer3Ts = lastRecvLayer3Ts;
|
||||
}
|
||||
|
||||
public void setLastSentLayer3Ts(Long lastSentLayer3Ts) {
|
||||
this.lastSentLayer3Ts = lastSentLayer3Ts;
|
||||
}
|
||||
|
||||
public void setNumRcvFrameForTx(Long numRcvFrameForTx) {
|
||||
this.numRcvFrameForTx = numRcvFrameForTx;
|
||||
}
|
||||
|
||||
public void setNumRxAck(Integer numRxAck) {
|
||||
this.numRxAck = numRxAck;
|
||||
}
|
||||
|
||||
public void setNumRxBytes(Long numRxBytes) {
|
||||
this.numRxBytes = numRxBytes;
|
||||
}
|
||||
|
||||
public void setNumRxControl(Integer numRxControl) {
|
||||
this.numRxControl = numRxControl;
|
||||
}
|
||||
|
||||
public void setNumRxCts(Integer numRxCts) {
|
||||
this.numRxCts = numRxCts;
|
||||
}
|
||||
|
||||
public void setNumRxData(Integer numRxData) {
|
||||
this.numRxData = numRxData;
|
||||
}
|
||||
|
||||
public void setNumRxDup(Integer numRxDup) {
|
||||
this.numRxDup = numRxDup;
|
||||
}
|
||||
|
||||
public void setNumRxLdpc(Integer numRxLdpc) {
|
||||
this.numRxLdpc = numRxLdpc;
|
||||
}
|
||||
|
||||
public void setNumRxManagement(Integer numRxManagement) {
|
||||
this.numRxManagement = numRxManagement;
|
||||
}
|
||||
|
||||
public void setNumRxNoFcsErr(Integer numRxNoFcsErr) {
|
||||
this.numRxNoFcsErr = numRxNoFcsErr;
|
||||
}
|
||||
|
||||
public void setNumRxNullData(Integer numRxNullData) {
|
||||
this.numRxNullData = numRxNullData;
|
||||
}
|
||||
|
||||
public void setNumRxPackets(Long numRxPackets) {
|
||||
this.numRxPackets = numRxPackets;
|
||||
}
|
||||
|
||||
public void setNumRxProbeReq(Integer numRxProbeReq) {
|
||||
this.numRxProbeReq = numRxProbeReq;
|
||||
}
|
||||
|
||||
public void setNumRxPspoll(Integer numRxPspoll) {
|
||||
this.numRxPspoll = numRxPspoll;
|
||||
}
|
||||
|
||||
public void setNumRxRetry(Integer numRxRetry) {
|
||||
this.numRxRetry = numRxRetry;
|
||||
}
|
||||
|
||||
public void setNumRxRts(Integer numRxRts) {
|
||||
this.numRxRts = numRxRts;
|
||||
}
|
||||
|
||||
public void setNumRxStbc(Integer numRxStbc) {
|
||||
this.numRxStbc = numRxStbc;
|
||||
}
|
||||
|
||||
public void setNumTxAction(Integer numTxAction) {
|
||||
this.numTxAction = numTxAction;
|
||||
}
|
||||
|
||||
public void setNumTxAggrOneMpdu(Integer numTxAggrOneMpdu) {
|
||||
this.numTxAggrOneMpdu = numTxAggrOneMpdu;
|
||||
}
|
||||
|
||||
public void setNumTxAggrSucc(Integer numTxAggrSucc) {
|
||||
this.numTxAggrSucc = numTxAggrSucc;
|
||||
}
|
||||
|
||||
public void setNumTxBytes(Long numTxBytes) {
|
||||
this.numTxBytes = numTxBytes;
|
||||
}
|
||||
|
||||
public void setNumTxByteSucc(Long numTxByteSucc) {
|
||||
this.numTxByteSucc = numTxByteSucc;
|
||||
}
|
||||
|
||||
public void setNumTxControl(Integer numTxControl) {
|
||||
this.numTxControl = numTxControl;
|
||||
}
|
||||
|
||||
public void setNumTxData(Integer numTxData) {
|
||||
this.numTxData = numTxData;
|
||||
}
|
||||
|
||||
public void setNumTxDataRetries(Integer numTxDataRetries) {
|
||||
this.numTxDataRetries = numTxDataRetries;
|
||||
}
|
||||
@@ -680,74 +207,14 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
this.numTxDropped = numTxDropped;
|
||||
}
|
||||
|
||||
public void setNumTxEapol(Integer numTxEapol) {
|
||||
this.numTxEapol = numTxEapol;
|
||||
}
|
||||
|
||||
public void setNumTxLdpc(Integer numTxLdpc) {
|
||||
this.numTxLdpc = numTxLdpc;
|
||||
}
|
||||
|
||||
public void setNumTxManagement(Integer numTxManagement) {
|
||||
this.numTxManagement = numTxManagement;
|
||||
}
|
||||
|
||||
public void setNumTxMultiRetries(Integer numTxMultiRetries) {
|
||||
this.numTxMultiRetries = numTxMultiRetries;
|
||||
}
|
||||
|
||||
public void setNumTxNoAck(Integer numTxNoAck) {
|
||||
this.numTxNoAck = numTxNoAck;
|
||||
}
|
||||
|
||||
public void setNumTxPackets(Long numTxPackets) {
|
||||
this.numTxPackets = numTxPackets;
|
||||
}
|
||||
|
||||
public void setNumTxPropResp(Integer numTxPropResp) {
|
||||
this.numTxPropResp = numTxPropResp;
|
||||
}
|
||||
|
||||
public void setNumTxQueued(Long numTxQueued) {
|
||||
this.numTxQueued = numTxQueued;
|
||||
}
|
||||
|
||||
public void setNumTxRetryDropped(Integer numTxRetryDropped) {
|
||||
this.numTxRetryDropped = numTxRetryDropped;
|
||||
}
|
||||
|
||||
public void setNumTxRtsFail(Integer numTxRtsFail) {
|
||||
this.numTxRtsFail = numTxRtsFail;
|
||||
}
|
||||
|
||||
public void setNumTxRtsSucc(Integer numTxRtsSucc) {
|
||||
this.numTxRtsSucc = numTxRtsSucc;
|
||||
}
|
||||
|
||||
public void setNumTxStbc(Integer numTxStbc) {
|
||||
this.numTxStbc = numTxStbc;
|
||||
}
|
||||
|
||||
public void setNumTxSucc(Integer numTxSucc) {
|
||||
this.numTxSucc = numTxSucc;
|
||||
}
|
||||
|
||||
public void setNumTxSuccNoRetry(Integer numTxSuccNoRetry) {
|
||||
this.numTxSuccNoRetry = numTxSuccNoRetry;
|
||||
}
|
||||
|
||||
public void setNumTxSuccRetries(Integer numTxSuccRetries) {
|
||||
this.numTxSuccRetries = numTxSuccRetries;
|
||||
}
|
||||
|
||||
public void setRadioType(RadioType radioType) {
|
||||
this.radioType = radioType;
|
||||
}
|
||||
|
||||
public void setRates(int[] rates) {
|
||||
this.rates = rates;
|
||||
}
|
||||
|
||||
public void setRssi(Integer rssi) {
|
||||
this.rssi = rssi;
|
||||
}
|
||||
@@ -756,18 +223,10 @@ public class ClientMetrics extends ServiceMetricDetails {
|
||||
this.rxBytes = rxBytes;
|
||||
}
|
||||
|
||||
public void setRxDataBytes(Long rxDataBytes) {
|
||||
this.rxDataBytes = rxDataBytes;
|
||||
}
|
||||
|
||||
public void setRxDuplicatePackets(Integer rxDuplicatePackets) {
|
||||
this.rxDuplicatePackets = rxDuplicatePackets;
|
||||
}
|
||||
|
||||
public void setRxLastRssi(Integer rxLastRssi) {
|
||||
this.rxLastRssi = rxLastRssi;
|
||||
}
|
||||
|
||||
public void setSnr(Integer snr) {
|
||||
this.snr = snr;
|
||||
}
|
||||
@@ -792,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;
|
||||
}
|
||||
@@ -824,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);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.telecominfraproject.wlan.status.equipment.report.models;
|
||||
|
||||
import com.telecominfraproject.wlan.status.models.StatusDataType;
|
||||
import com.telecominfraproject.wlan.status.models.StatusDetails;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author rsharma
|
||||
*/
|
||||
public class WiredEthernetPortStatusData extends StatusDetails {
|
||||
private static final long serialVersionUID = 1684955685155400122L;
|
||||
|
||||
// key is ifName, value is the list of wiredPortStatus that link to the ifName
|
||||
private Map<String, List<WiredPortStatus>> interfacePortStatusMap;
|
||||
|
||||
public WiredEthernetPortStatusData() {
|
||||
this.interfacePortStatusMap = new HashMap<>();
|
||||
}
|
||||
|
||||
public WiredEthernetPortStatusData(Map<String, List<WiredPortStatus>> interfacePortStatusMap) {
|
||||
this.interfacePortStatusMap = interfacePortStatusMap;
|
||||
}
|
||||
|
||||
public Map<String, List<WiredPortStatus>> getInterfacePortStatusMap() {
|
||||
return interfacePortStatusMap;
|
||||
}
|
||||
|
||||
public void setInterfacePortStatusMap(Map<String, List<WiredPortStatus>> interfacePortStatusMap) {
|
||||
this.interfacePortStatusMap = interfacePortStatusMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatusDataType getStatusDataType() {
|
||||
return StatusDataType.WIRED_ETHERNET_PORT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof WiredEthernetPortStatusData)) {
|
||||
return false;
|
||||
}
|
||||
WiredEthernetPortStatusData that = (WiredEthernetPortStatusData) o;
|
||||
return Objects.equals(getInterfacePortStatusMap(), that.getInterfacePortStatusMap());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getInterfacePortStatusMap());
|
||||
}
|
||||
|
||||
@Override
|
||||
public WiredEthernetPortStatusData clone() {
|
||||
WiredEthernetPortStatusData data = (WiredEthernetPortStatusData) super.clone();
|
||||
|
||||
if (interfacePortStatusMap != null) {
|
||||
data.interfacePortStatusMap = new HashMap<>(interfacePortStatusMap);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.telecominfraproject.wlan.status.equipment.report.models;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author rsharma
|
||||
*/
|
||||
public class WiredPortStatus extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = 5525006111579379607L;
|
||||
|
||||
private String name; // eth_port: eth0 or eth1
|
||||
private String originalIfName; // ifName when the AP came up (lan, wan etc.)
|
||||
private String currentIfName; // Current ifName (e.g. lan, wan etc.)
|
||||
private String ifType; // bridge/Nat/eth/vlan
|
||||
private int speed; // in MBPS
|
||||
private String duplex; // full, half
|
||||
private String operationalState; // Operational State
|
||||
private int vlanId; // tagged VlanId
|
||||
private boolean trunkEnabled; // trunk enabled or disabled
|
||||
private List<Integer> allowedVlanIds; // allowed vlanIds
|
||||
|
||||
public WiredPortStatus() {
|
||||
|
||||
}
|
||||
|
||||
public WiredPortStatus(String name, String originalIfName, String currentIfName, String ifType, int speed, String duplex,
|
||||
String operationalState, int vlanId, boolean trunkEnabled, List<Integer> allowedVlanIds) {
|
||||
this.name = name;
|
||||
this.originalIfName = originalIfName;
|
||||
this.currentIfName = currentIfName;
|
||||
this.ifType = ifType;
|
||||
this.speed = speed;
|
||||
this.duplex = duplex;
|
||||
this.operationalState = operationalState;
|
||||
this.vlanId = vlanId;
|
||||
this.trunkEnabled = trunkEnabled;
|
||||
this.allowedVlanIds = allowedVlanIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof WiredPortStatus)) {
|
||||
return false;
|
||||
}
|
||||
WiredPortStatus that = (WiredPortStatus) o;
|
||||
return getSpeed() == that.getSpeed() && Objects.equals(getName(), that.getName())
|
||||
&& Objects.equals(getOriginalIfName(), that.getOriginalIfName())
|
||||
&& Objects.equals(getCurrentIfName(), that.getCurrentIfName())
|
||||
&& Objects.equals(getIfType(), that.getIfType())
|
||||
&& Objects.equals(getDuplex(), that.getDuplex())
|
||||
&& Objects.equals(getOperationalState(), that.getOperationalState())
|
||||
&& getVlanId() == that.getVlanId()
|
||||
&& Objects.equals(getAllowedVlanIds(), that.getAllowedVlanIds())
|
||||
&& Objects.equals(isTrunkEnabled(), that.isTrunkEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getName(), getOriginalIfName(), getCurrentIfName(), getIfType(), getSpeed(), getDuplex(),
|
||||
getOperationalState(), getVlanId(), getAllowedVlanIds(), isTrunkEnabled());
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getOriginalIfName() {
|
||||
return originalIfName;
|
||||
}
|
||||
|
||||
public void setOriginalIfName(String originalIfName) {
|
||||
this.originalIfName = originalIfName;
|
||||
}
|
||||
|
||||
public String getCurrentIfName() {
|
||||
return currentIfName;
|
||||
}
|
||||
|
||||
public void setCurrentIfName(String currentIfName) {
|
||||
this.currentIfName = currentIfName;
|
||||
}
|
||||
|
||||
public String getIfType() {
|
||||
return ifType;
|
||||
}
|
||||
|
||||
public void setIfType(String ifType) {
|
||||
this.ifType = ifType;
|
||||
}
|
||||
|
||||
public int getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(int speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public String getDuplex() {
|
||||
return duplex;
|
||||
}
|
||||
|
||||
public void setDuplex(String duplex) {
|
||||
this.duplex = duplex;
|
||||
}
|
||||
|
||||
public String getOperationalState() {
|
||||
return operationalState;
|
||||
}
|
||||
|
||||
public void setOperationalState(String operationalState) {
|
||||
this.operationalState = operationalState;
|
||||
}
|
||||
|
||||
public int getVlanId() {
|
||||
return vlanId;
|
||||
}
|
||||
|
||||
public void setVlanId(int vlanId) {
|
||||
this.vlanId = vlanId;
|
||||
}
|
||||
|
||||
public List<Integer> getAllowedVlanIds() {
|
||||
return allowedVlanIds;
|
||||
}
|
||||
|
||||
public void setAllowedVlanIds(List<Integer> allowedVlanIds) {
|
||||
this.allowedVlanIds = allowedVlanIds;
|
||||
}
|
||||
|
||||
public boolean isTrunkEnabled() {
|
||||
return trunkEnabled;
|
||||
}
|
||||
|
||||
public void setTrunkEnabled(boolean trunkEnabled) {
|
||||
this.trunkEnabled = trunkEnabled;
|
||||
}
|
||||
}
|
||||
@@ -101,6 +101,9 @@ public class StatusDataType implements EnumWithId {
|
||||
*/
|
||||
EQUIPMENT_MANUFACTURER_DATA = new StatusDataType(17, "EQUIPMENT_MANUFACTURER_DATA", Set.of(StatusTrait.DeleteOnEquipmentDisconnect)),
|
||||
|
||||
// STATUS OF ETHERNET PORTS ON THE DEVICE
|
||||
WIRED_ETHERNET_PORT = new StatusDataType(18, "WIRED_ETHERNET_PORT", Set.of(StatusTrait.DeleteOnEquipmentDisconnect)),
|
||||
|
||||
UNSUPPORTED = new StatusDataType(-1, "UNSUPPORTED") ;
|
||||
|
||||
static {
|
||||
|
||||
Reference in New Issue
Block a user