mirror of
https://github.com/Telecominfraproject/wlan-cloud-services.git
synced 2026-03-20 19:39:19 +00:00
Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90ac57b988 | ||
|
|
0cc90764c6 | ||
|
|
3d2f4db32a | ||
|
|
c75d44ff03 | ||
|
|
799b243cc4 | ||
|
|
8834c33d90 | ||
|
|
e9c54a892b | ||
|
|
8353dd375f | ||
|
|
46de84b28b | ||
|
|
9edca1fd9d | ||
|
|
5714c9bf32 | ||
|
|
2b2e34a064 | ||
|
|
d7a75faf4c | ||
|
|
5fd977f064 | ||
|
|
bafec1fdd8 | ||
|
|
6b046e0a7a | ||
|
|
fb6604cdf5 | ||
|
|
2c1c60344e | ||
|
|
9e959e258f | ||
|
|
2410233046 | ||
|
|
a7f91a29f8 | ||
|
|
80cd0abd58 | ||
|
|
4555ff339b | ||
|
|
04a13877d1 | ||
|
|
e148bab291 | ||
|
|
9ad3cec4af | ||
|
|
dc0b838f83 | ||
|
|
7cac7fff3f | ||
|
|
b48340b709 | ||
|
|
44b3836758 | ||
|
|
4f0b032549 | ||
|
|
5ba0c4c242 | ||
|
|
304e80332a | ||
|
|
9fd3e73398 | ||
|
|
b9db744aee | ||
|
|
1eee65d284 | ||
|
|
75c943211a | ||
|
|
d0a0ed59fe | ||
|
|
a200fcc12e | ||
|
|
1f6996abb2 | ||
|
|
1ebaa4a539 | ||
|
|
f1e1bdffd7 | ||
|
|
37f5872552 | ||
|
|
367b9ec428 | ||
|
|
87ca619ad5 | ||
|
|
622f78f681 | ||
|
|
faeb65d8d6 | ||
|
|
34841a3a04 | ||
|
|
4fc8bc4018 | ||
|
|
cce36019fe | ||
|
|
4596280090 | ||
|
|
caaa8fb4e3 | ||
|
|
b957c8bf72 | ||
|
|
b797cc392f | ||
|
|
5fc9715649 | ||
|
|
0a66897e48 | ||
|
|
8d77fcb090 | ||
|
|
256d9fbd16 | ||
|
|
39e14da2e6 | ||
|
|
996c60adf6 | ||
|
|
879abe3beb | ||
|
|
796d657952 | ||
|
|
52ed5f6344 | ||
|
|
f5869961b2 | ||
|
|
f02cadbdc3 | ||
|
|
c45cabf607 | ||
|
|
c9faf138da | ||
|
|
f6b96fc566 | ||
|
|
a089e7b748 | ||
|
|
e790db2c2b | ||
|
|
b03dccc63f | ||
|
|
03eccfa448 |
@@ -121,6 +121,10 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
|
||||
" from " + TABLE_NAME + " " +
|
||||
" where customerId = ? ";
|
||||
|
||||
private static final String CQL_GET_ALL =
|
||||
"select " + ALL_COLUMNS +
|
||||
" from " + TABLE_NAME + " ";
|
||||
|
||||
private static final String CQL_GET_LASTMOD_BY_ID =
|
||||
"select lastModifiedTimestamp " +
|
||||
" from "+TABLE_NAME+" " +
|
||||
@@ -922,4 +926,51 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
|
||||
return alarmCounts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Alarm> get(Set<AlarmCode> alarmCodes, long createdAfterTimestamp) {
|
||||
|
||||
if (alarmCodes == null || alarmCodes.isEmpty()) {
|
||||
throw new IllegalArgumentException("alarmCodes must be provided");
|
||||
}
|
||||
|
||||
LOG.debug("Looking up Alarms for alarmCodes {} createdAfter {}", alarmCodes, createdAfterTimestamp);
|
||||
|
||||
String query = CQL_GET_ALL;
|
||||
|
||||
// add filters for the query
|
||||
ArrayList<Object> queryArgs = new ArrayList<>();
|
||||
|
||||
// add alarmCodes filters
|
||||
alarmCodes.forEach(ac -> queryArgs.add(ac.getId()));
|
||||
|
||||
StringBuilder strb = new StringBuilder(100);
|
||||
strb.append("where alarmCode in (");
|
||||
for (int i = 0; i < alarmCodes.size(); i++) {
|
||||
strb.append("?");
|
||||
if (i < alarmCodes.size() - 1) {
|
||||
strb.append(",");
|
||||
}
|
||||
}
|
||||
strb.append(") ");
|
||||
|
||||
if (createdAfterTimestamp > 0) {
|
||||
strb.append(" and createdTimestamp > ?");
|
||||
queryArgs.add(createdAfterTimestamp);
|
||||
}
|
||||
strb.append(" allow filtering");
|
||||
query += strb.toString();
|
||||
|
||||
List<Alarm> ret = new ArrayList<>();
|
||||
|
||||
PreparedStatement preparedStmt_getListForCustomer = cqlSession.prepare(query);
|
||||
|
||||
ResultSet rs = cqlSession.execute(preparedStmt_getListForCustomer.bind(queryArgs.toArray()));
|
||||
|
||||
rs.forEach(row -> ret.add(alarmRowMapper.mapRow(row)));
|
||||
|
||||
LOG.debug("Found {} Alarms for alarmCodes {} createdAfter {}", ret.size(), alarmCodes, createdAfterTimestamp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -356,4 +356,25 @@ public class AlarmDatastoreInMemory extends BaseInMemoryDatastore implements Ala
|
||||
|
||||
return alarmCounts;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Alarm> get(Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp) {
|
||||
|
||||
if (alarmCodeSet == null || alarmCodeSet.isEmpty()) {
|
||||
throw new IllegalArgumentException("alarmCodeSet must be provided");
|
||||
}
|
||||
|
||||
List<Alarm> ret = new ArrayList<>();
|
||||
|
||||
idToAlarmMap.values().forEach(a -> {
|
||||
if (alarmCodeSet.contains(a.getAlarmCode()) && a.getCreatedTimestamp() > createdAfterTimestamp) {
|
||||
ret.add(a.clone());
|
||||
}
|
||||
});
|
||||
|
||||
LOG.debug("Found Alarms {}", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,4 +71,14 @@ public interface AlarmDatastore {
|
||||
*/
|
||||
AlarmCounts getAlarmCounts(int customerId, Set<Long> equipmentIdSet, Set<AlarmCode> alarmCodeSet, Boolean acknowledged);
|
||||
|
||||
/**
|
||||
* Retrieves a list of Alarms for the given alarm codes.
|
||||
*
|
||||
* @param alarmCodeSet - null or empty means include all alarm codes
|
||||
* @param createdAfterTimestamp
|
||||
* @return list of matching Alarm objects.
|
||||
* @throws IllegalArgumentException if supplied alarmCodeSet is null or empty
|
||||
*/
|
||||
List<Alarm> get(Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp);
|
||||
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class AlarmCode implements EnumWithId {
|
||||
public static final AlarmCode
|
||||
LimitedCloudConnectivity = new AlarmCode(3, "LimitedCloudConnectivity", "Equipment is connected, however it's not reporting status or metrics", StatusCode.error, "Service AP and verify networking path to cloud"),
|
||||
AccessPointIsUnreachable = new AlarmCode(4, "AccessPointIsUnreachable", "Equipment is not reachable from cloud", StatusCode.error, "Service AP and verify networking path to cloud"),
|
||||
NoMetricsReceived = new AlarmCode(6, "NoMetricsReceived", "Equipment is not report metrics"),
|
||||
NoMetricsReceived = new AlarmCode(6, "NoMetricsReceived", "Metrics are not received from the equipment"),
|
||||
NoiseFloor2G = new AlarmCode(7, "NoiseFloor2G", "Noise floor is too high on 2G radio", StatusCode.requiresAttention, "Investigate interference sources"),
|
||||
ChannelUtilization2G = new AlarmCode(8, "ChannelUtilization2G", "Channel utilization is too high on 2G radio", StatusCode.requiresAttention, "Consider adding more APs"),
|
||||
NoiseFloor5G = new AlarmCode(9, "NoiseFloor5G", "Noise floor is too high on 5G radio", StatusCode.requiresAttention, "Investigate interference sources"),
|
||||
|
||||
@@ -113,5 +113,16 @@ public interface AlarmServiceInterface {
|
||||
* @return alarm counts for the given filters
|
||||
*/
|
||||
AlarmCounts getAlarmCounts(int customerId, Set<Long> equipmentIdSet, Set<AlarmCode> alarmCodeSet, Boolean acknowledged);
|
||||
|
||||
/**
|
||||
* Retrieves a list of Alarms for the given alarm codes.
|
||||
*
|
||||
* @param alarmCodeSet - null or empty means include all alarm codes
|
||||
* @param createdAfterTimestamp
|
||||
* @return list of matching Alarm objects.
|
||||
* @throws IllegalArgumentException if supplied alarmCodeSet is null or empty
|
||||
*/
|
||||
List<Alarm> get(Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -47,6 +47,10 @@ public class AlarmServiceLocal implements AlarmServiceInterface {
|
||||
return alarmController.getAllForEquipment(customerId, equipmentIdSet, alarmCodeSet, createdAfterTimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Alarm> get(Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp) {
|
||||
return alarmController.getAllForAlarmCode(alarmCodeSet, createdAfterTimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Alarm update(Alarm alarm) {
|
||||
|
||||
@@ -52,6 +52,17 @@
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-service-local</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -241,14 +241,45 @@ public class AlarmServiceRemote extends BaseRemoteClient implements AlarmService
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Alarm> get(Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp) {
|
||||
LOG.debug("get({},{})", alarmCodeSet, createdAfterTimestamp);
|
||||
|
||||
if (alarmCodeSet == null || alarmCodeSet.isEmpty()) {
|
||||
throw new IllegalArgumentException("alarmCodeSet must be provided");
|
||||
}
|
||||
|
||||
String alarmCodeSetStr = alarmCodeSet.toString();
|
||||
// remove [] around the string, otherwise will get:
|
||||
// Failed to convert value of type 'java.lang.String' to required
|
||||
// type 'java.util.Set'; nested exception is
|
||||
// java.lang.NumberFormatException: For input string: "[690]"
|
||||
alarmCodeSetStr = alarmCodeSetStr.substring(1, alarmCodeSetStr.length() - 1);
|
||||
|
||||
try {
|
||||
ResponseEntity<List<Alarm>> responseEntity =
|
||||
restTemplate.exchange(getBaseUrl() + "/forAlarmCode?alarmCodeSet={alarmCodeSetStr}&createdAfterTimestamp={createdAfterTimestamp}",
|
||||
HttpMethod.GET, null, Alarm_LIST_CLASS_TOKEN, alarmCodeSetStr, createdAfterTimestamp);
|
||||
|
||||
List<Alarm> result = responseEntity.getBody();
|
||||
if (null == result) {
|
||||
result = Collections.emptyList();
|
||||
}
|
||||
LOG.debug("get({},{}) return {} entries", alarmCodeSet, createdAfterTimestamp, result.size());
|
||||
return result;
|
||||
} catch (Exception exp) {
|
||||
LOG.error("getAllInSet({},{}) exception ", alarmCodeSet, createdAfterTimestamp, exp);
|
||||
throw exp;
|
||||
}
|
||||
}
|
||||
|
||||
public String getBaseUrl() {
|
||||
if(baseUrl==null) {
|
||||
baseUrl = environment.getProperty("tip.wlan.alarmServiceBaseUrl").trim()+"/api/alarm";
|
||||
}
|
||||
|
||||
return baseUrl;
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -26,12 +27,17 @@ import com.telecominfraproject.wlan.alarm.models.Alarm;
|
||||
import com.telecominfraproject.wlan.alarm.models.AlarmCode;
|
||||
import com.telecominfraproject.wlan.alarm.models.AlarmCounts;
|
||||
import com.telecominfraproject.wlan.alarm.models.AlarmDetails;
|
||||
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherEmpty;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.SortOrder;
|
||||
import com.telecominfraproject.wlan.datastore.exceptions.DsConcurrentModificationException;
|
||||
import com.telecominfraproject.wlan.datastore.exceptions.DsEntityNotFoundException;
|
||||
import com.telecominfraproject.wlan.equipment.EquipmentServiceLocal;
|
||||
import com.telecominfraproject.wlan.equipment.datastore.inmemory.EquipmentDatastoreInMemory;
|
||||
import com.telecominfraproject.wlan.equipment.models.Equipment;
|
||||
import com.telecominfraproject.wlan.remote.tests.BaseRemoteTest;
|
||||
import com.telecominfraproject.wlan.status.models.StatusCode;
|
||||
|
||||
@@ -44,10 +50,16 @@ import com.telecominfraproject.wlan.status.models.StatusCode;
|
||||
"integration_test",
|
||||
"no_ssl","http_digest_auth","rest-template-single-user-per-service-digest-auth",
|
||||
}) //NOTE: these profiles will be ADDED to the list of active profiles
|
||||
@Import(value = {
|
||||
EquipmentServiceLocal.class,
|
||||
EquipmentDatastoreInMemory.class,
|
||||
CloudEventDispatcherEmpty.class
|
||||
})
|
||||
public class AlarmServiceRemoteTest extends BaseRemoteTest {
|
||||
|
||||
|
||||
@Autowired AlarmServiceRemote remoteInterface;
|
||||
@Autowired EquipmentServiceLocal equipmentServicelocal;
|
||||
|
||||
@Before public void urlSetup(){
|
||||
configureBaseUrl("tip.wlan.alarmServiceBaseUrl");
|
||||
@@ -505,8 +517,10 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
|
||||
public void testAlarmCountsRetrieval() {
|
||||
//create some Alarms
|
||||
Alarm mdl;
|
||||
int customerId_1 = getNextCustomerId();
|
||||
int customerId_2 = getNextCustomerId();
|
||||
final int customerId_1 = getNextCustomerId();
|
||||
final int customerId_2 = getNextCustomerId();
|
||||
final long equipmentId_1 = createEquipmentObject(customerId_1).getId();
|
||||
|
||||
|
||||
int apNameIdx = 0;
|
||||
Set<Long> equipmentIds = new HashSet<>();
|
||||
@@ -514,8 +528,8 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
|
||||
Set<Long> equipmentIds_AccessPointIsUnreachable = new HashSet<>();
|
||||
|
||||
for(int i = 0; i< 50; i++){
|
||||
mdl = createAlarmObject();
|
||||
mdl.setCustomerId(customerId_1);
|
||||
mdl = createAlarmObject(customerId_1, createEquipmentObject(customerId_1).getId());
|
||||
mdl.setEquipmentId(createEquipmentObject(customerId_1).getId());
|
||||
mdl.setScopeId("qr_"+apNameIdx);
|
||||
if((i%2) == 0) {
|
||||
mdl.setAlarmCode(AlarmCode.CPUUtilization);
|
||||
@@ -530,16 +544,14 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
|
||||
remoteInterface.create(mdl);
|
||||
}
|
||||
|
||||
mdl = createAlarmObject();
|
||||
mdl = createAlarmObject(customerId_1, equipmentId_1);
|
||||
mdl.setCustomerId(customerId_1);
|
||||
mdl.setEquipmentId(0);
|
||||
mdl.setAlarmCode(AlarmCode.GenericError);
|
||||
|
||||
remoteInterface.create(mdl);
|
||||
|
||||
for(int i = 0; i< 50; i++){
|
||||
mdl = createAlarmObject();
|
||||
mdl.setCustomerId(customerId_2);
|
||||
mdl = createAlarmObject(customerId_2, createEquipmentObject(customerId_2).getId());
|
||||
mdl.setScopeId("qr_"+apNameIdx);
|
||||
mdl.setAcknowledged(false);
|
||||
mdl.setAlarmCode(AlarmCode.GenericError);
|
||||
@@ -651,18 +663,33 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
|
||||
}
|
||||
|
||||
private Alarm createAlarmObject() {
|
||||
Alarm result = new Alarm();
|
||||
result.setCustomerId(getNextCustomerId());
|
||||
result.setEquipmentId(getNextEquipmentId());
|
||||
int customerId = getNextCustomerId();
|
||||
return createAlarmObject(customerId, createEquipmentObject(customerId).getId());
|
||||
}
|
||||
|
||||
private Alarm createAlarmObject(int customerId, long equipmentId) {
|
||||
Alarm result = new Alarm();
|
||||
result.setCustomerId(customerId);
|
||||
result.setAlarmCode(AlarmCode.AccessPointIsUnreachable);
|
||||
result.setCreatedTimestamp(System.currentTimeMillis());
|
||||
result.setEquipmentId(equipmentId);
|
||||
|
||||
result.setScopeId("test-scope-" + result.getEquipmentId());
|
||||
|
||||
AlarmDetails details = new AlarmDetails();
|
||||
details.setMessage("test-details-" + result.getEquipmentId());
|
||||
result.setDetails(details );
|
||||
result.setDetails(details );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private Equipment createEquipmentObject(int customerId)
|
||||
{
|
||||
Equipment equipment = new Equipment();
|
||||
equipment.setName("testName");
|
||||
equipment.setInventoryId("test-inv");
|
||||
equipment.setEquipmentType(EquipmentType.AP);
|
||||
equipment.setCustomerId(customerId);
|
||||
return equipmentServicelocal.create(equipment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,53 +1,70 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../wlan-cloud-root</relativePath>
|
||||
</parent>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../wlan-cloud-root</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>alarm-service</artifactId>
|
||||
<name>alarm-service</name>
|
||||
<description>Server side implementation of the service.</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>base-container</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>alarm-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>alarm-datastore-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>alarm-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<artifactId>alarm-service</artifactId>
|
||||
<name>alarm-service</name>
|
||||
<description>Server side implementation of the service.</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>base-container</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-empty</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<dependency>
|
||||
<artifactId>alarm-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>alarm-datastore-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>alarm-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-service-local</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-empty</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
||||
import com.telecominfraproject.wlan.datastore.exceptions.DsDataValidationException;
|
||||
import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
|
||||
import com.telecominfraproject.wlan.systemevent.models.SystemEvent;
|
||||
|
||||
import com.telecominfraproject.wlan.alarm.datastore.AlarmDatastore;
|
||||
@@ -48,6 +49,7 @@ public class AlarmController {
|
||||
|
||||
@Autowired private AlarmDatastore alarmDatastore;
|
||||
@Autowired private CloudEventDispatcherInterface cloudEventDispatcher;
|
||||
@Autowired private EquipmentServiceInterface equipmentServiceInterface;
|
||||
|
||||
|
||||
/**
|
||||
@@ -66,6 +68,14 @@ public class AlarmController {
|
||||
LOG.error("Failed to create Alarm, request contains unsupported value: {}", alarm);
|
||||
throw new DsDataValidationException("Alarm contains unsupported value");
|
||||
}
|
||||
|
||||
if (alarm.getEquipmentId() != 0)
|
||||
{
|
||||
if (equipmentServiceInterface.getOrNull(alarm.getEquipmentId()) == null)
|
||||
{
|
||||
throw new DsDataValidationException(String.format("Unable to create alarm for non-existant equipment ID: %d", alarm.getEquipmentId()));
|
||||
}
|
||||
}
|
||||
|
||||
long ts = alarm.getCreatedTimestamp();
|
||||
if (ts == 0) {
|
||||
@@ -119,6 +129,24 @@ public class AlarmController {
|
||||
throw exp;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/forAlarmCode", method = RequestMethod.GET)
|
||||
public ListOfAlarms getAllForAlarmCode(
|
||||
@RequestParam Set<AlarmCode> alarmCode,
|
||||
@RequestParam long createdAfterTimestamp) {
|
||||
LOG.debug("getAllForAlarmCode({}, {})", alarmCode, createdAfterTimestamp);
|
||||
try {
|
||||
List<Alarm> result = alarmDatastore.get(alarmCode, createdAfterTimestamp);
|
||||
LOG.debug("getAllForAlarmCode({},{}) return {} entries", alarmCode, createdAfterTimestamp, result.size());
|
||||
ListOfAlarms ret = new ListOfAlarms();
|
||||
ret.addAll(result);
|
||||
return ret;
|
||||
} catch (Exception exp) {
|
||||
LOG.error("getAllForAlarmCode({},{}) exception ", alarmCode, createdAfterTimestamp, exp);
|
||||
throw exp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/forCustomer", method = RequestMethod.GET)
|
||||
public PaginationResponse<Alarm> getForCustomer(@RequestParam int customerId,
|
||||
|
||||
@@ -17,7 +17,11 @@ import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherEmpty;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
|
||||
import com.telecominfraproject.wlan.equipment.EquipmentServiceLocal;
|
||||
import com.telecominfraproject.wlan.equipment.controller.EquipmentController;
|
||||
import com.telecominfraproject.wlan.equipment.datastore.inmemory.EquipmentDatastoreInMemory;
|
||||
import com.telecominfraproject.wlan.equipment.models.Equipment;
|
||||
import com.telecominfraproject.wlan.alarm.datastore.inmemory.AlarmDatastoreInMemory;
|
||||
import com.telecominfraproject.wlan.alarm.models.Alarm;
|
||||
import com.telecominfraproject.wlan.alarm.models.AlarmCode;
|
||||
@@ -39,10 +43,14 @@ import com.telecominfraproject.wlan.alarm.models.AlarmDetails;
|
||||
CloudEventDispatcherEmpty.class,
|
||||
AlarmDatastoreInMemory.class,
|
||||
AlarmControllerTest.Config.class,
|
||||
EquipmentServiceLocal.class,
|
||||
EquipmentController.class,
|
||||
EquipmentDatastoreInMemory.class
|
||||
})
|
||||
public class AlarmControllerTest {
|
||||
|
||||
@Autowired private AlarmController alarmController;
|
||||
@Autowired EquipmentServiceLocal equipmentServicelocal;
|
||||
|
||||
|
||||
@Configuration
|
||||
@@ -59,8 +67,9 @@ public class AlarmControllerTest {
|
||||
|
||||
//Create new Alarm - success
|
||||
Alarm alarm = new Alarm();
|
||||
alarm.setCustomerId((int) testSequence.getAndIncrement());
|
||||
alarm.setEquipmentId(testSequence.getAndIncrement());
|
||||
int customerId = (int) testSequence.getAndIncrement();
|
||||
alarm.setCustomerId(customerId);
|
||||
alarm.setEquipmentId(createEquipmentObject(customerId).getId());
|
||||
alarm.setAlarmCode(AlarmCode.AccessPointIsUnreachable);
|
||||
alarm.setCreatedTimestamp(System.currentTimeMillis());
|
||||
|
||||
@@ -91,5 +100,14 @@ public class AlarmControllerTest {
|
||||
assertEquals(expected.getDetails(), actual.getDetails());
|
||||
//TODO: add more fields to check here
|
||||
}
|
||||
|
||||
|
||||
private Equipment createEquipmentObject(int customerId)
|
||||
{
|
||||
Equipment equipment = new Equipment();
|
||||
equipment.setName("testName");
|
||||
equipment.setInventoryId("test-inv");
|
||||
equipment.setEquipmentType(EquipmentType.AP);
|
||||
equipment.setCustomerId(customerId);
|
||||
return equipmentServicelocal.create(equipment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,12 +349,6 @@
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-alarms-sp</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>adoption-metrics-sp</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
|
||||
@@ -250,12 +250,6 @@
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-alarms-sp</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>adoption-metrics-sp</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
|
||||
@@ -336,12 +336,6 @@
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-alarms-sp</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>adoption-metrics-sp</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package com.telecominfraproject.wlan.startuptasks;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.net.Inet4Address;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
||||
|
||||
import com.telecominfraproject.wlan.client.datastore.ClientDatastore;
|
||||
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
|
||||
import com.telecominfraproject.wlan.client.models.Client;
|
||||
import com.telecominfraproject.wlan.client.session.models.ClientSession;
|
||||
|
||||
@@ -45,6 +46,12 @@ public class ClientDatastoreCassandra implements ClientDatastore {
|
||||
return clientDAO.delete(customerId, clientMac);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(long createdBeforeTimestamp) {
|
||||
//This should be handled by Cassandra's life cycle for data.
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Client> get(int customerId, Set<MacAddress> clientMacSet) {
|
||||
return clientDAO.get(customerId, clientMacSet);
|
||||
@@ -80,6 +87,12 @@ public class ClientDatastoreCassandra implements ClientDatastore {
|
||||
public ClientSession deleteSession(int customerId, long equipmentId, MacAddress clientMac) {
|
||||
return clientSessionDAO.deleteSession(customerId, equipmentId, clientMac);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSessions(long createdBeforeTimestamp) {
|
||||
//This should be handled by Cassandra's lifecycle for data.
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClientSession> getSessions(int customerId, Set<MacAddress> clientMacSet) {
|
||||
@@ -96,6 +109,13 @@ public class ClientDatastoreCassandra implements ClientDatastore {
|
||||
|
||||
return clientSessionDAO.getSessionsForCustomer(customerId, equipmentIds, locationIds, macSubstring, sortBy, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientSessionCounts getSessionCounts(int customerId) {
|
||||
// Not yet supported.
|
||||
ClientSessionCounts counts = new ClientSessionCounts();
|
||||
return counts;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.telecominfraproject.wlan.client.datastore.inmemory;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -15,6 +16,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.telecominfraproject.wlan.client.datastore.ClientDatastore;
|
||||
import com.telecominfraproject.wlan.client.info.models.ClientInfoDetails;
|
||||
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
|
||||
import com.telecominfraproject.wlan.client.models.Client;
|
||||
import com.telecominfraproject.wlan.client.session.models.ClientSession;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||
@@ -156,6 +158,11 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
|
||||
//client is already cloned by the getOrNull method
|
||||
return client;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(long createdBeforeTimestamp) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Client> get(int customerId, Set<MacAddress> clientMacSet) {
|
||||
@@ -362,6 +369,10 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
|
||||
return clientSession.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSessions(long createdBeforeTimestamp) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClientSession> getSessions(int customerId, Set<MacAddress> clientMacSet) {
|
||||
@@ -503,4 +514,56 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientSessionCounts getSessionCounts(int customerId) {
|
||||
ClientSessionCounts counts = new ClientSessionCounts();
|
||||
counts.setCustomerId(customerId);
|
||||
|
||||
long totalCount = 0;
|
||||
Map<String, Long> perEquipmentMap = new HashMap<>();
|
||||
Map<String, Long> perOuiMap = new HashMap<>();
|
||||
Map<String, Long> perRadioMap = new HashMap<>();
|
||||
|
||||
for (ClientSession session : idToClientSessionMap.values()) {
|
||||
if (session.getCustomerId() == customerId) {
|
||||
totalCount++;
|
||||
String equipmentIdString = Long.toString(session.getEquipmentId());
|
||||
Long cnt = perEquipmentMap.get(equipmentIdString);
|
||||
if (cnt == null) {
|
||||
cnt = 0L;
|
||||
} else {
|
||||
cnt++;
|
||||
}
|
||||
perEquipmentMap.put(equipmentIdString, cnt);
|
||||
|
||||
if (session.getOui() != null) {
|
||||
cnt = perOuiMap.get(session.getOui());
|
||||
if (cnt == null) {
|
||||
cnt = 0L;
|
||||
} else {
|
||||
cnt++;
|
||||
}
|
||||
perOuiMap.put(session.getOui(), cnt);
|
||||
}
|
||||
|
||||
if (session.getDetails() != null && session.getDetails().getRadioType() != null) {
|
||||
String radioTypeString = session.getDetails().getRadioType().toString();
|
||||
cnt = perRadioMap.get(radioTypeString);
|
||||
if (cnt == null) {
|
||||
cnt = 0L;
|
||||
} else {
|
||||
cnt++;
|
||||
}
|
||||
perRadioMap.put(radioTypeString, cnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
counts.setTotalCount(totalCount);
|
||||
counts.setEquipmentCounts(perEquipmentMap);
|
||||
counts.setOuiCounts(perOuiMap);
|
||||
counts.setRadioCounts(perRadioMap);
|
||||
return counts;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
|
||||
import com.telecominfraproject.wlan.client.models.Client;
|
||||
import com.telecominfraproject.wlan.client.session.models.ClientSession;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||
@@ -21,6 +22,7 @@ public interface ClientDatastore {
|
||||
Client getOrNull(int customerId, MacAddress clientMac);
|
||||
Client update(Client client);
|
||||
Client delete(int customerId, MacAddress clientMac);
|
||||
void delete(long createdBeforeTimestamp);
|
||||
|
||||
/**
|
||||
* Retrieves a list of Client records that which have their mac address in the provided set.
|
||||
@@ -72,7 +74,7 @@ public interface ClientDatastore {
|
||||
|
||||
|
||||
ClientSession deleteSession(int customerId, long equipmentId, MacAddress clientMac);
|
||||
|
||||
void deleteSessions(long createdBeforeTimestamp);
|
||||
/**
|
||||
* Retrieves a list of Client sessions that which have their mac address in the provided set.
|
||||
*
|
||||
@@ -104,5 +106,12 @@ public interface ClientDatastore {
|
||||
*/
|
||||
PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context);
|
||||
|
||||
/**
|
||||
* Get Client Session counts for the given customerId.
|
||||
*
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
ClientSessionCounts getSessionCounts(int customerId);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
|
||||
package com.telecominfraproject.wlan.client.info.models;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
|
||||
/**
|
||||
* Total and per-oui/equipment/radio counts of the Client Sessions
|
||||
*/
|
||||
public class ClientSessionCounts extends BaseJsonModel {
|
||||
|
||||
private static final long serialVersionUID = 7697349699510565184L;
|
||||
|
||||
private int customerId;
|
||||
/**
|
||||
* Total count of all client sessions for the customer Id.
|
||||
*/
|
||||
private long totalCount;
|
||||
/**
|
||||
* Counts of client sessions per equipment Id.
|
||||
*/
|
||||
private Map<String, Long> equipmentCounts = new HashMap<>();
|
||||
/**
|
||||
* Counts of client sessions per OUI.
|
||||
*/
|
||||
private Map<String, Long> ouiCounts = new HashMap<>();
|
||||
/**
|
||||
* Counts of client sessions per Radio Type.
|
||||
*/
|
||||
private Map<String, Long> radioCounts = new HashMap<>();
|
||||
|
||||
public int getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
|
||||
public void setCustomerId(int customerId) {
|
||||
this.customerId = customerId;
|
||||
}
|
||||
|
||||
public long getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public void setTotalCount(long totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
public Map<String, Long> getEquipmentCounts() {
|
||||
return equipmentCounts;
|
||||
}
|
||||
|
||||
public void setEquipmentCounts(Map<String, Long> equipmentCounts) {
|
||||
this.equipmentCounts = equipmentCounts;
|
||||
}
|
||||
|
||||
public Map<String, Long> getOuiCounts() {
|
||||
return ouiCounts;
|
||||
}
|
||||
|
||||
public void setOuiCounts(Map<String, Long> ouiCounts) {
|
||||
this.ouiCounts = ouiCounts;
|
||||
}
|
||||
|
||||
public Map<String, Long> getRadioCounts() {
|
||||
return radioCounts;
|
||||
}
|
||||
|
||||
public void setRadioCounts(Map<String, Long> radioCounts) {
|
||||
this.radioCounts = radioCounts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientSessionCounts clone() {
|
||||
ClientSessionCounts ret = (ClientSessionCounts) super.clone();
|
||||
if (equipmentCounts != null) {
|
||||
ret.equipmentCounts = new HashMap<>(equipmentCounts);
|
||||
}
|
||||
if (ouiCounts != null) {
|
||||
ret.ouiCounts = new HashMap<>(ouiCounts);
|
||||
}
|
||||
if (radioCounts != null) {
|
||||
ret.radioCounts = new HashMap<>(radioCounts);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.telecominfraproject.wlan.client.models.events.realtime;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.net.InetAddress;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||
@@ -14,7 +14,7 @@ public class ClientIpAddressEvent extends RealTimeEvent implements HasClientMac
|
||||
|
||||
private long sessionId;
|
||||
private MacAddress clientMacAddress;
|
||||
private byte[] ipAddr;
|
||||
private InetAddress ipAddr;
|
||||
|
||||
public ClientIpAddressEvent() {
|
||||
// serialization
|
||||
@@ -45,11 +45,11 @@ public class ClientIpAddressEvent extends RealTimeEvent implements HasClientMac
|
||||
this.clientMacAddress = clientMacAddress;
|
||||
}
|
||||
|
||||
public byte[] getIpAddr() {
|
||||
public InetAddress getIpAddr() {
|
||||
return ipAddr;
|
||||
}
|
||||
|
||||
public void setIpAddr(byte[] ipAddr) {
|
||||
public void setIpAddr(InetAddress ipAddr) {
|
||||
this.ipAddr = ipAddr;
|
||||
}
|
||||
|
||||
@@ -57,8 +57,7 @@ public class ClientIpAddressEvent extends RealTimeEvent implements HasClientMac
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + Arrays.hashCode(this.ipAddr);
|
||||
result = prime * result + Objects.hash(clientMacAddress, sessionId);
|
||||
result = prime * result + Objects.hash(ipAddr, clientMacAddress, sessionId);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -74,7 +73,7 @@ public class ClientIpAddressEvent extends RealTimeEvent implements HasClientMac
|
||||
return false;
|
||||
}
|
||||
ClientIpAddressEvent other = (ClientIpAddressEvent) obj;
|
||||
return Objects.equals(clientMacAddress, other.clientMacAddress) && Arrays.equals(ipAddr, other.ipAddr)
|
||||
return Objects.equals(clientMacAddress, other.clientMacAddress) && Objects.equals(ipAddr, other.ipAddr)
|
||||
&& this.sessionId == other.sessionId;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.telecominfraproject.wlan.core.model.json.interfaces.HasCustomerId;
|
||||
|
||||
public class ClientSession extends BaseJsonModel implements HasCustomerId {
|
||||
|
||||
private static final String UNKNOWN_OUI = "ffffff";
|
||||
|
||||
private static final long serialVersionUID = -7714023056859882994L;
|
||||
|
||||
private MacAddress macAddress;
|
||||
@@ -16,6 +18,7 @@ public class ClientSession extends BaseJsonModel implements HasCustomerId {
|
||||
private long locationId;
|
||||
private ClientSessionDetails details;
|
||||
private long lastModifiedTimestamp;
|
||||
private String oui;
|
||||
|
||||
public long getEquipmentId() {
|
||||
return equipmentId;
|
||||
@@ -47,6 +50,12 @@ public class ClientSession extends BaseJsonModel implements HasCustomerId {
|
||||
|
||||
public void setMacAddress(MacAddress macAddress) {
|
||||
this.macAddress = macAddress;
|
||||
if (macAddress != null && macAddress.isGlobalAddress()) {
|
||||
this.oui = macAddress.toOuiString();
|
||||
}
|
||||
else {
|
||||
this.oui = UNKNOWN_OUI;
|
||||
}
|
||||
}
|
||||
|
||||
public long getLastModifiedTimestamp() {
|
||||
@@ -65,6 +74,14 @@ public class ClientSession extends BaseJsonModel implements HasCustomerId {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public String getOui() {
|
||||
return oui;
|
||||
}
|
||||
|
||||
public void setOui(String oui) {
|
||||
this.oui = oui;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientSession clone() {
|
||||
ClientSession ret = (ClientSession) super.clone();
|
||||
@@ -79,7 +96,7 @@ public class ClientSession extends BaseJsonModel implements HasCustomerId {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(customerId, details, equipmentId, locationId, lastModifiedTimestamp, macAddress);
|
||||
return Objects.hash(customerId, details, equipmentId, locationId, lastModifiedTimestamp, macAddress, oui);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -95,7 +112,8 @@ public class ClientSession extends BaseJsonModel implements HasCustomerId {
|
||||
&& equipmentId == other.equipmentId
|
||||
&& locationId == other.locationId
|
||||
&& lastModifiedTimestamp == other.lastModifiedTimestamp
|
||||
&& Objects.equals(macAddress, other.macAddress);
|
||||
&& Objects.equals(macAddress, other.macAddress)
|
||||
&& Objects.equals(oui, other.oui);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,10 +4,11 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||
import com.telecominfraproject.wlan.core.model.json.GenericResponse;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
||||
|
||||
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
|
||||
import com.telecominfraproject.wlan.client.models.Client;
|
||||
import com.telecominfraproject.wlan.client.session.models.ClientSession;
|
||||
|
||||
@@ -59,7 +60,15 @@ public interface ClientServiceInterface {
|
||||
* @param clientMac
|
||||
* @return deleted Client object
|
||||
*/
|
||||
Client delete(int customerId, MacAddress clientMac );
|
||||
Client delete(int customerId, MacAddress clientMac);
|
||||
|
||||
/**
|
||||
* Deletes Clients that are older than a given timestamp
|
||||
*
|
||||
* @param createdBeforeTimestamp
|
||||
* @return GenericResponse
|
||||
*/
|
||||
GenericResponse delete(long createdBeforeTimestamp);
|
||||
|
||||
/**
|
||||
* <br>Retrieves all of the Client records that are mapped to the provided customerId and optional macSubstring filter.
|
||||
@@ -96,6 +105,14 @@ public interface ClientServiceInterface {
|
||||
|
||||
ClientSession deleteSession(int customerId, long equipmentId, MacAddress clientMac);
|
||||
|
||||
/**
|
||||
* Deletes Client Sessions that older than a given timestamp
|
||||
*
|
||||
* @param createdBeforeTimestamp
|
||||
* @return GenericResponse
|
||||
*/
|
||||
GenericResponse deleteSessions(long createdBeforeTimestamp);
|
||||
|
||||
/**
|
||||
* Retrieves a list of Client sessions that which have their mac address in the provided set.
|
||||
*
|
||||
@@ -127,4 +144,12 @@ public interface ClientServiceInterface {
|
||||
*/
|
||||
PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context);
|
||||
|
||||
/**
|
||||
* Get Client Session counts for the given customerId.
|
||||
*
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
ClientSessionCounts getSessionCounts(int customerId);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,16 +3,16 @@ package com.telecominfraproject.wlan.client;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.telecominfraproject.wlan.client.controller.ClientController;
|
||||
import com.telecominfraproject.wlan.client.controller.ClientController.ListOfClientSessions;
|
||||
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
|
||||
import com.telecominfraproject.wlan.client.models.Client;
|
||||
import com.telecominfraproject.wlan.client.session.models.ClientSession;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||
import com.telecominfraproject.wlan.core.model.json.GenericResponse;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
||||
@@ -25,7 +25,6 @@ import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
||||
public class ClientServiceLocal implements ClientServiceInterface {
|
||||
|
||||
@Autowired private ClientController clientController;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ClientServiceLocal.class);
|
||||
|
||||
@Override
|
||||
public Client create(Client client) {
|
||||
@@ -57,6 +56,11 @@ public class ClientServiceLocal implements ClientServiceInterface {
|
||||
public Client delete(int customerId, MacAddress macAddress) {
|
||||
return clientController.delete(customerId, macAddress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericResponse delete(long createdBeforeTimestamp) {
|
||||
return clientController.delete(createdBeforeTimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Client> getBlockedClients(int customerId) {
|
||||
@@ -98,5 +102,15 @@ public class ClientServiceLocal implements ClientServiceInterface {
|
||||
public ClientSession deleteSession(int customerId, long equipmentId, MacAddress macAddress) {
|
||||
return clientController.deleteSession(customerId, equipmentId, macAddress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericResponse deleteSessions(long createdBeforeTimestamp) {
|
||||
return clientController.deleteSessions(createdBeforeTimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientSessionCounts getSessionCounts(int customerId) {
|
||||
return clientController.getSessionCounts(customerId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,11 +12,13 @@ import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
|
||||
import com.telecominfraproject.wlan.client.models.Client;
|
||||
import com.telecominfraproject.wlan.client.session.models.ClientSession;
|
||||
import com.telecominfraproject.wlan.core.client.BaseRemoteClient;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.json.GenericResponse;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
||||
@@ -182,7 +184,22 @@ public class ClientServiceRemote extends BaseRemoteClient implements ClientServi
|
||||
LOG.debug("completed client.delete {} ", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericResponse delete(long createdBeforeTimestamp) {
|
||||
LOG.debug("calling client.delete {}", createdBeforeTimestamp);
|
||||
|
||||
ResponseEntity<GenericResponse> responseEntity = restTemplate.exchange(
|
||||
getBaseUrl()
|
||||
+"/bulk?createdBeforeTimestamp={createdBeforeTimestamp}",
|
||||
HttpMethod.DELETE, null, GenericResponse.class, createdBeforeTimestamp);
|
||||
|
||||
GenericResponse ret = responseEntity.getBody();
|
||||
LOG.debug("completed client.delete {}", createdBeforeTimestamp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
//
|
||||
// Methods for managing client sessions
|
||||
@@ -304,6 +321,21 @@ public class ClientServiceRemote extends BaseRemoteClient implements ClientServi
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericResponse deleteSessions(long createdBeforeTimestamp) {
|
||||
LOG.debug("calling client.deleteSessions {}", createdBeforeTimestamp);
|
||||
|
||||
ResponseEntity<GenericResponse> responseEntity = restTemplate.exchange(
|
||||
getBaseUrl()
|
||||
+"/session/bulk?createdBeforeTimestamp={createdBeforeTimestamp}",
|
||||
HttpMethod.DELETE, null, GenericResponse.class, createdBeforeTimestamp);
|
||||
|
||||
GenericResponse ret = responseEntity.getBody();
|
||||
LOG.debug("completed client.deleteSessions {}", createdBeforeTimestamp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ClientSession> updateSessions(List<ClientSession> clientSessions) {
|
||||
LOG.debug("calling session.update {} ", clientSessions);
|
||||
@@ -334,5 +366,21 @@ public class ClientServiceRemote extends BaseRemoteClient implements ClientServi
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientSessionCounts getSessionCounts(int customerId) {
|
||||
LOG.debug("calling getSessionCounts( {} )", customerId);
|
||||
|
||||
try {
|
||||
ResponseEntity<ClientSessionCounts> responseEntity = restTemplate.exchange(getBaseUrl() + "/session/countsForCustomer?customerId={customerId}",
|
||||
HttpMethod.GET, null, ClientSessionCounts.class, customerId);
|
||||
|
||||
ClientSessionCounts result = responseEntity.getBody();
|
||||
LOG.debug("getSessionCounts({}) returns {} ", customerId, result);
|
||||
return result;
|
||||
} catch (Exception exp) {
|
||||
LOG.error("getSessionCounts({}) exception ", customerId, exp);
|
||||
throw exp;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.telecominfraproject.wlan.client.datastore.ClientDatastore;
|
||||
import com.telecominfraproject.wlan.client.info.models.ClientSessionCounts;
|
||||
import com.telecominfraproject.wlan.client.models.Client;
|
||||
import com.telecominfraproject.wlan.client.models.events.ClientAddedEvent;
|
||||
import com.telecominfraproject.wlan.client.models.events.ClientBlockListChangedEvent;
|
||||
@@ -26,6 +28,7 @@ import com.telecominfraproject.wlan.client.session.models.ClientSession;
|
||||
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherInterface;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.json.GenericResponse;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.ColumnAndSort;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
||||
@@ -246,6 +249,16 @@ public class ClientController {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/bulk", method=RequestMethod.DELETE)
|
||||
public GenericResponse delete(@RequestParam long createdBeforeTimestamp) {
|
||||
LOG.debug("Deleting Clients older than: {}", createdBeforeTimestamp);
|
||||
|
||||
clientDatastore.delete(createdBeforeTimestamp);
|
||||
|
||||
LOG.debug("Deleted Clients");
|
||||
|
||||
return new GenericResponse(true, "");
|
||||
}
|
||||
|
||||
//
|
||||
// Client Session -related methods
|
||||
@@ -408,8 +421,24 @@ public class ClientController {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value="/session/bulk", method=RequestMethod.DELETE)
|
||||
public GenericResponse deleteSessions(@RequestParam long createdBeforeTimestamp) {
|
||||
LOG.debug("Deleting Client session older than {}", createdBeforeTimestamp);
|
||||
|
||||
clientDatastore.deleteSessions(createdBeforeTimestamp);
|
||||
|
||||
LOG.debug("Deleted old Client sessions");
|
||||
|
||||
return new GenericResponse(true, "");
|
||||
}
|
||||
|
||||
@GetMapping("/session/countsForCustomer")
|
||||
public ClientSessionCounts getSessionCounts(@RequestParam int customerId) {
|
||||
ClientSessionCounts ret = clientDatastore.getSessionCounts(customerId);
|
||||
LOG.debug("countsForCustomer({}) {}", customerId, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void publishEvent(SystemEvent event) {
|
||||
if (event == null) {
|
||||
|
||||
@@ -59,8 +59,7 @@
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<artifactId>base-stream-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
|
||||
@@ -2856,6 +2856,9 @@ components:
|
||||
sharedSecret:
|
||||
type: string
|
||||
format: password
|
||||
dynamicDiscovery:
|
||||
description: Dynamic discovery of HSP and IdPs (home service and identity providers). Regardless of configured value, this will only be set 'true' on the AP if useRadSec is also true.
|
||||
type: boolean
|
||||
example:
|
||||
model_type: RadiusProxyConfiguration
|
||||
caCert:
|
||||
@@ -3159,6 +3162,14 @@ components:
|
||||
- wpa2OnlyPSK
|
||||
- wpa2OnlyRadius
|
||||
- wep
|
||||
- wpaEAP
|
||||
- wpa2EAP
|
||||
- wpa2OnlyEAP
|
||||
- wpa3OnlySAE
|
||||
- wpa3MixedSAE
|
||||
- wpa3OnlyEAP
|
||||
- wpa3MixedEAP
|
||||
- wpa3OnlyEAP192
|
||||
|
||||
RadioBasedSsidConfigurationMap:
|
||||
properties:
|
||||
@@ -3453,7 +3464,16 @@ components:
|
||||
$ref: '#/components/schemas/StatusCode'
|
||||
statusMessage:
|
||||
type: string
|
||||
ledStatus:
|
||||
$ref: '#/components/schemas/LedStatus'
|
||||
|
||||
LedStatus:
|
||||
type: string
|
||||
enum:
|
||||
- led_blink
|
||||
- led_off
|
||||
- UNKNOWN
|
||||
|
||||
StatusCode:
|
||||
type: string
|
||||
enum:
|
||||
@@ -4387,7 +4407,9 @@ components:
|
||||
- RADIO_CHANNEL
|
||||
channelNumberStatusDataMap:
|
||||
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
|
||||
|
||||
txPowerDataMap:
|
||||
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
|
||||
|
||||
#
|
||||
# Equipment configuration data models
|
||||
#
|
||||
@@ -4496,6 +4518,8 @@ components:
|
||||
type: boolean
|
||||
forwardMode:
|
||||
$ref: '#/components/schemas/NetworkForwardMode'
|
||||
blinkAllLEDs:
|
||||
type: boolean
|
||||
radioMap:
|
||||
$ref: '#/components/schemas/RadioMap'
|
||||
advancedRadioMap:
|
||||
@@ -4865,11 +4889,16 @@ components:
|
||||
$ref: '#/components/schemas/ServiceMetricDataType'
|
||||
createdTimestamp:
|
||||
type: integer
|
||||
format: int64
|
||||
format: int64
|
||||
details:
|
||||
$ref: '#/components/schemas/ServiceMetricDetails'
|
||||
|
||||
ServiceMetricDetails:
|
||||
type: object
|
||||
properties:
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ApNodeMetrics'
|
||||
- $ref: '#/components/schemas/ApSsidMetrics'
|
||||
@@ -4877,7 +4906,7 @@ components:
|
||||
- $ref: '#/components/schemas/ClientMetrics'
|
||||
- $ref: '#/components/schemas/NeighbourScanReports'
|
||||
discriminator:
|
||||
propertyName: model_type
|
||||
propertyName: model_type
|
||||
|
||||
NeighbourScanReports:
|
||||
properties:
|
||||
@@ -6753,7 +6782,11 @@ components:
|
||||
description: The number of aggregation frames sent using single MPDU (where the A-MPDU contains only one MPDU ).
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
wmmQueueStats:
|
||||
$ref: '#/components/schemas/WmmQueueStatsPerQueueTypeMap'
|
||||
|
||||
@@ -6902,6 +6935,9 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PerProcessUtilization'
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
EthernetLinkState:
|
||||
type: string
|
||||
@@ -6948,6 +6984,9 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/DnsProbeMetric'
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
StateUpDownError:
|
||||
type: string
|
||||
@@ -8762,7 +8801,10 @@ components:
|
||||
numRxVHT_3466_8_Mbps:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
ListOfRadioUtilizationPerRadioMap:
|
||||
properties:
|
||||
@@ -8810,6 +8852,9 @@ components:
|
||||
unAvailableCapacity:
|
||||
type: number
|
||||
format: double
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
ListOfMacsPerRadioMap:
|
||||
properties:
|
||||
|
||||
@@ -189,7 +189,6 @@
|
||||
|
||||
<module>../provisioning-sp</module>
|
||||
<module>../dashboard-sp</module>
|
||||
<module>../equipment-alarms-sp</module>
|
||||
<module>../adoption-metrics-sp</module>
|
||||
|
||||
<module>../single-process-streams</module>
|
||||
|
||||
1
equipment-alarms-sp/.gitignore
vendored
1
equipment-alarms-sp/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/target/
|
||||
@@ -1,111 +0,0 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../wlan-cloud-root</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>equipment-alarms-sp</artifactId>
|
||||
<name>equipment-alarms-sp</name>
|
||||
<description>Stream Processors for raising/clearing equipment alarms based on reported metrics.</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>base-stream-consumer</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>service-metric-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>system-event-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>alarm-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>status-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- unit tests dependencies -->
|
||||
<dependency>
|
||||
<artifactId>single-process-streams</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>alarm-service-local</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>status-service-local</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-service-local</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>alarm-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>status-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-empty</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
|
||||
@@ -1,187 +0,0 @@
|
||||
package com.telecominfraproject.wlan.streams.equipmentalarms;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import com.telecominfraproject.wlan.alarm.models.Alarm;
|
||||
import com.telecominfraproject.wlan.alarm.models.AlarmCode;
|
||||
import com.telecominfraproject.wlan.servicemetric.apnode.models.ApNodeMetrics;
|
||||
|
||||
/**
|
||||
* <br>This context keeps track of information needed for raising/clearing the alarms with the following codes:
|
||||
* <ul>
|
||||
* <li>AlarmCode.CPUTemperature
|
||||
* <li>AlarmCode.CPUUtilization
|
||||
* <li>AlarmCode.MemoryUtilization
|
||||
* <li>AlarmCode.AccessPointIsUnreachable
|
||||
* </ul>
|
||||
*
|
||||
* @author dtop
|
||||
*/
|
||||
public class EquipmentAlarmsContext {
|
||||
|
||||
private final int customerId;
|
||||
private final long equipmentId;
|
||||
private final Map<AlarmCode, Alarm> existingAlarms = new ConcurrentHashMap<>();
|
||||
private final long timeBucketMs;
|
||||
private final int temperatureThresholdInC;
|
||||
private final int cpuUtilThresholdPct;
|
||||
private final int memoryUtilThresholdPct;
|
||||
|
||||
private final Map<Long, Integer> cpuTempSamples = new ConcurrentHashMap<>();
|
||||
private final Map<Long, Integer> cpuUtilSamples = new ConcurrentHashMap<>();
|
||||
private final Map<Long, Integer> memoryUtilSamples = new ConcurrentHashMap<>();
|
||||
private final Map<Long, Long> metricReceivedTimestamps = new ConcurrentHashMap<>();
|
||||
|
||||
private long totalAvailableMemoryKb;
|
||||
private final long contextCreationTimestampMs = System.currentTimeMillis();
|
||||
|
||||
public EquipmentAlarmsContext(int customerId, long equipmentId, List<Alarm> existingAlarmsList, long timeBucketMs, int temperatureThresholdInC, int cpuUtilThresholdPct, int memoryUtilThresholdPct) {
|
||||
this.customerId = customerId;
|
||||
this.equipmentId = equipmentId;
|
||||
existingAlarmsList.forEach(a -> this.existingAlarms.put(a.getAlarmCode(), a));
|
||||
this.timeBucketMs = timeBucketMs;
|
||||
this.temperatureThresholdInC = temperatureThresholdInC;
|
||||
this.cpuUtilThresholdPct = cpuUtilThresholdPct;
|
||||
this.memoryUtilThresholdPct = memoryUtilThresholdPct;
|
||||
}
|
||||
|
||||
public long getTotalAvailableMemoryKb() {
|
||||
return totalAvailableMemoryKb;
|
||||
}
|
||||
|
||||
public void setTotalAvailableMemoryKb(long totalAvailableMemoryKb) {
|
||||
this.totalAvailableMemoryKb = totalAvailableMemoryKb;
|
||||
}
|
||||
|
||||
public int getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
|
||||
public long getEquipmentId() {
|
||||
return equipmentId;
|
||||
}
|
||||
|
||||
public Map<AlarmCode, Alarm> getExistingAlarms() {
|
||||
return existingAlarms;
|
||||
}
|
||||
|
||||
|
||||
public void addDataSamples(long timestamp, ApNodeMetrics model) {
|
||||
// add new samples
|
||||
if(model.getApPerformance()!=null ) {
|
||||
if(model.getApPerformance().getCpuTemperature()!=null) {
|
||||
cpuTempSamples.put(timestamp, model.getApPerformance().getCpuTemperature());
|
||||
}
|
||||
|
||||
if(model.getApPerformance().getAvgCpuUtilized()!=null) {
|
||||
cpuUtilSamples.put(timestamp, model.getApPerformance().getAvgCpuUtilized().intValue());
|
||||
}
|
||||
|
||||
if(model.getApPerformance().getFreeMemory()!=null && totalAvailableMemoryKb>0) {
|
||||
memoryUtilSamples.put(timestamp, 100 - (int) (model.getApPerformance().getFreeMemory() * 100 / totalAvailableMemoryKb));
|
||||
}
|
||||
}
|
||||
|
||||
//we are using our own timestamp in here in case AP's time is out of sync - we do not want to raise connectivity alarm in that case
|
||||
Long currentTs = System.currentTimeMillis();
|
||||
metricReceivedTimestamps.put(currentTs, currentTs);
|
||||
|
||||
}
|
||||
|
||||
public void removeOldDataSamples() {
|
||||
// remove samples older than timeBucketMs
|
||||
long timeThresholdMs = System.currentTimeMillis() - timeBucketMs;
|
||||
cpuTempSamples.entrySet().removeIf( t -> t.getKey() < timeThresholdMs );
|
||||
cpuUtilSamples.entrySet().removeIf( t -> t.getKey() < timeThresholdMs );
|
||||
memoryUtilSamples.entrySet().removeIf( t -> t.getKey() < timeThresholdMs );
|
||||
metricReceivedTimestamps.entrySet().removeIf( t -> t.getKey() < timeThresholdMs );
|
||||
}
|
||||
|
||||
public boolean isAlarmNeedsToBeRaised(AlarmCode alarmCode) {
|
||||
|
||||
if(existingAlarms.containsKey(alarmCode) || System.currentTimeMillis() < contextCreationTimestampMs + timeBucketMs) {
|
||||
//no need to check for thresholds - alarm is either already present, or it is too early to tell because the first time bucket has not been filled yet
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean ret = false;
|
||||
AtomicInteger sum = new AtomicInteger();
|
||||
AtomicInteger count = new AtomicInteger();
|
||||
|
||||
//check alarms against thresholds
|
||||
if(alarmCode.getId() == AlarmCode.AccessPointIsUnreachable.getId()) {
|
||||
ret = metricReceivedTimestamps.isEmpty();
|
||||
} else if(alarmCode.getId() == AlarmCode.CPUTemperature.getId()) {
|
||||
cpuTempSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
|
||||
if(count.get() > 0) {
|
||||
int avg = sum.get() / count.get();
|
||||
ret = avg >= temperatureThresholdInC ;
|
||||
}
|
||||
} else if(alarmCode.getId() == AlarmCode.CPUUtilization.getId()) {
|
||||
cpuUtilSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
|
||||
if(count.get() > 0) {
|
||||
int avg = sum.get() / count.get();
|
||||
ret = avg >= cpuUtilThresholdPct ;
|
||||
}
|
||||
} else if(alarmCode.getId() == AlarmCode.MemoryUtilization.getId()) {
|
||||
memoryUtilSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
|
||||
if(count.get() > 0) {
|
||||
int avg = sum.get() / count.get();
|
||||
ret = avg >= memoryUtilThresholdPct ;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public boolean isAlarmNeedsToBeCleared(AlarmCode alarmCode) {
|
||||
|
||||
if(!existingAlarms.containsKey(alarmCode) || System.currentTimeMillis() < contextCreationTimestampMs + timeBucketMs) {
|
||||
//no need to check for thresholds - alarm is either not present, or it is too early to tell because the first time bucket has not been filled yet
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean ret = false;
|
||||
AtomicInteger sum = new AtomicInteger();
|
||||
AtomicInteger count = new AtomicInteger();
|
||||
|
||||
//check alarms against thresholds
|
||||
if(alarmCode.getId() == AlarmCode.AccessPointIsUnreachable.getId()) {
|
||||
ret = !metricReceivedTimestamps.isEmpty();
|
||||
} else if(alarmCode.getId() == AlarmCode.CPUTemperature.getId()) {
|
||||
cpuTempSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
|
||||
if(count.get() > 0) {
|
||||
int avg = sum.get() / count.get();
|
||||
ret = avg < temperatureThresholdInC ;
|
||||
} else {
|
||||
//no new data available, but the alarm exists -> clear the alarm
|
||||
ret = true;
|
||||
}
|
||||
} else if(alarmCode.getId() == AlarmCode.CPUUtilization.getId()) {
|
||||
cpuUtilSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
|
||||
if(count.get() > 0) {
|
||||
int avg = sum.get() / count.get();
|
||||
ret = avg < cpuUtilThresholdPct ;
|
||||
} else {
|
||||
//no new data available, but the alarm exists -> clear the alarm
|
||||
ret = true;
|
||||
}
|
||||
} else if(alarmCode.getId() == AlarmCode.MemoryUtilization.getId()) {
|
||||
memoryUtilSamples.values().forEach(v -> { sum.addAndGet(v); count.incrementAndGet(); });
|
||||
if(count.get() > 0) {
|
||||
int avg = sum.get() / count.get();
|
||||
ret = avg < memoryUtilThresholdPct ;
|
||||
} else {
|
||||
//no new data available, but the alarm exists -> clear the alarm
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,322 +0,0 @@
|
||||
package com.telecominfraproject.wlan.streams.equipmentalarms;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.telecominfraproject.wlan.alarm.AlarmServiceInterface;
|
||||
import com.telecominfraproject.wlan.alarm.models.Alarm;
|
||||
import com.telecominfraproject.wlan.alarm.models.AlarmCode;
|
||||
import com.telecominfraproject.wlan.alarm.models.AlarmDetails;
|
||||
import com.telecominfraproject.wlan.alarm.models.AlarmScopeType;
|
||||
import com.telecominfraproject.wlan.alarm.models.OriginatorType;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.streams.QueuedStreamMessage;
|
||||
import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
|
||||
import com.telecominfraproject.wlan.equipment.models.Equipment;
|
||||
import com.telecominfraproject.wlan.servicemetric.apnode.models.ApNodeMetrics;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetric;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDetails;
|
||||
import com.telecominfraproject.wlan.status.StatusServiceInterface;
|
||||
import com.telecominfraproject.wlan.status.equipment.report.models.OperatingSystemPerformance;
|
||||
import com.telecominfraproject.wlan.status.models.Status;
|
||||
import com.telecominfraproject.wlan.status.models.StatusCode;
|
||||
import com.telecominfraproject.wlan.status.models.StatusDataType;
|
||||
import com.telecominfraproject.wlan.stream.StreamProcessor;
|
||||
|
||||
/**
|
||||
* @author dtop
|
||||
* <br> This stream processor is listening for APNodeMetrics, aggregating them in sliding windows of 5 minutes and raising/clearing alarms based on preconfigured thresholds.
|
||||
* <br> "AP out of reach" alarm is raised when no APNodeMetrics have been received for the equipment in the last interval, cleared when APNodeMetrics appear again
|
||||
* <br> "Temperature too high" alarm is raised when average temperature over the last interval goes above the configured threshold of 80C, cleared when average temperature goes below the threshold
|
||||
* <br> "CPU utilization is too high" alarm is raised when average CPU utilization on AP over the last interval goes above the configured threshold of 80%, cleared when average CPU utilization goes below the threshold
|
||||
* <br> "Memory utilization is too high" alarm is raised when average RAM utilization on AP over the last interval goes above the configured threshold of 70%, cleared when average RAM utilization goes below the threshold
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
public class EquipmentAlarmsProcessor extends StreamProcessor {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(EquipmentAlarmsProcessor.class);
|
||||
|
||||
@Value("${tip.wlan.wlanServiceMetricsTopic:wlan_service_metrics}")
|
||||
private String wlanServiceMetricsTopic;
|
||||
|
||||
@Value("${tip.wlan.equipmentAlarmProcessor.timeBucketMs:300000}") //5 minutes aggregation buckets
|
||||
private long timeBucketMs;
|
||||
|
||||
@Value("${tip.wlan.equipmentAlarmProcessor.checkAlarmsIntervalMs:15000}") //check for raising/clearing alarms every 15 seconds
|
||||
private long checkAlarmsIntervalMs;
|
||||
|
||||
@Value("${tip.wlan.equipmentAlarmProcessor.temperatureThresholdInC:80}")
|
||||
private int temperatureThresholdInC;
|
||||
|
||||
@Value("${tip.wlan.equipmentAlarmProcessor.cpuUtilThresholdPct:80}")
|
||||
private int cpuUtilThresholdPct;
|
||||
|
||||
@Value("${tip.wlan.equipmentAlarmProcessor.memoryUtilThresholdPct:70}")
|
||||
private int memoryUtilThresholdPct;
|
||||
|
||||
|
||||
private final ConcurrentHashMap<Long, EquipmentAlarmsContext> contextPerEquipmentIdMap = new ConcurrentHashMap<>();
|
||||
|
||||
private final Set<AlarmCode> alarmCodeSet = new HashSet<>();
|
||||
|
||||
@Autowired
|
||||
private AlarmServiceInterface alarmServiceInterface;
|
||||
|
||||
@Autowired
|
||||
private StatusServiceInterface statusServiceInterface;
|
||||
|
||||
@Autowired
|
||||
private EquipmentServiceInterface equipmentServiceInterface;
|
||||
|
||||
@Override
|
||||
protected boolean acceptMessage(QueuedStreamMessage message) {
|
||||
boolean ret = message.getTopic().equals(wlanServiceMetricsTopic);
|
||||
|
||||
if(ret && ( message.getModel() instanceof ServiceMetric) ) {
|
||||
|
||||
ServiceMetric sm = (ServiceMetric) message.getModel();
|
||||
ret = ret &&
|
||||
(
|
||||
sm.getDetails() instanceof ApNodeMetrics
|
||||
);
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
LOG.trace("acceptMessage {}", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processMessage(QueuedStreamMessage message) {
|
||||
|
||||
ServiceMetric mdl = (ServiceMetric) message.getModel();
|
||||
ServiceMetricDetails smd = mdl.getDetails();
|
||||
LOG.debug("Processing {}", mdl);
|
||||
|
||||
switch ( smd.getClass().getSimpleName() ) {
|
||||
case "ApNodeMetrics":
|
||||
process(mdl.getCustomerId(), mdl.getCreatedTimestamp(), mdl.getEquipmentId(), (ApNodeMetrics) smd);
|
||||
break;
|
||||
default:
|
||||
process(mdl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void process(int customerId, long timestamp, long equipmentId, ApNodeMetrics model) {
|
||||
LOG.debug("Processing ApNodeMetrics");
|
||||
//get context for the equipmentId
|
||||
EquipmentAlarmsContext context = contextPerEquipmentIdMap.get(equipmentId);
|
||||
if(context == null) {
|
||||
|
||||
//When creating EquipmentAlarmsContext - read currently raised alarms of the types we're interested, keep it in memory.
|
||||
//Only this SP is responsible for raising/clearing those alarms for this particular equipment
|
||||
List<Alarm> existingAlarms = alarmServiceInterface.get(customerId, Collections.singleton(equipmentId), alarmCodeSet);
|
||||
|
||||
//All alarms that are handled by this stream processor logically exist only once-per-alarmCode-per-equipment.
|
||||
//Ensure that there is only one alarm per alarmCode per equipment (the latest one), remove all others.
|
||||
//This is needed to recover from some corner-case scenarios that can happen with the distributed datastores (for example split-brain).
|
||||
existingAlarms = cleanUpDuplicateAlarms(existingAlarms);
|
||||
|
||||
context = new EquipmentAlarmsContext(customerId, equipmentId, existingAlarms, timeBucketMs, temperatureThresholdInC, cpuUtilThresholdPct, memoryUtilThresholdPct);
|
||||
context = contextPerEquipmentIdMap.putIfAbsent(equipmentId, context);
|
||||
if(context == null) {
|
||||
context = contextPerEquipmentIdMap.get(equipmentId);
|
||||
}
|
||||
}
|
||||
|
||||
//find out TotalAvailableMemory in kb, which is available as part of the OperatingSystemPerformance status object
|
||||
//we look for it separately because this status may not be populated when the first service_metrics_collection_config are coming in
|
||||
if(context.getTotalAvailableMemoryKb()==0L) {
|
||||
Status osPerformanceStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.OS_PERFORMANCE);
|
||||
if(osPerformanceStatus!=null) {
|
||||
OperatingSystemPerformance osPerformance = (OperatingSystemPerformance) osPerformanceStatus.getDetails();
|
||||
if(osPerformance !=null && osPerformance.getTotalAvailableMemoryKb() > 0) {
|
||||
context.setTotalAvailableMemoryKb(osPerformance.getTotalAvailableMemoryKb());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update counters on the context
|
||||
context.addDataSamples(timestamp, model);
|
||||
|
||||
LOG.debug("Processed {}", model);
|
||||
}
|
||||
|
||||
private List<Alarm> cleanUpDuplicateAlarms(List<Alarm> existingAlarms) {
|
||||
|
||||
Map<AlarmCode, Alarm> alarmsToKeep= new HashMap<>();
|
||||
|
||||
//find out the latest existing alarms for each alarmCode
|
||||
existingAlarms.forEach(a -> {
|
||||
Alarm eA = alarmsToKeep.get(a.getAlarmCode());
|
||||
if(eA == null) {
|
||||
eA = a;
|
||||
alarmsToKeep.put(a.getAlarmCode(), a);
|
||||
}
|
||||
|
||||
if(eA.getCreatedTimestamp() < a.getCreatedTimestamp() ) {
|
||||
alarmsToKeep.put(a.getAlarmCode(), a);
|
||||
}
|
||||
});
|
||||
|
||||
List<Alarm> alarmsToRemove = new ArrayList<>(existingAlarms);
|
||||
alarmsToRemove.removeAll(alarmsToKeep.values());
|
||||
|
||||
alarmsToRemove.forEach(a -> {
|
||||
try {
|
||||
alarmServiceInterface.delete(a.getCustomerId(), a.getEquipmentId(), a.getAlarmCode(), a.getCreatedTimestamp());
|
||||
} catch(Exception e) {
|
||||
LOG.debug("Alarm was already deleted: {}", a);
|
||||
}
|
||||
});
|
||||
|
||||
return new ArrayList<>(alarmsToKeep.values());
|
||||
}
|
||||
|
||||
private void process(BaseJsonModel model) {
|
||||
LOG.warn("Unprocessed model: {}", model);
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void postCreate() {
|
||||
|
||||
Thread equipmentAlarmsThread = new Thread( new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
LOG.info("Starting equipmentAlarmsThread");
|
||||
while(true) {
|
||||
LOG.trace("Checking if alarms need to be raised");
|
||||
|
||||
//take a snapshot of existing contexts for this iteration of alarm checks
|
||||
List<EquipmentAlarmsContext> contexts = new ArrayList<>(contextPerEquipmentIdMap.values());
|
||||
|
||||
HashSet<Long> equipmentIdsFromContexts = new HashSet<>();
|
||||
contexts.forEach(ctx -> equipmentIdsFromContexts.add(ctx.getEquipmentId()));
|
||||
|
||||
//get a list of equipment records for the current contexts
|
||||
HashSet<Long> existingEquipmentIds = new HashSet<>();
|
||||
|
||||
try {
|
||||
List<Equipment> existingEquipment = equipmentServiceInterface.get(equipmentIdsFromContexts);
|
||||
existingEquipment.forEach(e -> existingEquipmentIds.add(e.getId()));
|
||||
} catch(Exception e) {
|
||||
LOG.error("Error when retrieving existing equipment", e);
|
||||
sleep(checkAlarmsIntervalMs);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
for(EquipmentAlarmsContext context : contexts ) {
|
||||
|
||||
if(!existingEquipmentIds.contains(context.getEquipmentId())) {
|
||||
//equipment was removed, let's delete the context and remove all existing alarms for that equipmentId
|
||||
try {
|
||||
contextPerEquipmentIdMap.remove(context.getEquipmentId());
|
||||
alarmServiceInterface.delete(context.getCustomerId(), context.getEquipmentId());
|
||||
} catch(Exception e) {
|
||||
LOG.error("Error when removing stale alarms for deleted equipment", e);
|
||||
}
|
||||
//nothing else to do for this context
|
||||
continue;
|
||||
}
|
||||
|
||||
context.removeOldDataSamples();
|
||||
|
||||
alarmCodeSet.forEach(alarmCode -> {
|
||||
try {
|
||||
//check alarms against thresholds
|
||||
//if alarm needs to be raised - check if it is currently present, and if not - raise it, and add it to the context
|
||||
if(context.isAlarmNeedsToBeRaised(alarmCode)) {
|
||||
Alarm alarm = new Alarm();
|
||||
alarm.setCustomerId(context.getCustomerId());
|
||||
alarm.setEquipmentId(context.getEquipmentId());
|
||||
alarm.setAlarmCode(alarmCode);
|
||||
alarm.setOriginatorType(OriginatorType.AP);
|
||||
alarm.setSeverity(alarmCode.getSeverity());
|
||||
alarm.setScopeType(AlarmScopeType.EQUIPMENT);
|
||||
alarm.setScopeId("" + context.getEquipmentId());
|
||||
AlarmDetails alarmDetails = new AlarmDetails();
|
||||
alarmDetails.setMessage(alarmCode.getDescription());
|
||||
alarmDetails.setAffectedEquipmentIds(Collections.singletonList(context.getEquipmentId()));
|
||||
alarm.setDetails(alarmDetails);
|
||||
|
||||
alarm = alarmServiceInterface.create(alarm);
|
||||
context.getExistingAlarms().put(alarmCode, alarm);
|
||||
}
|
||||
|
||||
if(context.isAlarmNeedsToBeCleared(alarmCode)) {
|
||||
//if alarm needs to be cleared - check if it is currently present, and if it is - clear it, and remove it from the context
|
||||
Alarm alarm = context.getExistingAlarms().remove(alarmCode);
|
||||
if(alarm!=null) {
|
||||
//All alarms that are handled by this stream processor logically exist only once-per-alarmCode-per-equipment.
|
||||
//In order to self-heal from the corner cases with the datastore where more than one alarm with the same alarmCode
|
||||
// is raised per equipment (for example when the datastore experienced a split-brain scenario), we would remove
|
||||
// all alarms with the specified alarmCode for this equipment.
|
||||
//Most of the time the existingAlarms list below would contain only one alarm.
|
||||
//
|
||||
List<Alarm> existingAlarms = alarmServiceInterface.get(alarm.getCustomerId(), Collections.singleton(alarm.getEquipmentId()), Collections.singleton(alarmCode));
|
||||
existingAlarms.forEach(a -> {
|
||||
try {
|
||||
alarmServiceInterface.delete(a.getCustomerId(), a.getEquipmentId(), a.getAlarmCode(), a.getCreatedTimestamp());
|
||||
} catch(Exception e) {
|
||||
LOG.debug("Alarm was already deleted: {}", alarm);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
LOG.error("Error when processing context for customer {}", context.getCustomerId(), e);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
LOG.trace("Done alarms check");
|
||||
|
||||
sleep(checkAlarmsIntervalMs);
|
||||
|
||||
}
|
||||
}
|
||||
}, "equipmentAlarmsThread");
|
||||
|
||||
equipmentAlarmsThread.setDaemon(true);
|
||||
equipmentAlarmsThread.start();
|
||||
|
||||
//populate alarm codes this SP is responsible for
|
||||
alarmCodeSet.add(AlarmCode.CPUTemperature);
|
||||
alarmCodeSet.add(AlarmCode.CPUUtilization);
|
||||
alarmCodeSet.add(AlarmCode.MemoryUtilization);
|
||||
alarmCodeSet.add(AlarmCode.AccessPointIsUnreachable);
|
||||
|
||||
}
|
||||
|
||||
private static void sleep(long ms) {
|
||||
try {
|
||||
Thread.sleep(ms);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,342 +0,0 @@
|
||||
package com.telecominfraproject.wlan.streams.equipmentalarms;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.telecominfraproject.wlan.alarm.AlarmServiceInterface;
|
||||
import com.telecominfraproject.wlan.alarm.AlarmServiceLocal;
|
||||
import com.telecominfraproject.wlan.alarm.controller.AlarmController;
|
||||
import com.telecominfraproject.wlan.alarm.datastore.inmemory.AlarmDatastoreInMemory;
|
||||
import com.telecominfraproject.wlan.alarm.models.Alarm;
|
||||
import com.telecominfraproject.wlan.alarm.models.AlarmCode;
|
||||
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherEmpty;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
|
||||
import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
|
||||
import com.telecominfraproject.wlan.equipment.EquipmentServiceLocal;
|
||||
import com.telecominfraproject.wlan.equipment.controller.EquipmentController;
|
||||
import com.telecominfraproject.wlan.equipment.datastore.inmemory.EquipmentDatastoreInMemory;
|
||||
import com.telecominfraproject.wlan.equipment.models.Equipment;
|
||||
import com.telecominfraproject.wlan.servicemetric.apnode.models.ApNodeMetrics;
|
||||
import com.telecominfraproject.wlan.servicemetric.apnode.models.ApPerformance;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetric;
|
||||
import com.telecominfraproject.wlan.status.StatusServiceLocal;
|
||||
import com.telecominfraproject.wlan.status.controller.StatusController;
|
||||
import com.telecominfraproject.wlan.status.datastore.inmemory.StatusDatastoreInMemory;
|
||||
import com.telecominfraproject.wlan.stream.StreamInterface;
|
||||
import com.telecominfraproject.wlan.stream.StreamMessageDispatcher;
|
||||
import com.telecominfraproject.wlan.streams.simple.SimpleStreamsConfig;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.NONE, classes = EquipmentAlarmsProcessor.class)
|
||||
@Import(value = { EquipmentAlarmsProcessor.class, SimpleStreamsConfig.class, StreamMessageDispatcher.class,
|
||||
AlarmServiceLocal.class, AlarmController.class, AlarmDatastoreInMemory.class,
|
||||
StatusServiceLocal.class, StatusController.class, StatusDatastoreInMemory.class,
|
||||
EquipmentServiceLocal.class, EquipmentController.class, EquipmentDatastoreInMemory.class,
|
||||
CloudEventDispatcherEmpty.class,
|
||||
//EquipmentAlarmsProcessorTests.Config.class,
|
||||
})
|
||||
@Ignore("make these tests more robust, there are intermittent failures")
|
||||
/*
|
||||
expected: <0> but was: <1>
|
||||
org.opentest4j.AssertionFailedError: expected: <0> but was: <1>
|
||||
at com.telecominfraproject.wlan.streams.equipmentalarms.EquipmentAlarmsProcessorTests.testAccessPointIsUnreachableAlarm(EquipmentAlarmsProcessorTests.java:313)
|
||||
|
||||
*/
|
||||
public class EquipmentAlarmsProcessorTests {
|
||||
|
||||
private static final long testTimeBucketMs = 200;
|
||||
private static final long testCheckAlarmsIntervalMs = 50;
|
||||
|
||||
static {
|
||||
System.setProperty("tip.wlan.equipmentAlarmProcessor.checkAlarmsIntervalMs", "" + testCheckAlarmsIntervalMs);
|
||||
System.setProperty("tip.wlan.equipmentAlarmProcessor.timeBucketMs", "" + testTimeBucketMs);
|
||||
}
|
||||
|
||||
@Autowired @Qualifier("metricStreamInterface")
|
||||
StreamInterface<ServiceMetric> metricStreamInterface;
|
||||
|
||||
@Autowired
|
||||
EquipmentAlarmsProcessor equipmentAlarmsProcessor;
|
||||
|
||||
@Autowired
|
||||
AlarmServiceInterface alarmService;
|
||||
|
||||
@Autowired
|
||||
EquipmentServiceInterface equipmentService;
|
||||
|
||||
protected static final AtomicLong testSequence = new AtomicLong(1);
|
||||
|
||||
@Configuration
|
||||
public static class Config {
|
||||
|
||||
//Another way of configuring dependencies (instead of mentioning them in the pom.xml with the test scope) :
|
||||
// @Bean
|
||||
// AlarmServiceInterface getAlarmServiceInterface() {
|
||||
// return new AlarmServiceInterface() {
|
||||
// ...
|
||||
// };
|
||||
// }
|
||||
|
||||
// @Bean
|
||||
// StatusServiceInterface getStatusServiceInterface() {
|
||||
// return new StatusServiceInterface() {
|
||||
// ...
|
||||
// };
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCPUTemperatureAlarm() {
|
||||
int customerId = getNextCustomerId();
|
||||
|
||||
Equipment equipment = new Equipment();
|
||||
equipment.setCustomerId(customerId);
|
||||
equipment.setEquipmentType(EquipmentType.AP);
|
||||
equipment.setInventoryId("testCPUTemperatureAlarm");
|
||||
equipment.setName(equipment.getInventoryId());
|
||||
equipment = equipmentService.create(equipment);
|
||||
long equipmentId = equipment.getId();
|
||||
|
||||
ServiceMetric record = new ServiceMetric(customerId , equipmentId );
|
||||
//create metric a bit in the future so that it gets picked up by the processor and not simply discarded
|
||||
record.setCreatedTimestamp(System.currentTimeMillis() + 2 * testTimeBucketMs);
|
||||
|
||||
ApNodeMetrics apNodeMetrics = new ApNodeMetrics();
|
||||
record.setDetails(apNodeMetrics);
|
||||
|
||||
ApPerformance apPerformance = new ApPerformance();
|
||||
apNodeMetrics.setApPerformance(apPerformance);
|
||||
|
||||
//we will force the CPUTemperature alarm to be raised
|
||||
apPerformance.setCpuTemperature(85);
|
||||
|
||||
apPerformance.setCpuUtilized(new int[] { 70, 70 });
|
||||
|
||||
apPerformance.setFreeMemory(30000000);
|
||||
|
||||
//publish metric that should trigger alarm for the CPU Temperature
|
||||
metricStreamInterface.publish(record );
|
||||
|
||||
//wait for the metric to be processed
|
||||
sleep(2 * testTimeBucketMs);
|
||||
|
||||
//verify that alarm was raised
|
||||
List<Alarm> alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.CPUTemperature));
|
||||
assertEquals(1, alarms.size());
|
||||
|
||||
//Now create a metric that should clear the alarm
|
||||
ServiceMetric recordToClearAlarm = record.clone();
|
||||
recordToClearAlarm.setCreatedTimestamp(System.currentTimeMillis() + 2* testTimeBucketMs );
|
||||
((ApNodeMetrics)recordToClearAlarm.getDetails()).getApPerformance().setCpuTemperature(70);
|
||||
|
||||
//publish metric that should clear the alarm for the CPU Temperature
|
||||
metricStreamInterface.publish(recordToClearAlarm);
|
||||
|
||||
//wait for the metric to be processed
|
||||
sleep(2 * testTimeBucketMs);
|
||||
|
||||
//verify that alarm was cleared
|
||||
alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.CPUTemperature));
|
||||
assertEquals(0, alarms.size());
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCPUTemperatureAlarm_NoEquipment() {
|
||||
int customerId = getNextCustomerId();
|
||||
long equipmentId = -5;
|
||||
|
||||
ServiceMetric record = new ServiceMetric(customerId , equipmentId );
|
||||
//create metric a bit in the future so that it gets picked up by the processor and not simply discarded
|
||||
record.setCreatedTimestamp(System.currentTimeMillis() + 2 * testTimeBucketMs);
|
||||
|
||||
ApNodeMetrics apNodeMetrics = new ApNodeMetrics();
|
||||
record.setDetails(apNodeMetrics);
|
||||
|
||||
ApPerformance apPerformance = new ApPerformance();
|
||||
apNodeMetrics.setApPerformance(apPerformance);
|
||||
|
||||
//we will force the CPUTemperature alarm to be raised
|
||||
apPerformance.setCpuTemperature(85);
|
||||
|
||||
apPerformance.setCpuUtilized(new int[] { 70, 70 });
|
||||
|
||||
apPerformance.setFreeMemory(30000000);
|
||||
|
||||
//publish metric that should trigger alarm for the CPU Temperature
|
||||
metricStreamInterface.publish(record );
|
||||
|
||||
//wait for the metric to be processed
|
||||
sleep(2 * testTimeBucketMs);
|
||||
|
||||
//verify that alarm was not raised - because equipment for that alarm does not exist
|
||||
List<Alarm> alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.CPUTemperature));
|
||||
assertEquals(0, alarms.size());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCPUUtilizationAlarm() {
|
||||
int customerId = getNextCustomerId();
|
||||
|
||||
Equipment equipment = new Equipment();
|
||||
equipment.setCustomerId(customerId);
|
||||
equipment.setEquipmentType(EquipmentType.AP);
|
||||
equipment.setInventoryId("testCPUUtilizationAlarm");
|
||||
equipment.setName(equipment.getInventoryId());
|
||||
equipment = equipmentService.create(equipment);
|
||||
long equipmentId = equipment.getId();
|
||||
|
||||
ServiceMetric record = new ServiceMetric(customerId , equipmentId );
|
||||
//create metric a bit in the future so that it gets picked up by the processor and not simply discarded
|
||||
record.setCreatedTimestamp(System.currentTimeMillis() + 2 * testTimeBucketMs);
|
||||
|
||||
ApNodeMetrics apNodeMetrics = new ApNodeMetrics();
|
||||
record.setDetails(apNodeMetrics);
|
||||
|
||||
ApPerformance apPerformance = new ApPerformance();
|
||||
apNodeMetrics.setApPerformance(apPerformance);
|
||||
|
||||
apPerformance.setCpuTemperature(55);
|
||||
|
||||
//we will force the CPUUtilization alarm to be raised
|
||||
apPerformance.setCpuUtilized(new int[] { 90, 90 });
|
||||
|
||||
apPerformance.setFreeMemory(30000000);
|
||||
|
||||
//publish metric that should trigger alarm for the CPU Utilization
|
||||
metricStreamInterface.publish(record );
|
||||
|
||||
//wait for the metric to be processed
|
||||
sleep(2 * testTimeBucketMs);
|
||||
|
||||
//verify that alarm was raised
|
||||
List<Alarm> alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.CPUUtilization));
|
||||
assertEquals(1, alarms.size());
|
||||
|
||||
//Now create a metric that should clear the alarm
|
||||
ServiceMetric recordToClearAlarm = record.clone();
|
||||
recordToClearAlarm.setCreatedTimestamp(System.currentTimeMillis() + 2* testTimeBucketMs );
|
||||
((ApNodeMetrics)recordToClearAlarm.getDetails()).getApPerformance().setCpuUtilized(new int[] { 50, 50 });
|
||||
|
||||
//publish metric that should clear the alarm for the CPU Utilization
|
||||
metricStreamInterface.publish(recordToClearAlarm);
|
||||
|
||||
//wait for the metric to be processed
|
||||
sleep(2 * testTimeBucketMs);
|
||||
|
||||
//verify that alarm was cleared
|
||||
alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.CPUUtilization));
|
||||
assertEquals(0, alarms.size());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAccessPointIsUnreachableAlarm() {
|
||||
int customerId = getNextCustomerId();
|
||||
|
||||
Equipment equipment = new Equipment();
|
||||
equipment.setCustomerId(customerId);
|
||||
equipment.setEquipmentType(EquipmentType.AP);
|
||||
equipment.setInventoryId("testAccessPointIsUnreachableAlarm");
|
||||
equipment.setName(equipment.getInventoryId());
|
||||
equipment = equipmentService.create(equipment);
|
||||
long equipmentId = equipment.getId();
|
||||
|
||||
ServiceMetric record = new ServiceMetric(customerId , equipmentId );
|
||||
//create metric a bit in the future so that it gets picked up by the processor and not simply discarded
|
||||
record.setCreatedTimestamp(System.currentTimeMillis() + testTimeBucketMs);
|
||||
|
||||
ApNodeMetrics apNodeMetrics = new ApNodeMetrics();
|
||||
record.setDetails(apNodeMetrics);
|
||||
|
||||
ApPerformance apPerformance = new ApPerformance();
|
||||
apNodeMetrics.setApPerformance(apPerformance);
|
||||
|
||||
apPerformance.setCpuTemperature(55);
|
||||
|
||||
//we will force the CPUUtilization alarm to be raised
|
||||
apPerformance.setCpuUtilized(new int[] { 50, 50 });
|
||||
|
||||
apPerformance.setFreeMemory(30000000);
|
||||
|
||||
//publish metric that should not trigger AccessPointIsUnreachable alarm
|
||||
metricStreamInterface.publish(record );
|
||||
|
||||
//wait for the metric to be processed
|
||||
sleep(testTimeBucketMs);
|
||||
|
||||
//verify that alarm was not raised
|
||||
List<Alarm> alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.AccessPointIsUnreachable));
|
||||
assertEquals(0, alarms.size());
|
||||
|
||||
//Now wait for the alarm to be raised because no service_metrics_collection_config were posted
|
||||
sleep(testTimeBucketMs);
|
||||
|
||||
//verify that alarm was raised
|
||||
for(int i = 0; i < 50; i++) {
|
||||
alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.AccessPointIsUnreachable));
|
||||
if(!alarms.isEmpty()) {
|
||||
break;
|
||||
}else {
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
assertEquals(1, alarms.size());
|
||||
|
||||
//Now create a metric that should clear the alarm
|
||||
ServiceMetric recordToClearAlarm = record.clone();
|
||||
recordToClearAlarm.setCreatedTimestamp(System.currentTimeMillis() + testTimeBucketMs );
|
||||
|
||||
//publish metric that should clear the AccessPointIsUnreachable alarm
|
||||
metricStreamInterface.publish(recordToClearAlarm);
|
||||
|
||||
//wait for the metric to be processed
|
||||
sleep(testTimeBucketMs);
|
||||
|
||||
//verify that alarm was cleared
|
||||
for(int i = 0; i < 50; i++) {
|
||||
alarms = alarmService.get(customerId, Collections.singleton(equipmentId), Collections.singleton(AlarmCode.AccessPointIsUnreachable));
|
||||
if(alarms.isEmpty()) {
|
||||
break;
|
||||
}else {
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
assertEquals(0, alarms.size());
|
||||
|
||||
}
|
||||
|
||||
public int getNextCustomerId() {
|
||||
return (int) testSequence.incrementAndGet();
|
||||
}
|
||||
|
||||
public long getNextEquipmentId() {
|
||||
return testSequence.incrementAndGet();
|
||||
}
|
||||
|
||||
public void sleep(long ms) {
|
||||
try {
|
||||
Thread.sleep( ms );
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<configuration>
|
||||
<conversionRule conversionWord="filteredStack"
|
||||
converterClass="com.telecominfraproject.wlan.server.exceptions.logback.ExceptionCompressingConverter" />
|
||||
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n%filteredStack%nopex</pattern>
|
||||
<!-- See http://logback.qos.ch/manual/layouts.html for details -->
|
||||
<!-- %ex{5} - add at the end to display only 5 levels of the exception stack trace -->
|
||||
<!-- %nopex - add at the end to not display any of the exception stack traces -->
|
||||
<!-- %ex{full} - add at the end to display all the levels of the exception stack trace -->
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!--
|
||||
details: http://logback.qos.ch/manual/configuration.html#auto_configuration
|
||||
|
||||
runtime configuration, if need to override the defaults:
|
||||
-Dlogging.config=file:///home/ec2-user/opensync/logback.xml
|
||||
|
||||
for log configuration debugging - use
|
||||
-Dlogback.statusListenerClass=ch.qos.logback.core.status.OnConsoleStatusListener
|
||||
|
||||
log levels:
|
||||
OFF ERROR WARN INFO DEBUG TRACE
|
||||
-->
|
||||
<logger name="org.apache.catalina.startup.DigesterFactory" level="ERROR"/>
|
||||
<logger name="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" level="INFO"/>
|
||||
<logger name="org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer" level="INFO"/>
|
||||
<logger name="org.springframework.security.web.authentication.preauth" level="OFF"/>
|
||||
<logger name="com.netflix.servo.tag.aws.AwsInjectableTag" level="OFF"/>
|
||||
|
||||
<logger name="com.telecominfraproject" level="WARN"/>
|
||||
|
||||
<!--
|
||||
<logger name="com.telecominfraproject.wlan.streams.simple" level="TRACE"/>
|
||||
<logger name="com.telecominfraproject.wlan.streams.equipmentalarms" level="TRACE"/>
|
||||
-->
|
||||
|
||||
<root level="WARN">
|
||||
<appender-ref ref="stdout"/>
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.telecominfraproject.wlan.equipmentgateway.models;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.equipment.LEDColour;
|
||||
|
||||
public class CEGWBlinkRequest extends EquipmentCommand {
|
||||
|
||||
private static final long serialVersionUID = 3464950479960821571L;
|
||||
|
||||
private boolean blinkAllLEDs;
|
||||
private int numCycles;
|
||||
private int colour1DurationMs;
|
||||
private int colour2DurationMs;
|
||||
@@ -28,6 +31,14 @@ public class CEGWBlinkRequest extends EquipmentCommand {
|
||||
public CEGWBlinkRequest() {
|
||||
super(CEGWCommandType.BlinkRequest, null, 0);
|
||||
}
|
||||
|
||||
public boolean getBlinkAllLEDs() {
|
||||
return this.blinkAllLEDs;
|
||||
}
|
||||
|
||||
public void setBlinkAllLEDs(boolean blinkAllLEDs) {
|
||||
this.blinkAllLEDs = blinkAllLEDs;
|
||||
}
|
||||
|
||||
public int getNumCycles() {
|
||||
return numCycles;
|
||||
@@ -79,4 +90,25 @@ public class CEGWBlinkRequest extends EquipmentCommand {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + Objects.hash(blinkAllLEDs, colour1, colour1DurationMs, colour2, colour2DurationMs, numCycles);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (!super.equals(obj))
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
CEGWBlinkRequest other = (CEGWBlinkRequest) obj;
|
||||
return blinkAllLEDs == other.blinkAllLEDs && colour1 == other.colour1 && colour1DurationMs == other.colour1DurationMs && colour2 == other.colour2
|
||||
&& colour2DurationMs == other.colour2DurationMs && numCycles == other.numCycles;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,6 +346,7 @@ components:
|
||||
- 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:
|
||||
- $ref: '#/components/schemas/CEGWBaseCommand'
|
||||
properties:
|
||||
@@ -357,6 +358,8 @@ components:
|
||||
type: string
|
||||
enum:
|
||||
- CEGWBlinkRequest
|
||||
blinkAllLEDs:
|
||||
type: boolean
|
||||
colour1:
|
||||
$ref: '#/components/schemas/LEDColour'
|
||||
colour2:
|
||||
@@ -375,6 +378,7 @@ components:
|
||||
inventoryId: inv-1
|
||||
model_type: CEGWBlinkRequest
|
||||
commandType: BlinkRequest
|
||||
blinkAllLEDs: true
|
||||
colour1: blue
|
||||
colour2: red
|
||||
colour1DurationMs: 1000
|
||||
|
||||
@@ -37,6 +37,7 @@ public abstract class CommonElementConfiguration extends EquipmentDetails implem
|
||||
private AntennaType antennaType;
|
||||
private Boolean costSavingEventsEnabled;
|
||||
private NetworkForwardMode forwardMode;
|
||||
private boolean blinkAllLEDs;
|
||||
|
||||
/**
|
||||
* this constructor is used for CAMI only
|
||||
@@ -69,37 +70,33 @@ public abstract class CommonElementConfiguration extends EquipmentDetails implem
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + Objects.hash(antennaType, blinkAllLEDs, costSavingEventsEnabled, deploymentType, deviceMode, deviceName, elementConfigVersion,
|
||||
equipmentType, forwardMode, frameReportThrottleEnabled, gettingDNS, gettingIP, locallyConfigured, locallyConfiguredMgmtVlan, locationData,
|
||||
peerInfoList, staticDnsIp1, staticDnsIp2, staticIP, staticIpGw, staticIpMaskCidr, syntheticClientEnabled);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (!super.equals(obj))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof CommonElementConfiguration)) {
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
}
|
||||
CommonElementConfiguration other = (CommonElementConfiguration) obj;
|
||||
return this.antennaType == other.antennaType
|
||||
&& Objects.equals(costSavingEventsEnabled, other.costSavingEventsEnabled)
|
||||
&& this.deploymentType == other.deploymentType && this.deviceMode == other.deviceMode
|
||||
&& Objects.equals(deviceName, other.deviceName)
|
||||
&& Objects.equals(elementConfigVersion, other.elementConfigVersion)
|
||||
&& this.equipmentType == other.equipmentType && this.forwardMode == other.forwardMode
|
||||
&& Objects.equals(frameReportThrottleEnabled, other.frameReportThrottleEnabled)
|
||||
&& this.gettingDNS == other.gettingDNS && this.gettingIP == other.gettingIP
|
||||
&& this.locallyConfigured == other.locallyConfigured
|
||||
&& this.locallyConfiguredMgmtVlan == other.locallyConfiguredMgmtVlan
|
||||
&& Objects.equals(locationData, other.locationData) && Objects.equals(peerInfoList, other.peerInfoList)
|
||||
&& Objects.equals(staticDnsIp1, other.staticDnsIp1) && Objects.equals(staticDnsIp2, other.staticDnsIp2)
|
||||
&& Objects.equals(staticIP, other.staticIP) && Objects.equals(staticIpGw, other.staticIpGw)
|
||||
&& Objects.equals(staticIpMaskCidr, other.staticIpMaskCidr)
|
||||
&& Objects.equals(syntheticClientEnabled, other.syntheticClientEnabled);
|
||||
return antennaType == other.antennaType && blinkAllLEDs == other.blinkAllLEDs && Objects.equals(costSavingEventsEnabled, other.costSavingEventsEnabled)
|
||||
&& deploymentType == other.deploymentType && deviceMode == other.deviceMode && Objects.equals(deviceName, other.deviceName)
|
||||
&& Objects.equals(elementConfigVersion, other.elementConfigVersion) && Objects.equals(equipmentType, other.equipmentType)
|
||||
&& forwardMode == other.forwardMode && Objects.equals(frameReportThrottleEnabled, other.frameReportThrottleEnabled)
|
||||
&& gettingDNS == other.gettingDNS && gettingIP == other.gettingIP && locallyConfigured == other.locallyConfigured
|
||||
&& locallyConfiguredMgmtVlan == other.locallyConfiguredMgmtVlan && Objects.equals(locationData, other.locationData)
|
||||
&& Objects.equals(peerInfoList, other.peerInfoList) && Objects.equals(staticDnsIp1, other.staticDnsIp1)
|
||||
&& Objects.equals(staticDnsIp2, other.staticDnsIp2) && Objects.equals(staticIP, other.staticIP) && Objects.equals(staticIpGw, other.staticIpGw)
|
||||
&& Objects.equals(staticIpMaskCidr, other.staticIpMaskCidr) && Objects.equals(syntheticClientEnabled, other.syntheticClientEnabled);
|
||||
}
|
||||
|
||||
public AntennaType getAntennaType() {
|
||||
@@ -189,14 +186,6 @@ public abstract class CommonElementConfiguration extends EquipmentDetails implem
|
||||
return syntheticClientEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(antennaType, costSavingEventsEnabled, deploymentType, deviceMode, deviceName,
|
||||
elementConfigVersion, equipmentType, forwardMode, frameReportThrottleEnabled, gettingDNS, gettingIP,
|
||||
locallyConfigured, locallyConfiguredMgmtVlan, locationData, peerInfoList, staticDnsIp1, staticDnsIp2,
|
||||
staticIP, staticIpGw, staticIpMaskCidr, syntheticClientEnabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnsupportedValue() {
|
||||
if (super.hasUnsupportedValue()) {
|
||||
@@ -311,4 +300,14 @@ public abstract class CommonElementConfiguration extends EquipmentDetails implem
|
||||
public void setSyntheticClientEnabled(Boolean syntheticClientEnabled) {
|
||||
this.syntheticClientEnabled = syntheticClientEnabled;
|
||||
}
|
||||
|
||||
public boolean isBlinkAllLEDs() {
|
||||
return blinkAllLEDs;
|
||||
}
|
||||
|
||||
public void setBlinkAllLEDs(boolean blinkAllLEDs) {
|
||||
this.blinkAllLEDs = blinkAllLEDs;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.telecominfraproject.wlan.equipment.models.events;
|
||||
|
||||
import com.telecominfraproject.wlan.equipment.models.Equipment;
|
||||
|
||||
public class EquipmentBlinkLEDsEvent extends EquipmentChangedEvent {
|
||||
private static final long serialVersionUID = 5222048279956123654L;
|
||||
public EquipmentBlinkLEDsEvent(Equipment equipment){
|
||||
super(equipment);
|
||||
setEquipmentChangeType(EquipmentChangeType.blinkLEDs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor used by JSON
|
||||
*/
|
||||
private EquipmentBlinkLEDsEvent() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ import com.telecominfraproject.wlan.core.model.json.JsonDeserializationUtils;
|
||||
|
||||
public enum EquipmentChangeType {
|
||||
|
||||
All(0), ChannelsOnly(1), CellSizeAttributesOnly(2), ApImpacting(3), UNSUPPORTED(-1);
|
||||
All(0), ChannelsOnly(1), CellSizeAttributesOnly(2), ApImpacting(3), blinkLEDs(4), CustomerOnly(5), UNSUPPORTED(-1);
|
||||
|
||||
private final int id;
|
||||
private static final Map<Integer, EquipmentChangeType> ELEMENTS = new HashMap<>();
|
||||
private static final EquipmentChangeType validValues[] = { All, ChannelsOnly, CellSizeAttributesOnly, ApImpacting};
|
||||
private static final EquipmentChangeType validValues[] = { All, ChannelsOnly, CellSizeAttributesOnly, ApImpacting,blinkLEDs};
|
||||
|
||||
private EquipmentChangeType(int id) {
|
||||
this.id = id;
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.telecominfraproject.wlan.equipment.models.events;
|
||||
|
||||
import com.telecominfraproject.wlan.equipment.models.Equipment;
|
||||
|
||||
public class EquipmentCustomerChangedEvent extends EquipmentChangedEvent {
|
||||
|
||||
private static final long serialVersionUID = 4650302079238674307L;
|
||||
private Equipment existingEquipment; // old equipment
|
||||
private Equipment equipment; // new configured equipment
|
||||
|
||||
public EquipmentCustomerChangedEvent(Equipment existingEquipment, Equipment equipment) {
|
||||
super(equipment);
|
||||
setEquipmentChangeType(EquipmentChangeType.CustomerOnly);
|
||||
this.setExistingEquipment(existingEquipment);
|
||||
this.setEquipment(equipment);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor used by JSON
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private EquipmentCustomerChangedEvent() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Equipment getExistingEquipment() {
|
||||
return existingEquipment;
|
||||
}
|
||||
|
||||
public void setExistingEquipment(Equipment existingEquipment) {
|
||||
this.existingEquipment = existingEquipment;
|
||||
}
|
||||
|
||||
public Equipment getEquipment() {
|
||||
return equipment;
|
||||
}
|
||||
|
||||
public void setEquipment(Equipment equipment) {
|
||||
this.equipment = equipment;
|
||||
}
|
||||
}
|
||||
@@ -1,57 +1,58 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../wlan-cloud-root</relativePath>
|
||||
</parent>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../wlan-cloud-root</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>equipment-service-remote</artifactId>
|
||||
<name>equipment-service-remote</name>
|
||||
<description>Remote client for accessing the service, uses REST API calls.</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>equipment-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>base-client</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<artifactId>equipment-service-remote</artifactId>
|
||||
<name>equipment-service-remote</name>
|
||||
<description>Remote client for accessing the service, uses REST API calls.</description>
|
||||
|
||||
<!-- Dependencies for the unit tests -->
|
||||
<dependency>
|
||||
<artifactId>base-remote-tests</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-service</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>equipment-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>base-client</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-empty</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- Dependencies for the unit tests -->
|
||||
<dependency>
|
||||
<artifactId>base-remote-tests</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<dependency>
|
||||
<artifactId>equipment-service</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-empty</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -1,53 +1,59 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../wlan-cloud-root</relativePath>
|
||||
</parent>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../wlan-cloud-root</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>equipment-service</artifactId>
|
||||
<name>equipment-service</name>
|
||||
<description>Server side implementation of the service.</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>base-container</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-datastore-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<artifactId>equipment-service</artifactId>
|
||||
<name>equipment-service</name>
|
||||
<description>Server side implementation of the service.</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>alarm-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-empty</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>base-container</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-datastore-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-empty</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -47,14 +47,15 @@ import com.telecominfraproject.wlan.equipment.models.SourceSelectionMulticast;
|
||||
import com.telecominfraproject.wlan.equipment.models.bulkupdate.rrm.EquipmentRrmBulkUpdateRequest;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentAddedEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentApImpactingChangedEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentBlinkLEDsEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentCellSizeAttributesChangedEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentChangedEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentChannelsChangedEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentCustomerChangedEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentRemovedEvent;
|
||||
import com.telecominfraproject.wlan.server.exceptions.ConfigurationException;
|
||||
import com.telecominfraproject.wlan.systemevent.models.SystemEvent;
|
||||
|
||||
|
||||
/**
|
||||
* @author dtoptygin
|
||||
*
|
||||
@@ -73,7 +74,6 @@ public class EquipmentController {
|
||||
@Autowired private EquipmentDatastore equipmentDatastore;
|
||||
@Autowired private CloudEventDispatcherInterface cloudEventDispatcher;
|
||||
|
||||
|
||||
/**
|
||||
* Creates new Equipment.
|
||||
*
|
||||
@@ -280,18 +280,23 @@ public class EquipmentController {
|
||||
LOG.debug("Updated Equipment {}", ret);
|
||||
|
||||
EquipmentChangedEvent event;
|
||||
if (equipment.getCustomerId() != existingEquipment.getCustomerId()) {
|
||||
publishEvent(new EquipmentCustomerChangedEvent(existingEquipment, ret));
|
||||
}
|
||||
if ((equipment.getProfileId() != existingEquipment.getProfileId()) || (existingApElementConfig != null && updatedApElementConfig != null &&
|
||||
updatedApElementConfig.needsToBeUpdatedOnDevice(existingApElementConfig))) {
|
||||
event = new EquipmentApImpactingChangedEvent(ret);
|
||||
} else if (existingApElementConfig != null && existingApElementConfig.isBlinkAllLEDs() != updatedApElementConfig.isBlinkAllLEDs()) {
|
||||
LOG.debug("Updated BlinkingLEDs {}", ret);
|
||||
event = new EquipmentBlinkLEDsEvent(ret);
|
||||
} else {
|
||||
event = new EquipmentChangedEvent(ret);
|
||||
}
|
||||
publishEvent(event);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
private void validateChannelNum(Equipment equipment) {
|
||||
if (equipment.getDetails() instanceof ApElementConfiguration) {
|
||||
ApElementConfiguration apElementConfiguration = (ApElementConfiguration) equipment.getDetails();
|
||||
|
||||
@@ -220,6 +220,8 @@ components:
|
||||
type: boolean
|
||||
forwardMode:
|
||||
$ref: '#/components/schemas/NetworkForwardMode'
|
||||
blinkAllLEDs:
|
||||
type: boolean
|
||||
radioMap:
|
||||
$ref: '#/components/schemas/RadioMap'
|
||||
advancedRadioMap:
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.telecominfraproject.wlan.equipment.models.Equipment;
|
||||
EquipmentController.class,
|
||||
CloudEventDispatcherEmpty.class,
|
||||
EquipmentDatastoreInMemory.class,
|
||||
EquipmentControllerTest.Config.class,
|
||||
EquipmentControllerTest.Config.class
|
||||
})
|
||||
public class EquipmentControllerTest {
|
||||
|
||||
|
||||
@@ -191,18 +191,18 @@ public class ManufacturerServiceRemoteTest extends BaseRemoteTest {
|
||||
Set<String> ouiList = new HashSet<>();
|
||||
ouiList.add(oui1);
|
||||
ouiListSearchResult = remoteInterface.getManufacturerDetailsForOuiSet(ouiList);
|
||||
assertTrue(ouiListSearchResult.size() == 1);
|
||||
assertTrue(ouiListSearchResult.size() == 2);
|
||||
assertTrue(ouiListSearchResult.get(oui1).equals(ret1));
|
||||
|
||||
ouiList.add(oui2);
|
||||
ouiListSearchResult = remoteInterface.getManufacturerDetailsForOuiSet(ouiList);
|
||||
assertTrue(ouiListSearchResult.size() == 2);
|
||||
assertTrue(ouiListSearchResult.size() == 3);
|
||||
assertTrue(ouiListSearchResult.get(oui1).equals(ret1));
|
||||
assertTrue(ouiListSearchResult.get(oui2).equals(ret2));
|
||||
|
||||
ouiList.add(oui3);
|
||||
ouiListSearchResult = remoteInterface.getManufacturerDetailsForOuiSet(ouiList);
|
||||
assertTrue(ouiListSearchResult.size() == 3);
|
||||
assertTrue(ouiListSearchResult.size() == 4);
|
||||
assertTrue(ouiListSearchResult.get(oui1).equals(ret1));
|
||||
assertTrue(ouiListSearchResult.get(oui2).equals(ret2));
|
||||
assertTrue(ouiListSearchResult.get(oui3).equals(ret3));
|
||||
@@ -211,7 +211,7 @@ public class ManufacturerServiceRemoteTest extends BaseRemoteTest {
|
||||
ouiList.add(String.format("%06d", i));
|
||||
}
|
||||
ouiListSearchResult = remoteInterface.getManufacturerDetailsForOuiSet(ouiList);
|
||||
assertEquals(3,ouiListSearchResult.size());
|
||||
assertEquals(4,ouiListSearchResult.size());
|
||||
assertTrue(ouiListSearchResult.get(oui1).equals(ret1));
|
||||
assertTrue(ouiListSearchResult.get(oui2).equals(ret2));
|
||||
assertTrue(ouiListSearchResult.get(oui3).equals(ret3));
|
||||
|
||||
@@ -35,7 +35,10 @@ import com.telecominfraproject.wlan.manufacturer.models.ManufacturerOuiDetails;
|
||||
public class ManufacturerController {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ManufacturerController.class);
|
||||
|
||||
|
||||
private static final int GLOBE_BIT = (0x1 << 1);
|
||||
private static final ManufacturerOuiDetails PRIVATE_MAC_RESPONSE = new ManufacturerOuiDetails();
|
||||
|
||||
@Autowired
|
||||
private ManufacturerDatastoreInterface manufacturerDatastore;
|
||||
|
||||
@@ -43,6 +46,11 @@ public class ManufacturerController {
|
||||
private static final long serialVersionUID = -8035392255039609079L;
|
||||
}
|
||||
|
||||
static {
|
||||
PRIVATE_MAC_RESPONSE.setOui("ffffff");
|
||||
PRIVATE_MAC_RESPONSE.setManufacturerName("Unknown (Private Address)");
|
||||
PRIVATE_MAC_RESPONSE.setManufacturerAlias("Unknown");
|
||||
}
|
||||
@PostMapping(value = "/oui")
|
||||
public ManufacturerOuiDetails createOuiDetails(@RequestBody ManufacturerOuiDetails ouiDetails) {
|
||||
LOG.debug("Creating OUI details {} ", ouiDetails);
|
||||
@@ -76,9 +84,7 @@ public class ManufacturerController {
|
||||
@GetMapping(value = "/oui")
|
||||
public ManufacturerOuiDetails getByOui(@RequestParam String oui) {
|
||||
LOG.debug("Retrieving OUI details for OUI {} ", oui);
|
||||
|
||||
ManufacturerOuiDetails ret = manufacturerDatastore.getByOui(oui);
|
||||
|
||||
ManufacturerOuiDetails ret = isGlobalAddress(oui) ? manufacturerDatastore.getByOui(oui) : PRIVATE_MAC_RESPONSE;
|
||||
LOG.debug("Retrieved OUI details {} ", ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -157,7 +163,11 @@ public class ManufacturerController {
|
||||
public Map<String, ManufacturerOuiDetails> getManufacturerDetailsForOuiList(
|
||||
@RequestParam List<String> ouiList) {
|
||||
LOG.debug("calling getManufacturerDetailsForOuiList ");
|
||||
return manufacturerDatastore.getManufacturerDetailsForOuiList(ouiList);
|
||||
Map<String, ManufacturerOuiDetails> manufMap = manufacturerDatastore.getManufacturerDetailsForOuiList(ouiList);
|
||||
|
||||
ouiList.forEach(oui -> {if (!isGlobalAddress(oui)) manufMap.put(oui, PRIVATE_MAC_RESPONSE);});
|
||||
manufMap.put(PRIVATE_MAC_RESPONSE.getOui(), PRIVATE_MAC_RESPONSE);
|
||||
return manufMap;
|
||||
}
|
||||
|
||||
@PutMapping(value = "/oui/alias")
|
||||
@@ -180,4 +190,14 @@ public class ManufacturerController {
|
||||
LOG.debug("Retrieving alias values that begin with {}", prefix);
|
||||
return manufacturerDatastore.getAliasValuesThatBeginWith(prefix, maxResults);
|
||||
}
|
||||
|
||||
private boolean isGlobalAddress(String oui) {
|
||||
if (oui != null && oui.length() == 6) {
|
||||
// we only need to check the first Byte of the OUI
|
||||
Integer hex = Integer.parseInt(oui.substring(0, 2), 16);
|
||||
byte firstByte = hex.byteValue();
|
||||
return (firstByte & GLOBE_BIT) == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,49 @@
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<artifactId>equipment-service-local</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-service</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>cloud-event-dispatcher-empty</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>profile-service-local</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>profile-service</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>profile-datastore-inmemory</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package com.telecominfraproject.wlan.portal.controller.equipmentgateway;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
@@ -13,6 +14,7 @@ import com.telecominfraproject.wlan.core.model.json.GenericResponse;
|
||||
import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
|
||||
import com.telecominfraproject.wlan.equipment.models.Equipment;
|
||||
import com.telecominfraproject.wlan.equipment.models.RadioChannelChangeSettings;
|
||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWBlinkRequest;
|
||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWCommandResultCode;
|
||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWFirmwareDownloadRequest;
|
||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWNewChannelRequest;
|
||||
@@ -30,7 +32,7 @@ import com.telecominfraproject.wlan.status.equipment.models.EquipmentResetMethod
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/portal")
|
||||
public class EquipmentGatewayPortalController {
|
||||
public class EquipmentGatewayPortalController {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(EquipmentGatewayPortalController.class);
|
||||
|
||||
@@ -49,94 +51,113 @@ public class EquipmentGatewayPortalController {
|
||||
|
||||
Equipment equipment = equipmentServiceInterface.get(equipmentId);
|
||||
FirmwareVersion fwVersion = firmwareServiceInterface.getFirmwareVersion(firmwareVersionId);
|
||||
|
||||
CEGWFirmwareDownloadRequest fwDownloadRequest = new CEGWFirmwareDownloadRequest(equipment.getInventoryId(),
|
||||
equipment.getId(), fwVersion.getVersionName(), fwVersion.getFilename());
|
||||
|
||||
CEGWFirmwareDownloadRequest fwDownloadRequest =
|
||||
new CEGWFirmwareDownloadRequest(equipment.getInventoryId(), equipment.getId(), fwVersion.getVersionName(), fwVersion.getFilename());
|
||||
|
||||
EquipmentCommandResponse response = equipmentGatewayServiceInterface.sendCommand(fwDownloadRequest);
|
||||
LOG.debug("FW Download Response {}", response);
|
||||
|
||||
if(response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true,"");
|
||||
if (response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true, "");
|
||||
} else {
|
||||
return new GenericResponse(false, "Failed to request firmware update: "+ response.getResultCode() + " " + response.getResultDetail());
|
||||
return new GenericResponse(false, "Failed to request firmware update: " + response.getResultCode() + " " + response.getResultDetail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/equipmentGateway/requestChannelChange", method = RequestMethod.POST)
|
||||
public GenericResponse requestChannelChange(@RequestParam long equipmentId, @RequestBody RadioChannelChangeSettings radioChannelChangeSettings) {
|
||||
LOG.debug("requestChannelChange {} {}", equipmentId);
|
||||
|
||||
Equipment equipment = equipmentServiceInterface.get(equipmentId);
|
||||
|
||||
CEGWNewChannelRequest newChannelRequest = new CEGWNewChannelRequest(equipment.getInventoryId(), equipmentId, radioChannelChangeSettings.getBackupChannel(), radioChannelChangeSettings.getPrimaryChannel());
|
||||
|
||||
Equipment equipment = equipmentServiceInterface.get(equipmentId);
|
||||
|
||||
CEGWNewChannelRequest newChannelRequest = new CEGWNewChannelRequest(equipment.getInventoryId(), equipmentId,
|
||||
radioChannelChangeSettings.getBackupChannel(), radioChannelChangeSettings.getPrimaryChannel());
|
||||
|
||||
EquipmentCommandResponse response = equipmentGatewayServiceInterface.sendCommand(newChannelRequest);
|
||||
LOG.debug("Channel Change Response {}", response);
|
||||
|
||||
if(response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true,"");
|
||||
if (response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true, "");
|
||||
} else {
|
||||
return new GenericResponse(false, "Failed to initiate channel change: "+ response.getResultCode() + " " + response.getResultDetail());
|
||||
return new GenericResponse(false, "Failed to initiate channel change: " + response.getResultCode() + " " + response.getResultDetail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/equipmentGateway/requestApReboot", method = RequestMethod.POST)
|
||||
public GenericResponse requestApReboot(@RequestParam long equipmentId) {
|
||||
LOG.debug("requestApReboot {}", equipmentId);
|
||||
|
||||
Equipment equipment = equipmentServiceInterface.get(equipmentId);
|
||||
// No config change, just plain reboot
|
||||
CEGWRebootRequest apRebootRequest = new CEGWRebootRequest(equipment.getInventoryId(),
|
||||
equipment.getId(), false, EquipmentResetMethod.NoReset);
|
||||
// No config change, just plain reboot
|
||||
CEGWRebootRequest apRebootRequest = new CEGWRebootRequest(equipment.getInventoryId(), equipment.getId(), false, EquipmentResetMethod.NoReset);
|
||||
|
||||
EquipmentCommandResponse response = equipmentGatewayServiceInterface.sendCommand(apRebootRequest);
|
||||
LOG.debug("AP reboot response {}", response);
|
||||
|
||||
if(response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true,"");
|
||||
if (response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true, "");
|
||||
} else {
|
||||
return new GenericResponse(false, "Failed to trigger AP reboot: "+ response.getResultCode() + " " + response.getResultDetail());
|
||||
return new GenericResponse(false, "Failed to trigger AP reboot: " + response.getResultCode() + " " + response.getResultDetail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/equipmentGateway/requestApSwitchSoftwareBank", method = RequestMethod.POST)
|
||||
public GenericResponse requestApSwitchSoftwareBank(@RequestParam long equipmentId) {
|
||||
LOG.debug("requestApSwitchSoftwareBank {}", equipmentId);
|
||||
|
||||
Equipment equipment = equipmentServiceInterface.get(equipmentId);
|
||||
// Reboot, switch active/inactive software bank
|
||||
CEGWRebootRequest apSwitchSoftwareBank = new CEGWRebootRequest(equipment.getInventoryId(),
|
||||
equipment.getId(), true, EquipmentResetMethod.NoReset);
|
||||
// Reboot, switch active/inactive software bank
|
||||
CEGWRebootRequest apSwitchSoftwareBank = new CEGWRebootRequest(equipment.getInventoryId(), equipment.getId(), true, EquipmentResetMethod.NoReset);
|
||||
|
||||
EquipmentCommandResponse response = equipmentGatewayServiceInterface.sendCommand(apSwitchSoftwareBank);
|
||||
LOG.debug("AP switch software bank response {}", response);
|
||||
|
||||
if(response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true,"");
|
||||
if (response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true, "");
|
||||
} else {
|
||||
return new GenericResponse(false, "Failed to trigger AP switch software bank: "+ response.getResultCode() + " " + response.getResultDetail());
|
||||
return new GenericResponse(false, "Failed to trigger AP switch software bank: " + response.getResultCode() + " " + response.getResultDetail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/equipmentGateway/requestApFactoryReset", method = RequestMethod.POST)
|
||||
public GenericResponse requestApFactoryReset(@RequestParam long equipmentId) {
|
||||
LOG.debug("requestApFactoryReset {}", equipmentId);
|
||||
|
||||
Equipment equipment = equipmentServiceInterface.get(equipmentId);
|
||||
// Reboot Ap with factory settings
|
||||
CEGWRebootRequest apFactoryReset = new CEGWRebootRequest(equipment.getInventoryId(),
|
||||
equipment.getId(), false, EquipmentResetMethod.FactoryReset);
|
||||
// Reboot Ap with factory settings
|
||||
CEGWRebootRequest apFactoryReset = new CEGWRebootRequest(equipment.getInventoryId(), equipment.getId(), false, EquipmentResetMethod.FactoryReset);
|
||||
|
||||
EquipmentCommandResponse response = equipmentGatewayServiceInterface.sendCommand(apFactoryReset);
|
||||
LOG.debug("AP factory reset response {}", response);
|
||||
|
||||
if(response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true,"");
|
||||
if (response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true, "");
|
||||
} else {
|
||||
return new GenericResponse(false, "Failed to trigger AP factory reset: "+ response.getResultCode() + " " + response.getResultDetail());
|
||||
return new GenericResponse(false, "Failed to trigger AP factory reset: " + response.getResultCode() + " " + response.getResultDetail());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/equipmentGateway/requestApBlinkLEDs", method = RequestMethod.POST)
|
||||
public GenericResponse requestApBlinkLEDs(@RequestParam long equipmentId, @RequestParam boolean blinkAllLEDs) {
|
||||
String action = "stop blinking LEDs on AP ";
|
||||
if (blinkAllLEDs) action = "start blinking LEDs on AP ";
|
||||
Equipment equipment = equipmentServiceInterface.get(equipmentId);
|
||||
LOG.debug("Request {} for AP {}", action, equipment.getInventoryId());
|
||||
|
||||
// Turn LEDs on Ap on or off based on blinkAllLEDs value
|
||||
CEGWBlinkRequest apBlinkLEDs = new CEGWBlinkRequest(equipment.getInventoryId(), equipment.getId());
|
||||
apBlinkLEDs.setBlinkAllLEDs(blinkAllLEDs);
|
||||
|
||||
EquipmentCommandResponse response = equipmentGatewayServiceInterface.sendCommand(apBlinkLEDs);
|
||||
LOG.debug("{} response {}", action,response);
|
||||
|
||||
|
||||
if (response.getResultCode() == CEGWCommandResultCode.Success) {
|
||||
return new GenericResponse(true, "");
|
||||
} else {
|
||||
return new GenericResponse(false, "Failed to " + action + " for AP: " + response.getResultCode() + " " + response.getResultDetail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -158,55 +158,66 @@ public class ProfilePortalController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/profile/equipmentCounts", method = RequestMethod.GET)
|
||||
public ListOfPairLongLong getCountsOfEquipmentThatUseProfiles(@RequestParam Set<Long> profileIdSet) {
|
||||
LOG.debug("getCountsOfEquipmentThatUseProfiles({})", profileIdSet);
|
||||
|
||||
//first get top-level profiles for the supplied set - only top-level profiles are linked to equipment
|
||||
List<PairLongLong> topLevelProfiles = this.profileServiceInterface.getTopLevelProfiles(profileIdSet);
|
||||
Map<Long, AtomicInteger> profileIdToCountMap = new HashMap<Long, AtomicInteger>();
|
||||
profileIdSet.forEach(profileId -> profileIdToCountMap.put(profileId, new AtomicInteger(0)));
|
||||
|
||||
//Maps child at all top level profiles that reference it. A top level profile references itself int this map
|
||||
Map<Long, List<Long>> childProfileToTopProfileMap = new HashMap<Long, List<Long>>();
|
||||
|
||||
List<PairLongLong> topLevelProfileList = profileServiceInterface.getTopLevelProfiles(profileIdSet);
|
||||
Set<Long> topProfileIdSet= new HashSet<Long>();
|
||||
|
||||
topLevelProfileList.forEach(pair ->
|
||||
{
|
||||
if (childProfileToTopProfileMap.putIfAbsent(
|
||||
pair.getValue1(),
|
||||
new ArrayList<Long>() {{ add(pair.getValue2());}}
|
||||
) != null)
|
||||
{
|
||||
childProfileToTopProfileMap.compute(pair.getValue1(), (k,v) ->
|
||||
new ArrayList<Long>() {{
|
||||
addAll(v);
|
||||
add(pair.getValue2());}});
|
||||
}
|
||||
topProfileIdSet.add(pair.getValue2());
|
||||
});
|
||||
|
||||
Map<Long, AtomicInteger> topProfileToEquipmentCountMap = new HashMap<>();
|
||||
topProfileIdSet.forEach(p -> topProfileToEquipmentCountMap.put(p, new AtomicInteger()));
|
||||
|
||||
PaginationContext<PairLongLong> context = new PaginationContext<>(500);
|
||||
equipmentServiceInterface.getEquipmentIdsByProfileIds(topProfileIdSet, context);
|
||||
|
||||
while(!context.isLastPage()) {
|
||||
PaginationResponse<PairLongLong> page = equipmentServiceInterface.getEquipmentIdsByProfileIds(topProfileIdSet, context );
|
||||
context = page.getContext();
|
||||
|
||||
page.getItems().forEach(p -> {
|
||||
AtomicInteger cnt = topProfileToEquipmentCountMap.get(p.getValue1());
|
||||
if(cnt!=null) {
|
||||
cnt.incrementAndGet();
|
||||
}
|
||||
});
|
||||
|
||||
LOG.debug("Page {} - counted {} equipmentids", context.getLastReturnedPageNumber(), context.getTotalItemsReturned());
|
||||
}
|
||||
|
||||
// assemble profile count for return, using child to top level profile id map
|
||||
childProfileToTopProfileMap.forEach((childKey,TopLevelIdList) ->
|
||||
{
|
||||
for (Long topProfileId : TopLevelIdList)
|
||||
{
|
||||
profileIdToCountMap.get(childKey).addAndGet(topProfileToEquipmentCountMap.get(topProfileId).get());
|
||||
}
|
||||
});
|
||||
//package results to get equipment counts for the original profile ids
|
||||
ListOfPairLongLong ret = new ListOfPairLongLong();
|
||||
profileIdToCountMap.forEach((id, count) -> ret.add(new PairLongLong(id, count.get())));
|
||||
|
||||
//map each supplied profile to its top-level parent
|
||||
Map<Long, Long> profileIdToTopProfileIdMap = new HashMap<>();
|
||||
topLevelProfiles.forEach(pair -> profileIdToTopProfileIdMap.put(pair.getValue1(), pair.getValue2()));
|
||||
|
||||
//gather top-level profile ids
|
||||
Set<Long> topProfileIds = new HashSet<>();
|
||||
topLevelProfiles.forEach(pair -> topProfileIds.add(pair.getValue2()));
|
||||
|
||||
|
||||
//TODO: this may be more efficiently done by a specialized count method on equipment datastore
|
||||
|
||||
//now get pages of equipmentIds that refer to the top-level profiles and count the equipmentIds
|
||||
PaginationContext<PairLongLong> context = new PaginationContext<>(500);
|
||||
this.equipmentServiceInterface.getEquipmentIdsByProfileIds(topProfileIds, context );
|
||||
|
||||
//prepare map of top-level profileId to the count of equipmentIds
|
||||
Map<Long, AtomicInteger> topProfileIdToEquipmentCountsMap = new HashMap<>();
|
||||
topProfileIds.forEach(p -> topProfileIdToEquipmentCountsMap.put(p, new AtomicInteger()));
|
||||
|
||||
while(!context.isLastPage()) {
|
||||
PaginationResponse<PairLongLong> page = equipmentServiceInterface.getEquipmentIdsByProfileIds(topProfileIds, context );
|
||||
context = page.getContext();
|
||||
|
||||
page.getItems().forEach(p -> {
|
||||
AtomicInteger cnt = topProfileIdToEquipmentCountsMap.get(p.getValue1());
|
||||
if(cnt!=null) {
|
||||
cnt.incrementAndGet();
|
||||
}
|
||||
});
|
||||
|
||||
LOG.debug("Page {} - counted {} equipmentids", context.getLastReturnedPageNumber(), context.getTotalItemsReturned());
|
||||
}
|
||||
|
||||
|
||||
//package results to get equipment counts for the original profile ids
|
||||
profileIdToTopProfileIdMap.forEach((p, tp) -> ret.add(new PairLongLong(p, topProfileIdToEquipmentCountsMap.get(tp).intValue())));
|
||||
|
||||
LOG.debug("getCountsOfEquipmentThatUseProfiles({}) return {}", profileIdSet, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1043,6 +1043,8 @@ components:
|
||||
type: boolean
|
||||
forwardMode:
|
||||
$ref: '#/components/schemas/NetworkForwardMode'
|
||||
blinkAllLEDs:
|
||||
type: boolean
|
||||
radioMap:
|
||||
$ref: '#/components/schemas/RadioMap'
|
||||
advancedRadioMap:
|
||||
@@ -1865,6 +1867,9 @@ components:
|
||||
sharedSecret:
|
||||
type: string
|
||||
format: password
|
||||
dynamicDiscovery:
|
||||
description: Dynamic discovery of HSP and IdPs (home service and identity providers). Regardless of configured value, this will only be set 'true' on the AP if useRadSec is also true.
|
||||
type: boolean
|
||||
example:
|
||||
model_type: RadiusProxyConfiguration
|
||||
caCert:
|
||||
@@ -2263,7 +2268,8 @@ components:
|
||||
- wpa3OnlySAE
|
||||
- wpa3MixedSAE
|
||||
- wpa3OnlyEAP
|
||||
- wpa3MixedEAP
|
||||
- wpa3MixedEAP
|
||||
- wpa3OnlyEAP192
|
||||
|
||||
RadioBasedSsidConfigurationMap:
|
||||
properties:
|
||||
@@ -3327,8 +3333,6 @@ components:
|
||||
|
||||
EquipmentAdminStatusData:
|
||||
type: object
|
||||
required:
|
||||
- model_type
|
||||
properties:
|
||||
model_type:
|
||||
type: string
|
||||
@@ -3342,6 +3346,15 @@ components:
|
||||
$ref: '#/components/schemas/StatusCode'
|
||||
statusMessage:
|
||||
type: string
|
||||
ledStatus:
|
||||
$ref: '#/components/schemas/LedStatus'
|
||||
|
||||
LedStatus:
|
||||
type: string
|
||||
enum:
|
||||
- led_blink
|
||||
- led_off
|
||||
- UNKNOWN
|
||||
|
||||
StatusCode:
|
||||
type: string
|
||||
@@ -4305,6 +4318,8 @@ components:
|
||||
- RADIO_CHANNEL
|
||||
channelNumberStatusDataMap:
|
||||
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
|
||||
txPowerDataMap:
|
||||
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
|
||||
|
||||
#
|
||||
# Objects related to Client sessions
|
||||
@@ -5041,6 +5056,11 @@ components:
|
||||
$ref: '#/components/schemas/ServiceMetricDetails'
|
||||
|
||||
ServiceMetricDetails:
|
||||
type: object
|
||||
properties:
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ApNodeMetrics'
|
||||
- $ref: '#/components/schemas/ApSsidMetrics'
|
||||
@@ -6940,7 +6960,10 @@ components:
|
||||
description: The number of aggregation frames sent using single MPDU (where the A-MPDU contains only one MPDU ).
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
wmmQueueStats:
|
||||
$ref: '#/components/schemas/WmmQueueStatsPerQueueTypeMap'
|
||||
|
||||
@@ -7093,6 +7116,9 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PerProcessUtilization'
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
EthernetLinkState:
|
||||
type: string
|
||||
@@ -7139,6 +7165,10 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/DnsProbeMetric'
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
|
||||
StateUpDownError:
|
||||
type: string
|
||||
@@ -8953,7 +8983,10 @@ components:
|
||||
numRxVHT_3466_8_Mbps:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
ListOfRadioUtilizationPerRadioMap:
|
||||
properties:
|
||||
@@ -9001,6 +9034,9 @@ components:
|
||||
unAvailableCapacity:
|
||||
type: number
|
||||
format: double
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
ListOfMacsPerRadioMap:
|
||||
properties:
|
||||
@@ -9062,6 +9098,7 @@ components:
|
||||
- EquipmentChangedEvent
|
||||
- EquipmentApImpactingChangedEvent
|
||||
- EquipmentChannelsChangedEvent
|
||||
- EquipmentBlinkLEDsEvent
|
||||
- EquipmentCellSizeAttributesChangedEvent
|
||||
- EquipmentRemovedEvent
|
||||
- StatusChangedEvent
|
||||
@@ -9155,6 +9192,7 @@ components:
|
||||
- $ref: '#/components/schemas/EquipmentChangedEvent'
|
||||
- $ref: '#/components/schemas/EquipmentApImpactingChangedEvent'
|
||||
- $ref: '#/components/schemas/EquipmentChannelsChangedEvent'
|
||||
- $ref: '#/components/schemas/EquipmentBlinkLEDsEvent'
|
||||
- $ref: '#/components/schemas/EquipmentCellSizeAttributesChangedEvent'
|
||||
- $ref: '#/components/schemas/EquipmentRemovedEvent'
|
||||
- $ref: '#/components/schemas/StatusChangedEvent'
|
||||
@@ -9508,7 +9546,12 @@ components:
|
||||
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
|
||||
newBackupChannels:
|
||||
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
|
||||
|
||||
|
||||
EquipmentBlinkLEDsEvent:
|
||||
properties:
|
||||
allOf:
|
||||
$ref: '#/components/schemas/EquipmentChangedEvent'
|
||||
|
||||
EquipmentCellSizeAttributesChangedEvent:
|
||||
properties:
|
||||
allOf:
|
||||
@@ -14217,6 +14260,36 @@ paths:
|
||||
$ref: '#/components/schemas/GenericResponse'
|
||||
500:
|
||||
$ref: '#/components/responses/GenericApiError'
|
||||
|
||||
/portal/equipmentGateway/requestApBlinkLEDs:
|
||||
post:
|
||||
tags:
|
||||
- Equipment Gateway
|
||||
summary: Request to enable or disable the blinking of LEDs on the AP
|
||||
operationId: requestApBlinkLEDs
|
||||
parameters:
|
||||
- name: equipmentId
|
||||
in: query
|
||||
description: Equipment id for AP on which the enabling or disabling of blinking LEDs is requested.
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
- name: blinkAllLEDs
|
||||
in: query
|
||||
description: enable (true) or disable (false) the LEDs blinking state.
|
||||
required: true
|
||||
schema:
|
||||
type: boolean
|
||||
responses:
|
||||
200:
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/GenericResponse'
|
||||
500:
|
||||
$ref: '#/components/responses/GenericApiError'
|
||||
|
||||
/portal/equipmentGateway/requestChannelChange:
|
||||
post:
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
package com.telecominfraproject.wlan.portal.controller.profile;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherEmpty;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
|
||||
import com.telecominfraproject.wlan.core.model.pair.PairLongLong;
|
||||
import com.telecominfraproject.wlan.equipment.EquipmentServiceLocal;
|
||||
import com.telecominfraproject.wlan.equipment.controller.EquipmentController;
|
||||
import com.telecominfraproject.wlan.equipment.datastore.EquipmentDatastore;
|
||||
import com.telecominfraproject.wlan.equipment.datastore.inmemory.EquipmentDatastoreInMemory;
|
||||
import com.telecominfraproject.wlan.equipment.models.Equipment;
|
||||
import com.telecominfraproject.wlan.portal.controller.profile.ProfilePortalController.ListOfPairLongLong;
|
||||
import com.telecominfraproject.wlan.profile.ProfileServiceLocal;
|
||||
import com.telecominfraproject.wlan.profile.controller.ProfileController;
|
||||
import com.telecominfraproject.wlan.profile.datastore.ProfileDatastore;
|
||||
import com.telecominfraproject.wlan.profile.datastore.inmemory.ProfileDatastoreInMemory;
|
||||
import com.telecominfraproject.wlan.profile.models.Profile;
|
||||
import com.telecominfraproject.wlan.profile.models.ProfileByCustomerRequestFactory;
|
||||
import com.telecominfraproject.wlan.profile.models.ProfileType;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@ActiveProfiles(profiles = {
|
||||
"integration_test",
|
||||
}) //NOTE: these profiles will be ADDED to the list of active profiles
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.NONE, classes = ProfilePortalControllerTest.class)
|
||||
@Import(value = {
|
||||
EquipmentServiceLocal.class,
|
||||
EquipmentController.class,
|
||||
EquipmentDatastoreInMemory.class,
|
||||
ProfileServiceLocal.class,
|
||||
ProfileController.class,
|
||||
ProfileDatastoreInMemory.class,
|
||||
ProfileByCustomerRequestFactory.class,
|
||||
CloudEventDispatcherEmpty.class,
|
||||
ProfilePortalController.class
|
||||
})
|
||||
public class ProfilePortalControllerTest {
|
||||
private static AtomicLong profileIncrementer = new AtomicLong(1);
|
||||
private static AtomicLong equipmentIncrementer = new AtomicLong(1);
|
||||
private static Set<Long> profileIds = new HashSet<Long>();
|
||||
private static Set<Long> equipmentIds = new HashSet<Long>();
|
||||
|
||||
@Autowired private ProfilePortalController profilePortalController;
|
||||
@Autowired private EquipmentDatastore equipmentDatastore;
|
||||
@Autowired private ProfileDatastore profileDatastore;
|
||||
|
||||
@BeforeEach
|
||||
public void setup()
|
||||
{
|
||||
profileIds.clear();
|
||||
equipmentIds.clear();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getCountsOfEquipmentThatUseProfilesTest()
|
||||
{
|
||||
|
||||
Profile parentProfile_1 = createProfile(); // 3 equipment
|
||||
Profile parentProfile_2 = createProfile(); // 2 equipment
|
||||
Profile parentProfile_3 = createProfile(); // 1 equipment
|
||||
|
||||
Profile ssidProfile_1 = createSsidProfile(); // linked to parent ids: 1 = 3 expected count
|
||||
Profile ssidProfile_2 = createSsidProfile(); // linked to parent ids: 1,2 = 5 expected count
|
||||
Profile ssidProfile_3 = createSsidProfile(); // linked to parent ids: 3 = 1 expected count
|
||||
|
||||
Profile captivePortalProfile_1 = createCaptivePortalProfile(); // linked to 4 -> 1 = 3 expected count
|
||||
Profile captivePortalProfile_2 = createCaptivePortalProfile(); // linked to 5 and 6 -> 5 + 1 = 6 expected count
|
||||
|
||||
Profile radiusProfile_1 = createRadiusProfile(); // 7, 8 -> 4, 5, 6 -> 1 , 2 , 3 -> 6 expected
|
||||
Profile radiusProfile_2 = createRadiusProfile(); // 0 expected
|
||||
|
||||
// link ssid to AP profiles
|
||||
linkChildToParent(ssidProfile_1.getId(), parentProfile_1.getId());
|
||||
linkChildToParent(ssidProfile_2.getId(), parentProfile_1.getId());
|
||||
linkChildToParent(ssidProfile_2.getId(), parentProfile_2.getId());
|
||||
linkChildToParent(ssidProfile_3.getId(), parentProfile_3.getId());
|
||||
|
||||
//link captive portal profiles to ssid profiles
|
||||
linkChildToParent(captivePortalProfile_1.getId(), ssidProfile_1.getId());
|
||||
linkChildToParent(captivePortalProfile_2.getId(), ssidProfile_2.getId());
|
||||
linkChildToParent(captivePortalProfile_2.getId(), ssidProfile_3.getId());
|
||||
|
||||
//link radius profiles to captive portal profiles
|
||||
linkChildToParent(radiusProfile_1.getId(), captivePortalProfile_1.getId());
|
||||
linkChildToParent(radiusProfile_1.getId(), captivePortalProfile_2.getId());
|
||||
|
||||
createEquipment(parentProfile_1.getId());
|
||||
createEquipment(parentProfile_1.getId());
|
||||
createEquipment(parentProfile_1.getId());
|
||||
createEquipment(parentProfile_2.getId());
|
||||
createEquipment(parentProfile_2.getId());
|
||||
createEquipment(parentProfile_3.getId());
|
||||
|
||||
ListOfPairLongLong ret = profilePortalController.getCountsOfEquipmentThatUseProfiles(profileIds);
|
||||
|
||||
List<PairLongLong> expectedReturn = new ArrayList<PairLongLong>() {{
|
||||
add(new PairLongLong(parentProfile_1.getId(), 3));
|
||||
add(new PairLongLong(parentProfile_2.getId(), 2));
|
||||
add(new PairLongLong(parentProfile_3.getId(), 1));
|
||||
add(new PairLongLong(ssidProfile_1.getId(), 3));
|
||||
add(new PairLongLong(ssidProfile_2.getId(), 5));
|
||||
add(new PairLongLong(ssidProfile_3.getId(), 1));
|
||||
add(new PairLongLong(captivePortalProfile_1.getId(), 3));
|
||||
add(new PairLongLong(captivePortalProfile_2.getId(), 6));
|
||||
add(new PairLongLong(radiusProfile_1.getId(), 6));
|
||||
add(new PairLongLong(radiusProfile_2.getId(), 0));
|
||||
}};
|
||||
|
||||
expectedReturn.forEach(pair -> assertTrue(ret.contains(pair)));
|
||||
equipmentIds.forEach(id -> equipmentDatastore.delete(id));
|
||||
profileIds.forEach(id -> profileDatastore.delete(id));
|
||||
}
|
||||
|
||||
private Profile createProfile()
|
||||
{
|
||||
Profile profile = new Profile();
|
||||
profile.setName("test" + profileIncrementer.getAndIncrement());
|
||||
profile.setProfileType(ProfileType.equipment_ap);
|
||||
profile.setCustomerId(2);
|
||||
|
||||
Profile created = profileDatastore.create(profile);
|
||||
profileIds.add(created.getId());
|
||||
|
||||
return created;
|
||||
}
|
||||
|
||||
private Profile createSsidProfile()
|
||||
{
|
||||
Profile profile = new Profile();
|
||||
profile.setName("test" + profileIncrementer.getAndIncrement());
|
||||
profile.setProfileType(ProfileType.ssid);
|
||||
profile.setCustomerId(2);
|
||||
|
||||
Profile created = profileDatastore.create(profile);
|
||||
profileIds.add(created.getId());
|
||||
|
||||
return created;
|
||||
}
|
||||
|
||||
private Profile createCaptivePortalProfile()
|
||||
{
|
||||
Profile profile = new Profile();
|
||||
profile.setName("test" + profileIncrementer.getAndIncrement());
|
||||
profile.setProfileType(ProfileType.captive_portal);
|
||||
profile.setCustomerId(2);
|
||||
|
||||
Profile created = profileDatastore.create(profile);
|
||||
profileIds.add(created.getId());
|
||||
|
||||
return created;
|
||||
}
|
||||
|
||||
private Profile createRadiusProfile()
|
||||
{
|
||||
Profile profile = new Profile();
|
||||
profile.setName("test" + profileIncrementer.getAndIncrement());
|
||||
profile.setProfileType(ProfileType.radius);
|
||||
profile.setCustomerId(2);
|
||||
|
||||
Profile created = profileDatastore.create(profile);
|
||||
profileIds.add(created.getId());
|
||||
|
||||
return created;
|
||||
}
|
||||
|
||||
private void linkChildToParent(long childId, long parentId)
|
||||
{
|
||||
Profile parentProfile = profileDatastore.get(parentId);
|
||||
parentProfile.getChildProfileIds().add(childId);
|
||||
|
||||
profileDatastore.update(parentProfile);
|
||||
}
|
||||
|
||||
private Equipment createEquipment(long profileId)
|
||||
{
|
||||
Equipment equipment = new Equipment();
|
||||
equipment.setCustomerId(2);
|
||||
equipment.setEquipmentType(EquipmentType.AP);
|
||||
equipment.setName("test" + equipmentIncrementer.getAndIncrement());
|
||||
equipment.setProfileId(profileId);
|
||||
return equipmentDatastore.create(equipment);
|
||||
}
|
||||
}
|
||||
@@ -69,15 +69,15 @@ public class PortalUserDAO extends BaseJdbcDao {
|
||||
private static final Set<String> columnsToSkipForInsert = new HashSet<>(Arrays.asList(COL_ID));
|
||||
private static final Set<String> columnsToSkipForUpdate = new HashSet<>(Arrays.asList(COL_ID, "createdTimestamp"));
|
||||
|
||||
private static final String TABLE_NAME = "portal_user";
|
||||
private static final String TABLE_PREFIX = "s.";
|
||||
private static final String ALL_COLUMNS;
|
||||
public static final String TABLE_NAME = "portal_user";
|
||||
public static final String TABLE_PREFIX = "s.";
|
||||
public static final String ALL_COLUMNS;
|
||||
|
||||
private static final Set<String> ALL_COLUMNS_LOWERCASE = new HashSet<>();
|
||||
public static final Set<String> ALL_COLUMNS_LOWERCASE = new HashSet<>();
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
//use this for queries where multiple tables are involved
|
||||
private static final String ALL_COLUMNS_WITH_PREFIX;
|
||||
public static final String ALL_COLUMNS_WITH_PREFIX;
|
||||
|
||||
private static final String ALL_COLUMNS_FOR_INSERT;
|
||||
private static final String BIND_VARS_FOR_INSERT;
|
||||
@@ -162,8 +162,8 @@ public class PortalUserDAO extends BaseJdbcDao {
|
||||
|
||||
private static final String SQL_GET_ALL_IN_SET = "select " + ALL_COLUMNS + " from "+TABLE_NAME + " where "+ COL_ID +" in ";
|
||||
|
||||
private static final String SQL_PAGING_SUFFIX = " LIMIT ? OFFSET ? ";
|
||||
private static final String SORT_SUFFIX = "";
|
||||
public static final String SQL_PAGING_SUFFIX = " LIMIT ? OFFSET ? ";
|
||||
public static final String SORT_SUFFIX = "";
|
||||
|
||||
|
||||
private static final RowMapper<PortalUser> portalUserRowMapper = new PortalUserRowMapper();
|
||||
|
||||
@@ -28,6 +28,8 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
|
||||
private Boolean useRadSec;
|
||||
private String sharedSecret; // if useRadSec is false
|
||||
private String acctSharedSecret; // if useRadSec is false
|
||||
private Boolean dynamicDiscovery; // dynamic discovery of HSP and IdPs (home service and identity providers).
|
||||
// regardless of configured value, this will only be set 'true' on the AP if useRadSec is also true.
|
||||
|
||||
private RadiusProxyConfiguration() {
|
||||
|
||||
@@ -70,6 +72,7 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
|
||||
}
|
||||
|
||||
public Integer getPort() {
|
||||
if (port == null) return -1;
|
||||
return port;
|
||||
}
|
||||
|
||||
@@ -86,6 +89,7 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
|
||||
}
|
||||
|
||||
public Integer getAcctPort() {
|
||||
if (acctPort == null) return -1;
|
||||
return acctPort;
|
||||
}
|
||||
|
||||
@@ -118,6 +122,7 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
|
||||
}
|
||||
|
||||
public Boolean getUseRadSec() {
|
||||
if (useRadSec == null) return false;
|
||||
return useRadSec;
|
||||
}
|
||||
|
||||
@@ -141,6 +146,21 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
|
||||
this.acctSharedSecret = acctSharedSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dynamicDiscovery
|
||||
*/
|
||||
public Boolean getDynamicDiscovery() {
|
||||
if (dynamicDiscovery == null) return false;
|
||||
return dynamicDiscovery;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dynamicDiscovery the dynamicDiscovery to set
|
||||
*/
|
||||
public void setDynamicDiscovery(Boolean dynamicDiscovery) {
|
||||
this.dynamicDiscovery = dynamicDiscovery;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsToBeUpdatedOnDevice(RadiusProxyConfiguration previousVersion) {
|
||||
return !Objects.deepEquals(this, previousVersion);
|
||||
@@ -153,8 +173,8 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(acctPort, acctServer, acctSharedSecret, caCert, clientCert, clientKey, name, passphrase, port, realm, server, sharedSecret,
|
||||
useRadSec);
|
||||
return Objects.hash(acctPort, acctServer, acctSharedSecret, caCert, clientCert, clientKey, dynamicDiscovery, name, passphrase, port, realm, server,
|
||||
sharedSecret, useRadSec);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -168,9 +188,10 @@ public class RadiusProxyConfiguration extends BaseJsonModel implements PushableC
|
||||
RadiusProxyConfiguration other = (RadiusProxyConfiguration) obj;
|
||||
return Objects.equals(acctPort, other.acctPort) && Objects.equals(acctServer, other.acctServer)
|
||||
&& Objects.equals(acctSharedSecret, other.acctSharedSecret) && Objects.equals(caCert, other.caCert)
|
||||
&& Objects.equals(clientCert, other.clientCert) && Objects.equals(clientKey, other.clientKey) && Objects.equals(name, other.name)
|
||||
&& Objects.equals(passphrase, other.passphrase) && Objects.equals(port, other.port) && Objects.equals(realm, other.realm)
|
||||
&& Objects.equals(server, other.server) && Objects.equals(sharedSecret, other.sharedSecret) && Objects.equals(useRadSec, other.useRadSec);
|
||||
&& Objects.equals(clientCert, other.clientCert) && Objects.equals(clientKey, other.clientKey)
|
||||
&& Objects.equals(dynamicDiscovery, other.dynamicDiscovery) && Objects.equals(name, other.name) && Objects.equals(passphrase, other.passphrase)
|
||||
&& Objects.equals(port, other.port) && Objects.equals(realm, other.realm) && Objects.equals(server, other.server)
|
||||
&& Objects.equals(sharedSecret, other.sharedSecret) && Objects.equals(useRadSec, other.useRadSec);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -324,6 +324,13 @@ public class RfElementConfiguration extends BaseJsonModel {
|
||||
}
|
||||
|
||||
public Integer getMaxAutoCellSize() {
|
||||
if (maxAutoCellSize == null) {
|
||||
if (MAX_CELL_SIZE_MAP.containsKey(this.radioType)) {
|
||||
return MAX_CELL_SIZE_MAP.get(this.radioType);
|
||||
} else {
|
||||
return MAX_CELL_SIZE_MAP.get(RadioType.is2dot4GHz);
|
||||
}
|
||||
}
|
||||
return maxAutoCellSize;
|
||||
}
|
||||
|
||||
|
||||
@@ -370,11 +370,9 @@ public class SsidConfiguration extends ProfileDetails implements PushableConfigu
|
||||
|
||||
public static enum SecureMode {
|
||||
|
||||
open(0L), wpaPSK(1L), wpa2PSK(2L), wpaRadius(3L), wpa2Radius(4L), wpa2OnlyPSK(5L), wpa2OnlyRadius(6L), wep(
|
||||
7L), wpaEAP(8L), wpa2EAP(
|
||||
9L), wpa2OnlyEAP(10L), wpa3OnlySAE(11L), wpa3MixedSAE(12L), wpa3OnlyEAP(13L), wpa3MixedEAP(14L),
|
||||
|
||||
UNSUPPORTED(-1L);
|
||||
open(0L), wpaPSK(1L), wpa2PSK(2L), wpaRadius(3L), wpa2Radius(4L), wpa2OnlyPSK(5L), wpa2OnlyRadius(6L), wep(7L),
|
||||
wpaEAP(8L), wpa2EAP(9L), wpa2OnlyEAP(10L), wpa3OnlySAE(11L), wpa3MixedSAE(12L), wpa3OnlyEAP(13L), wpa3MixedEAP(14L),
|
||||
wpa3OnlyEAP192(15L), UNSUPPORTED(-1L);
|
||||
|
||||
private final long id;
|
||||
private static final Map<Long, SecureMode> ELEMENTS = new HashMap<>();
|
||||
@@ -415,7 +413,7 @@ public class SsidConfiguration extends ProfileDetails implements PushableConfigu
|
||||
}
|
||||
|
||||
public static boolean isWPA3_Enterprise_or_Personal(SecureMode mode) {
|
||||
return mode == wpa3OnlySAE || mode == wpa3OnlyEAP;
|
||||
return mode == wpa3OnlySAE || mode == wpa3OnlyEAP || mode == wpa3OnlyEAP192;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -491,6 +491,9 @@ components:
|
||||
sharedSecret:
|
||||
type: string
|
||||
format: password
|
||||
dynamicDiscovery:
|
||||
description: Dynamic discovery of HSP and IdPs (home service and identity providers). Regardless of configured value, this will only be set 'true' on the AP if useRadSec is also true.
|
||||
type: boolean
|
||||
example:
|
||||
model_type: RadiusProxyConfiguration
|
||||
caCert:
|
||||
@@ -1021,6 +1024,7 @@ components:
|
||||
- wpa3MixedSAE
|
||||
- wpa3OnlyEAP
|
||||
- wpa3MixedEAP
|
||||
- wpa3OnlyEAP192
|
||||
|
||||
RadioBasedSsidConfigurationMap:
|
||||
properties:
|
||||
|
||||
@@ -1,97 +1,111 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../wlan-cloud-root</relativePath>
|
||||
</parent>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../wlan-cloud-root</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>provisioning-sp</artifactId>
|
||||
<name>provisioning-sp</name>
|
||||
<description>Stream Processors for provisioning events.</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>base-stream-consumer</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<artifactId>provisioning-sp</artifactId>
|
||||
<name>provisioning-sp</name>
|
||||
<description>Stream Processors for provisioning events.</description>
|
||||
|
||||
<dependency>
|
||||
<artifactId>service-metric-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>base-stream-consumer</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>system-event-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>service-metric-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>base-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>routing-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-gateway-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>system-event-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>base-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>location-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>routing-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>profile-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>client-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- models used by the application logic of the stream processor -->
|
||||
<dependency>
|
||||
<artifactId>equipment-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>profile-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-gateway-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>location-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>equipment-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<dependency>
|
||||
<artifactId>location-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>profile-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>client-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>alarm-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>status-service-interface</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- models used by the application logic of the stream processor -->
|
||||
<dependency>
|
||||
<artifactId>equipment-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>profile-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>location-models</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package com.telecominfraproject.wlan.streams.provisioning;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -12,18 +13,24 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.telecominfraproject.wlan.alarm.AlarmServiceInterface;
|
||||
import com.telecominfraproject.wlan.alarm.models.Alarm;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationContext;
|
||||
import com.telecominfraproject.wlan.core.model.pagination.PaginationResponse;
|
||||
import com.telecominfraproject.wlan.core.model.pair.PairLongLong;
|
||||
import com.telecominfraproject.wlan.core.model.streams.QueuedStreamMessage;
|
||||
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.events.EquipmentApImpactingChangedEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentBlinkLEDsEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentCellSizeAttributesChangedEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentChannelsChangedEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentCustomerChangedEvent;
|
||||
import com.telecominfraproject.wlan.equipment.models.events.EquipmentRemovedEvent;
|
||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWBaseCommand;
|
||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWBlinkRequest;
|
||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWCloseSessionRequest;
|
||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWConfigChangeNotification;
|
||||
import com.telecominfraproject.wlan.equipmentgateway.models.CEGWNewChannelRequest;
|
||||
@@ -35,13 +42,16 @@ import com.telecominfraproject.wlan.profile.models.Profile;
|
||||
import com.telecominfraproject.wlan.profile.models.events.ProfileAddedEvent;
|
||||
import com.telecominfraproject.wlan.profile.models.events.ProfileChangedEvent;
|
||||
import com.telecominfraproject.wlan.profile.models.events.ProfileRemovedEvent;
|
||||
import com.telecominfraproject.wlan.status.StatusServiceInterface;
|
||||
import com.telecominfraproject.wlan.status.models.Status;
|
||||
import com.telecominfraproject.wlan.status.models.StatusDataType;
|
||||
import com.telecominfraproject.wlan.stream.StreamProcessor;
|
||||
import com.telecominfraproject.wlan.systemevent.models.SystemEvent;
|
||||
import com.telecominfraproject.wlan.systemevent.models.SystemEventRecord;
|
||||
|
||||
/**
|
||||
* @author dtop
|
||||
* This stream processor is listening for events related to changes
|
||||
* @author dtop
|
||||
* This stream processor is listening for events related to changes
|
||||
* in Equipment, Location, and Profile objects. If a change is detected,
|
||||
* it uses Routing service to find affected equipment and delivers
|
||||
* CEGWConfigChangeNotification command to the equipment, which results
|
||||
@@ -50,187 +60,225 @@ import com.telecominfraproject.wlan.systemevent.models.SystemEventRecord;
|
||||
@Component
|
||||
public class EquipmentConfigPushTrigger extends StreamProcessor {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(EquipmentConfigPushTrigger.class);
|
||||
|
||||
@Value("${tip.wlan.systemEventsTopic:system_events}")
|
||||
private String systemEventsTopic;
|
||||
|
||||
@Autowired
|
||||
private EquipmentGatewayServiceInterface equipmentGatewayInterface;
|
||||
@Autowired
|
||||
private ProfileServiceInterface profileServiceInterface;
|
||||
@Autowired
|
||||
private EquipmentServiceInterface equipmentServiceInterface;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(EquipmentConfigPushTrigger.class);
|
||||
|
||||
@Override
|
||||
protected boolean acceptMessage(QueuedStreamMessage message) {
|
||||
boolean ret = message.getTopic().equals(systemEventsTopic);
|
||||
@Value("${tip.wlan.systemEventsTopic:system_events}")
|
||||
private String systemEventsTopic;
|
||||
|
||||
if(ret && ( message.getModel() instanceof SystemEventRecord) ) {
|
||||
|
||||
SystemEventRecord ser = (SystemEventRecord) message.getModel();
|
||||
ret = ret &&
|
||||
(
|
||||
ser.getDetails() instanceof EquipmentApImpactingChangedEvent ||
|
||||
ser.getDetails() instanceof EquipmentChannelsChangedEvent ||
|
||||
ser.getDetails() instanceof EquipmentCellSizeAttributesChangedEvent ||
|
||||
ser.getDetails() instanceof EquipmentRemovedEvent ||
|
||||
ser.getDetails() instanceof ProfileAddedEvent ||
|
||||
ser.getDetails() instanceof ProfileChangedEvent ||
|
||||
ser.getDetails() instanceof ProfileRemovedEvent ||
|
||||
ser.getDetails() instanceof LocationChangedApImpactingEvent
|
||||
);
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
LOG.trace("acceptMessage {}", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processMessage(QueuedStreamMessage message) {
|
||||
SystemEventRecord mdl = (SystemEventRecord) message.getModel();
|
||||
SystemEvent se = mdl.getDetails();
|
||||
LOG.debug("Processing {}", mdl);
|
||||
|
||||
switch ( se.getClass().getSimpleName() ) {
|
||||
case "EquipmentApImpactingChangedEvent":
|
||||
process((EquipmentApImpactingChangedEvent) se);
|
||||
break;
|
||||
case "EquipmentChannelsChangedEvent":
|
||||
@Autowired
|
||||
private EquipmentGatewayServiceInterface equipmentGatewayInterface;
|
||||
@Autowired
|
||||
private ProfileServiceInterface profileServiceInterface;
|
||||
@Autowired
|
||||
private EquipmentServiceInterface equipmentServiceInterface;
|
||||
@Autowired
|
||||
private StatusServiceInterface statusServiceInterface;
|
||||
@Autowired
|
||||
private AlarmServiceInterface alarmServiceInterface;
|
||||
|
||||
@Override
|
||||
protected boolean acceptMessage(QueuedStreamMessage message) {
|
||||
boolean ret = message.getTopic().equals(systemEventsTopic);
|
||||
|
||||
if (ret && (message.getModel() instanceof SystemEventRecord)) {
|
||||
|
||||
SystemEventRecord ser = (SystemEventRecord) message.getModel();
|
||||
ret = ret && (ser.getDetails() instanceof EquipmentApImpactingChangedEvent || ser.getDetails() instanceof EquipmentBlinkLEDsEvent
|
||||
|| ser.getDetails() instanceof EquipmentChannelsChangedEvent || ser.getDetails() instanceof EquipmentCellSizeAttributesChangedEvent
|
||||
|| ser.getDetails() instanceof EquipmentRemovedEvent || ser.getDetails() instanceof ProfileAddedEvent
|
||||
|| ser.getDetails() instanceof ProfileChangedEvent || ser.getDetails() instanceof ProfileRemovedEvent
|
||||
|| ser.getDetails() instanceof LocationChangedApImpactingEvent || ser.getDetails() instanceof EquipmentCustomerChangedEvent);
|
||||
} else {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
LOG.trace("acceptMessage {}", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processMessage(QueuedStreamMessage message) {
|
||||
SystemEventRecord mdl = (SystemEventRecord) message.getModel();
|
||||
SystemEvent se = mdl.getDetails();
|
||||
LOG.debug("Processing {}", mdl);
|
||||
|
||||
switch (se.getClass().getSimpleName()) {
|
||||
case "EquipmentApImpactingChangedEvent":
|
||||
process((EquipmentApImpactingChangedEvent) se);
|
||||
break;
|
||||
case "EquipmentChannelsChangedEvent":
|
||||
process((EquipmentChannelsChangedEvent) se);
|
||||
break;
|
||||
case "EquipmentCellSizeAttributesChangedEvent":
|
||||
case "EquipmentCellSizeAttributesChangedEvent":
|
||||
process((EquipmentCellSizeAttributesChangedEvent) se);
|
||||
break;
|
||||
case "EquipmentRemovedEvent":
|
||||
case "EquipmentBlinkLEDsEvent":
|
||||
process((EquipmentBlinkLEDsEvent) se);
|
||||
break;
|
||||
case "EquipmentRemovedEvent":
|
||||
process((EquipmentRemovedEvent) se);
|
||||
break;
|
||||
case "ProfileAddedEvent":
|
||||
process((ProfileAddedEvent) se);
|
||||
break;
|
||||
case "ProfileChangedEvent":
|
||||
process((ProfileChangedEvent) se);
|
||||
break;
|
||||
case "ProfileRemovedEvent":
|
||||
process((ProfileRemovedEvent) se);
|
||||
break;
|
||||
case "LocationChangedApImpactingEvent":
|
||||
process((LocationChangedApImpactingEvent) se);
|
||||
break;
|
||||
default:
|
||||
process(mdl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void process(EquipmentApImpactingChangedEvent model) {
|
||||
LOG.debug("Processing EquipmentChangedEvent");
|
||||
equipmentGatewayInterface.sendCommand(new CEGWConfigChangeNotification(model.getPayload().getInventoryId(),
|
||||
model.getEquipmentId()));
|
||||
case "ProfileAddedEvent":
|
||||
process((ProfileAddedEvent) se);
|
||||
break;
|
||||
case "ProfileChangedEvent":
|
||||
process((ProfileChangedEvent) se);
|
||||
break;
|
||||
case "ProfileRemovedEvent":
|
||||
process((ProfileRemovedEvent) se);
|
||||
break;
|
||||
case "LocationChangedApImpactingEvent":
|
||||
process((LocationChangedApImpactingEvent) se);
|
||||
break;
|
||||
case "EquipmentCustomerChangedEvent":
|
||||
process((EquipmentCustomerChangedEvent) se);
|
||||
default:
|
||||
process(mdl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void process(EquipmentApImpactingChangedEvent model) {
|
||||
LOG.debug("Processing EquipmentChangedEvent");
|
||||
equipmentGatewayInterface.sendCommand(new CEGWConfigChangeNotification(model.getPayload().getInventoryId(), model.getEquipmentId()));
|
||||
}
|
||||
|
||||
private void process(EquipmentChannelsChangedEvent model) {
|
||||
LOG.debug("Processing EquipmentChannelsChangedEvent for equipmentId {}", model.getEquipmentId());
|
||||
equipmentGatewayInterface.sendCommand(new CEGWNewChannelRequest(model.getPayload().getInventoryId(), model.getEquipmentId(),
|
||||
model.getNewBackupChannels(), model.getNewPrimaryChannels()));
|
||||
}
|
||||
|
||||
private void process(EquipmentCellSizeAttributesChangedEvent model) {
|
||||
LOG.debug("Processing EquipmentCellSizeAttributesChangedEvent for equipmentId {}", model.getEquipmentId());
|
||||
equipmentGatewayInterface
|
||||
.sendCommand(new CEGWCellSizeAttributesRequest(model.getPayload().getInventoryId(), model.getEquipmentId(), model.getCellSizeAttributesMap()));
|
||||
}
|
||||
|
||||
private void process(EquipmentBlinkLEDsEvent model) {
|
||||
LOG.debug("Processing EquipmentBlinkLEDsEvent for equipmentId {}", model.getEquipmentId());
|
||||
CEGWBlinkRequest br = new CEGWBlinkRequest(model.getPayload().getInventoryId(), model.getEquipmentId());
|
||||
br.setBlinkAllLEDs(((ApElementConfiguration) model.getPayload().getDetails()).isBlinkAllLEDs());
|
||||
equipmentGatewayInterface.sendCommand(br);
|
||||
}
|
||||
|
||||
private void process(EquipmentRemovedEvent model) {
|
||||
LOG.debug("Processing EquipmentRemovedEvent");
|
||||
equipmentGatewayInterface.sendCommand(new CEGWCloseSessionRequest(model.getPayload().getInventoryId(), model.getEquipmentId()));
|
||||
}
|
||||
|
||||
private void process(ProfileAddedEvent model) {
|
||||
LOG.debug("Processing ProfileAddedEvent {}", model.getPayload().getId());
|
||||
processProfile(model.getPayload());
|
||||
}
|
||||
|
||||
private void process(ProfileChangedEvent model) {
|
||||
LOG.debug("Processing ProfileChangedEvent {}", model.getPayload().getId());
|
||||
processProfile(model.getPayload());
|
||||
}
|
||||
|
||||
private void process(ProfileRemovedEvent model) {
|
||||
LOG.debug("Processing ProfileRemovedEvent {}", model.getPayload().getId());
|
||||
processProfile(model.getPayload());
|
||||
}
|
||||
|
||||
private void processProfile(Profile profile) {
|
||||
|
||||
List<PairLongLong> ret = profileServiceInterface.getTopLevelProfiles(new HashSet<>(Arrays.asList(profile.getId())));
|
||||
if (ret == null || ret.isEmpty()) {
|
||||
// nothing to do here
|
||||
return;
|
||||
}
|
||||
|
||||
Set<Long> parentProfileIds = new HashSet<>();
|
||||
ret.forEach(p -> parentProfileIds.add(p.getValue2()));
|
||||
|
||||
// go through all equipmentIds that refer to parent profiles and trigger change config notification on them
|
||||
PaginationContext<PairLongLong> context = new PaginationContext<>(100);
|
||||
|
||||
while (!context.isLastPage()) {
|
||||
PaginationResponse<PairLongLong> page = equipmentServiceInterface.getEquipmentIdsByProfileIds(parentProfileIds, context);
|
||||
context = page.getContext();
|
||||
|
||||
Set<Long> equipmentIds = new HashSet<>();
|
||||
page.getItems().forEach(p -> equipmentIds.add(p.getValue2()));
|
||||
|
||||
// retrieve full equipment objects to get the inventory id
|
||||
List<Equipment> equipmentForPage = equipmentServiceInterface.get(equipmentIds);
|
||||
|
||||
List<CEGWBaseCommand> commands = new ArrayList<>(equipmentForPage.size());
|
||||
equipmentForPage.forEach(eq -> commands.add(new CEGWConfigChangeNotification(eq.getInventoryId(), eq.getId())));
|
||||
|
||||
equipmentGatewayInterface.sendCommands(commands);
|
||||
LOG.debug("Page {} - sent {} commands to equipment gateway", context.getLastReturnedPageNumber(), commands.size());
|
||||
}
|
||||
|
||||
LOG.debug("Finished processing profile {}", profile.getId());
|
||||
}
|
||||
|
||||
private void process(LocationChangedApImpactingEvent model) {
|
||||
LOG.debug("Processing LocationChangedApImpactingEvent {}", model.getPayload().getId());
|
||||
|
||||
Set<Long> locationIds = new HashSet<>(Arrays.asList(model.getPayload().getId()));
|
||||
|
||||
// go through all equipmentIds that reside in the specified location and trigger change config notification on
|
||||
// them
|
||||
PaginationContext<PairLongLong> context = new PaginationContext<>(100);
|
||||
|
||||
while (!context.isLastPage()) {
|
||||
PaginationResponse<PairLongLong> page = equipmentServiceInterface.getEquipmentIdsByLocationIds(locationIds, context);
|
||||
context = page.getContext();
|
||||
|
||||
Set<Long> equipmentIds = new HashSet<>();
|
||||
page.getItems().forEach(p -> equipmentIds.add(p.getValue2()));
|
||||
|
||||
// retrieve full equipment objects to get the inventory id
|
||||
List<Equipment> equipmentForPage = equipmentServiceInterface.get(equipmentIds);
|
||||
|
||||
List<CEGWBaseCommand> commands = new ArrayList<>(equipmentForPage.size());
|
||||
equipmentForPage.forEach(eq -> commands.add(new CEGWConfigChangeNotification(eq.getInventoryId(), eq.getId())));
|
||||
|
||||
equipmentGatewayInterface.sendCommands(commands);
|
||||
LOG.debug("Page {} - sent {} commands to equipment gateway", context.getLastReturnedPageNumber(), commands.size());
|
||||
}
|
||||
|
||||
LOG.debug("Finished processing LocationChangedApImpactingEvent {}", model.getPayload().getId());
|
||||
|
||||
}
|
||||
|
||||
private void process(EquipmentCustomerChangedEvent model) {
|
||||
LOG.info("Processing EquipmentCustomerChangedEvent {}", model.getPayload().getId());
|
||||
|
||||
private void process(EquipmentChannelsChangedEvent model) {
|
||||
LOG.debug("Processing EquipmentChannelsChangedEvent for equipmentId {}", model.getEquipmentId());
|
||||
equipmentGatewayInterface.sendCommand(new CEGWNewChannelRequest(model.getPayload().getInventoryId(),
|
||||
model.getEquipmentId(), model.getNewBackupChannels(), model.getNewPrimaryChannels()));
|
||||
Equipment existingEquipment = model.getExistingEquipment();
|
||||
Equipment equipment = model.getEquipment();
|
||||
|
||||
// when customerId changes, we keep the EQUIPMENT_ADMIN and PROTOCOL status of the AP
|
||||
Status status = statusServiceInterface.getOrNull(existingEquipment.getCustomerId(), existingEquipment.getId(), StatusDataType.EQUIPMENT_ADMIN);
|
||||
if (status != null) {
|
||||
status.setCustomerId(equipment.getCustomerId());
|
||||
statusServiceInterface.update(status);
|
||||
}
|
||||
|
||||
private void process(EquipmentCellSizeAttributesChangedEvent model) {
|
||||
LOG.debug("Processing EquipmentCellSizeAttributesChangedEvent for equipmentId {}", model.getEquipmentId());
|
||||
equipmentGatewayInterface.sendCommand(new CEGWCellSizeAttributesRequest(model.getPayload().getInventoryId(),
|
||||
model.getEquipmentId(), model.getCellSizeAttributesMap()));
|
||||
status = statusServiceInterface.getOrNull(existingEquipment.getCustomerId(), existingEquipment.getId(), StatusDataType.PROTOCOL);
|
||||
if (status != null) {
|
||||
status.setCustomerId(equipment.getCustomerId());
|
||||
statusServiceInterface.update(status);
|
||||
}
|
||||
|
||||
private void process(EquipmentRemovedEvent model) {
|
||||
LOG.debug("Processing EquipmentRemovedEvent");
|
||||
equipmentGatewayInterface.sendCommand(new CEGWCloseSessionRequest(model.getPayload().getInventoryId(), model.getEquipmentId()));
|
||||
|
||||
// Alarms has to move to new customerId as well
|
||||
List<Alarm> oldCustomerAlarms = alarmServiceInterface.get(existingEquipment.getCustomerId(), Set.of(existingEquipment.getId()), null);
|
||||
if (!oldCustomerAlarms.isEmpty()) {
|
||||
oldCustomerAlarms.stream().forEach(a -> {
|
||||
a.setCustomerId(equipment.getCustomerId());
|
||||
Alarm alarm = alarmServiceInterface.create(a);
|
||||
LOG.debug("Move an alarm to new customer {}", alarm);
|
||||
});
|
||||
}
|
||||
|
||||
private void process(ProfileAddedEvent model) {
|
||||
LOG.debug("Processing ProfileAddedEvent {}", model.getPayload().getId());
|
||||
processProfile(model.getPayload());
|
||||
}
|
||||
alarmServiceInterface.delete(existingEquipment.getCustomerId(), existingEquipment.getId());
|
||||
}
|
||||
|
||||
private void process(ProfileChangedEvent model) {
|
||||
LOG.debug("Processing ProfileChangedEvent {}", model.getPayload().getId());
|
||||
processProfile(model.getPayload());
|
||||
}
|
||||
private void process(BaseJsonModel model) {
|
||||
LOG.warn("Unprocessed model: {}", model);
|
||||
}
|
||||
|
||||
private void process(ProfileRemovedEvent model) {
|
||||
LOG.debug("Processing ProfileRemovedEvent {}", model.getPayload().getId());
|
||||
processProfile(model.getPayload());
|
||||
}
|
||||
|
||||
|
||||
private void processProfile(Profile profile) {
|
||||
|
||||
List<PairLongLong> ret = profileServiceInterface.getTopLevelProfiles(new HashSet<>(Arrays.asList(profile.getId())));
|
||||
if(ret == null || ret.isEmpty()) {
|
||||
//nothing to do here
|
||||
return;
|
||||
}
|
||||
|
||||
Set<Long> parentProfileIds = new HashSet<>();
|
||||
ret.forEach(p -> parentProfileIds.add(p.getValue2()));
|
||||
|
||||
//go through all equipmentIds that refer to parent profiles and trigger change config notification on them
|
||||
PaginationContext<PairLongLong> context = new PaginationContext<>(100);
|
||||
|
||||
while(!context.isLastPage()) {
|
||||
PaginationResponse<PairLongLong> page = equipmentServiceInterface.getEquipmentIdsByProfileIds(parentProfileIds, context );
|
||||
context = page.getContext();
|
||||
|
||||
Set<Long> equipmentIds = new HashSet<>();
|
||||
page.getItems().forEach(p -> equipmentIds.add(p.getValue2()));
|
||||
|
||||
//retrieve full equipment objects to get the inventory id
|
||||
List<Equipment> equipmentForPage = equipmentServiceInterface.get(equipmentIds);
|
||||
|
||||
List<CEGWBaseCommand> commands = new ArrayList<>(equipmentForPage.size());
|
||||
equipmentForPage.forEach(eq -> commands.add(new CEGWConfigChangeNotification(eq.getInventoryId(), eq.getId())));
|
||||
|
||||
equipmentGatewayInterface.sendCommands(commands);
|
||||
LOG.debug("Page {} - sent {} commands to equipment gateway", context.getLastReturnedPageNumber(), commands.size());
|
||||
}
|
||||
|
||||
LOG.debug("Finished processing profile {}", profile.getId());
|
||||
}
|
||||
|
||||
private void process(LocationChangedApImpactingEvent model) {
|
||||
LOG.debug("Processing LocationChangedApImpactingEvent {}", model.getPayload().getId());
|
||||
|
||||
Set<Long> locationIds = new HashSet<>(Arrays.asList(model.getPayload().getId()));
|
||||
|
||||
//go through all equipmentIds that reside in the specified location and trigger change config notification on them
|
||||
PaginationContext<PairLongLong> context = new PaginationContext<>(100);
|
||||
|
||||
while(!context.isLastPage()) {
|
||||
PaginationResponse<PairLongLong> page = equipmentServiceInterface.getEquipmentIdsByLocationIds(locationIds, context );
|
||||
context = page.getContext();
|
||||
|
||||
Set<Long> equipmentIds = new HashSet<>();
|
||||
page.getItems().forEach(p -> equipmentIds.add(p.getValue2()));
|
||||
|
||||
//retrieve full equipment objects to get the inventory id
|
||||
List<Equipment> equipmentForPage = equipmentServiceInterface.get(equipmentIds);
|
||||
|
||||
List<CEGWBaseCommand> commands = new ArrayList<>(equipmentForPage.size());
|
||||
equipmentForPage.forEach(eq -> commands.add(new CEGWConfigChangeNotification(eq.getInventoryId(), eq.getId())));
|
||||
|
||||
equipmentGatewayInterface.sendCommands(commands);
|
||||
LOG.debug("Page {} - sent {} commands to equipment gateway", context.getLastReturnedPageNumber(), commands.size());
|
||||
}
|
||||
|
||||
LOG.debug("Finished processing LocationChangedApImpactingEvent {}", model.getPayload().getId());
|
||||
|
||||
}
|
||||
|
||||
private void process(BaseJsonModel model) {
|
||||
LOG.warn("Unprocessed model: {}", model);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,13 +8,14 @@ import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.json.interfaces.HasSourceTimestamp;
|
||||
|
||||
/**
|
||||
* @author yongli
|
||||
*
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ApPerformance extends BaseJsonModel {
|
||||
public class ApPerformance extends BaseJsonModel implements HasSourceTimestamp {
|
||||
|
||||
private static final long serialVersionUID = 4520822419578448525L;
|
||||
|
||||
@@ -69,6 +70,11 @@ public class ApPerformance extends BaseJsonModel {
|
||||
*/
|
||||
private Long cloudRxBytes;
|
||||
|
||||
/**
|
||||
* Timestamp of the stats report used to generate this metric (i.e. timestamp from the AP)
|
||||
*/
|
||||
private long sourceTimestampMs;
|
||||
|
||||
/**
|
||||
* Top CPU consuming processes.
|
||||
* CPU usage in percent.
|
||||
@@ -100,16 +106,20 @@ public class ApPerformance extends BaseJsonModel {
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + Arrays.hashCode(cpuUtilized);
|
||||
result = prime * result + Objects.hash(camiCrashed, cloudRxBytes, cloudTxBytes, cpuTemperature, ethLinkState,
|
||||
freeMemory, lowMemoryReboot, psCpuUtil, psMemUtil, upTime);
|
||||
result = prime * result + Objects.hash(camiCrashed, cloudRxBytes, cloudTxBytes, cpuTemperature, ethLinkState, freeMemory, lowMemoryReboot, psCpuUtil,
|
||||
psMemUtil, sourceTimestampMs, upTime);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
@@ -120,13 +130,14 @@ public class ApPerformance extends BaseJsonModel {
|
||||
return false;
|
||||
ApPerformance other = (ApPerformance) obj;
|
||||
return Objects.equals(camiCrashed, other.camiCrashed) && Objects.equals(cloudRxBytes, other.cloudRxBytes)
|
||||
&& Objects.equals(cloudTxBytes, other.cloudTxBytes)
|
||||
&& Objects.equals(cpuTemperature, other.cpuTemperature) && Arrays.equals(cpuUtilized, other.cpuUtilized)
|
||||
&& ethLinkState == other.ethLinkState && Objects.equals(freeMemory, other.freeMemory)
|
||||
&& Objects.equals(cloudTxBytes, other.cloudTxBytes) && Objects.equals(cpuTemperature, other.cpuTemperature)
|
||||
&& Arrays.equals(cpuUtilized, other.cpuUtilized) && ethLinkState == other.ethLinkState && Objects.equals(freeMemory, other.freeMemory)
|
||||
&& Objects.equals(lowMemoryReboot, other.lowMemoryReboot) && Objects.equals(psCpuUtil, other.psCpuUtil)
|
||||
&& Objects.equals(psMemUtil, other.psMemUtil) && Objects.equals(upTime, other.upTime);
|
||||
&& Objects.equals(psMemUtil, other.psMemUtil) && sourceTimestampMs == other.sourceTimestampMs && Objects.equals(upTime, other.upTime);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@JsonIgnore
|
||||
public Float getAvgCpuUtilized() {
|
||||
if (cpuUtilized == null) {
|
||||
@@ -192,7 +203,6 @@ public class ApPerformance extends BaseJsonModel {
|
||||
return psMemUtil;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasUnsupportedValue() {
|
||||
return (super.hasUnsupportedValue() || EthernetLinkState.isUnsupported(this.ethLinkState));
|
||||
@@ -254,4 +264,13 @@ public class ApPerformance extends BaseJsonModel {
|
||||
this.psMemUtil = psMemUtil;
|
||||
}
|
||||
|
||||
public void setSourceTimestampMs(long sourceTimestamp) {
|
||||
this.sourceTimestampMs = sourceTimestamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSourceTimestampMs() {
|
||||
return sourceTimestampMs;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.telecominfraproject.wlan.servicemetric.apnode.models;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.json.interfaces.HasSourceTimestamp;
|
||||
|
||||
/**
|
||||
* Metric Data from network probes that are running on CE
|
||||
@@ -13,7 +15,7 @@ import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
*
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class NetworkProbeMetrics extends BaseJsonModel {
|
||||
public class NetworkProbeMetrics extends BaseJsonModel implements HasSourceTimestamp {
|
||||
|
||||
private static final long serialVersionUID = 7293164162279703547L;
|
||||
|
||||
@@ -30,6 +32,11 @@ public class NetworkProbeMetrics extends BaseJsonModel {
|
||||
|
||||
private List<DnsProbeMetric> dnsProbeResults;
|
||||
|
||||
/**
|
||||
* timestamp for the source data (AP stats) for this metrics report
|
||||
*/
|
||||
private long sourceTimestampMs;
|
||||
|
||||
public String getVlanIF()
|
||||
{
|
||||
return this.vlanIF;
|
||||
@@ -109,39 +116,7 @@ public void setDnsProbeResults(List<DnsProbeMetric> dnsProbeResults) {
|
||||
this.dnsProbeResults = dnsProbeResults;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return Objects.hash(this.dhcpState,
|
||||
this.dhcpLatencyMs,
|
||||
this.dnsState,
|
||||
this.dnsLatencyMs,
|
||||
this.vlanIF,
|
||||
this.radiusLatencyMs,
|
||||
this.radiusState,
|
||||
this.dnsProbeResults);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if(obj instanceof NetworkProbeMetrics)
|
||||
{
|
||||
NetworkProbeMetrics casted = (NetworkProbeMetrics) obj;
|
||||
|
||||
return Objects.equals(casted.dhcpState, dhcpState) &&
|
||||
Objects.equals(casted.dnsState, dnsState) &&
|
||||
Objects.equals(casted.dnsLatencyMs, dnsLatencyMs) &&
|
||||
Objects.equals(casted.dhcpLatencyMs, dhcpLatencyMs) &&
|
||||
Objects.equals(casted.vlanIF, vlanIF) &&
|
||||
Objects.equals(casted.radiusLatencyMs, radiusLatencyMs) &&
|
||||
Objects.equals(casted.dnsProbeResults, dnsProbeResults) &&
|
||||
Objects.equals(casted.radiusState, radiusState);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnsupportedValue() {
|
||||
@@ -166,4 +141,32 @@ public void setDnsProbeResults(List<DnsProbeMetric> dnsProbeResults) {
|
||||
public NetworkProbeMetrics clone() {
|
||||
return (NetworkProbeMetrics) super.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(dhcpLatencyMs, dhcpState, dnsLatencyMs, dnsProbeResults, dnsState, radiusLatencyMs, radiusState, sourceTimestampMs, vlanIF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
NetworkProbeMetrics other = (NetworkProbeMetrics) obj;
|
||||
return dhcpLatencyMs == other.dhcpLatencyMs && dhcpState == other.dhcpState && dnsLatencyMs == other.dnsLatencyMs
|
||||
&& Objects.equals(dnsProbeResults, other.dnsProbeResults) && dnsState == other.dnsState && radiusLatencyMs == other.radiusLatencyMs
|
||||
&& radiusState == other.radiusState && sourceTimestampMs == other.sourceTimestampMs && Objects.equals(vlanIF, other.vlanIF);
|
||||
}
|
||||
|
||||
public void setSourceTimestampMs(long sourceTimestamp) {
|
||||
this.sourceTimestampMs = sourceTimestamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSourceTimestampMs() {
|
||||
return this.sourceTimestampMs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,15 @@ package com.telecominfraproject.wlan.servicemetric.apnode.models;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.json.interfaces.HasSourceTimestamp;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class RadioStatistics extends BaseJsonModel {
|
||||
public class RadioStatistics extends BaseJsonModel implements HasSourceTimestamp {
|
||||
private static final long serialVersionUID = 1185985309064758000L;
|
||||
|
||||
/**
|
||||
@@ -697,6 +700,8 @@ public class RadioStatistics extends BaseJsonModel {
|
||||
private Long numRxVHT_2808_Mbps;
|
||||
private Long numRxVHT_3120_Mbps;
|
||||
private Long numRxVHT_3466_8_Mbps;
|
||||
|
||||
private long sourceTimestampMs;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -3682,5 +3687,272 @@ public class RadioStatistics extends BaseJsonModel {
|
||||
public void setNumRxVHT_3466_8_Mbps(Long numRxVHT_3466_8_Mbps) {
|
||||
this.numRxVHT_3466_8_Mbps = numRxVHT_3466_8_Mbps;
|
||||
}
|
||||
|
||||
public void setSourceTimestampMs(long sourceTimestamp) {
|
||||
this.sourceTimestampMs = sourceTimestamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSourceTimestampMs() {
|
||||
return this.sourceTimestampMs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(actualCellSize, curBackupChannel, curChannel, curEirp, elevenGProtection, numChanChanges, numChannelBusy64s, numFreeTxBuf,
|
||||
numRadarChanChanges, numRadioResets, numRcvBcForTx, numRcvFrameForTx, numRx, numRxAck, numRxAmsduDeaggItmd, numRxAmsduDeaggLast,
|
||||
numRxAmsduDeaggSeq, numRxBcMc, numRxBeacon, numRxControl, numRxCts, numRxData, numRxDataFrames, numRxDataFramesRetried,
|
||||
numRxDataFrames_108_Mbps, numRxDataFrames_12_Mbps, numRxDataFrames_1300Plus_Mbps, numRxDataFrames_1300_Mbps, numRxDataFrames_300_Mbps,
|
||||
numRxDataFrames_450_Mbps, numRxDataFrames_54_Mbps, numRxDropAmsduNoRcv, numRxDropBadProtocol, numRxDropEthHdrRunt, numRxDropInvalidSrcMac,
|
||||
numRxDropNoFcField, numRxDropRunt, numRxDup, numRxErr, numRxFcsErr, numRxFramesReceived, numRxHT_104_Mbps, numRxHT_108_Mbps, numRxHT_115_5_Mbps,
|
||||
numRxHT_117_1_Mbps, numRxHT_117_Mbps, numRxHT_120_Mbps, numRxHT_121_5_Mbps, numRxHT_130_3_Mbps, numRxHT_130_Mbps, numRxHT_135_Mbps,
|
||||
numRxHT_13_5_Mbps, numRxHT_13_Mbps, numRxHT_144_3_Mbps, numRxHT_14_3_Mbps, numRxHT_150_Mbps, numRxHT_156_Mbps, numRxHT_15_Mbps,
|
||||
numRxHT_162_Mbps, numRxHT_173_1_Mbps, numRxHT_173_3_Mbps, numRxHT_175_5_Mbps, numRxHT_180_Mbps, numRxHT_195_Mbps, numRxHT_19_5_Mbps,
|
||||
numRxHT_200_Mbps, numRxHT_208_Mbps, numRxHT_216_6_Mbps, numRxHT_216_Mbps, numRxHT_21_7_Mbps, numRxHT_231_1_Mbps, numRxHT_234_Mbps,
|
||||
numRxHT_240_Mbps, numRxHT_243_Mbps, numRxHT_260_Mbps, numRxHT_263_2_Mbps, numRxHT_26_Mbps, numRxHT_270_Mbps, numRxHT_27_Mbps,
|
||||
numRxHT_288_7_Mbps, numRxHT_288_8_Mbps, numRxHT_28_7_Mbps, numRxHT_28_8_Mbps, numRxHT_292_5_Mbps, numRxHT_29_2_Mbps, numRxHT_300_Mbps,
|
||||
numRxHT_30_Mbps, numRxHT_312_Mbps, numRxHT_324_Mbps, numRxHT_325_Mbps, numRxHT_32_5_Mbps, numRxHT_346_7_Mbps, numRxHT_351_2_Mbps,
|
||||
numRxHT_351_Mbps, numRxHT_360_Mbps, numRxHT_39_Mbps, numRxHT_40_5_Mbps, numRxHT_43_2_Mbps, numRxHT_45_Mbps, numRxHT_52_Mbps, numRxHT_54_Mbps,
|
||||
numRxHT_57_5_Mbps, numRxHT_57_7_Mbps, numRxHT_58_5_Mbps, numRxHT_60_Mbps, numRxHT_65_Mbps, numRxHT_6_5_Mbps, numRxHT_72_1_Mbps, numRxHT_78_Mbps,
|
||||
numRxHT_7_1_Mbps, numRxHT_81_Mbps, numRxHT_86_6_Mbps, numRxHT_86_8_Mbps, numRxHT_87_8_Mbps, numRxHT_90_Mbps, numRxHT_97_5_Mbps, numRxLdpc,
|
||||
numRxManagement, numRxNoFcsErr, numRxNullData, numRxOffChan, numRxProbeReq, numRxProbeResp, numRxPspoll, numRxRetry, numRxRetryFrames, numRxRts,
|
||||
numRxStbc, numRxTimeData, numRxTimeToMe, numRxVHT_1040_Mbps, numRxVHT_1053_1_Mbps, numRxVHT_1053_Mbps, numRxVHT_1170_Mbps, numRxVHT_1300_Mbps,
|
||||
numRxVHT_1404_Mbps, numRxVHT_1560_Mbps, numRxVHT_1579_5_Mbps, numRxVHT_1733_1_Mbps, numRxVHT_1733_4_Mbps, numRxVHT_1755_Mbps,
|
||||
numRxVHT_1872_Mbps, numRxVHT_1950_Mbps, numRxVHT_2080_Mbps, numRxVHT_2106_Mbps, numRxVHT_2340_Mbps, numRxVHT_2600_Mbps, numRxVHT_2808_Mbps,
|
||||
numRxVHT_292_5_Mbps, numRxVHT_3120_Mbps, numRxVHT_325_Mbps, numRxVHT_3466_8_Mbps, numRxVHT_364_5_Mbps, numRxVHT_390_Mbps, numRxVHT_400_Mbps,
|
||||
numRxVHT_403_Mbps, numRxVHT_405_Mbps, numRxVHT_432_Mbps, numRxVHT_433_2_Mbps, numRxVHT_450_Mbps, numRxVHT_468_Mbps, numRxVHT_480_Mbps,
|
||||
numRxVHT_486_Mbps, numRxVHT_520_Mbps, numRxVHT_526_5_Mbps, numRxVHT_540_Mbps, numRxVHT_585_Mbps, numRxVHT_600_Mbps, numRxVHT_648_Mbps,
|
||||
numRxVHT_650_Mbps, numRxVHT_702_Mbps, numRxVHT_720_Mbps, numRxVHT_780_Mbps, numRxVHT_800_Mbps, numRxVHT_866_7_Mbps, numRxVHT_877_5_Mbps,
|
||||
numRxVHT_936_Mbps, numRxVHT_975_Mbps, numRx_12_Mbps, numRx_18_Mbps, numRx_1_Mbps, numRx_24_Mbps, numRx_36_Mbps, numRx_48_Mbps, numRx_54_Mbps,
|
||||
numRx_6_Mbps, numRx_9_Mbps, numScanReq, numScanSucc, numTxAction, numTxAggrOneMpdu, numTxAggrSucc, numTxBcDropped, numTxBeaconFail,
|
||||
numTxBeaconSuFail, numTxBeaconSucc, numTxControl, numTxCts, numTxData, numTxDataFrames, numTxDataFrames_108_Mbps, numTxDataFrames_12_Mbps,
|
||||
numTxDataFrames_1300Plus_Mbps, numTxDataFrames_1300_Mbps, numTxDataFrames_300_Mbps, numTxDataFrames_450_Mbps, numTxDataFrames_54_Mbps,
|
||||
numTxDataRetries, numTxDataTransmitted, numTxDataTransmittedRetried, numTxDropped, numTxDtimMc, numTxEapol, numTxFramesTransmitted,
|
||||
numTxHT_104_Mbps, numTxHT_108_Mbps, numTxHT_115_5_Mbps, numTxHT_117_1_Mbps, numTxHT_117_Mbps, numTxHT_120_Mbps, numTxHT_121_5_Mbps,
|
||||
numTxHT_130_3_Mbps, numTxHT_130_Mbps, numTxHT_135_Mbps, numTxHT_13_5_Mbps, numTxHT_13_Mbps, numTxHT_144_3_Mbps, numTxHT_14_3_Mbps,
|
||||
numTxHT_150_Mbps, numTxHT_156_Mbps, numTxHT_15_Mbps, numTxHT_162_Mbps, numTxHT_173_1_Mbps, numTxHT_173_3_Mbps, numTxHT_175_5_Mbps,
|
||||
numTxHT_180_Mbps, numTxHT_195_Mbps, numTxHT_19_5_Mbps, numTxHT_200_Mbps, numTxHT_208_Mbps, numTxHT_216_6_Mbps, numTxHT_216_Mbps,
|
||||
numTxHT_21_7_Mbps, numTxHT_231_1_Mbps, numTxHT_234_Mbps, numTxHT_240_Mbps, numTxHT_243_Mbps, numTxHT_260_Mbps, numTxHT_263_2_Mbps,
|
||||
numTxHT_26_Mbps, numTxHT_270_Mbps, numTxHT_27_Mbps, numTxHT_288_7_Mbps, numTxHT_288_8_Mbps, numTxHT_28_7_Mbps, numTxHT_28_8_Mbps,
|
||||
numTxHT_292_5_Mbps, numTxHT_29_2_Mbps, numTxHT_300_Mbps, numTxHT_30_Mbps, numTxHT_312_Mbps, numTxHT_324_Mbps, numTxHT_325_Mbps,
|
||||
numTxHT_32_5_Mbps, numTxHT_346_7_Mbps, numTxHT_351_2_Mbps, numTxHT_351_Mbps, numTxHT_360_Mbps, numTxHT_39_Mbps, numTxHT_40_5_Mbps,
|
||||
numTxHT_43_2_Mbps, numTxHT_45_Mbps, numTxHT_52_Mbps, numTxHT_54_Mbps, numTxHT_57_5_Mbps, numTxHT_57_7_Mbps, numTxHT_58_5_Mbps, numTxHT_60_Mbps,
|
||||
numTxHT_65_Mbps, numTxHT_6_5_Mbps, numTxHT_72_1_Mbps, numTxHT_78_Mbps, numTxHT_7_1_Mbps, numTxHT_81_Mbps, numTxHT_86_6_Mbps, numTxHT_86_8_Mbps,
|
||||
numTxHT_87_8_Mbps, numTxHT_90_Mbps, numTxHT_97_5_Mbps, numTxLdpc, numTxManagement, numTxMultiRetries, numTxMultipleRetries, numTxNoAck,
|
||||
numTxPowerChanges, numTxProbeResp, numTxPsUnicast, numTxQueued, numTxRateLimitDrop, numTxRetryAttemps, numTxRetryDropped, numTxRtsFail,
|
||||
numTxRtsSucc, numTxStbc, numTxSucc, numTxSuccNoRetry, numTxSuccRetries, numTxSuccessWithRetry, numTxTimeData, numTxTimeFramesTransmitted,
|
||||
numTxTime_BC_MC_Data, numTxTotalAttemps, numTxVHT_1040_Mbps, numTxVHT_1053_1_Mbps, numTxVHT_1053_Mbps, numTxVHT_1170_Mbps, numTxVHT_1300_Mbps,
|
||||
numTxVHT_1404_Mbps, numTxVHT_1560_Mbps, numTxVHT_1579_5_Mbps, numTxVHT_1733_1_Mbps, numTxVHT_1733_4_Mbps, numTxVHT_1755_Mbps,
|
||||
numTxVHT_1872_Mbps, numTxVHT_1950_Mbps, numTxVHT_2080_Mbps, numTxVHT_2106_Mbps, numTxVHT_2340_Mbps, numTxVHT_2600_Mbps, numTxVHT_2808_Mbps,
|
||||
numTxVHT_292_5_Mbps, numTxVHT_3120_Mbps, numTxVHT_325_Mbps, numTxVHT_3466_8_Mbps, numTxVHT_364_5_Mbps, numTxVHT_390_Mbps, numTxVHT_400_Mbps,
|
||||
numTxVHT_403_Mbps, numTxVHT_405_Mbps, numTxVHT_432_Mbps, numTxVHT_433_2_Mbps, numTxVHT_450_Mbps, numTxVHT_468_Mbps, numTxVHT_480_Mbps,
|
||||
numTxVHT_486_Mbps, numTxVHT_520_Mbps, numTxVHT_526_5_Mbps, numTxVHT_540_Mbps, numTxVHT_585_Mbps, numTxVHT_600_Mbps, numTxVHT_648_Mbps,
|
||||
numTxVHT_650_Mbps, numTxVHT_702_Mbps, numTxVHT_720_Mbps, numTxVHT_780_Mbps, numTxVHT_800_Mbps, numTxVHT_866_7_Mbps, numTxVHT_877_5_Mbps,
|
||||
numTxVHT_936_Mbps, numTxVHT_975_Mbps, numTx_12_Mbps, numTx_18_Mbps, numTx_1_Mbps, numTx_24_Mbps, numTx_36_Mbps, numTx_48_Mbps, numTx_54_Mbps,
|
||||
numTx_6_Mbps, numTx_9_Mbps, rxDataBytes, rxLastRssi, sourceTimestampMs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
RadioStatistics other = (RadioStatistics) obj;
|
||||
return Objects.equals(actualCellSize, other.actualCellSize) && Objects.equals(curBackupChannel, other.curBackupChannel)
|
||||
&& Objects.equals(curChannel, other.curChannel) && Objects.equals(curEirp, other.curEirp)
|
||||
&& Objects.equals(elevenGProtection, other.elevenGProtection) && Objects.equals(numChanChanges, other.numChanChanges)
|
||||
&& Objects.equals(numChannelBusy64s, other.numChannelBusy64s) && Objects.equals(numFreeTxBuf, other.numFreeTxBuf)
|
||||
&& Objects.equals(numRadarChanChanges, other.numRadarChanChanges) && Objects.equals(numRadioResets, other.numRadioResets)
|
||||
&& Objects.equals(numRcvBcForTx, other.numRcvBcForTx) && Objects.equals(numRcvFrameForTx, other.numRcvFrameForTx)
|
||||
&& Objects.equals(numRx, other.numRx) && Objects.equals(numRxAck, other.numRxAck)
|
||||
&& Objects.equals(numRxAmsduDeaggItmd, other.numRxAmsduDeaggItmd) && Objects.equals(numRxAmsduDeaggLast, other.numRxAmsduDeaggLast)
|
||||
&& Objects.equals(numRxAmsduDeaggSeq, other.numRxAmsduDeaggSeq) && Objects.equals(numRxBcMc, other.numRxBcMc)
|
||||
&& Objects.equals(numRxBeacon, other.numRxBeacon) && Objects.equals(numRxControl, other.numRxControl)
|
||||
&& Objects.equals(numRxCts, other.numRxCts) && Objects.equals(numRxData, other.numRxData)
|
||||
&& Objects.equals(numRxDataFrames, other.numRxDataFrames) && Objects.equals(numRxDataFramesRetried, other.numRxDataFramesRetried)
|
||||
&& Objects.equals(numRxDataFrames_108_Mbps, other.numRxDataFrames_108_Mbps)
|
||||
&& Objects.equals(numRxDataFrames_12_Mbps, other.numRxDataFrames_12_Mbps)
|
||||
&& Objects.equals(numRxDataFrames_1300Plus_Mbps, other.numRxDataFrames_1300Plus_Mbps)
|
||||
&& Objects.equals(numRxDataFrames_1300_Mbps, other.numRxDataFrames_1300_Mbps)
|
||||
&& Objects.equals(numRxDataFrames_300_Mbps, other.numRxDataFrames_300_Mbps)
|
||||
&& Objects.equals(numRxDataFrames_450_Mbps, other.numRxDataFrames_450_Mbps)
|
||||
&& Objects.equals(numRxDataFrames_54_Mbps, other.numRxDataFrames_54_Mbps) && Objects.equals(numRxDropAmsduNoRcv, other.numRxDropAmsduNoRcv)
|
||||
&& Objects.equals(numRxDropBadProtocol, other.numRxDropBadProtocol) && Objects.equals(numRxDropEthHdrRunt, other.numRxDropEthHdrRunt)
|
||||
&& Objects.equals(numRxDropInvalidSrcMac, other.numRxDropInvalidSrcMac) && Objects.equals(numRxDropNoFcField, other.numRxDropNoFcField)
|
||||
&& Objects.equals(numRxDropRunt, other.numRxDropRunt) && Objects.equals(numRxDup, other.numRxDup) && Objects.equals(numRxErr, other.numRxErr)
|
||||
&& Objects.equals(numRxFcsErr, other.numRxFcsErr) && Objects.equals(numRxFramesReceived, other.numRxFramesReceived)
|
||||
&& Objects.equals(numRxHT_104_Mbps, other.numRxHT_104_Mbps) && Objects.equals(numRxHT_108_Mbps, other.numRxHT_108_Mbps)
|
||||
&& Objects.equals(numRxHT_115_5_Mbps, other.numRxHT_115_5_Mbps) && Objects.equals(numRxHT_117_1_Mbps, other.numRxHT_117_1_Mbps)
|
||||
&& Objects.equals(numRxHT_117_Mbps, other.numRxHT_117_Mbps) && Objects.equals(numRxHT_120_Mbps, other.numRxHT_120_Mbps)
|
||||
&& Objects.equals(numRxHT_121_5_Mbps, other.numRxHT_121_5_Mbps) && Objects.equals(numRxHT_130_3_Mbps, other.numRxHT_130_3_Mbps)
|
||||
&& Objects.equals(numRxHT_130_Mbps, other.numRxHT_130_Mbps) && Objects.equals(numRxHT_135_Mbps, other.numRxHT_135_Mbps)
|
||||
&& Objects.equals(numRxHT_13_5_Mbps, other.numRxHT_13_5_Mbps) && Objects.equals(numRxHT_13_Mbps, other.numRxHT_13_Mbps)
|
||||
&& Objects.equals(numRxHT_144_3_Mbps, other.numRxHT_144_3_Mbps) && Objects.equals(numRxHT_14_3_Mbps, other.numRxHT_14_3_Mbps)
|
||||
&& Objects.equals(numRxHT_150_Mbps, other.numRxHT_150_Mbps) && Objects.equals(numRxHT_156_Mbps, other.numRxHT_156_Mbps)
|
||||
&& Objects.equals(numRxHT_15_Mbps, other.numRxHT_15_Mbps) && Objects.equals(numRxHT_162_Mbps, other.numRxHT_162_Mbps)
|
||||
&& Objects.equals(numRxHT_173_1_Mbps, other.numRxHT_173_1_Mbps) && Objects.equals(numRxHT_173_3_Mbps, other.numRxHT_173_3_Mbps)
|
||||
&& Objects.equals(numRxHT_175_5_Mbps, other.numRxHT_175_5_Mbps) && Objects.equals(numRxHT_180_Mbps, other.numRxHT_180_Mbps)
|
||||
&& Objects.equals(numRxHT_195_Mbps, other.numRxHT_195_Mbps) && Objects.equals(numRxHT_19_5_Mbps, other.numRxHT_19_5_Mbps)
|
||||
&& Objects.equals(numRxHT_200_Mbps, other.numRxHT_200_Mbps) && Objects.equals(numRxHT_208_Mbps, other.numRxHT_208_Mbps)
|
||||
&& Objects.equals(numRxHT_216_6_Mbps, other.numRxHT_216_6_Mbps) && Objects.equals(numRxHT_216_Mbps, other.numRxHT_216_Mbps)
|
||||
&& Objects.equals(numRxHT_21_7_Mbps, other.numRxHT_21_7_Mbps) && Objects.equals(numRxHT_231_1_Mbps, other.numRxHT_231_1_Mbps)
|
||||
&& Objects.equals(numRxHT_234_Mbps, other.numRxHT_234_Mbps) && Objects.equals(numRxHT_240_Mbps, other.numRxHT_240_Mbps)
|
||||
&& Objects.equals(numRxHT_243_Mbps, other.numRxHT_243_Mbps) && Objects.equals(numRxHT_260_Mbps, other.numRxHT_260_Mbps)
|
||||
&& Objects.equals(numRxHT_263_2_Mbps, other.numRxHT_263_2_Mbps) && Objects.equals(numRxHT_26_Mbps, other.numRxHT_26_Mbps)
|
||||
&& Objects.equals(numRxHT_270_Mbps, other.numRxHT_270_Mbps) && Objects.equals(numRxHT_27_Mbps, other.numRxHT_27_Mbps)
|
||||
&& Objects.equals(numRxHT_288_7_Mbps, other.numRxHT_288_7_Mbps) && Objects.equals(numRxHT_288_8_Mbps, other.numRxHT_288_8_Mbps)
|
||||
&& Objects.equals(numRxHT_28_7_Mbps, other.numRxHT_28_7_Mbps) && Objects.equals(numRxHT_28_8_Mbps, other.numRxHT_28_8_Mbps)
|
||||
&& Objects.equals(numRxHT_292_5_Mbps, other.numRxHT_292_5_Mbps) && Objects.equals(numRxHT_29_2_Mbps, other.numRxHT_29_2_Mbps)
|
||||
&& Objects.equals(numRxHT_300_Mbps, other.numRxHT_300_Mbps) && Objects.equals(numRxHT_30_Mbps, other.numRxHT_30_Mbps)
|
||||
&& Objects.equals(numRxHT_312_Mbps, other.numRxHT_312_Mbps) && Objects.equals(numRxHT_324_Mbps, other.numRxHT_324_Mbps)
|
||||
&& Objects.equals(numRxHT_325_Mbps, other.numRxHT_325_Mbps) && Objects.equals(numRxHT_32_5_Mbps, other.numRxHT_32_5_Mbps)
|
||||
&& Objects.equals(numRxHT_346_7_Mbps, other.numRxHT_346_7_Mbps) && Objects.equals(numRxHT_351_2_Mbps, other.numRxHT_351_2_Mbps)
|
||||
&& Objects.equals(numRxHT_351_Mbps, other.numRxHT_351_Mbps) && Objects.equals(numRxHT_360_Mbps, other.numRxHT_360_Mbps)
|
||||
&& Objects.equals(numRxHT_39_Mbps, other.numRxHT_39_Mbps) && Objects.equals(numRxHT_40_5_Mbps, other.numRxHT_40_5_Mbps)
|
||||
&& Objects.equals(numRxHT_43_2_Mbps, other.numRxHT_43_2_Mbps) && Objects.equals(numRxHT_45_Mbps, other.numRxHT_45_Mbps)
|
||||
&& Objects.equals(numRxHT_52_Mbps, other.numRxHT_52_Mbps) && Objects.equals(numRxHT_54_Mbps, other.numRxHT_54_Mbps)
|
||||
&& Objects.equals(numRxHT_57_5_Mbps, other.numRxHT_57_5_Mbps) && Objects.equals(numRxHT_57_7_Mbps, other.numRxHT_57_7_Mbps)
|
||||
&& Objects.equals(numRxHT_58_5_Mbps, other.numRxHT_58_5_Mbps) && Objects.equals(numRxHT_60_Mbps, other.numRxHT_60_Mbps)
|
||||
&& Objects.equals(numRxHT_65_Mbps, other.numRxHT_65_Mbps) && Objects.equals(numRxHT_6_5_Mbps, other.numRxHT_6_5_Mbps)
|
||||
&& Objects.equals(numRxHT_72_1_Mbps, other.numRxHT_72_1_Mbps) && Objects.equals(numRxHT_78_Mbps, other.numRxHT_78_Mbps)
|
||||
&& Objects.equals(numRxHT_7_1_Mbps, other.numRxHT_7_1_Mbps) && Objects.equals(numRxHT_81_Mbps, other.numRxHT_81_Mbps)
|
||||
&& Objects.equals(numRxHT_86_6_Mbps, other.numRxHT_86_6_Mbps) && Objects.equals(numRxHT_86_8_Mbps, other.numRxHT_86_8_Mbps)
|
||||
&& Objects.equals(numRxHT_87_8_Mbps, other.numRxHT_87_8_Mbps) && Objects.equals(numRxHT_90_Mbps, other.numRxHT_90_Mbps)
|
||||
&& Objects.equals(numRxHT_97_5_Mbps, other.numRxHT_97_5_Mbps) && Objects.equals(numRxLdpc, other.numRxLdpc)
|
||||
&& Objects.equals(numRxManagement, other.numRxManagement) && Objects.equals(numRxNoFcsErr, other.numRxNoFcsErr)
|
||||
&& Objects.equals(numRxNullData, other.numRxNullData) && Objects.equals(numRxOffChan, other.numRxOffChan)
|
||||
&& Objects.equals(numRxProbeReq, other.numRxProbeReq) && Objects.equals(numRxProbeResp, other.numRxProbeResp)
|
||||
&& Objects.equals(numRxPspoll, other.numRxPspoll) && Objects.equals(numRxRetry, other.numRxRetry)
|
||||
&& Objects.equals(numRxRetryFrames, other.numRxRetryFrames) && Objects.equals(numRxRts, other.numRxRts)
|
||||
&& Objects.equals(numRxStbc, other.numRxStbc) && Objects.equals(numRxTimeData, other.numRxTimeData)
|
||||
&& Objects.equals(numRxTimeToMe, other.numRxTimeToMe) && Objects.equals(numRxVHT_1040_Mbps, other.numRxVHT_1040_Mbps)
|
||||
&& Objects.equals(numRxVHT_1053_1_Mbps, other.numRxVHT_1053_1_Mbps) && Objects.equals(numRxVHT_1053_Mbps, other.numRxVHT_1053_Mbps)
|
||||
&& Objects.equals(numRxVHT_1170_Mbps, other.numRxVHT_1170_Mbps) && Objects.equals(numRxVHT_1300_Mbps, other.numRxVHT_1300_Mbps)
|
||||
&& Objects.equals(numRxVHT_1404_Mbps, other.numRxVHT_1404_Mbps) && Objects.equals(numRxVHT_1560_Mbps, other.numRxVHT_1560_Mbps)
|
||||
&& Objects.equals(numRxVHT_1579_5_Mbps, other.numRxVHT_1579_5_Mbps) && Objects.equals(numRxVHT_1733_1_Mbps, other.numRxVHT_1733_1_Mbps)
|
||||
&& Objects.equals(numRxVHT_1733_4_Mbps, other.numRxVHT_1733_4_Mbps) && Objects.equals(numRxVHT_1755_Mbps, other.numRxVHT_1755_Mbps)
|
||||
&& Objects.equals(numRxVHT_1872_Mbps, other.numRxVHT_1872_Mbps) && Objects.equals(numRxVHT_1950_Mbps, other.numRxVHT_1950_Mbps)
|
||||
&& Objects.equals(numRxVHT_2080_Mbps, other.numRxVHT_2080_Mbps) && Objects.equals(numRxVHT_2106_Mbps, other.numRxVHT_2106_Mbps)
|
||||
&& Objects.equals(numRxVHT_2340_Mbps, other.numRxVHT_2340_Mbps) && Objects.equals(numRxVHT_2600_Mbps, other.numRxVHT_2600_Mbps)
|
||||
&& Objects.equals(numRxVHT_2808_Mbps, other.numRxVHT_2808_Mbps) && Objects.equals(numRxVHT_292_5_Mbps, other.numRxVHT_292_5_Mbps)
|
||||
&& Objects.equals(numRxVHT_3120_Mbps, other.numRxVHT_3120_Mbps) && Objects.equals(numRxVHT_325_Mbps, other.numRxVHT_325_Mbps)
|
||||
&& Objects.equals(numRxVHT_3466_8_Mbps, other.numRxVHT_3466_8_Mbps) && Objects.equals(numRxVHT_364_5_Mbps, other.numRxVHT_364_5_Mbps)
|
||||
&& Objects.equals(numRxVHT_390_Mbps, other.numRxVHT_390_Mbps) && Objects.equals(numRxVHT_400_Mbps, other.numRxVHT_400_Mbps)
|
||||
&& Objects.equals(numRxVHT_403_Mbps, other.numRxVHT_403_Mbps) && Objects.equals(numRxVHT_405_Mbps, other.numRxVHT_405_Mbps)
|
||||
&& Objects.equals(numRxVHT_432_Mbps, other.numRxVHT_432_Mbps) && Objects.equals(numRxVHT_433_2_Mbps, other.numRxVHT_433_2_Mbps)
|
||||
&& Objects.equals(numRxVHT_450_Mbps, other.numRxVHT_450_Mbps) && Objects.equals(numRxVHT_468_Mbps, other.numRxVHT_468_Mbps)
|
||||
&& Objects.equals(numRxVHT_480_Mbps, other.numRxVHT_480_Mbps) && Objects.equals(numRxVHT_486_Mbps, other.numRxVHT_486_Mbps)
|
||||
&& Objects.equals(numRxVHT_520_Mbps, other.numRxVHT_520_Mbps) && Objects.equals(numRxVHT_526_5_Mbps, other.numRxVHT_526_5_Mbps)
|
||||
&& Objects.equals(numRxVHT_540_Mbps, other.numRxVHT_540_Mbps) && Objects.equals(numRxVHT_585_Mbps, other.numRxVHT_585_Mbps)
|
||||
&& Objects.equals(numRxVHT_600_Mbps, other.numRxVHT_600_Mbps) && Objects.equals(numRxVHT_648_Mbps, other.numRxVHT_648_Mbps)
|
||||
&& Objects.equals(numRxVHT_650_Mbps, other.numRxVHT_650_Mbps) && Objects.equals(numRxVHT_702_Mbps, other.numRxVHT_702_Mbps)
|
||||
&& Objects.equals(numRxVHT_720_Mbps, other.numRxVHT_720_Mbps) && Objects.equals(numRxVHT_780_Mbps, other.numRxVHT_780_Mbps)
|
||||
&& Objects.equals(numRxVHT_800_Mbps, other.numRxVHT_800_Mbps) && Objects.equals(numRxVHT_866_7_Mbps, other.numRxVHT_866_7_Mbps)
|
||||
&& Objects.equals(numRxVHT_877_5_Mbps, other.numRxVHT_877_5_Mbps) && Objects.equals(numRxVHT_936_Mbps, other.numRxVHT_936_Mbps)
|
||||
&& Objects.equals(numRxVHT_975_Mbps, other.numRxVHT_975_Mbps) && Objects.equals(numRx_12_Mbps, other.numRx_12_Mbps)
|
||||
&& Objects.equals(numRx_18_Mbps, other.numRx_18_Mbps) && Objects.equals(numRx_1_Mbps, other.numRx_1_Mbps)
|
||||
&& Objects.equals(numRx_24_Mbps, other.numRx_24_Mbps) && Objects.equals(numRx_36_Mbps, other.numRx_36_Mbps)
|
||||
&& Objects.equals(numRx_48_Mbps, other.numRx_48_Mbps) && Objects.equals(numRx_54_Mbps, other.numRx_54_Mbps)
|
||||
&& Objects.equals(numRx_6_Mbps, other.numRx_6_Mbps) && Objects.equals(numRx_9_Mbps, other.numRx_9_Mbps)
|
||||
&& Objects.equals(numScanReq, other.numScanReq) && Objects.equals(numScanSucc, other.numScanSucc)
|
||||
&& Objects.equals(numTxAction, other.numTxAction) && Objects.equals(numTxAggrOneMpdu, other.numTxAggrOneMpdu)
|
||||
&& Objects.equals(numTxAggrSucc, other.numTxAggrSucc) && Objects.equals(numTxBcDropped, other.numTxBcDropped)
|
||||
&& Objects.equals(numTxBeaconFail, other.numTxBeaconFail) && Objects.equals(numTxBeaconSuFail, other.numTxBeaconSuFail)
|
||||
&& Objects.equals(numTxBeaconSucc, other.numTxBeaconSucc) && Objects.equals(numTxControl, other.numTxControl)
|
||||
&& Objects.equals(numTxCts, other.numTxCts) && Objects.equals(numTxData, other.numTxData)
|
||||
&& Objects.equals(numTxDataFrames, other.numTxDataFrames) && Objects.equals(numTxDataFrames_108_Mbps, other.numTxDataFrames_108_Mbps)
|
||||
&& Objects.equals(numTxDataFrames_12_Mbps, other.numTxDataFrames_12_Mbps)
|
||||
&& Objects.equals(numTxDataFrames_1300Plus_Mbps, other.numTxDataFrames_1300Plus_Mbps)
|
||||
&& Objects.equals(numTxDataFrames_1300_Mbps, other.numTxDataFrames_1300_Mbps)
|
||||
&& Objects.equals(numTxDataFrames_300_Mbps, other.numTxDataFrames_300_Mbps)
|
||||
&& Objects.equals(numTxDataFrames_450_Mbps, other.numTxDataFrames_450_Mbps)
|
||||
&& Objects.equals(numTxDataFrames_54_Mbps, other.numTxDataFrames_54_Mbps) && Objects.equals(numTxDataRetries, other.numTxDataRetries)
|
||||
&& Objects.equals(numTxDataTransmitted, other.numTxDataTransmitted)
|
||||
&& Objects.equals(numTxDataTransmittedRetried, other.numTxDataTransmittedRetried) && Objects.equals(numTxDropped, other.numTxDropped)
|
||||
&& Objects.equals(numTxDtimMc, other.numTxDtimMc) && Objects.equals(numTxEapol, other.numTxEapol)
|
||||
&& Objects.equals(numTxFramesTransmitted, other.numTxFramesTransmitted) && Objects.equals(numTxHT_104_Mbps, other.numTxHT_104_Mbps)
|
||||
&& Objects.equals(numTxHT_108_Mbps, other.numTxHT_108_Mbps) && Objects.equals(numTxHT_115_5_Mbps, other.numTxHT_115_5_Mbps)
|
||||
&& Objects.equals(numTxHT_117_1_Mbps, other.numTxHT_117_1_Mbps) && Objects.equals(numTxHT_117_Mbps, other.numTxHT_117_Mbps)
|
||||
&& Objects.equals(numTxHT_120_Mbps, other.numTxHT_120_Mbps) && Objects.equals(numTxHT_121_5_Mbps, other.numTxHT_121_5_Mbps)
|
||||
&& Objects.equals(numTxHT_130_3_Mbps, other.numTxHT_130_3_Mbps) && Objects.equals(numTxHT_130_Mbps, other.numTxHT_130_Mbps)
|
||||
&& Objects.equals(numTxHT_135_Mbps, other.numTxHT_135_Mbps) && Objects.equals(numTxHT_13_5_Mbps, other.numTxHT_13_5_Mbps)
|
||||
&& Objects.equals(numTxHT_13_Mbps, other.numTxHT_13_Mbps) && Objects.equals(numTxHT_144_3_Mbps, other.numTxHT_144_3_Mbps)
|
||||
&& Objects.equals(numTxHT_14_3_Mbps, other.numTxHT_14_3_Mbps) && Objects.equals(numTxHT_150_Mbps, other.numTxHT_150_Mbps)
|
||||
&& Objects.equals(numTxHT_156_Mbps, other.numTxHT_156_Mbps) && Objects.equals(numTxHT_15_Mbps, other.numTxHT_15_Mbps)
|
||||
&& Objects.equals(numTxHT_162_Mbps, other.numTxHT_162_Mbps) && Objects.equals(numTxHT_173_1_Mbps, other.numTxHT_173_1_Mbps)
|
||||
&& Objects.equals(numTxHT_173_3_Mbps, other.numTxHT_173_3_Mbps) && Objects.equals(numTxHT_175_5_Mbps, other.numTxHT_175_5_Mbps)
|
||||
&& Objects.equals(numTxHT_180_Mbps, other.numTxHT_180_Mbps) && Objects.equals(numTxHT_195_Mbps, other.numTxHT_195_Mbps)
|
||||
&& Objects.equals(numTxHT_19_5_Mbps, other.numTxHT_19_5_Mbps) && Objects.equals(numTxHT_200_Mbps, other.numTxHT_200_Mbps)
|
||||
&& Objects.equals(numTxHT_208_Mbps, other.numTxHT_208_Mbps) && Objects.equals(numTxHT_216_6_Mbps, other.numTxHT_216_6_Mbps)
|
||||
&& Objects.equals(numTxHT_216_Mbps, other.numTxHT_216_Mbps) && Objects.equals(numTxHT_21_7_Mbps, other.numTxHT_21_7_Mbps)
|
||||
&& Objects.equals(numTxHT_231_1_Mbps, other.numTxHT_231_1_Mbps) && Objects.equals(numTxHT_234_Mbps, other.numTxHT_234_Mbps)
|
||||
&& Objects.equals(numTxHT_240_Mbps, other.numTxHT_240_Mbps) && Objects.equals(numTxHT_243_Mbps, other.numTxHT_243_Mbps)
|
||||
&& Objects.equals(numTxHT_260_Mbps, other.numTxHT_260_Mbps) && Objects.equals(numTxHT_263_2_Mbps, other.numTxHT_263_2_Mbps)
|
||||
&& Objects.equals(numTxHT_26_Mbps, other.numTxHT_26_Mbps) && Objects.equals(numTxHT_270_Mbps, other.numTxHT_270_Mbps)
|
||||
&& Objects.equals(numTxHT_27_Mbps, other.numTxHT_27_Mbps) && Objects.equals(numTxHT_288_7_Mbps, other.numTxHT_288_7_Mbps)
|
||||
&& Objects.equals(numTxHT_288_8_Mbps, other.numTxHT_288_8_Mbps) && Objects.equals(numTxHT_28_7_Mbps, other.numTxHT_28_7_Mbps)
|
||||
&& Objects.equals(numTxHT_28_8_Mbps, other.numTxHT_28_8_Mbps) && Objects.equals(numTxHT_292_5_Mbps, other.numTxHT_292_5_Mbps)
|
||||
&& Objects.equals(numTxHT_29_2_Mbps, other.numTxHT_29_2_Mbps) && Objects.equals(numTxHT_300_Mbps, other.numTxHT_300_Mbps)
|
||||
&& Objects.equals(numTxHT_30_Mbps, other.numTxHT_30_Mbps) && Objects.equals(numTxHT_312_Mbps, other.numTxHT_312_Mbps)
|
||||
&& Objects.equals(numTxHT_324_Mbps, other.numTxHT_324_Mbps) && Objects.equals(numTxHT_325_Mbps, other.numTxHT_325_Mbps)
|
||||
&& Objects.equals(numTxHT_32_5_Mbps, other.numTxHT_32_5_Mbps) && Objects.equals(numTxHT_346_7_Mbps, other.numTxHT_346_7_Mbps)
|
||||
&& Objects.equals(numTxHT_351_2_Mbps, other.numTxHT_351_2_Mbps) && Objects.equals(numTxHT_351_Mbps, other.numTxHT_351_Mbps)
|
||||
&& Objects.equals(numTxHT_360_Mbps, other.numTxHT_360_Mbps) && Objects.equals(numTxHT_39_Mbps, other.numTxHT_39_Mbps)
|
||||
&& Objects.equals(numTxHT_40_5_Mbps, other.numTxHT_40_5_Mbps) && Objects.equals(numTxHT_43_2_Mbps, other.numTxHT_43_2_Mbps)
|
||||
&& Objects.equals(numTxHT_45_Mbps, other.numTxHT_45_Mbps) && Objects.equals(numTxHT_52_Mbps, other.numTxHT_52_Mbps)
|
||||
&& Objects.equals(numTxHT_54_Mbps, other.numTxHT_54_Mbps) && Objects.equals(numTxHT_57_5_Mbps, other.numTxHT_57_5_Mbps)
|
||||
&& Objects.equals(numTxHT_57_7_Mbps, other.numTxHT_57_7_Mbps) && Objects.equals(numTxHT_58_5_Mbps, other.numTxHT_58_5_Mbps)
|
||||
&& Objects.equals(numTxHT_60_Mbps, other.numTxHT_60_Mbps) && Objects.equals(numTxHT_65_Mbps, other.numTxHT_65_Mbps)
|
||||
&& Objects.equals(numTxHT_6_5_Mbps, other.numTxHT_6_5_Mbps) && Objects.equals(numTxHT_72_1_Mbps, other.numTxHT_72_1_Mbps)
|
||||
&& Objects.equals(numTxHT_78_Mbps, other.numTxHT_78_Mbps) && Objects.equals(numTxHT_7_1_Mbps, other.numTxHT_7_1_Mbps)
|
||||
&& Objects.equals(numTxHT_81_Mbps, other.numTxHT_81_Mbps) && Objects.equals(numTxHT_86_6_Mbps, other.numTxHT_86_6_Mbps)
|
||||
&& Objects.equals(numTxHT_86_8_Mbps, other.numTxHT_86_8_Mbps) && Objects.equals(numTxHT_87_8_Mbps, other.numTxHT_87_8_Mbps)
|
||||
&& Objects.equals(numTxHT_90_Mbps, other.numTxHT_90_Mbps) && Objects.equals(numTxHT_97_5_Mbps, other.numTxHT_97_5_Mbps)
|
||||
&& Objects.equals(numTxLdpc, other.numTxLdpc) && Objects.equals(numTxManagement, other.numTxManagement)
|
||||
&& Objects.equals(numTxMultiRetries, other.numTxMultiRetries) && Objects.equals(numTxMultipleRetries, other.numTxMultipleRetries)
|
||||
&& Objects.equals(numTxNoAck, other.numTxNoAck) && Objects.equals(numTxPowerChanges, other.numTxPowerChanges)
|
||||
&& Objects.equals(numTxProbeResp, other.numTxProbeResp) && Objects.equals(numTxPsUnicast, other.numTxPsUnicast)
|
||||
&& Objects.equals(numTxQueued, other.numTxQueued) && Objects.equals(numTxRateLimitDrop, other.numTxRateLimitDrop)
|
||||
&& Objects.equals(numTxRetryAttemps, other.numTxRetryAttemps) && 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)
|
||||
&& Objects.equals(numTxSuccessWithRetry, other.numTxSuccessWithRetry) && Objects.equals(numTxTimeData, other.numTxTimeData)
|
||||
&& Objects.equals(numTxTimeFramesTransmitted, other.numTxTimeFramesTransmitted)
|
||||
&& Objects.equals(numTxTime_BC_MC_Data, other.numTxTime_BC_MC_Data) && Objects.equals(numTxTotalAttemps, other.numTxTotalAttemps)
|
||||
&& Objects.equals(numTxVHT_1040_Mbps, other.numTxVHT_1040_Mbps) && Objects.equals(numTxVHT_1053_1_Mbps, other.numTxVHT_1053_1_Mbps)
|
||||
&& Objects.equals(numTxVHT_1053_Mbps, other.numTxVHT_1053_Mbps) && Objects.equals(numTxVHT_1170_Mbps, other.numTxVHT_1170_Mbps)
|
||||
&& Objects.equals(numTxVHT_1300_Mbps, other.numTxVHT_1300_Mbps) && Objects.equals(numTxVHT_1404_Mbps, other.numTxVHT_1404_Mbps)
|
||||
&& Objects.equals(numTxVHT_1560_Mbps, other.numTxVHT_1560_Mbps) && Objects.equals(numTxVHT_1579_5_Mbps, other.numTxVHT_1579_5_Mbps)
|
||||
&& Objects.equals(numTxVHT_1733_1_Mbps, other.numTxVHT_1733_1_Mbps) && Objects.equals(numTxVHT_1733_4_Mbps, other.numTxVHT_1733_4_Mbps)
|
||||
&& Objects.equals(numTxVHT_1755_Mbps, other.numTxVHT_1755_Mbps) && Objects.equals(numTxVHT_1872_Mbps, other.numTxVHT_1872_Mbps)
|
||||
&& Objects.equals(numTxVHT_1950_Mbps, other.numTxVHT_1950_Mbps) && Objects.equals(numTxVHT_2080_Mbps, other.numTxVHT_2080_Mbps)
|
||||
&& Objects.equals(numTxVHT_2106_Mbps, other.numTxVHT_2106_Mbps) && Objects.equals(numTxVHT_2340_Mbps, other.numTxVHT_2340_Mbps)
|
||||
&& Objects.equals(numTxVHT_2600_Mbps, other.numTxVHT_2600_Mbps) && Objects.equals(numTxVHT_2808_Mbps, other.numTxVHT_2808_Mbps)
|
||||
&& Objects.equals(numTxVHT_292_5_Mbps, other.numTxVHT_292_5_Mbps) && Objects.equals(numTxVHT_3120_Mbps, other.numTxVHT_3120_Mbps)
|
||||
&& Objects.equals(numTxVHT_325_Mbps, other.numTxVHT_325_Mbps) && Objects.equals(numTxVHT_3466_8_Mbps, other.numTxVHT_3466_8_Mbps)
|
||||
&& Objects.equals(numTxVHT_364_5_Mbps, other.numTxVHT_364_5_Mbps) && Objects.equals(numTxVHT_390_Mbps, other.numTxVHT_390_Mbps)
|
||||
&& Objects.equals(numTxVHT_400_Mbps, other.numTxVHT_400_Mbps) && Objects.equals(numTxVHT_403_Mbps, other.numTxVHT_403_Mbps)
|
||||
&& Objects.equals(numTxVHT_405_Mbps, other.numTxVHT_405_Mbps) && Objects.equals(numTxVHT_432_Mbps, other.numTxVHT_432_Mbps)
|
||||
&& Objects.equals(numTxVHT_433_2_Mbps, other.numTxVHT_433_2_Mbps) && Objects.equals(numTxVHT_450_Mbps, other.numTxVHT_450_Mbps)
|
||||
&& Objects.equals(numTxVHT_468_Mbps, other.numTxVHT_468_Mbps) && Objects.equals(numTxVHT_480_Mbps, other.numTxVHT_480_Mbps)
|
||||
&& Objects.equals(numTxVHT_486_Mbps, other.numTxVHT_486_Mbps) && Objects.equals(numTxVHT_520_Mbps, other.numTxVHT_520_Mbps)
|
||||
&& Objects.equals(numTxVHT_526_5_Mbps, other.numTxVHT_526_5_Mbps) && Objects.equals(numTxVHT_540_Mbps, other.numTxVHT_540_Mbps)
|
||||
&& Objects.equals(numTxVHT_585_Mbps, other.numTxVHT_585_Mbps) && Objects.equals(numTxVHT_600_Mbps, other.numTxVHT_600_Mbps)
|
||||
&& Objects.equals(numTxVHT_648_Mbps, other.numTxVHT_648_Mbps) && Objects.equals(numTxVHT_650_Mbps, other.numTxVHT_650_Mbps)
|
||||
&& Objects.equals(numTxVHT_702_Mbps, other.numTxVHT_702_Mbps) && Objects.equals(numTxVHT_720_Mbps, other.numTxVHT_720_Mbps)
|
||||
&& Objects.equals(numTxVHT_780_Mbps, other.numTxVHT_780_Mbps) && Objects.equals(numTxVHT_800_Mbps, other.numTxVHT_800_Mbps)
|
||||
&& Objects.equals(numTxVHT_866_7_Mbps, other.numTxVHT_866_7_Mbps) && Objects.equals(numTxVHT_877_5_Mbps, other.numTxVHT_877_5_Mbps)
|
||||
&& Objects.equals(numTxVHT_936_Mbps, other.numTxVHT_936_Mbps) && Objects.equals(numTxVHT_975_Mbps, other.numTxVHT_975_Mbps)
|
||||
&& Objects.equals(numTx_12_Mbps, other.numTx_12_Mbps) && Objects.equals(numTx_18_Mbps, other.numTx_18_Mbps)
|
||||
&& Objects.equals(numTx_1_Mbps, other.numTx_1_Mbps) && Objects.equals(numTx_24_Mbps, other.numTx_24_Mbps)
|
||||
&& Objects.equals(numTx_36_Mbps, other.numTx_36_Mbps) && Objects.equals(numTx_48_Mbps, other.numTx_48_Mbps)
|
||||
&& Objects.equals(numTx_54_Mbps, other.numTx_54_Mbps) && Objects.equals(numTx_6_Mbps, other.numTx_6_Mbps)
|
||||
&& Objects.equals(numTx_9_Mbps, other.numTx_9_Mbps) && Objects.equals(rxDataBytes, other.rxDataBytes)
|
||||
&& Objects.equals(rxLastRssi, other.rxLastRssi) && sourceTimestampMs == other.sourceTimestampMs;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,15 +3,19 @@
|
||||
*/
|
||||
package com.telecominfraproject.wlan.servicemetric.apnode.models;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.json.interfaces.HasSourceTimestamp;
|
||||
|
||||
/**
|
||||
* @author ekeddy
|
||||
*
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class RadioUtilization extends BaseJsonModel {
|
||||
public class RadioUtilization extends BaseJsonModel implements HasSourceTimestamp {
|
||||
|
||||
private static final long serialVersionUID = -6295155025058221865L;
|
||||
|
||||
@@ -21,7 +25,7 @@ public class RadioUtilization extends BaseJsonModel {
|
||||
private Integer unassocClientRx;
|
||||
private Integer nonWifi;
|
||||
private Integer timestampSeconds;
|
||||
|
||||
private long sourceTimestampMs;
|
||||
//
|
||||
// If the two value below are null and the value above aren't, we'll
|
||||
// calculate them on the spot.
|
||||
@@ -111,106 +115,40 @@ public class RadioUtilization extends BaseJsonModel {
|
||||
this.unAvailableCapacity = unAvailableCapacity;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result
|
||||
+ ((assocClientTx == null) ? 0 : assocClientTx.hashCode());
|
||||
result = prime * result
|
||||
+ ((unassocClientTx == null) ? 0 : unassocClientTx.hashCode());
|
||||
result = prime * result
|
||||
+ ((assocClientRx == null) ? 0 : assocClientRx.hashCode());
|
||||
result = prime * result
|
||||
+ ((unassocClientRx == null) ? 0 : unassocClientRx.hashCode());
|
||||
result = prime * result
|
||||
+ ((nonWifi == null) ? 0 : nonWifi.hashCode());
|
||||
result = prime * result
|
||||
+ ((timestampSeconds == null) ? 0 : timestampSeconds.hashCode());
|
||||
result = prime * result
|
||||
+ ((ibss == null) ? 0 : ibss.hashCode());
|
||||
result = prime * result
|
||||
+ ((unAvailableCapacity == null) ? 0 : unAvailableCapacity.hashCode());
|
||||
|
||||
return result;
|
||||
return Objects.hash(assocClientRx, assocClientTx, ibss, nonWifi, sourceTimestampMs, timestampSeconds, unAvailableCapacity, unassocClientRx,
|
||||
unassocClientTx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (obj == null) {
|
||||
if (obj == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
}
|
||||
|
||||
RadioUtilization other = (RadioUtilization) obj;
|
||||
if (assocClientTx == null) {
|
||||
if (other.assocClientTx != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!assocClientTx.equals(other.assocClientTx)) {
|
||||
return false;
|
||||
}
|
||||
if (unassocClientTx == null) {
|
||||
if (other.unassocClientTx != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!unassocClientTx.equals(other.unassocClientTx)) {
|
||||
return false;
|
||||
}
|
||||
if (assocClientRx == null) {
|
||||
if (other.assocClientRx != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!assocClientRx.equals(other.assocClientRx)) {
|
||||
return false;
|
||||
}
|
||||
if (unassocClientRx == null) {
|
||||
if (other.unassocClientRx != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!unassocClientRx.equals(other.unassocClientRx)) {
|
||||
return false;
|
||||
}
|
||||
if (nonWifi == null) {
|
||||
if (other.nonWifi != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!nonWifi.equals(other.nonWifi)) {
|
||||
return false;
|
||||
}
|
||||
if (timestampSeconds == null) {
|
||||
if (other.timestampSeconds != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!timestampSeconds.equals(other.timestampSeconds)) {
|
||||
return false;
|
||||
}
|
||||
if (ibss == null) {
|
||||
if (other.ibss != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!ibss.equals(other.ibss)) {
|
||||
return false;
|
||||
}
|
||||
if (unAvailableCapacity == null) {
|
||||
if (other.unAvailableCapacity != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!unAvailableCapacity.equals(other.unAvailableCapacity)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return Objects.equals(assocClientRx, other.assocClientRx) && Objects.equals(assocClientTx, other.assocClientTx) && Objects.equals(ibss, other.ibss)
|
||||
&& Objects.equals(nonWifi, other.nonWifi) && sourceTimestampMs == other.sourceTimestampMs
|
||||
&& Objects.equals(timestampSeconds, other.timestampSeconds) && Objects.equals(unAvailableCapacity, other.unAvailableCapacity)
|
||||
&& Objects.equals(unassocClientRx, other.unassocClientRx) && Objects.equals(unassocClientTx, other.unassocClientTx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadioUtilization clone() {
|
||||
return (RadioUtilization) super.clone();
|
||||
}
|
||||
|
||||
public void setSourceTimestampMs(long sourceTimestamp) {
|
||||
this.sourceTimestampMs = sourceTimestamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSourceTimestampMs() {
|
||||
return this.sourceTimestampMs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.json.interfaces.HasSourceTimestamp;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.McsStats;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.WmmQueueStats;
|
||||
import com.telecominfraproject.wlan.servicemetric.models.WmmQueueStats.WmmQueueType;
|
||||
@@ -17,7 +19,7 @@ import com.telecominfraproject.wlan.servicemetric.models.WmmQueueStats.WmmQueueT
|
||||
*
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class SsidStatistics extends BaseJsonModel {
|
||||
public class SsidStatistics extends BaseJsonModel implements HasSourceTimestamp {
|
||||
|
||||
private static final long serialVersionUID = 8903368367046455020L;
|
||||
|
||||
@@ -261,6 +263,11 @@ public class SsidStatistics extends BaseJsonModel {
|
||||
private Map<WmmQueueType, WmmQueueStats> wmmQueueStats;
|
||||
|
||||
private List<McsStats> mcsStats;
|
||||
|
||||
/**
|
||||
* Timestamp from the AP source statistics used for this metric
|
||||
*/
|
||||
private long sourceTimestampMs;
|
||||
|
||||
@Override
|
||||
public SsidStatistics clone() {
|
||||
@@ -1091,4 +1098,13 @@ public class SsidStatistics extends BaseJsonModel {
|
||||
public void setWmmQueueStats(Map<WmmQueueType, WmmQueueStats> wmmQueueStats) {
|
||||
this.wmmQueueStats = wmmQueueStats;
|
||||
}
|
||||
|
||||
public void setSourceTimestampMs(long sourceTimestamp) {
|
||||
this.sourceTimestampMs = sourceTimestamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSourceTimestampMs() {
|
||||
return this.sourceTimestampMs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ServiceMetric extends BaseJsonModel implements HasCustomerId, HasEq
|
||||
private long locationId;
|
||||
private long clientMac;
|
||||
private ServiceMetricDataType dataType;
|
||||
private long createdTimestamp;
|
||||
private long createdTimestamp;
|
||||
|
||||
private ServiceMetricDetails details;
|
||||
|
||||
@@ -106,7 +106,7 @@ public class ServiceMetric extends BaseJsonModel implements HasCustomerId, HasEq
|
||||
this.createdTimestamp = createdTimestamp;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public MacAddress getClientMacAddress() {
|
||||
if(clientMac==0) {
|
||||
return null;
|
||||
@@ -175,5 +175,4 @@ public class ServiceMetric extends BaseJsonModel implements HasCustomerId, HasEq
|
||||
return createdTimestamp;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,15 +3,17 @@ package com.telecominfraproject.wlan.servicemetric.models;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.telecominfraproject.wlan.core.model.json.BaseJsonModel;
|
||||
import com.telecominfraproject.wlan.core.model.json.interfaces.HasSourceTimestamp;
|
||||
|
||||
/**
|
||||
* @author dtoptygin
|
||||
*
|
||||
*/
|
||||
public abstract class ServiceMetricDetails extends BaseJsonModel {
|
||||
public abstract class ServiceMetricDetails extends BaseJsonModel implements HasSourceTimestamp {
|
||||
|
||||
private static final long serialVersionUID = 5570757656953699233L;
|
||||
|
||||
private long sourceTimestamp;
|
||||
|
||||
public abstract ServiceMetricDataType getDataType();
|
||||
|
||||
@Override
|
||||
@@ -28,21 +30,30 @@ public abstract class ServiceMetricDetails extends BaseJsonModel {
|
||||
return (ServiceMetricDetails) super.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getDataType());
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceTimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof ServiceMetricDetails)) {
|
||||
return false;
|
||||
}
|
||||
ServiceMetricDetails other = (ServiceMetricDetails) obj;
|
||||
return Objects.equals(getDataType(), other.getDataType());
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ServiceMetricDetails other = (ServiceMetricDetails) obj;
|
||||
return sourceTimestamp == other.sourceTimestamp;
|
||||
}
|
||||
|
||||
public void setSourceTimestampMs(long sourceTimestampMs) {
|
||||
this.sourceTimestamp = sourceTimestampMs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSourceTimestampMs() {
|
||||
return sourceTimestamp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -100,6 +100,11 @@ components:
|
||||
$ref: '#/components/schemas/ServiceMetricDetails'
|
||||
|
||||
ServiceMetricDetails:
|
||||
type: object
|
||||
properties:
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ApNodeMetrics'
|
||||
- $ref: '#/components/schemas/ApSsidMetrics'
|
||||
@@ -108,7 +113,7 @@ components:
|
||||
- $ref: '#/components/schemas/NeighbourScanReports'
|
||||
discriminator:
|
||||
propertyName: model_type
|
||||
|
||||
|
||||
NeighbourScanReports:
|
||||
properties:
|
||||
neighbourReports:
|
||||
@@ -1983,7 +1988,11 @@ components:
|
||||
description: The number of aggregation frames sent using single MPDU (where the A-MPDU contains only one MPDU ).
|
||||
type: integer
|
||||
format: int32
|
||||
|
||||
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
wmmQueueStats:
|
||||
$ref: '#/components/schemas/WmmQueueStatsPerQueueTypeMap'
|
||||
|
||||
@@ -2132,7 +2141,10 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PerProcessUtilization'
|
||||
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
EthernetLinkState:
|
||||
type: string
|
||||
enum:
|
||||
@@ -2178,6 +2190,9 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/DnsProbeMetric'
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
StateUpDownError:
|
||||
type: string
|
||||
@@ -3992,7 +4007,10 @@ components:
|
||||
numRxVHT_3466_8_Mbps:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
ListOfRadioUtilizationPerRadioMap:
|
||||
properties:
|
||||
@@ -4040,6 +4058,9 @@ components:
|
||||
unAvailableCapacity:
|
||||
type: number
|
||||
format: double
|
||||
sourceTimestampMs:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
ListOfMacsPerRadioMap:
|
||||
properties:
|
||||
|
||||
@@ -53,12 +53,6 @@
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>equipment-alarms-sp</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>adoption-metrics-sp</artifactId>
|
||||
<groupId>com.telecominfraproject.wlan</groupId>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
|
||||
package com.telecominfraproject.wlan.status.equipment.models;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.telecominfraproject.wlan.status.models.StatusCode;
|
||||
import com.telecominfraproject.wlan.status.models.StatusDataType;
|
||||
@@ -29,70 +31,29 @@ public class EquipmentAdminStatusData extends StatusDetails {
|
||||
*/
|
||||
private String statusMessage;
|
||||
|
||||
private Map<String, Long> alarmTimestamps;
|
||||
|
||||
private LedStatus ledStatus;
|
||||
|
||||
private Map<String,Long> alarmTimestamps;
|
||||
|
||||
public EquipmentAdminStatusData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatusDataType getStatusDataType() {
|
||||
return StatusDataType.EQUIPMENT_ADMIN;
|
||||
return StatusDataType.EQUIPMENT_ADMIN;
|
||||
}
|
||||
|
||||
|
||||
public EquipmentAdminStatusData(EquipmentAdminStatusData data) {
|
||||
this.statusCode = data.statusCode;
|
||||
this.statusMessage = data.statusMessage;
|
||||
this.alarmTimestamps = data.alarmTimestamps==null?null:new HashMap<>(data.alarmTimestamps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((alarmTimestamps == null) ? 0 : alarmTimestamps.hashCode());
|
||||
result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
|
||||
result = prime * result + ((statusMessage == null) ? 0 : statusMessage.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof EquipmentAdminStatusData)) {
|
||||
return false;
|
||||
}
|
||||
EquipmentAdminStatusData other = (EquipmentAdminStatusData) obj;
|
||||
if (alarmTimestamps == null) {
|
||||
if (other.alarmTimestamps != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!alarmTimestamps.equals(other.alarmTimestamps)) {
|
||||
return false;
|
||||
}
|
||||
if (statusCode != other.statusCode) {
|
||||
return false;
|
||||
}
|
||||
if (statusMessage == null) {
|
||||
if (other.statusMessage != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!statusMessage.equals(other.statusMessage)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
this.alarmTimestamps = data.alarmTimestamps == null ? null : new HashMap<>(data.alarmTimestamps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EquipmentAdminStatusData clone() {
|
||||
EquipmentAdminStatusData res = (EquipmentAdminStatusData) super.clone();
|
||||
if(this.alarmTimestamps != null) {
|
||||
if (this.alarmTimestamps != null) {
|
||||
res.setAlarmTimestamps(new HashMap<>(this.alarmTimestamps));
|
||||
}
|
||||
return res;
|
||||
@@ -121,26 +82,54 @@ public class EquipmentAdminStatusData extends StatusDetails {
|
||||
public void setAlarmTimestamps(Map<String, Long> alarmTimestamps) {
|
||||
this.alarmTimestamps = alarmTimestamps;
|
||||
}
|
||||
|
||||
|
||||
public long findAlarmTimeOrZero(String alarmKey) {
|
||||
return alarmTimestamps==null?0:alarmTimestamps.getOrDefault(alarmKey, 0l);
|
||||
return alarmTimestamps == null ? 0 : alarmTimestamps.getOrDefault(alarmKey, 0l);
|
||||
}
|
||||
|
||||
public void putAlarmTimestamp(String alarmKey, long value) {
|
||||
if(alarmTimestamps == null) {
|
||||
if (alarmTimestamps == null) {
|
||||
alarmTimestamps = new HashMap<>();
|
||||
}
|
||||
alarmTimestamps.put(alarmKey, value);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasUnsupportedValue() {
|
||||
if (super.hasUnsupportedValue()) {
|
||||
return true;
|
||||
}
|
||||
if (StatusCode.isUnsupported(statusCode) ) {
|
||||
if (StatusCode.isUnsupported(statusCode)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public LedStatus getLedStatus() {
|
||||
return ledStatus;
|
||||
}
|
||||
|
||||
public void setLedStatus(LedStatus ledStatus) {
|
||||
this.ledStatus = ledStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(alarmTimestamps, ledStatus, statusCode, statusMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
EquipmentAdminStatusData other = (EquipmentAdminStatusData) obj;
|
||||
return Objects.equals(alarmTimestamps, other.alarmTimestamps) && ledStatus == other.ledStatus && statusCode == other.statusCode
|
||||
&& Objects.equals(statusMessage, other.statusMessage);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ public class EquipmentChannelStatusData extends StatusDetails {
|
||||
private static final long serialVersionUID = 470569467119609438L;
|
||||
|
||||
private Map<RadioType, Integer> channelNumberStatusDataMap = new EnumMap<>(RadioType.class);
|
||||
private Map<RadioType, Integer> txPowerDataMap = new EnumMap<>(RadioType.class);
|
||||
|
||||
|
||||
public EquipmentChannelStatusData()
|
||||
@@ -34,10 +35,18 @@ public class EquipmentChannelStatusData extends StatusDetails {
|
||||
public Map<RadioType, Integer> getChannelNumberStatusDataMap() {
|
||||
return channelNumberStatusDataMap;
|
||||
}
|
||||
|
||||
public Map<RadioType, Integer> getTxPowerDataMap() {
|
||||
return txPowerDataMap;
|
||||
}
|
||||
|
||||
public void setChannelNumberStatusDataMap(Map<RadioType, Integer> channelNumberStatusDataMap) {
|
||||
this.channelNumberStatusDataMap = channelNumberStatusDataMap;
|
||||
}
|
||||
|
||||
public void setTxPowerDataMap(Map<RadioType, Integer> txPowerDataMap) {
|
||||
this.txPowerDataMap = txPowerDataMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EquipmentChannelStatusData clone() {
|
||||
@@ -49,19 +58,33 @@ public class EquipmentChannelStatusData extends StatusDetails {
|
||||
result.channelNumberStatusDataMap.put(k, v);
|
||||
});
|
||||
}
|
||||
|
||||
if (getTxPowerDataMap() != null) {
|
||||
result.setTxPowerDataMap(new EnumMap<>(RadioType.class));
|
||||
|
||||
this.txPowerDataMap.forEach((k, v) -> {
|
||||
result.txPowerDataMap.put(k, v);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
EquipmentChannelStatusData other = (EquipmentChannelStatusData) obj;
|
||||
return Objects.equals(channelNumberStatusDataMap, other.channelNumberStatusDataMap);
|
||||
public int hashCode() {
|
||||
return Objects.hash(channelNumberStatusDataMap, txPowerDataMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(channelNumberStatusDataMap);
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
EquipmentChannelStatusData other = (EquipmentChannelStatusData) obj;
|
||||
return Objects.equals(channelNumberStatusDataMap, other.channelNumberStatusDataMap)
|
||||
&& Objects.equals(txPowerDataMap, other.txPowerDataMap);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
package com.telecominfraproject.wlan.status.equipment.models;
|
||||
|
||||
public enum LedStatus {
|
||||
led_blink, led_off, UNKNOWN,
|
||||
}
|
||||
@@ -197,6 +197,15 @@ components:
|
||||
$ref: '#/components/schemas/StatusCode'
|
||||
statusMessage:
|
||||
type: string
|
||||
ledStatus:
|
||||
$ref: '#/components/schemas/LedStatus'
|
||||
|
||||
LedStatus:
|
||||
type: string
|
||||
enum:
|
||||
- led_blink
|
||||
- led_off
|
||||
- UNKNOWN
|
||||
|
||||
StatusCode:
|
||||
type: string
|
||||
|
||||
@@ -20,6 +20,7 @@ public interface SystemEventServiceInterface {
|
||||
GenericResponse create(SystemEventRecord systemEventRecord);
|
||||
GenericResponse create(List<SystemEventRecord> systemEventRecords);
|
||||
GenericResponse delete(int customerId, long equipmentId, long createdBeforeTimestamp);
|
||||
GenericResponse delete(long createdBeforeTimestamp);
|
||||
|
||||
/**
|
||||
* <br>Retrieves all of the SystemEvent records that are mapped to the provided customerId.
|
||||
|
||||
@@ -44,6 +44,12 @@ public class SystemEventServiceLocal implements SystemEventServiceInterface {
|
||||
LOG.debug("calling systemEventController.delete {} {} {}", customerId, equipmentId, createdBeforeTimestamp);
|
||||
return systemEventController.delete(customerId, equipmentId, createdBeforeTimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericResponse delete(long createdBeforeTimestamp) {
|
||||
LOG.debug("calling systemEventController.delete {}", createdBeforeTimestamp);
|
||||
return systemEventController.delete(createdBeforeTimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PaginationResponse<SystemEventRecord> getForCustomer(long fromTime, long toTime, int customerId,
|
||||
|
||||
@@ -150,7 +150,22 @@ public class SystemEventServiceRemote extends BaseRemoteClient implements System
|
||||
LOG.debug("completed systemEventRecord.delete {} {} {}", customerId, equipmentId, createdBeforeTimestamp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericResponse delete(long createdBeforeTimestamp) {
|
||||
LOG.debug("calling systemEventRecord.delete {}", createdBeforeTimestamp);
|
||||
|
||||
ResponseEntity<GenericResponse> responseEntity = restTemplate.exchange(
|
||||
getBaseUrl()
|
||||
+"/delete?createdBeforeTimestamp={createdBeforeTimestamp}",
|
||||
HttpMethod.DELETE, null, GenericResponse.class, createdBeforeTimestamp);
|
||||
|
||||
GenericResponse ret = responseEntity.getBody();
|
||||
LOG.debug("completed systemEventRecords.delete {}", createdBeforeTimestamp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public String getBaseUrl() {
|
||||
if(baseUrl==null) {
|
||||
|
||||
@@ -157,4 +157,21 @@ public class SystemEventController {
|
||||
|
||||
return new GenericResponse(true, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes SystemEventRecord records before a given time stamp
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value="/delete", method=RequestMethod.DELETE)
|
||||
public GenericResponse delete(@RequestParam long createdBeforeTimestamp) {
|
||||
|
||||
LOG.debug("Deleting SystemEventRecords created before {}", createdBeforeTimestamp);
|
||||
|
||||
systemEventDatastore.delete(createdBeforeTimestamp);
|
||||
|
||||
LOG.debug("Deleted SystemEventRecords created before {}", createdBeforeTimestamp);
|
||||
|
||||
return new GenericResponse(true, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2864,6 +2864,9 @@ components:
|
||||
sharedSecret:
|
||||
type: string
|
||||
format: password
|
||||
dynamicDiscovery:
|
||||
description: Dynamic discovery of HSP and IdPs (home service and identity providers). Regardless of configured value, this will only be set 'true' on the AP if useRadSec is also true.
|
||||
type: boolean
|
||||
example:
|
||||
model_type: RadiusProxyConfiguration
|
||||
caCert:
|
||||
@@ -3169,6 +3172,14 @@ components:
|
||||
- wpa2OnlyPSK
|
||||
- wpa2OnlyRadius
|
||||
- wep
|
||||
- wpaEAP
|
||||
- wpa2EAP
|
||||
- wpa2OnlyEAP
|
||||
- wpa3OnlySAE
|
||||
- wpa3MixedSAE
|
||||
- wpa3OnlyEAP
|
||||
- wpa3MixedEAP
|
||||
- wpa3OnlyEAP192
|
||||
|
||||
RadioBasedSsidConfigurationMap:
|
||||
properties:
|
||||
@@ -3463,6 +3474,15 @@ components:
|
||||
$ref: '#/components/schemas/StatusCode'
|
||||
statusMessage:
|
||||
type: string
|
||||
ledStatus:
|
||||
$ref: '#/components/schemas/LedStatus'
|
||||
|
||||
LedStatus:
|
||||
type: string
|
||||
enum:
|
||||
- led_blink
|
||||
- led_off
|
||||
- UNKNOWN
|
||||
|
||||
StatusCode:
|
||||
type: string
|
||||
@@ -4398,6 +4418,8 @@ components:
|
||||
- RADIO_CHANNEL
|
||||
channelNumberStatusDataMap:
|
||||
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
|
||||
txPowerDataMap:
|
||||
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
|
||||
|
||||
#
|
||||
# Equipment configuration data models
|
||||
@@ -4507,6 +4529,8 @@ components:
|
||||
type: boolean
|
||||
forwardMode:
|
||||
$ref: '#/components/schemas/NetworkForwardMode'
|
||||
blinkAllLEDs:
|
||||
type: boolean
|
||||
radioMap:
|
||||
$ref: '#/components/schemas/RadioMap'
|
||||
advancedRadioMap:
|
||||
|
||||
Reference in New Issue
Block a user