Compare commits

...

8 Commits

Author SHA1 Message Date
Mike Hansen
a66ac7ff8a WIFI-1732: Acct-Interim-Interval config not working when configured from radius 2021-03-23 16:12:49 -04:00
Mike Hansen
beb9692bf5 WIFI-1808: AP-NOS Passpoint : Access type and internet value is not getting set Interworking element in Beacon for passpoint SSID
Change qosMapSet to List instead of Set as duplicate values allowed
2021-03-18 20:36:56 -04:00
AkshayJagadish-ne
bf445ba787 Merge pull request #89 from Telecominfraproject/WIFI-1669
WIFI-1669: Propagations
2021-03-10 17:07:44 -05:00
Akshay Jagadish
88de7ebee1 Propagated WIFI-1729 2021-03-10 17:04:23 -05:00
Akshay Jagadish
373a146105 WIFI-1669: Propagations
WIFI-1616
WIFI-1681
WIFI-1687
WIFI-1358
WIFI-1658
WIFI-1641
2021-03-09 17:02:21 -05:00
tomrcurrie
763183e8a1 Propogate WIFI-1440 fix to release branch (#85)
* Fix setter method to use actual provided value for radiusAcountingServiceInterval instead of default min value of 60.

* Make constants BANDWIDTH_LIMIT_MAX, RADIUS_ACCOUNTING_SERVICE_INTERVAL_MIN, RADIUS_ACCOUNTING_SERVICE_INTERVAL_MAX, MAX_SSID_LENGTH configurable via system properties

* WIFI-1616 SSID character length too long causes AP to not pull configuration (#79)

* Add validator for ClientSession, add ssid length check to validator.

* Add null check for ClientSessionDetaiks.Ssid in the validator

* Add some null checking for ClientSession. Undo auto formatting changes (hopefully)

* add ssid length validation to Profile provisioning. Improved exception and error behaviour for ssid error scenarios by using a RuntimeException and logger.

* remove ssid length validator from client session controller

* remove  duplicate variable 'MAX_SSID_LENGTH' from cherry-picked commits
2021-03-03 17:26:37 -05:00
AkshayJagadish-ne
fdc12b641d Merge pull request #80 from Telecominfraproject/WIFI-1669
WIFI:1669 TIP 1.0 Update SDK components in release 1.0 branch
2021-02-27 22:05:38 -05:00
Akshay Jagadish
8b25a31db4 WIFI:1669 TIP 1.0 Update SDK components in release 1.0 branch 2021-02-26 18:16:52 -05:00
225 changed files with 2748 additions and 2479 deletions

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,19 +15,19 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-datastore-inmemory</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-exceptions</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc-tests</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>adoption-metrics-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>adoption-metrics-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,13 +16,13 @@
<dependency>
<artifactId>adoption-metrics-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,41 +15,41 @@
<dependency>
<artifactId>adoption-metrics-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-client</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Dependencies for the unit tests -->
<dependency>
<artifactId>base-remote-tests</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>adoption-metrics-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>adoption-metrics-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,29 +15,29 @@
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-datastore-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -45,7 +45,7 @@
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,25 +15,25 @@
<dependency>
<artifactId>base-stream-consumer</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-cassandra</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-cassandra-tests</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -36,6 +36,7 @@ import com.telecominfraproject.wlan.alarm.models.AlarmCounts;
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.server.cassandra.CassandraUtils;
import com.telecominfraproject.wlan.core.server.cassandra.RowMapper;
import com.telecominfraproject.wlan.datastore.exceptions.DsConcurrentModificationException;
import com.telecominfraproject.wlan.datastore.exceptions.DsEntityNotFoundException;
@@ -154,6 +155,18 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
private static final String CQL_COUNTS_BY_EQUIPMENT_AND_ALARM_CODE_HEADER = "select equipmentId, alarmCode, count(1) from alarm where customerId = ? ";
private static final String CQL_COUNTS_BY_EQUIPMENT_AND_ALARM_CODE_FOOTER = " group by equipmentId, alarmCode";
private static final String CQL_INSERT_INTO_BY_ACKNOWLEDGED_TABLE = "insert into alarm_by_acknowledged(customerId, equipmentId, alarmCode, createdTimestamp, acknowledged) values ( ?, ?, ?, ?, ?) ";
private static final String CQL_DELETE_FROM_BY_ACKNOWLEDGED_TABLE = "delete from alarm_by_acknowledged where customerId = ? and equipmentId = ? and alarmCode = ? and createdTimestamp = ? and acknowledged = ? ";
private static final String CQL_INSERT_INTO_BY_ACKNOWLEDGED_EQUIPMENTID_TABLE = "insert into alarm_by_acknowledged_equipmentId(customerId, equipmentId, alarmCode, createdTimestamp, acknowledged) values ( ?, ?, ?, ?, ?) ";
private static final String CQL_DELETE_FROM_BY_ACKNOWLEDGED_EQUIPMENTID_TABLE = "delete from alarm_by_acknowledged_equipmentId where customerId = ? and equipmentId = ? and alarmCode = ? and createdTimestamp = ? and acknowledged = ? ";
private static final String CQL_INSERT_INTO_BY_ACKNOWLEDGED_ALARMCODE_TABLE = "insert into alarm_by_acknowledged_alarmCode(customerId, equipmentId, alarmCode, createdTimestamp, acknowledged) values ( ?, ?, ?, ?, ?) ";
private static final String CQL_DELETE_FROM_BY_ACKNOWLEDGED_ALARMCODE_TABLE = "delete from alarm_by_acknowledged_alarmCode where customerId = ? and equipmentId = ? and alarmCode = ? and createdTimestamp = ? and acknowledged = ? ";
private static final String CQL_INSERT_INTO_BY_ACKNOWLEDGED_TIMESTAMP_TABLE = "insert into alarm_by_acknowledged_timestamp(customerId, equipmentId, alarmCode, createdTimestamp, acknowledged) values ( ?, ?, ?, ?, ?) ";
private static final String CQL_DELETE_FROM_BY_ACKNOWLEDGED_TIMESTAMP_TABLE = "delete from alarm_by_acknowledged_timestamp where customerId = ? and equipmentId = ? and alarmCode = ? and createdTimestamp = ? and acknowledged = ? ";
//Cassandra has a difficulty running this:
// message="Group by currently only support groups of columns following their declared order in the PRIMARY KEY"
//private static final String CQL_COUNTS_BY_ALARM_CODE_HEADER = "select alarmCode, count(1) from alarm where customerId = ? ";
@@ -193,7 +206,18 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
private PreparedStatement preparedStmt_updateAlarmCountByEquipment;
private PreparedStatement preparedStmt_updateAlarmCountByCustomer;
private PreparedStatement preparedStmt_insertIntoAlarmByAcknowledged;
private PreparedStatement preparedStmt_deleteFromAlarmByAcknowledged;
private PreparedStatement preparedStmt_insertIntoAlarmByAcknowledgedEquipmentId;
private PreparedStatement preparedStmt_deleteFromAlarmByAcknowledgedEquipmentId;
private PreparedStatement preparedStmt_insertIntoAlarmByAcknowledgedAlarmCode;
private PreparedStatement preparedStmt_deleteFromAlarmByAcknowledgedAlarmCode;
private PreparedStatement preparedStmt_insertIntoAlarmByAcknowledgedTimestamp;
private PreparedStatement preparedStmt_deleteFromAlarmByAcknowledgedTimestamp;
@PostConstruct
private void postConstruct(){
@@ -211,6 +235,18 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
preparedStmt_updateAlarmCountByEquipment = cqlSession.prepare(CQL_UPDATE_EQUIPMENT_ALARM_COUNT);
preparedStmt_updateAlarmCountByCustomer= cqlSession.prepare(CQL_UPDATE_CUSTOMER_ALARM_COUNT);
preparedStmt_insertIntoAlarmByAcknowledged = cqlSession.prepare(CQL_INSERT_INTO_BY_ACKNOWLEDGED_TABLE);
preparedStmt_deleteFromAlarmByAcknowledged = cqlSession.prepare(CQL_DELETE_FROM_BY_ACKNOWLEDGED_TABLE);
preparedStmt_insertIntoAlarmByAcknowledgedEquipmentId = cqlSession.prepare(CQL_INSERT_INTO_BY_ACKNOWLEDGED_EQUIPMENTID_TABLE);
preparedStmt_deleteFromAlarmByAcknowledgedEquipmentId = cqlSession.prepare(CQL_DELETE_FROM_BY_ACKNOWLEDGED_EQUIPMENTID_TABLE);
preparedStmt_insertIntoAlarmByAcknowledgedAlarmCode = cqlSession.prepare(CQL_INSERT_INTO_BY_ACKNOWLEDGED_ALARMCODE_TABLE);
preparedStmt_deleteFromAlarmByAcknowledgedAlarmCode = cqlSession.prepare(CQL_DELETE_FROM_BY_ACKNOWLEDGED_ALARMCODE_TABLE);
preparedStmt_insertIntoAlarmByAcknowledgedTimestamp = cqlSession.prepare(CQL_INSERT_INTO_BY_ACKNOWLEDGED_TIMESTAMP_TABLE);
preparedStmt_deleteFromAlarmByAcknowledgedTimestamp = cqlSession.prepare(CQL_DELETE_FROM_BY_ACKNOWLEDGED_TIMESTAMP_TABLE);
}
@@ -256,6 +292,39 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
alarm.getCustomerId(),
alarm.getAlarmCode().getId()
));
//insert entry into acknowledged tables
cqlSession.execute(preparedStmt_insertIntoAlarmByAcknowledged.bind(
alarm.getCustomerId(),
alarm.getEquipmentId(),
alarm.getAlarmCode().getId(),
alarm.getCreatedTimestamp(),
alarm.isAcknowledged()
));
cqlSession.execute(preparedStmt_insertIntoAlarmByAcknowledgedEquipmentId.bind(
alarm.getCustomerId(),
alarm.getEquipmentId(),
alarm.getAlarmCode().getId(),
alarm.getCreatedTimestamp(),
alarm.isAcknowledged()
));
cqlSession.execute(preparedStmt_insertIntoAlarmByAcknowledgedAlarmCode.bind(
alarm.getCustomerId(),
alarm.getEquipmentId(),
alarm.getAlarmCode().getId(),
alarm.getCreatedTimestamp(),
alarm.isAcknowledged()
));
cqlSession.execute(preparedStmt_insertIntoAlarmByAcknowledgedTimestamp.bind(
alarm.getCustomerId(),
alarm.getEquipmentId(),
alarm.getAlarmCode().getId(),
alarm.getCreatedTimestamp(),
alarm.isAcknowledged()
));
return alarm.clone();
}
@@ -309,6 +378,8 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
@Override
public Alarm update(Alarm alarm) {
Alarm original = getOrNull(alarm.getCustomerId(), alarm.getEquipmentId(), alarm.getAlarmCode(), alarm.getCreatedTimestamp());
long newLastModifiedTs = System.currentTimeMillis();
long incomingLastModifiedTs = alarm.getLastModifiedTimestamp();
@@ -378,6 +449,78 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
}
}
// if the acknowledged boolean value has been updated (typically false -> true, but opposite could happen too)
// then we need to update the values in the supporting acknowledged tables as well.
// Since they are part of the primary key to properly filter, we cannot simply update the acknowledged value in these tables.
// We need to delete those rows (in acknowledged tables) and recreate them with the new acknowledged value (in alarm)
if (original.isAcknowledged() != alarm.isAcknowledged()) {
//delete entry into acknowledged tables
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledged.bind(
original.getCustomerId(),
original.getEquipmentId(),
original.getAlarmCode().getId(),
original.getCreatedTimestamp(),
original.isAcknowledged()
));
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledgedEquipmentId.bind(
original.getCustomerId(),
original.getEquipmentId(),
original.getAlarmCode().getId(),
original.getCreatedTimestamp(),
original.isAcknowledged()
));
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledgedAlarmCode.bind(
original.getCustomerId(),
original.getEquipmentId(),
original.getAlarmCode().getId(),
original.getCreatedTimestamp(),
original.isAcknowledged()
));
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledgedTimestamp.bind(
original.getCustomerId(),
original.getEquipmentId(),
original.getAlarmCode().getId(),
original.getCreatedTimestamp(),
original.isAcknowledged()
));
// recreate rows in supporting acknowledged tables with the new acknowledged value
cqlSession.execute(preparedStmt_insertIntoAlarmByAcknowledged.bind(
alarm.getCustomerId(),
alarm.getEquipmentId(),
alarm.getAlarmCode().getId(),
alarm.getCreatedTimestamp(),
alarm.isAcknowledged()
));
cqlSession.execute(preparedStmt_insertIntoAlarmByAcknowledgedEquipmentId.bind(
alarm.getCustomerId(),
alarm.getEquipmentId(),
alarm.getAlarmCode().getId(),
alarm.getCreatedTimestamp(),
alarm.isAcknowledged()
));
cqlSession.execute(preparedStmt_insertIntoAlarmByAcknowledgedAlarmCode.bind(
alarm.getCustomerId(),
alarm.getEquipmentId(),
alarm.getAlarmCode().getId(),
alarm.getCreatedTimestamp(),
alarm.isAcknowledged()
));
cqlSession.execute(preparedStmt_insertIntoAlarmByAcknowledgedTimestamp.bind(
alarm.getCustomerId(),
alarm.getEquipmentId(),
alarm.getAlarmCode().getId(),
alarm.getCreatedTimestamp(),
alarm.isAcknowledged()
));
}
//make a copy so that we don't accidentally update caller's version by reference
Alarm alarmCopy = alarm.clone();
@@ -410,6 +553,39 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
ret.getCustomerId(),
ret.getAlarmCode().getId()
));
//delete entry into acknowledged tables
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledged.bind(
ret.getCustomerId(),
ret.getEquipmentId(),
ret.getAlarmCode().getId(),
ret.getCreatedTimestamp(),
ret.isAcknowledged()
));
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledgedEquipmentId.bind(
ret.getCustomerId(),
ret.getEquipmentId(),
ret.getAlarmCode().getId(),
ret.getCreatedTimestamp(),
ret.isAcknowledged()
));
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledgedAlarmCode.bind(
ret.getCustomerId(),
ret.getEquipmentId(),
ret.getAlarmCode().getId(),
ret.getCreatedTimestamp(),
ret.isAcknowledged()
));
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledgedTimestamp.bind(
ret.getCustomerId(),
ret.getEquipmentId(),
ret.getAlarmCode().getId(),
ret.getCreatedTimestamp(),
ret.isAcknowledged()
));
return ret;
}
@@ -435,7 +611,40 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
cqlSession.execute(preparedStmt_decrementAlarmCountByCustomer.bind(
al.getCustomerId(),
al.getAlarmCode().getId()
));
));
//delete entry into acknowledged tables
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledged.bind(
al.getCustomerId(),
al.getEquipmentId(),
al.getAlarmCode().getId(),
al.getCreatedTimestamp(),
al.isAcknowledged()
));
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledgedEquipmentId.bind(
al.getCustomerId(),
al.getEquipmentId(),
al.getAlarmCode().getId(),
al.getCreatedTimestamp(),
al.isAcknowledged()
));
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledgedAlarmCode.bind(
al.getCustomerId(),
al.getEquipmentId(),
al.getAlarmCode().getId(),
al.getCreatedTimestamp(),
al.isAcknowledged()
));
cqlSession.execute(preparedStmt_deleteFromAlarmByAcknowledgedTimestamp.bind(
al.getCustomerId(),
al.getEquipmentId(),
al.getAlarmCode().getId(),
al.getCreatedTimestamp(),
al.isAcknowledged()
));
});
@@ -651,11 +860,12 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
return ret;
}
private static enum FilterOptions{ customer_only, customer_and_equipment, customer_and_alarmCode, customer_and_timestamp, customer_and_acknowledged }
@Override
public PaginationResponse<Alarm> getForCustomer(int customerId, Set<Long> equipmentIds,
Set<AlarmCode> alarmCodes, long createdAfterTimestamp, List<ColumnAndSort> sortBy,
Set<AlarmCode> alarmCodes, long createdAfterTimestamp, Boolean acknowledged, List<ColumnAndSort> sortBy,
PaginationContext<Alarm> context) {
PaginationResponse<Alarm> ret = new PaginationResponse<>();
ret.setContext(context.clone());
@@ -671,7 +881,8 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
LOG.debug("Looking up Alarms for customer {} with last returned page number {}",
customerId, context.getLastReturnedPageNumber());
String query = CQL_GET_BY_CUSTOMER_ID;
String query_head = CQL_GET_BY_CUSTOMER_ID;
String query = "";
if((alarmCodes==null || alarmCodes.isEmpty()) && createdAfterTimestamp>0) {
//if alarm codes not specified (means all) - explicitly list all of them, otherwise the following exception if thrown:
@@ -680,6 +891,8 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
alarmCodes = new HashSet<>(Arrays.asList(AlarmCode.validValues()));
}
FilterOptions filterOptions = FilterOptions.customer_only;
// add filters for the query
ArrayList<Object> queryArgs = new ArrayList<>();
queryArgs.add(customerId);
@@ -688,39 +901,52 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
if (equipmentIds != null && !equipmentIds.isEmpty()) {
queryArgs.addAll(equipmentIds);
StringBuilder strb = new StringBuilder(100);
strb.append("and equipmentId in (");
for (int i = 0; i < equipmentIds.size(); i++) {
strb.append("?");
if (i < equipmentIds.size() - 1) {
strb.append(",");
}
}
strb.append(") ");
query += " and equipmentId in" + CassandraUtils.getBindPlaceholders(equipmentIds);
query += strb.toString();
filterOptions = FilterOptions.customer_and_equipment;
}
//add alarmCodes filters
if (alarmCodes != null && !alarmCodes.isEmpty()) {
alarmCodes.forEach(ac -> queryArgs.add(ac.getId()));
StringBuilder strb = new StringBuilder(100);
strb.append("and alarmCode in (");
for (int i = 0; i < alarmCodes.size(); i++) {
strb.append("?");
if (i < alarmCodes.size() - 1) {
strb.append(",");
}
}
strb.append(") ");
query += " and alarmCode in" + CassandraUtils.getBindPlaceholders(alarmCodes);
query += strb.toString();
filterOptions = FilterOptions.customer_and_alarmCode;
}
if(createdAfterTimestamp > 0) {
query += " and createdTimestamp > ?" ;
queryArgs.add(createdAfterTimestamp);
filterOptions = FilterOptions.customer_and_timestamp;
}
if (acknowledged != null) {
queryArgs.clear();
queryArgs.add(customerId);
queryArgs.add(acknowledged);
query_head = "select customerId, equipmentId, alarmCode, createdTimestamp from alarm_by_acknowledged where customerId = ? ";
if (equipmentIds != null && !equipmentIds.isEmpty()) {
query_head = "select customerId, equipmentId, alarmCode, createdTimestamp from alarm_by_acknowledged_equipmentId where customerId = ? ";
queryArgs.addAll(equipmentIds);
}
if (alarmCodes != null && !alarmCodes.isEmpty()) {
query_head = "select customerId, equipmentId, alarmCode, createdTimestamp from alarm_by_acknowledged_alarmCode where customerId = ? ";
alarmCodes.forEach(ac -> queryArgs.add(ac.getId()));
}
if (createdAfterTimestamp > 0) {
query_head = "select customerId, equipmentId, alarmCode, createdTimestamp from alarm_by_acknowledged_timestamp where customerId = ? ";
queryArgs.add(createdAfterTimestamp);
if (equipmentIds != null && !equipmentIds.isEmpty()) {
query_head = "select customerId, equipmentId, alarmCode, createdTimestamp from alarm_by_acknowledged where customerId = ? ";
}
}
query = " and acknowledged = ? " + query;
filterOptions = FilterOptions.customer_and_acknowledged;
}
// add sorting options for the query
@@ -734,7 +960,7 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
//TODO: create a cache of these prepared statements, keyed by the numberOfEquipmentIds_numberOfAlarmCodes
PreparedStatement preparedStmt_getPageForCustomer;
try {
preparedStmt_getPageForCustomer = cqlSession.prepare(query);
preparedStmt_getPageForCustomer = cqlSession.prepare(query_head + query);
} catch(InvalidQueryException e) {
LOG.error("Cannot prepare cassandra query '{}'", query, e);
throw e;
@@ -755,10 +981,30 @@ public class AlarmDatastoreCassandra implements AlarmDatastore {
List<Alarm> pageItems = new ArrayList<>();
// iterate through the current page
while (rs.getAvailableWithoutFetching() > 0) {
pageItems.add(alarmRowMapper.mapRow(rs.one()));
switch(filterOptions) {
case customer_only:
case customer_and_equipment:
case customer_and_alarmCode:
case customer_and_timestamp:
// iterate through the current page
while (rs.getAvailableWithoutFetching() > 0) {
pageItems.add(alarmRowMapper.mapRow(rs.one()));
}
break;
case customer_and_acknowledged:
while (rs.getAvailableWithoutFetching() > 0) {
Row row = rs.one();
long equipmentIdPostQuery = row.getLong("equipmentId");
int alarmCodePostQuery = row.getInt("alarmCode");
long createdTimestampPostQuery = row.getLong("createdTimestamp");
pageItems.add(getOrNull(customerId, equipmentIdPostQuery, AlarmCode.getById(alarmCodePostQuery), createdTimestampPostQuery));
}
break;
default:
LOG.warn("Unknown filter option:", filterOptions);
throw new IllegalArgumentException("Unknown filter option " + filterOptions);
}
if (pageItems.isEmpty()) {
LOG.debug("Cannot find Alarms for customer {} with last returned page number {}",

View File

@@ -20,6 +20,54 @@ CREATE TABLE IF NOT EXISTS tip_wlan_keyspace.alarm (
-- this is needed to support retrieval of all alarms for a customer
CREATE INDEX IF NOT EXISTS idx_alarm_customerId ON tip_wlan_keyspace.alarm (customerId);
CREATE TABLE IF NOT EXISTS tip_wlan_keyspace.alarm_by_acknowledged (
customerId int,
equipmentId bigint,
alarmCode int,
createdTimestamp bigint,
acknowledged boolean,
PRIMARY KEY ((customerId, acknowledged), equipmentId, alarmCode, createdTimestamp)
) WITH comment='Index Table to look up alarms by acknowledged used by TIP WLAN CloudSDK';
CREATE TABLE IF NOT EXISTS tip_wlan_keyspace.alarm_by_acknowledged_equipmentId (
customerId int,
equipmentId bigint,
alarmCode int,
createdTimestamp bigint,
acknowledged boolean,
PRIMARY KEY ((customerId, acknowledged, equipmentId), alarmCode, createdTimestamp)
) WITH comment='Index Table to look up alarms by acknowledged and equipmentId used by TIP WLAN CloudSDK';
CREATE TABLE IF NOT EXISTS tip_wlan_keyspace.alarm_by_acknowledged_alarmCode (
customerId int,
equipmentId bigint,
alarmCode int,
createdTimestamp bigint,
acknowledged boolean,
PRIMARY KEY ((customerId, acknowledged, alarmCode), equipmentId, createdTimestamp)
) WITH comment='Index Table to look up alarms by acknowledged and alarmCode used by TIP WLAN CloudSDK';
CREATE TABLE IF NOT EXISTS tip_wlan_keyspace.alarm_by_acknowledged_timestamp (
customerId int,
equipmentId bigint,
alarmCode int,
createdTimestamp bigint,
acknowledged boolean,
PRIMARY KEY ((customerId, acknowledged), alarmCode, createdTimestamp, equipmentId)
) WITH comment='Index Table to look up alarms by acknowledged and createdTimestamp used by TIP WLAN CloudSDK';
/*
# COPY tip_wlan_keyspace.alarm(customerId, equipmentId, alarmCode, createdTimestamp, acknowledged) TO 'alarmToAcknowledgedTable.csv';
# COPY tip_wlan_keyspace.alarm_by_acknowledged(customerId, equipmentId, alarmCode, createdTimestamp, acknowledged) FROM 'alarmToAcknowledgedTable.csv';
# COPY tip_wlan_keyspace.alarm_by_acknowledged_equipmentId(customerId, equipmentId, alarmCode, createdTimestamp, acknowledged) FROM 'alarmToAcknowledgedTable.csv';
# COPY tip_wlan_keyspace.alarm_by_acknowledged_alarmCode(customerId, equipmentId, alarmCode, createdTimestamp, acknowledged) FROM 'alarmToAcknowledgedTable.csv';
# COPY tip_wlan_keyspace.alarm_by_acknowledged_timestamp(customerId, equipmentId, alarmCode, createdTimestamp, acknowledged) FROM 'alarmToAcknowledgedTable.csv';
*/
/*
# Experiment with a separate alarm_counts table because raw alarms table generates warnings like these:
# Query '[5 values] select equipmentId, alarmCode, count(1) from alarm where customerId = ? and equipmentId in (?,?,?,?) group by equipmentId, alarmCode [customerid=2, equipmentid=4, equipmentid=6, equipmentid=8, equipmentid=10]' generated server side warning(s): Aggregation query used on multiple partition keys (IN restriction)

View File

@@ -28,12 +28,12 @@ public class AlarmDatastoreCassandraTests extends BaseAlarmDatastoreTest {
@Override
protected List<String> getAlarmPagination_expectedPage3Strings(){
//in cassandra the sort order is weird but consistent - although it may change on the cassandra server restart
return Arrays.asList(new String[]{"qr_6", "qr_2", "qr_26", "qr_43", "qr_41", "qr_3", "qr_49", "qr_40", "qr_24", "qr_28" });
return Arrays.asList(new String[]{"qr_9", "qr_40", "qr_3", "qr_32", "qr_31", "qr_2", "qr_39", "qr_35", "qr_38", "qr_48" });
}
@Override
protected List<String> getAlarmPagination_expectedPage1EmptySortStrings() {
return Arrays.asList(new String[]{"qr_17", "qr_14", "qr_9", "qr_38", "qr_18", "qr_30", "qr_0", "qr_7", "qr_25", "qr_19" });
return Arrays.asList(new String[]{"qr_28", "qr_21", "qr_46", "qr_20", "qr_22", "qr_15", "qr_49", "qr_45", "qr_43", "qr_42" });
}
@Override

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -223,6 +223,11 @@ public abstract class BaseAlarmDatastoreTest {
mdl.setCreatedTimestamp(mdl.getCreatedTimestamp() - 10000);
pastTimestamp = mdl.getCreatedTimestamp();
}
if (i < 20) {
mdl.setAcknowledged(true);
} else {
mdl.setAcknowledged(false);
}
apNameIdx++;
testInterface.create(mdl);
@@ -246,13 +251,13 @@ public abstract class BaseAlarmDatastoreTest {
//get active alarms for all equipment and all alarmCodes for the customer since the beginning of time
PaginationContext<Alarm> context = new PaginationContext<>(10);
PaginationResponse<Alarm> page1 = testInterface.getForCustomer(customerId_1, null, null, -1, sortBy, context);
PaginationResponse<Alarm> page2 = testInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page1.getContext());
PaginationResponse<Alarm> page3 = testInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page2.getContext());
PaginationResponse<Alarm> page4 = testInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page3.getContext());
PaginationResponse<Alarm> page5 = testInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page4.getContext());
PaginationResponse<Alarm> page6 = testInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page5.getContext());
PaginationResponse<Alarm> page7 = testInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page6.getContext());
PaginationResponse<Alarm> page1 = testInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, context);
PaginationResponse<Alarm> page2 = testInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page1.getContext());
PaginationResponse<Alarm> page3 = testInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page2.getContext());
PaginationResponse<Alarm> page4 = testInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page3.getContext());
PaginationResponse<Alarm> page5 = testInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page4.getContext());
PaginationResponse<Alarm> page6 = testInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page5.getContext());
PaginationResponse<Alarm> page7 = testInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page6.getContext());
//verify returned pages
assertEquals(10, page1.getItems().size());
@@ -285,9 +290,99 @@ public abstract class BaseAlarmDatastoreTest {
assertEquals(expectedPage3Strings, actualPage3Strings);
// testing Acknowledged filter (alarm_by_acknowledged)
PaginationResponse<Alarm> page1Acknowledged = testInterface.getForCustomer(customerId_1, null, null, -1, true, sortBy, context);
PaginationResponse<Alarm> page2Acknowledged = testInterface.getForCustomer(customerId_1, null, null, -1, true, sortBy, page1Acknowledged.getContext());
PaginationResponse<Alarm> page3Acknowledged = testInterface.getForCustomer(customerId_1, null, null, -1, true, sortBy, page2Acknowledged.getContext());
PaginationResponse<Alarm> page4Acknowledged = testInterface.getForCustomer(customerId_1, null, null, -1, true, sortBy, page3Acknowledged.getContext());
//verify returned pages
assertEquals(10, page1Acknowledged.getItems().size());
assertEquals(10, page2Acknowledged.getItems().size());
assertEquals(0, page3Acknowledged.getItems().size());
assertEquals(0, page4Acknowledged.getItems().size());
// testing Acknowledged filter with equipmentIds (alarm_by_acknowledged_equipmentId)
PaginationResponse<Alarm> page1AcknowledgedAndEquipment = testInterface.getForCustomer(customerId_1, equipmentIds, null, -1, true, sortBy, context);
PaginationResponse<Alarm> page2AcknowledgedAndEquipment = testInterface.getForCustomer(customerId_1, equipmentIds, null, -1, true, sortBy, page1AcknowledgedAndEquipment.getContext());
PaginationResponse<Alarm> page3AcknowledgedAndEquipment = testInterface.getForCustomer(customerId_1, equipmentIds, null, -1, true, sortBy, page2AcknowledgedAndEquipment.getContext());
PaginationResponse<Alarm> page4AcknowledgedAndEquipment = testInterface.getForCustomer(customerId_1, equipmentIds, null, -1, true, sortBy, page3AcknowledgedAndEquipment.getContext());
page1AcknowledgedAndEquipment.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page2AcknowledgedAndEquipment.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page1AcknowledgedAndEquipment.getItems().forEach(e -> assertTrue(equipmentIds.contains(e.getEquipmentId())));
page2AcknowledgedAndEquipment.getItems().forEach(e -> assertTrue(equipmentIds.contains(e.getEquipmentId())));
assertTrue(page3AcknowledgedAndEquipment.getContext().isLastPage());
assertTrue(page4AcknowledgedAndEquipment.getContext().isLastPage());
// testing Acknowledged filter with alarmCodes (alarm_by_acknowledged_alarmCode)
PaginationResponse<Alarm> page1AcknowledgedAndAlarmCode = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, -1, true, sortBy, context);
PaginationResponse<Alarm> page2AcknowledgedAndAlarmCode = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, -1, true, sortBy, page1AcknowledgedAndAlarmCode.getContext());
PaginationResponse<Alarm> page3AcknowledgedAndAlarmCode = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, -1, true, sortBy, page2AcknowledgedAndAlarmCode.getContext());
PaginationResponse<Alarm> page4AcknowledgedAndAlarmCode = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, -1, true, sortBy, page3AcknowledgedAndAlarmCode.getContext());
page1AcknowledgedAndAlarmCode.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page2AcknowledgedAndAlarmCode.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page1AcknowledgedAndAlarmCode.getItems().forEach(e -> assertEquals(AlarmCode.AccessPointIsUnreachable, e.getAlarmCode()));
page2AcknowledgedAndAlarmCode.getItems().forEach(e -> assertEquals(AlarmCode.AccessPointIsUnreachable, e.getAlarmCode()));
assertTrue(page3AcknowledgedAndAlarmCode.getContext().isLastPage());
assertTrue(page4AcknowledgedAndAlarmCode.getContext().isLastPage());
// testing Acknowledged filter with failure alarm code (no alarms initialized with failure code, should return empty page)
PaginationResponse<Alarm> page1AcknowledgedAndAlarmCodeFailure = testInterface.getForCustomer(customerId_1, equipmentIds, Collections.singleton(AlarmCode.AssocFailure), -1, true, sortBy, context);
assertTrue(page1AcknowledgedAndAlarmCodeFailure.getContext().isLastPage());
long checkTimestamp = pastTimestamp;
// testing Acknowledged filter with timestamp (alarm_by_acknowledged_timestamp)
PaginationResponse<Alarm> page1AcknowledgedAndTimestamp = testInterface.getForCustomer(customerId_1, null, null, pastTimestamp, true, sortBy, context);
PaginationResponse<Alarm> page2AcknowledgedAndTimestamp = testInterface.getForCustomer(customerId_1, null, null, pastTimestamp, true, sortBy, page1AcknowledgedAndTimestamp.getContext());
PaginationResponse<Alarm> page3AcknowledgedAndTimestamp = testInterface.getForCustomer(customerId_1, null, null, pastTimestamp, true, sortBy, page2AcknowledgedAndTimestamp.getContext());
PaginationResponse<Alarm> page4AcknowledgedAndTimestamp = testInterface.getForCustomer(customerId_1, null, null, pastTimestamp, true, sortBy, page3AcknowledgedAndTimestamp.getContext());
assertEquals(10, page1AcknowledgedAndTimestamp.getItems().size());
assertEquals(9, page2AcknowledgedAndTimestamp.getItems().size());
assertEquals(0, page3AcknowledgedAndTimestamp.getItems().size());
assertEquals(0, page4AcknowledgedAndTimestamp.getItems().size());
page1AcknowledgedAndTimestamp.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page2AcknowledgedAndTimestamp.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page1AcknowledgedAndTimestamp.getItems().forEach(e -> assertTrue(e.getCreatedTimestamp() > checkTimestamp));
page2AcknowledgedAndTimestamp.getItems().forEach(e -> assertTrue(e.getCreatedTimestamp() > checkTimestamp));
assertTrue(page3AcknowledgedAndTimestamp.getContext().isLastPage());
assertTrue(page4AcknowledgedAndTimestamp.getContext().isLastPage());
// testing Acknowledged with equipmentId and timestamp
// With timestamp, alarmCodes will be set to AlarmCode.validValues, so these calls will be equivalent to having all filters included.
// Because all filters are included, the alarm_by_acknowledged will be used instead of alarm_by_acknowledged_timestamp
PaginationResponse<Alarm> page1AcknowledgedEquipmentIdAndTimestamp = testInterface.getForCustomer(customerId_1, equipmentIds, null, pastTimestamp, true, sortBy, context);
PaginationResponse<Alarm> page2AcknowledgedEquipmentIdAndTimestamp = testInterface.getForCustomer(customerId_1, equipmentIds, null, pastTimestamp, true, sortBy, page1AcknowledgedEquipmentIdAndTimestamp.getContext());
PaginationResponse<Alarm> page3AcknowledgedEquipmentIdAndTimestamp = testInterface.getForCustomer(customerId_1, equipmentIds, null, pastTimestamp, true, sortBy, page2AcknowledgedEquipmentIdAndTimestamp.getContext());
assertEquals(10, page1AcknowledgedEquipmentIdAndTimestamp.getItems().size());
assertEquals(9, page2AcknowledgedEquipmentIdAndTimestamp.getItems().size());
assertEquals(0, page3AcknowledgedEquipmentIdAndTimestamp.getItems().size());
page1AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page2AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page1AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertTrue(equipmentIds.contains(e.getEquipmentId())));
page2AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertTrue(equipmentIds.contains(e.getEquipmentId())));
page1AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertTrue(e.getCreatedTimestamp() > checkTimestamp));
page2AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertTrue(e.getCreatedTimestamp() > checkTimestamp));
assertTrue(page3AcknowledgedEquipmentIdAndTimestamp.getContext().isLastPage());
//test first page of the results with empty sort order -> default sort order (by Id ascending)
PaginationResponse<Alarm> page1EmptySort = testInterface.getForCustomer(customerId_1, null, null, -1, Collections.emptyList(), context);
PaginationResponse<Alarm> page1EmptySort = testInterface.getForCustomer(customerId_1, null, null, -1, null, Collections.emptyList(), context);
assertEquals(10, page1EmptySort.getItems().size());
List<String> expectedPage1EmptySortStrings = getAlarmPagination_expectedPage1EmptySortStrings();
@@ -297,7 +392,7 @@ public abstract class BaseAlarmDatastoreTest {
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
//test first page of the results with null sort order -> default sort order (by Id ascending)
PaginationResponse<Alarm> page1NullSort = testInterface.getForCustomer(customerId_1, null, null, -1, null, context);
PaginationResponse<Alarm> page1NullSort = testInterface.getForCustomer(customerId_1, null, null, -1, null, null, context);
assertEquals(10, page1NullSort.getItems().size());
List<String> expectedPage1NullSortStrings = expectedPage1EmptySortStrings;
@@ -308,7 +403,7 @@ public abstract class BaseAlarmDatastoreTest {
//test first page of the results with sort descending order by a equipmentId property
PaginationResponse<Alarm> page1SingleSortDesc = testInterface.getForCustomer(customerId_1, null, null, -1, Collections.singletonList(new ColumnAndSort("equipmentId", SortOrder.desc)), context);
PaginationResponse<Alarm> page1SingleSortDesc = testInterface.getForCustomer(customerId_1, null, null, -1, null, Collections.singletonList(new ColumnAndSort("equipmentId", SortOrder.desc)), context);
assertEquals(10, page1SingleSortDesc.getItems().size());
List<String> expectedPage1SingleSortDescStrings = getAlarmPagination_expectedPage1SingleSortDescStrings();
@@ -320,13 +415,13 @@ public abstract class BaseAlarmDatastoreTest {
//test with explicit list of equipmentIds and explicit list of AlarmCodes
long createdAfterTs = pastTimestamp + 10;
context = new PaginationContext<>(10);
page1 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, context);
page2 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page1.getContext());
page3 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page2.getContext());
page4 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page3.getContext());
page5 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page4.getContext());
page6 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page5.getContext());
page7 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page6.getContext());
page1 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, context);
page2 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page1.getContext());
page3 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page2.getContext());
page4 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page3.getContext());
page5 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page4.getContext());
page6 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page5.getContext());
page7 = testInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page6.getContext());
//verify returned pages
assertEquals(10, page1.getItems().size());
@@ -344,7 +439,7 @@ public abstract class BaseAlarmDatastoreTest {
//test with explicit list of equipmentIds of one element and explicit list of AlarmCodes of one element
context = new PaginationContext<>(10);
page1 = testInterface.getForCustomer(customerId_1, Collections.singleton(equipmentIds.iterator().next()), Collections.singleton(AlarmCode.AccessPointIsUnreachable), -1, sortBy, context);
page1 = testInterface.getForCustomer(customerId_1, Collections.singleton(equipmentIds.iterator().next()), Collections.singleton(AlarmCode.AccessPointIsUnreachable), -1, null, sortBy, context);
assertEquals(1, page1.getItems().size());
testInterface.resetAlarmCounters();
@@ -369,6 +464,54 @@ public abstract class BaseAlarmDatastoreTest {
return Arrays.asList(new String[]{"qr_49", "qr_48", "qr_47", "qr_46", "qr_45", "qr_44", "qr_43", "qr_42", "qr_41", "qr_40" });
}
@Test
public void testAlarmAcknowledgedPaginationWithUpdate() {
Alarm alarm = createAlarmObject();
//create
Alarm created = testInterface.create(alarm);
assertNotNull(created);
assertEquals(alarm.getCustomerId(), created.getCustomerId());
assertEquals(alarm.getEquipmentId(), created.getEquipmentId());
assertEquals(alarm.getAlarmCode(), created.getAlarmCode());
assertEquals(alarm.getCreatedTimestamp(), created.getCreatedTimestamp());
assertNotNull(created.getDetails());
assertEquals(alarm.getDetails(), created.getDetails());
List<ColumnAndSort> sortBy = new ArrayList<>();
sortBy.addAll(Arrays.asList(new ColumnAndSort("equipmentId")));
PaginationContext<Alarm> context = new PaginationContext<>(10);
PaginationResponse<Alarm> page1CheckFalse = testInterface.getForCustomer(created.getCustomerId(), null, null, -1, false, sortBy, context);
assertEquals(1, page1CheckFalse.getItems().size());
page1CheckFalse.getItems().forEach(e -> assertFalse(e.isAcknowledged()));
PaginationResponse<Alarm> page1CheckTrue = testInterface.getForCustomer(created.getCustomerId(), null, null, -1, true, sortBy, context);
assertEquals(0, page1CheckTrue.getItems().size());
// update
created.setAcknowledged(true);
Alarm updated = testInterface.update(created);
assertNotNull(updated);
assertTrue(updated.isAcknowledged());
page1CheckFalse = testInterface.getForCustomer(created.getCustomerId(), null, null, -1, false, sortBy, context);
assertEquals(0, page1CheckFalse.getItems().size());
page1CheckTrue = testInterface.getForCustomer(created.getCustomerId(), null, null, -1, true, sortBy, context);
assertEquals(1, page1CheckTrue.getItems().size());
page1CheckTrue.getItems().forEach(e -> assertTrue(e.isAcknowledged()));
//delete
created = testInterface.delete(created.getCustomerId(), created.getEquipmentId(), created.getAlarmCode(), created.getCreatedTimestamp());
assertNotNull(created);
created = testInterface.getOrNull(created.getCustomerId(), created.getEquipmentId(), created.getAlarmCode(), created.getCreatedTimestamp());
assertNull(created);
}
@Test
public void testAlarmCountsModel() {
@@ -493,6 +636,7 @@ public abstract class BaseAlarmDatastoreTest {
result.setEquipmentId(testSequence.getAndIncrement());
result.setAlarmCode(AlarmCode.AccessPointIsUnreachable);
result.setCreatedTimestamp(System.currentTimeMillis());
result.setAcknowledged(false);
result.setScopeId("test-scope-" + result.getEquipmentId());

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,19 +15,19 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-datastore-inmemory</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -204,7 +204,7 @@ public class AlarmDatastoreInMemory extends BaseInMemoryDatastore implements Ala
@Override
public PaginationResponse<Alarm> getForCustomer(int customerId, Set<Long> equipmentIdSet, Set<AlarmCode> alarmCodeSet,
long createdAfterTimestamp, List<ColumnAndSort> sortBy, PaginationContext<Alarm> context) {
long createdAfterTimestamp, Boolean acknowledged, List<ColumnAndSort> sortBy, PaginationContext<Alarm> context) {
if(context == null) {
context = new PaginationContext<>();
@@ -226,6 +226,7 @@ public class AlarmDatastoreInMemory extends BaseInMemoryDatastore implements Ala
&& ( equipmentIdSet == null || equipmentIdSet.isEmpty() || equipmentIdSet.contains(a.getEquipmentId()) )
&& ( alarmCodeSet ==null || alarmCodeSet.isEmpty() || alarmCodeSet.contains(a.getAlarmCode()) )
&& a.getCreatedTimestamp() > createdAfterTimestamp
&& (acknowledged == null || a.isAcknowledged() == acknowledged.booleanValue())
) {
items.add(a.clone());
}

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-exceptions</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -60,7 +60,7 @@ public interface AlarmDatastore {
* @param createdAfterTimestamp
* @return next page of matching Alarm objects.
*/
PaginationResponse<Alarm> getForCustomer(int customerId, Set<Long> equipmentIdSet, Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp, List<ColumnAndSort> sortBy, PaginationContext<Alarm> context);
PaginationResponse<Alarm> getForCustomer(int customerId, Set<Long> equipmentIdSet, Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp, Boolean acknowledged, List<ColumnAndSort> sortBy, PaginationContext<Alarm> context);
/**
* @param customerId

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc-tests</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>alarm-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -445,7 +445,7 @@ public class AlarmDAO extends BaseJdbcDao {
public PaginationResponse<Alarm> getForCustomer(int customerId,
Set<Long> equipmentIds, Set<AlarmCode> alarmCodes, long createdAfterTimestamp,
Set<Long> equipmentIds, Set<AlarmCode> alarmCodes, long createdAfterTimestamp, Boolean acknowledged,
List<ColumnAndSort> sortBy, PaginationContext<Alarm> context) {
PaginationResponse<Alarm> ret = new PaginationResponse<>();
@@ -507,6 +507,11 @@ public class AlarmDAO extends BaseJdbcDao {
queryArgs.add(createdAfterTimestamp);
}
if (acknowledged != null) {
query += " and acknowledged = ? ";
queryArgs.add(acknowledged);
}
// add sorting options for the query
StringBuilder strbSort = new StringBuilder(100);
strbSort.append(" order by ");

View File

@@ -57,7 +57,7 @@ public class AlarmDatastoreRdbms implements AlarmDatastore {
@Override
public PaginationResponse<Alarm> getForCustomer(int customerId, Set<Long> equipmentIdSet,
Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp, List<ColumnAndSort> sortBy,
Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp, Boolean acknowledged, List<ColumnAndSort> sortBy,
PaginationContext<Alarm> context) {
if(context == null) {
@@ -65,7 +65,7 @@ public class AlarmDatastoreRdbms implements AlarmDatastore {
}
return alarmDAO.getForCustomer(customerId, equipmentIdSet,
alarmCodeSet, createdAfterTimestamp, sortBy,
alarmCodeSet, createdAfterTimestamp, acknowledged, sortBy,
context);
}

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,17 +15,17 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>status-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>system-event-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>alarm-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -104,7 +104,7 @@ public interface AlarmServiceInterface {
* @param createdAfterTimestamp
* @return next page of matching Alarm objects.
*/
PaginationResponse<Alarm> getForCustomer(int customerId, Set<Long> equipmentIdSet, Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp, List<ColumnAndSort> sortBy, PaginationContext<Alarm> context);
PaginationResponse<Alarm> getForCustomer(int customerId, Set<Long> equipmentIdSet, Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp, Boolean acknowledged, List<ColumnAndSort> sortBy, PaginationContext<Alarm> context);
/**
* @param customerId

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,13 +16,13 @@
<dependency>
<artifactId>alarm-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -69,11 +69,11 @@ public class AlarmServiceLocal implements AlarmServiceInterface {
@Override
public PaginationResponse<Alarm> getForCustomer(int customerId, Set<Long> equipmentIdSet,
Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp, List<ColumnAndSort> sortBy,
Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp, Boolean acknowledged, List<ColumnAndSort> sortBy,
PaginationContext<Alarm> context) {
return alarmController.getForCustomer(customerId, equipmentIdSet,
alarmCodeSet, createdAfterTimestamp, sortBy, context);
alarmCodeSet, createdAfterTimestamp, acknowledged, sortBy, context);
}
@Override

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,41 +15,41 @@
<dependency>
<artifactId>alarm-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-client</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Dependencies for the unit tests -->
<dependency>
<artifactId>base-remote-tests</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>alarm-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -170,10 +170,10 @@ public class AlarmServiceRemote extends BaseRemoteClient implements AlarmService
@Override
public PaginationResponse<Alarm> getForCustomer(int customerId, Set<Long> equipmentIdSet,
Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp, List<ColumnAndSort> sortBy,
Set<AlarmCode> alarmCodeSet, long createdAfterTimestamp, Boolean acknowledged, List<ColumnAndSort> sortBy,
PaginationContext<Alarm> context) {
LOG.debug("calling getForCustomer( {}, {}, {}, {}, {}, {} )", customerId, equipmentIdSet, alarmCodeSet, createdAfterTimestamp, sortBy, context);
LOG.debug("calling getForCustomer( {}, {}, {}, {}, {}, {}, {} )", customerId, equipmentIdSet, alarmCodeSet, createdAfterTimestamp, acknowledged, sortBy, context);
String equipmentIdSetStr = null;
if (equipmentIdSet != null && !equipmentIdSet.isEmpty()) {
@@ -193,9 +193,9 @@ public class AlarmServiceRemote extends BaseRemoteClient implements AlarmService
ResponseEntity<PaginationResponse<Alarm>> responseEntity = restTemplate.exchange(
getBaseUrl()
+ "/forCustomer?customerId={customerId}&equipmentIdSet={equipmentIdSetStr}&alarmCodeSet={alarmCodeSetStr}&createdAfterTimestamp={createdAfterTimestamp}&sortBy={sortBy}&paginationContext={paginationContext}",
+ "/forCustomer?customerId={customerId}&equipmentIdSet={equipmentIdSetStr}&alarmCodeSet={alarmCodeSetStr}&createdAfterTimestamp={createdAfterTimestamp}&acknowledged={acknowledged}&sortBy={sortBy}&paginationContext={paginationContext}",
HttpMethod.GET,
null, Alarm_PAGINATION_RESPONSE_CLASS_TOKEN, customerId, equipmentIdSetStr, alarmCodeSetStr, createdAfterTimestamp, sortBy, context);
null, Alarm_PAGINATION_RESPONSE_CLASS_TOKEN, customerId, equipmentIdSetStr, alarmCodeSetStr, createdAfterTimestamp, acknowledged, sortBy, context);
PaginationResponse<Alarm> ret = responseEntity.getBody();
LOG.debug("completed getForCustomer {} ", ret.getItems().size());

View File

@@ -232,6 +232,11 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
mdl.setCreatedTimestamp(mdl.getCreatedTimestamp() - 10000);
pastTimestamp = mdl.getCreatedTimestamp();
}
if (i < 20) {
mdl.setAcknowledged(true);
} else {
mdl.setAcknowledged(false);
}
apNameIdx++;
remoteInterface.create(mdl);
@@ -252,13 +257,13 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
//get active alarms for all equipment and all alarmCodes for the customer since the beginning of time
PaginationContext<Alarm> context = new PaginationContext<>(10);
PaginationResponse<Alarm> page1 = remoteInterface.getForCustomer(customerId_1, null, null, -1, sortBy, context);
PaginationResponse<Alarm> page2 = remoteInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page1.getContext());
PaginationResponse<Alarm> page3 = remoteInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page2.getContext());
PaginationResponse<Alarm> page4 = remoteInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page3.getContext());
PaginationResponse<Alarm> page5 = remoteInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page4.getContext());
PaginationResponse<Alarm> page6 = remoteInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page5.getContext());
PaginationResponse<Alarm> page7 = remoteInterface.getForCustomer(customerId_1, null, null, -1, sortBy, page6.getContext());
PaginationResponse<Alarm> page1 = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, context);
PaginationResponse<Alarm> page2 = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page1.getContext());
PaginationResponse<Alarm> page3 = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page2.getContext());
PaginationResponse<Alarm> page4 = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page3.getContext());
PaginationResponse<Alarm> page5 = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page4.getContext());
PaginationResponse<Alarm> page6 = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page5.getContext());
PaginationResponse<Alarm> page7 = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, sortBy, page6.getContext());
//verify returned pages
assertEquals(10, page1.getItems().size());
@@ -291,9 +296,99 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
assertEquals(expectedPage3Strings, actualPage3Strings);
// testing Acknowledged filter (alarm_by_acknowledged)
PaginationResponse<Alarm> page1Acknowledged = remoteInterface.getForCustomer(customerId_1, null, null, -1, true, sortBy, context);
PaginationResponse<Alarm> page2Acknowledged = remoteInterface.getForCustomer(customerId_1, null, null, -1, true, sortBy, page1Acknowledged.getContext());
PaginationResponse<Alarm> page3Acknowledged = remoteInterface.getForCustomer(customerId_1, null, null, -1, true, sortBy, page2Acknowledged.getContext());
PaginationResponse<Alarm> page4Acknowledged = remoteInterface.getForCustomer(customerId_1, null, null, -1, true, sortBy, page3Acknowledged.getContext());
//verify returned pages
assertEquals(10, page1Acknowledged.getItems().size());
assertEquals(10, page2Acknowledged.getItems().size());
assertEquals(0, page3Acknowledged.getItems().size());
assertEquals(0, page4Acknowledged.getItems().size());
// testing Acknowledged filter with equipmentIds (alarm_by_acknowledged_equipmentId)
PaginationResponse<Alarm> page1AcknowledgedAndEquipment = remoteInterface.getForCustomer(customerId_1, equipmentIds, null, -1, true, sortBy, context);
PaginationResponse<Alarm> page2AcknowledgedAndEquipment = remoteInterface.getForCustomer(customerId_1, equipmentIds, null, -1, true, sortBy, page1AcknowledgedAndEquipment.getContext());
PaginationResponse<Alarm> page3AcknowledgedAndEquipment = remoteInterface.getForCustomer(customerId_1, equipmentIds, null, -1, true, sortBy, page2AcknowledgedAndEquipment.getContext());
PaginationResponse<Alarm> page4AcknowledgedAndEquipment = remoteInterface.getForCustomer(customerId_1, equipmentIds, null, -1, true, sortBy, page3AcknowledgedAndEquipment.getContext());
page1AcknowledgedAndEquipment.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page2AcknowledgedAndEquipment.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page1AcknowledgedAndEquipment.getItems().forEach(e -> assertTrue(equipmentIds.contains(e.getEquipmentId())));
page2AcknowledgedAndEquipment.getItems().forEach(e -> assertTrue(equipmentIds.contains(e.getEquipmentId())));
assertTrue(page3AcknowledgedAndEquipment.getContext().isLastPage());
assertTrue(page4AcknowledgedAndEquipment.getContext().isLastPage());
// testing Acknowledged filter with alarmCodes (alarm_by_acknowledged_alarmCode)
PaginationResponse<Alarm> page1AcknowledgedAndAlarmCode = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, -1, true, sortBy, context);
PaginationResponse<Alarm> page2AcknowledgedAndAlarmCode = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, -1, true, sortBy, page1AcknowledgedAndAlarmCode.getContext());
PaginationResponse<Alarm> page3AcknowledgedAndAlarmCode = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, -1, true, sortBy, page2AcknowledgedAndAlarmCode.getContext());
PaginationResponse<Alarm> page4AcknowledgedAndAlarmCode = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, -1, true, sortBy, page3AcknowledgedAndAlarmCode.getContext());
page1AcknowledgedAndAlarmCode.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page2AcknowledgedAndAlarmCode.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page1AcknowledgedAndAlarmCode.getItems().forEach(e -> assertEquals(AlarmCode.AccessPointIsUnreachable, e.getAlarmCode()));
page2AcknowledgedAndAlarmCode.getItems().forEach(e -> assertEquals(AlarmCode.AccessPointIsUnreachable, e.getAlarmCode()));
assertTrue(page3AcknowledgedAndAlarmCode.getContext().isLastPage());
assertTrue(page4AcknowledgedAndAlarmCode.getContext().isLastPage());
// testing Acknowledged filter with failure alarm code (no alarms initialized with failure code, should return empty page)
PaginationResponse<Alarm> page1AcknowledgedAndAlarmCodeFailure = remoteInterface.getForCustomer(customerId_1, equipmentIds, Collections.singleton(AlarmCode.AssocFailure), -1, true, sortBy, context);
assertTrue(page1AcknowledgedAndAlarmCodeFailure.getContext().isLastPage());
long checkTimestamp = pastTimestamp;
// testing Acknowledged filter with timestamp (alarm_by_acknowledged_timestamp)
PaginationResponse<Alarm> page1AcknowledgedAndTimestamp = remoteInterface.getForCustomer(customerId_1, null, null, pastTimestamp, true, sortBy, context);
PaginationResponse<Alarm> page2AcknowledgedAndTimestamp = remoteInterface.getForCustomer(customerId_1, null, null, pastTimestamp, true, sortBy, page1AcknowledgedAndTimestamp.getContext());
PaginationResponse<Alarm> page3AcknowledgedAndTimestamp = remoteInterface.getForCustomer(customerId_1, null, null, pastTimestamp, true, sortBy, page2AcknowledgedAndTimestamp.getContext());
PaginationResponse<Alarm> page4AcknowledgedAndTimestamp = remoteInterface.getForCustomer(customerId_1, null, null, pastTimestamp, true, sortBy, page3AcknowledgedAndTimestamp.getContext());
assertEquals(10, page1AcknowledgedAndTimestamp.getItems().size());
assertEquals(9, page2AcknowledgedAndTimestamp.getItems().size());
assertEquals(0, page3AcknowledgedAndTimestamp.getItems().size());
assertEquals(0, page4AcknowledgedAndTimestamp.getItems().size());
page1AcknowledgedAndTimestamp.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page2AcknowledgedAndTimestamp.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page1AcknowledgedAndTimestamp.getItems().forEach(e -> assertTrue(e.getCreatedTimestamp() > checkTimestamp));
page2AcknowledgedAndTimestamp.getItems().forEach(e -> assertTrue(e.getCreatedTimestamp() > checkTimestamp));
assertTrue(page3AcknowledgedAndTimestamp.getContext().isLastPage());
assertTrue(page4AcknowledgedAndTimestamp.getContext().isLastPage());
// testing Acknowledged with equipmentId and timestamp
// With timestamp, alarmCodes will be set to AlarmCode.validValues, so these calls will be equivalent to having all filters included.
// Because all filters are included, the alarm_by_acknowledged will be used instead of alarm_by_acknowledged_timestamp
PaginationResponse<Alarm> page1AcknowledgedEquipmentIdAndTimestamp = remoteInterface.getForCustomer(customerId_1, equipmentIds, null, pastTimestamp, true, sortBy, context);
PaginationResponse<Alarm> page2AcknowledgedEquipmentIdAndTimestamp = remoteInterface.getForCustomer(customerId_1, equipmentIds, null, pastTimestamp, true, sortBy, page1AcknowledgedEquipmentIdAndTimestamp.getContext());
PaginationResponse<Alarm> page3AcknowledgedEquipmentIdAndTimestamp = remoteInterface.getForCustomer(customerId_1, equipmentIds, null, pastTimestamp, true, sortBy, page2AcknowledgedEquipmentIdAndTimestamp.getContext());
assertEquals(10, page1AcknowledgedEquipmentIdAndTimestamp.getItems().size());
assertEquals(9, page2AcknowledgedEquipmentIdAndTimestamp.getItems().size());
assertEquals(0, page3AcknowledgedEquipmentIdAndTimestamp.getItems().size());
page1AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page2AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertEquals(true, e.isAcknowledged()) );
page1AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertTrue(equipmentIds.contains(e.getEquipmentId())));
page2AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertTrue(equipmentIds.contains(e.getEquipmentId())));
page1AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertTrue(e.getCreatedTimestamp() > checkTimestamp));
page2AcknowledgedEquipmentIdAndTimestamp.getItems().forEach(e -> assertTrue(e.getCreatedTimestamp() > checkTimestamp));
assertTrue(page3AcknowledgedEquipmentIdAndTimestamp.getContext().isLastPage());
//test first page of the results with empty sort order -> default sort order (by Id ascending)
PaginationResponse<Alarm> page1EmptySort = remoteInterface.getForCustomer(customerId_1, null, null, -1, Collections.emptyList(), context);
PaginationResponse<Alarm> page1EmptySort = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, Collections.emptyList(), context);
assertEquals(10, page1EmptySort.getItems().size());
List<String> expectedPage1EmptySortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
@@ -303,7 +398,7 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
//test first page of the results with null sort order -> default sort order (by Id ascending)
PaginationResponse<Alarm> page1NullSort = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, context);
PaginationResponse<Alarm> page1NullSort = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, null, context);
assertEquals(10, page1NullSort.getItems().size());
List<String> expectedPage1NullSortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
@@ -314,7 +409,7 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
//test first page of the results with sort descending order by a equipmentId property
PaginationResponse<Alarm> page1SingleSortDesc = remoteInterface.getForCustomer(customerId_1, null, null, -1, Collections.singletonList(new ColumnAndSort("equipmentId", SortOrder.desc)), context);
PaginationResponse<Alarm> page1SingleSortDesc = remoteInterface.getForCustomer(customerId_1, null, null, -1, null, Collections.singletonList(new ColumnAndSort("equipmentId", SortOrder.desc)), context);
assertEquals(10, page1SingleSortDesc.getItems().size());
List<String> expectedPage1SingleSortDescStrings = new ArrayList< >(Arrays.asList(new String[]{"qr_49", "qr_48", "qr_47", "qr_46", "qr_45", "qr_44", "qr_43", "qr_42", "qr_41", "qr_40" }));
@@ -326,13 +421,13 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
//test with explicit list of equipmentIds and explicit list of AlarmCodes
long createdAfterTs = pastTimestamp + 10;
context = new PaginationContext<>(10);
page1 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, context);
page2 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page1.getContext());
page3 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page2.getContext());
page4 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page3.getContext());
page5 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page4.getContext());
page6 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page5.getContext());
page7 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, sortBy, page6.getContext());
page1 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, context);
page2 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page1.getContext());
page3 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page2.getContext());
page4 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page3.getContext());
page5 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page4.getContext());
page6 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page5.getContext());
page7 = remoteInterface.getForCustomer(customerId_1, equipmentIds, alarmCodes, createdAfterTs, null, sortBy, page6.getContext());
//verify returned pages
assertEquals(10, page1.getItems().size());
@@ -350,10 +445,59 @@ public class AlarmServiceRemoteTest extends BaseRemoteTest {
//test with explicit list of equipmentIds of one element and explicit list of AlarmCodes of one element
context = new PaginationContext<>(10);
page1 = remoteInterface.getForCustomer(customerId_1, Collections.singleton(equipmentIds.iterator().next()), Collections.singleton(AlarmCode.AccessPointIsUnreachable), -1, sortBy, context);
page1 = remoteInterface.getForCustomer(customerId_1, Collections.singleton(equipmentIds.iterator().next()), Collections.singleton(AlarmCode.AccessPointIsUnreachable), -1, null, sortBy, context);
assertEquals(1, page1.getItems().size());
}
@Test
public void testAlarmAcknowledgedPaginationWithUpdate() {
Alarm alarm = createAlarmObject();
//create
Alarm created = remoteInterface.create(alarm);
assertNotNull(created);
assertEquals(alarm.getCustomerId(), created.getCustomerId());
assertEquals(alarm.getEquipmentId(), created.getEquipmentId());
assertEquals(alarm.getAlarmCode(), created.getAlarmCode());
assertEquals(alarm.getCreatedTimestamp(), created.getCreatedTimestamp());
assertNotNull(created.getDetails());
assertEquals(alarm.getDetails(), created.getDetails());
List<ColumnAndSort> sortBy = new ArrayList<>();
sortBy.addAll(Arrays.asList(new ColumnAndSort("equipmentId")));
PaginationContext<Alarm> context = new PaginationContext<>(10);
PaginationResponse<Alarm> page1CheckFalse = remoteInterface.getForCustomer(created.getCustomerId(), null, null, -1, false, sortBy, context);
assertEquals(1, page1CheckFalse.getItems().size());
page1CheckFalse.getItems().forEach(e -> assertFalse(e.isAcknowledged()));
PaginationResponse<Alarm> page1CheckTrue = remoteInterface.getForCustomer(created.getCustomerId(), null, null, -1, true, sortBy, context);
assertEquals(0, page1CheckTrue.getItems().size());
// update
created.setAcknowledged(true);
Alarm updated = remoteInterface.update(created);
assertNotNull(updated);
assertTrue(updated.isAcknowledged());
page1CheckFalse = remoteInterface.getForCustomer(created.getCustomerId(), null, null, -1, false, sortBy, context);
assertEquals(0, page1CheckFalse.getItems().size());
page1CheckTrue = remoteInterface.getForCustomer(created.getCustomerId(), null, null, -1, true, sortBy, context);
assertEquals(1, page1CheckTrue.getItems().size());
page1CheckTrue.getItems().forEach(e -> assertTrue(e.isAcknowledged()));
//delete
created = remoteInterface.delete(created.getCustomerId(), created.getEquipmentId(), created.getAlarmCode(), created.getCreatedTimestamp());
assertNotNull(created);
created = remoteInterface.getOrNull(created.getCustomerId(), created.getEquipmentId(), created.getAlarmCode(), created.getCreatedTimestamp());
assertNull(created);
}
@Test

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,29 +15,29 @@
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-datastore-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -45,7 +45,7 @@
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -123,10 +123,11 @@ public class AlarmController {
@RequestMapping(value = "/forCustomer", method = RequestMethod.GET)
public PaginationResponse<Alarm> getForCustomer(@RequestParam int customerId,
@RequestParam Set<Long> equipmentIdSet,
@RequestParam Set<AlarmCode> alarmCodeSet,
@RequestParam long createdAfterTimestamp,
@RequestParam List<ColumnAndSort> sortBy,
@RequestParam(required = false) Set<Long> equipmentIdSet,
@RequestParam(required = false) Set<AlarmCode> alarmCodeSet,
@RequestParam(required = false) long createdAfterTimestamp,
@RequestParam(required = false) Boolean acknowledged,
@RequestParam(required = false) List<ColumnAndSort> sortBy,
@RequestParam(required = false) PaginationContext<Alarm> paginationContext) {
if(paginationContext == null) {
@@ -148,7 +149,7 @@ public class AlarmController {
}
PaginationResponse<Alarm> onePage = this.alarmDatastore
.getForCustomer(customerId, equipmentIdSet, alarmCodeSet, createdAfterTimestamp, sortBy, paginationContext);
.getForCustomer(customerId, equipmentIdSet, alarmCodeSet, createdAfterTimestamp, acknowledged, sortBy, paginationContext);
ret.setContext(onePage.getContext());
ret.getItems().addAll(onePage.getItems());

View File

@@ -534,7 +534,7 @@ paths:
- name: equipmentIdSet
in: query
description: Equipment ID Set
required: true
required: false
schema:
type: array
items:
@@ -543,7 +543,7 @@ paths:
- name: alarmCodeSet
in: query
description: Alarm Code Set
required: true
required: false
schema:
type: array
items:
@@ -551,14 +551,20 @@ paths:
- name: createdAfterTimestamp
in: query
description: Created After Timestamp
required: true
required: false
schema:
type: integer
format: int64
- name: acknowledged
in: query
description: Acknowledged flag
required: false
schema:
type: boolean
- name: sortBy
in: query
description: sort options
required: true
required: false
schema:
type: array
items:

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
<artifactId>all-cloud-and-opensync-gw-in-one-docker</artifactId>
@@ -22,7 +22,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>all-cloud-and-opensync-gw-in-one-process</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -21,350 +21,350 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>opensync-ext-cloud</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- PortForwarding Gateway - to support remote ssh connections to APs -->
<dependency>
<artifactId>port-forwarding-gateway</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- portal services -->
<dependency>
<artifactId>webtoken-auth-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-services</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>filestore-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- prov services -->
<dependency>
<artifactId>customer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>customer-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>location-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>equipment-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>profile-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>portal-user-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>firmware-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>manufacturer-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>adoption-metrics-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- ssc services -->
<dependency>
<artifactId>cloud-event-dispatcher</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>service-metric-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>system-event-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>status-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>client-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>routing-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Stream Processors -->
<dependency>
<artifactId>single-process-streams</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>provisioning-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>dashboard-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-alarms-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-gateway-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -86,6 +86,7 @@ import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDataType;
import com.telecominfraproject.wlan.status.StatusServiceInterface;
import com.telecominfraproject.wlan.status.dashboard.models.CustomerPortalDashboardStatus;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentAdminStatusData;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentChannelStatusData;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentProtocolState;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentProtocolStatusData;
import com.telecominfraproject.wlan.status.equipment.report.models.EquipmentCapacityDetails;
@@ -950,6 +951,21 @@ public class AllInOneWithGatewayStartListener implements ApplicationRunner {
status.setDetails(eqRadioUtilReport);
statusList.add(status);
status = new Status();
status.setCustomerId(equipment.getCustomerId());
status.setEquipmentId(equipment.getId());
EquipmentChannelStatusData eqChannelStatus = new EquipmentChannelStatusData();
Map<RadioType, Integer> channelStatusDataMap = new EnumMap<>(RadioType.class);
channelStatusDataMap.put(RadioType.is2dot4GHz, 6);
channelStatusDataMap.put(RadioType.is5GHzL, 36);
channelStatusDataMap.put(RadioType.is5GHzU, 157);
eqChannelStatus.setChannelNumberStatusDataMap(channelStatusDataMap);
status.setDetails(eqChannelStatus);
statusList.add(status);
statusServiceInterface.update(statusList);
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -23,7 +23,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>all-cloud-in-one-process-with-persistence</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -23,7 +23,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>all-cloud-in-one-process</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -22,322 +22,322 @@
<dependency>
<artifactId>webtoken-auth-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-services</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>filestore-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- prov services -->
<dependency>
<artifactId>customer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- ssc services -->
<dependency>
<artifactId>cloud-event-dispatcher</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-datastore-rdbms</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Stream Processors -->
<dependency>
<artifactId>single-process-streams</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>provisioning-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>dashboard-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-alarms-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-gateway-service-remote</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -21,343 +21,343 @@
<dependency>
<artifactId>webtoken-auth-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-services</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>filestore-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- prov services -->
<dependency>
<artifactId>customer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>customer-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>location-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>equipment-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>profile-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>portal-user-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>firmware-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>manufacturer-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>adoption-metrics-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- ssc services -->
<dependency>
<artifactId>cloud-event-dispatcher</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>service-metric-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>system-event-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>status-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>client-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- Use in-memory DS for now, later switch to RDBMS -->
<artifactId>routing-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Stream Processors -->
<dependency>
<artifactId>single-process-streams</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>provisioning-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>dashboard-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-alarms-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>adoption-metrics-sp</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-gateway-service-remote</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>port-forwarding-gateway-local</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -111,6 +111,7 @@ import com.telecominfraproject.wlan.servicemetric.models.ServiceMetricDataType;
import com.telecominfraproject.wlan.status.StatusServiceInterface;
import com.telecominfraproject.wlan.status.dashboard.models.CustomerPortalDashboardStatus;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentAdminStatusData;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentChannelStatusData;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentProtocolState;
import com.telecominfraproject.wlan.status.equipment.models.EquipmentProtocolStatusData;
import com.telecominfraproject.wlan.status.equipment.report.models.EquipmentCapacityDetails;
@@ -1510,6 +1511,21 @@ public class AllInOneStartListener implements ApplicationRunner {
status.setDetails(eqRadioUtilReport);
statusList.add(status);
status = new Status();
status.setCustomerId(equipment.getCustomerId());
status.setEquipmentId(equipment.getId());
EquipmentChannelStatusData eqChannelStatus = new EquipmentChannelStatusData();
Map<RadioType, Integer> channelStatusDataMap = new EnumMap<>(RadioType.class);
channelStatusDataMap.put(RadioType.is2dot4GHz, 6);
channelStatusDataMap.put(RadioType.is5GHzL, 36);
channelStatusDataMap.put(RadioType.is5GHzU, 157);
eqChannelStatus.setChannelNumberStatusDataMap(channelStatusDataMap);
status.setDetails(eqChannelStatus);
statusList.add(status);
statusServiceInterface.update(statusList);
}

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-cassandra</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-cassandra-tests</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -142,10 +142,7 @@ public class ClientDAO {
private static final String CQL_DELETE_BLOCKED_LIST =
"delete from client_blocklist where customerId = ? and macAddress = ?";
// Statements using client_by_mac_string table
private static final String CQL_GET_CLIENT_MAC_BY_CUSTOMER_ID =
"select customerId, macAddress from client_by_mac_string where customerId = ?";
// Statements using client_by_mac_string table
private static final String CQL_GET_CLIENT_MAC_LIKE_MAC_SUBSTRING =
"select customerId, macAddress from client_by_mac_string where customerId = ? and macAddressString like ?";
@@ -169,7 +166,6 @@ public class ClientDAO {
private PreparedStatement preparedStmt_getBlockedListForCustomer;
private PreparedStatement preparedStmt_insertBlockedList;
private PreparedStatement preparedStmt_deleteBlockedList;
private PreparedStatement preparedStmt_getClientMacByCustomerId;
private PreparedStatement preparedStmt_getClientMacLikeMacString;
private PreparedStatement preparedStmt_insertMacString;
private PreparedStatement preparedStmt_deleteMacString;
@@ -188,7 +184,6 @@ public class ClientDAO {
preparedStmt_getBlockedListForCustomer = cqlSession.prepare(CQL_GET_BLOCKED_LIST_BY_CUSTOMER_ID);
preparedStmt_insertBlockedList = cqlSession.prepare(CQL_INSERT_BLOCKED_LIST);
preparedStmt_deleteBlockedList = cqlSession.prepare(CQL_DELETE_BLOCKED_LIST);
preparedStmt_getClientMacByCustomerId = cqlSession.prepare(CQL_GET_CLIENT_MAC_BY_CUSTOMER_ID);
preparedStmt_getClientMacLikeMacString = cqlSession.prepare(CQL_GET_CLIENT_MAC_LIKE_MAC_SUBSTRING);
preparedStmt_insertMacString = cqlSession.prepare(CQL_INSERT_INTO_CLIENT_MAC_STRING);
preparedStmt_deleteMacString = cqlSession.prepare(CQL_DELETE_FROM_CLIENT_MAC_STRING);
@@ -412,9 +407,10 @@ public class ClientDAO {
return results;
}
public PaginationResponse<Client> searchByMacAddress(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
LOG.debug("calling searchByMacAddress({}, {})", customerId, macSubstring);
private static enum FilterOptions{ customer_only, customer_and_macAddress}
public PaginationResponse<Client> getForCustomer(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
PaginationResponse<Client> ret = new PaginationResponse<>();
ret.setContext(context.clone());
@@ -422,108 +418,27 @@ public class ClientDAO {
if (ret.getContext().isLastPage()) {
// no more pages available according to the context
LOG.debug(
"No more pages available when looking up Clients for customer {} and macSubstring {} with last returned page number {}",
"No more pages available when looking up Clients for customer {} macSubstring {} with last returned page number {}",
customerId, macSubstring, context.getLastReturnedPageNumber());
return ret;
}
LOG.debug("Looking up Clients for customer {} and macSubstring {} with last returned page number {}",
LOG.debug("Looking up Clients for customer {} macSubstring {} with last returned page number {}",
customerId, macSubstring, context.getLastReturnedPageNumber());
// add sorting options for the query
// Cassandra allows very limited support for ordering results
// See https://cassandra.apache.org/doc/latest/cql/dml.html#select
// In here allowed orderings are the order induced by the clustering columns and the reverse of that one.
// also, order by with secondary indexes is not supported
// ***** We will ignore the order supplied by the caller for this datastore
ArrayList<Object> bindVars = new ArrayList<>();
BoundStatement boundStmt;
String query = CQL_GET_BY_CUSTOMER_ID;
FilterOptions filterOptions = FilterOptions.customer_only;
// add filters for the query
ArrayList<Object> queryArgs = new ArrayList<>();
queryArgs.add(customerId);
if (macSubstring != null && !macSubstring.isEmpty()) {
bindVars.add(customerId);
bindVars.add("%" + macSubstring.toLowerCase() + "%");
queryArgs.add("%" + macSubstring.toLowerCase() + "%");
boundStmt = preparedStmt_getClientMacLikeMacString.bind(bindVars.toArray());
} else {
bindVars.add(customerId);
boundStmt = preparedStmt_getClientMacByCustomerId.bind(bindVars.toArray());
query = CQL_GET_CLIENT_MAC_LIKE_MAC_SUBSTRING;
filterOptions = FilterOptions.customer_and_macAddress;
}
//have to do it this way - setPageSize creates new object
boundStmt = boundStmt.setPageSize(context.getMaxItemsPerPage());
if(context.getThirdPartyPagingState()!=null) {
ByteBuffer currentPagingState = ByteBuffer.wrap(context.getThirdPartyPagingState());
//have to do it this way - setPagingState creates new object
boundStmt = boundStmt.setPagingState(currentPagingState);
}
ResultSet rs = cqlSession.execute(boundStmt);
ByteBuffer nextPagingState = rs.getExecutionInfo().getPagingState();
List<Client> pageItems = new ArrayList<>();
Set<MacAddress> macSet = new HashSet<>();
// iterate through the current page
while (rs.getAvailableWithoutFetching() > 0) {
// macSet will contain MACs of paginated items to get Client objects via macSet
macSet.add(new MacAddress(rs.one().getLong("macAddress")));
}
pageItems.addAll(get(customerId, macSet));
if (pageItems.isEmpty()) {
LOG.debug("Cannot find Clients for customer {} and macSubstring {} with last returned page number {}",
customerId, macSubstring, context.getLastReturnedPageNumber());
} else {
LOG.debug("Found {} Clients for customer {} and macSubstring {} with last returned page number {}",
pageItems.size(), customerId, macSubstring, context.getLastReturnedPageNumber());
}
ret.setItems(pageItems);
// adjust context for the next page
ret.prepareForNextPage();
if(nextPagingState!=null) {
ret.getContext().setThirdPartyPagingState(nextPagingState.array());
} else {
ret.getContext().setThirdPartyPagingState(null);
}
// startAfterItem is not used in Cassandra datastores, set it to null
ret.getContext().setStartAfterItem(null);
//in cassandra we will rely only on nextPagingState to set the lastPage indicator
ret.getContext().setLastPage(false);
if(nextPagingState == null) {
//in cassandra, if there are no more pages available, the pagingState is returned as null by the driver
//this overrides all other heuristics related to guessing the indication of the last page
ret.getContext().setLastPage(true);
}
return ret;
}
public PaginationResponse<Client> getForCustomer(int customerId, List<ColumnAndSort> sortBy,
PaginationContext<Client> context) {
PaginationResponse<Client> ret = new PaginationResponse<>();
ret.setContext(context.clone());
if (ret.getContext().isLastPage()) {
// no more pages available according to the context
LOG.debug(
"No more pages available when looking up Clients for customer {} with last returned page number {}",
customerId, context.getLastReturnedPageNumber());
return ret;
}
LOG.debug("Looking up Clients for customer {} with last returned page number {}",
customerId, context.getLastReturnedPageNumber());
// add sorting options for the query
// Cassandra allows very limited support for ordering results
@@ -531,8 +446,18 @@ public class ClientDAO {
// In here allowed orderings are the order induced by the clustering columns and the reverse of that one.
// also, order by with secondary indexes is not supported
// ***** We will ignore the order supplied by the caller for this datastore
BoundStatement boundStmt = preparedStmt_getPageForCustomer.bind(customerId );
PreparedStatement preparedStmt_getPageForCustomer;
try {
preparedStmt_getPageForCustomer = cqlSession.prepare(query);
} catch(InvalidQueryException e) {
LOG.error("Cannot prepare cassandra query '{}'", query, e);
throw e;
}
// add pagination parameters for the query
BoundStatement boundStmt = preparedStmt_getPageForCustomer.bind(queryArgs.toArray() );
//have to do it this way - setPageSize creates new object
boundStmt = boundStmt.setPageSize(context.getMaxItemsPerPage());
@@ -547,17 +472,36 @@ public class ClientDAO {
List<Client> pageItems = new ArrayList<>();
// iterate through the current page
while (rs.getAvailableWithoutFetching() > 0) {
pageItems.add(clientRowMapper.mapRow(rs.one()));
switch(filterOptions) {
case customer_only:
// iterate through the current page
while (rs.getAvailableWithoutFetching() > 0) {
pageItems.add(clientRowMapper.mapRow(rs.one()));
}
break;
case customer_and_macAddress:
//the query was against client_by_mac_string table
//find all the macAddresses for the page, then retrieve records for them from client table
Set<MacAddress> macAddrSet = new HashSet<>();
while (rs.getAvailableWithoutFetching() > 0) {
macAddrSet.add(new MacAddress(rs.one().getLong("macAddress")));
}
//get all clients for the involved mac addresses
pageItems = get(customerId, macAddrSet);
break;
default:
LOG.warn("Unknown filter option:", filterOptions);
throw new IllegalArgumentException("Unknown filter option " + filterOptions);
}
if (pageItems.isEmpty()) {
LOG.debug("Cannot find Clients for customer {} with last returned page number {}",
customerId, context.getLastReturnedPageNumber());
LOG.debug("Cannot find Clients for customer {} macSubstring {} with last returned page number {}",
customerId, macSubstring, context.getLastReturnedPageNumber());
} else {
LOG.debug("Found {} Clients for customer {} with last returned page number {}",
pageItems.size(), customerId, context.getLastReturnedPageNumber());
LOG.debug("Found {} Clients for customer {} macSubstring {} with last returned page number {}",
pageItems.size(), customerId, macSubstring, context.getLastReturnedPageNumber());
}
ret.setItems(pageItems);

View File

@@ -49,27 +49,21 @@ public class ClientDatastoreCassandra implements ClientDatastore {
public List<Client> get(int customerId, Set<MacAddress> clientMacSet) {
return clientDAO.get(customerId, clientMacSet);
}
@Override
public PaginationResponse<Client> searchByMacAddress(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
return clientDAO.searchByMacAddress(customerId, macSubstring, sortBy, context);
}
@Override
public List<Client> getBlockedClients(int customerId) {
return clientDAO.getBlockedClients(customerId);
}
@Override
public PaginationResponse<Client> getForCustomer(int customerId, List<ColumnAndSort> sortBy,
PaginationContext<Client> context) {
public PaginationResponse<Client> getForCustomer(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
if(context == null) {
context = new PaginationContext<>();
}
return clientDAO.getForCustomer( customerId, sortBy, context);
return clientDAO.getForCustomer(customerId, macSubstring, sortBy, context);
}
@Override
@@ -94,13 +88,13 @@ public class ClientDatastoreCassandra implements ClientDatastore {
@Override
public PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds,
List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context) {
String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context) {
if(context == null) {
context = new PaginationContext<>();
}
return clientSessionDAO.getSessionsForCustomer(customerId, equipmentIds, locationIds, sortBy, context);
return clientSessionDAO.getSessionsForCustomer(customerId, equipmentIds, locationIds, macSubstring, sortBy, context);
}

View File

@@ -26,6 +26,7 @@ import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
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.server.cassandra.CassandraUtils;
import com.telecominfraproject.wlan.core.server.cassandra.RowMapper;
import com.telecominfraproject.wlan.datastore.exceptions.DsEntityNotFoundException;
@@ -134,6 +135,12 @@ public class ClientSessionDAO {
private static final String CQL_INSERT_INTO_BY_LOCATION_TABLE = "insert into client_session_by_location(customerId, locationId, equipmentId, macAddress) values ( ?, ?, ?, ?) ";
private static final String CQL_DELETE_FROM_BY_LOCATION_TABLE = "delete from client_session_by_location where locationId = ? and equipmentId = ? and macAddress = ? ";
private static final String CQL_INSERT_INTO_CLIENT_SESSION_MAC = "insert into client_session_by_mac (customerId, locationId, equipmentId, macAddress, macAddressString) values (?, ?, ?, ?, ?)";
private static final String CQL_DELETE_FROM_CLIENT_SESSION_MAC = "delete from client_session_by_mac where locationId = ? and equipmentId = ? and macAddress = ?";
private static final String CQL_INSERT_INTO_CLIENT_SESSION_MAC_AND_EQUIPMENT = "insert into client_session_by_mac_and_equipment (customerId, locationId, equipmentId, macAddress, macAddressString) values (?, ?, ?, ?, ?)";
private static final String CQL_DELETE_FROM_CLIENT_SESSION_MAC_AND_EQUIPMENT = "delete from client_session_by_mac_and_equipment where locationId = ? and equipmentId = ? and macAddress = ?";
private static final RowMapper<ClientSession> clientSessionRowMapper = new ClientSessionRowMapper();
@@ -151,6 +158,11 @@ public class ClientSessionDAO {
private PreparedStatement preparedStmt_deleteByEquipment;
private PreparedStatement preparedStmt_createByLocation;
private PreparedStatement preparedStmt_deleteByLocation;
private PreparedStatement preparedStmt_createByMac;
private PreparedStatement preparedStmt_deleteByMac;
private PreparedStatement preparedStmt_createByMacAndEquipment;
private PreparedStatement preparedStmt_deleteByMacAndEquipment;
@PostConstruct
private void postConstruct(){
@@ -166,6 +178,10 @@ public class ClientSessionDAO {
preparedStmt_deleteByEquipment = cqlSession.prepare(CQL_DELETE_FROM_BY_EQUIPMENT_TABLE);
preparedStmt_createByLocation = cqlSession.prepare(CQL_INSERT_INTO_BY_LOCATION_TABLE);
preparedStmt_deleteByLocation = cqlSession.prepare(CQL_DELETE_FROM_BY_LOCATION_TABLE);
preparedStmt_createByMac = cqlSession.prepare(CQL_INSERT_INTO_CLIENT_SESSION_MAC);
preparedStmt_deleteByMac = cqlSession.prepare(CQL_DELETE_FROM_CLIENT_SESSION_MAC);
preparedStmt_createByMacAndEquipment = cqlSession.prepare(CQL_INSERT_INTO_CLIENT_SESSION_MAC_AND_EQUIPMENT);
preparedStmt_deleteByMacAndEquipment = cqlSession.prepare(CQL_DELETE_FROM_CLIENT_SESSION_MAC_AND_EQUIPMENT);
} catch (InvalidQueryException e) {
LOG.error("Cannot prepare query", e);
@@ -203,6 +219,22 @@ public class ClientSessionDAO {
clientSession.getLocationId(),
clientSession.getEquipmentId(),
clientSession.getMacAddress().getAddressAsLong()));
cqlSession.execute(preparedStmt_createByMac.bind(
clientSession.getCustomerId(),
clientSession.getLocationId(),
clientSession.getEquipmentId(),
clientSession.getMacAddress().getAddressAsLong(),
clientSession.getMacAddress().getAddressAsString()
));
cqlSession.execute(preparedStmt_createByMacAndEquipment.bind(
clientSession.getCustomerId(),
clientSession.getLocationId(),
clientSession.getEquipmentId(),
clientSession.getMacAddress().getAddressAsLong(),
clientSession.getMacAddress().getAddressAsString()
));
LOG.debug("Stored Client session {}", clientSession);
@@ -297,6 +329,16 @@ public class ClientSessionDAO {
clientSession.getLocationId(),
clientSession.getEquipmentId(),
clientSession.getMacAddress().getAddressAsLong()));
cqlSession.execute(preparedStmt_deleteByMac.bind(
clientSession.getLocationId(),
clientSession.getEquipmentId(),
clientSession.getMacAddress().getAddressAsLong()));
cqlSession.execute(preparedStmt_deleteByMacAndEquipment.bind(
clientSession.getLocationId(),
clientSession.getEquipmentId(),
clientSession.getMacAddress().getAddressAsLong()));
return clientSession;
@@ -336,9 +378,9 @@ public class ClientSessionDAO {
return results;
}
private static enum FilterOptions{ customer_only, customer_and_equipment, customer_and_location}
private static enum FilterOptions{ customer_only, customer_and_equipment, customer_and_location, customer_and_macAddress}
public PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, List<ColumnAndSort> sortBy,
public PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, String macSubstring, List<ColumnAndSort> sortBy,
PaginationContext<ClientSession> context) {
PaginationResponse<ClientSession> ret = new PaginationResponse<>();
@@ -367,17 +409,7 @@ public class ClientSessionDAO {
if (equipmentIds != null && !equipmentIds.isEmpty()) {
queryArgs.addAll(equipmentIds);
StringBuilder strb = new StringBuilder(100);
strb.append("and equipmentId in (");
for (int i = 0; i < equipmentIds.size(); i++) {
strb.append("?");
if (i < equipmentIds.size() - 1) {
strb.append(",");
}
}
strb.append(") ");
query += strb.toString();
query += "and equipmentId in " + CassandraUtils.getBindPlaceholders(equipmentIds);
query_head = "select macAddress from client_session_by_equipment where customerId = ? ";
filterOptions = FilterOptions.customer_and_equipment;
@@ -392,21 +424,32 @@ public class ClientSessionDAO {
queryArgs.addAll(equipmentIds);
}
StringBuilder strb = new StringBuilder(100);
strb.append(" locationId in (");
for (int i = 0; i < locationIds.size(); i++) {
strb.append("?");
if (i < locationIds.size() - 1) {
strb.append(",");
}
}
strb.append(") ");
query = strb.toString() + query;
query = " locationId in " + CassandraUtils.getBindPlaceholders(locationIds) + query;
query_head = "select macAddress from client_session_by_location where ";
filterOptions = FilterOptions.customer_and_location;
}
//add macSubstring filters
if (macSubstring != null && !macSubstring.isEmpty()) {
queryArgs.clear();
queryArgs.add(customerId);
queryArgs.add("%" + macSubstring.toLowerCase() + "%");
query_head = "select macAddress from client_session_by_mac where customerId = ? ";
if (locationIds != null && !locationIds.isEmpty()) {
queryArgs.addAll(locationIds);
query = "and " + query;
}
if (equipmentIds != null && !equipmentIds.isEmpty()) {
queryArgs.addAll(equipmentIds);
query_head = "select macAddress from client_session_by_mac_and_equipment where customerId = ? ";
}
query = " and macAddressString like ? " + query + " allow filtering";
filterOptions = FilterOptions.customer_and_macAddress;
}
// add sorting options for the query
// Cassandra allows very limited support for ordering results
@@ -450,6 +493,7 @@ public class ClientSessionDAO {
break;
case customer_and_equipment:
case customer_and_location:
case customer_and_macAddress:
//the query was against client_session_by_equipment or client_session_by_location table
//find all the macAddresses for the page, then retrieve records for them from client_session table
Set<MacAddress> macAddrSet = new HashSet<>();
@@ -464,10 +508,12 @@ public class ClientSessionDAO {
pageSessions.forEach(cs -> {
//apply locationId and equipmentId filtering in here
if ((locationIds == null || locationIds.isEmpty() || locationIds.contains(cs.getLocationId()))
&& (equipmentIds == null || equipmentIds.isEmpty() || equipmentIds.contains(cs.getEquipmentId())) )
&& (equipmentIds == null || equipmentIds.isEmpty() || equipmentIds.contains(cs.getEquipmentId()))
&& (macSubstring == null || macSubstring.isEmpty() || cs.getMacAddress().getAddressAsString().toLowerCase().contains(macSubstring.toLowerCase()))
)
{
pageItems.add(cs);
}
}
});
break;

View File

@@ -59,9 +59,33 @@ CREATE TABLE IF NOT EXISTS tip_wlan_keyspace.client_session_by_location (
customerId int,
locationId bigint,
equipmentId bigint,
macAddress bigint ,
macAddress bigint,
PRIMARY KEY ((locationId), equipmentId, macAddress)
) WITH comment='Index Table to look up wireless client sessions by location and equipment used by TIP WLAN CloudSDK. Records automatically expire after 30 days'
AND default_time_to_live = 2592000;
CREATE TABLE IF NOT EXISTS tip_wlan_keyspace.client_session_by_mac (
customerId int,
locationId bigint,
equipmentId bigint,
macAddress bigint,
macAddressString text,
PRIMARY KEY ((macAddress), locationId, equipmentId, macAddressString)
) WITH comment='Index Table to look up wireless client sessions by macAddressString, location, and equipment by TIP WLAN CloudSDK. Records automatically expire after 30 days'
AND default_time_to_live = 2592000;
CREATE TABLE IF NOT EXISTS tip_wlan_keyspace.client_session_by_mac_and_equipment (
customerId int,
locationId bigint,
equipmentId bigint,
macAddress bigint,
macAddressString text,
PRIMARY KEY ((macAddress), equipmentId, locationId, macAddressString)
) WITH comment='Index Table to look up wireless client sessions by macAddressString, location, and equipment by TIP WLAN CloudSDK. Records automatically expire after 30 days'
AND default_time_to_live = 2592000;
CREATE CUSTOM INDEX IF NOT EXISTS idx_client_session_by_mac_macAddressString ON tip_wlan_keyspace.client_session_by_mac (macAddressString) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'CONTAINS', 'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.StandardAnalyzer', 'case_sensitive': 'false'};
CREATE CUSTOM INDEX IF NOT EXISTS idx_client_session_by_mac_and_equipment_macAddressString ON tip_wlan_keyspace.client_session_by_mac_and_equipment (macAddressString) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'CONTAINS', 'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.StandardAnalyzer', 'case_sensitive': 'false'};

View File

@@ -30,22 +30,16 @@ public class ClientDatastoreCassandraTests extends BaseClientDatastoreTest {
@Override
protected List<String> getClientPagination_ExpectedPage3Strings() {
//in cassandra the sort order is weird but consistent - although it may change on the cassandra server restart
return new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_13", "qr_47", "qr_4", "qr_36", "qr_21", "qr_12", "qr_27", "qr_20", "qr_19" }));
return new ArrayList<>(Arrays.asList(new String[]{"qr_10", "qr_13", "qr_8", "qr_18", "qr_42", "qr_30", "qr_35", "qr_28", "qr_14", "qr_22" }));
}
@Override
protected List<String> getClientPagination_ExpectedPage1EmptySortStrings(){
return new ArrayList<>(Arrays.asList(new String[]{"qr_46", "qr_9", "qr_3", "qr_6", "qr_1", "qr_26", "qr_10", "qr_40", "qr_14", "qr_42" }));
return new ArrayList<>(Arrays.asList(new String[]{"qr_32", "qr_0", "qr_12", "qr_25", "qr_40", "qr_39", "qr_29", "qr_41", "qr_4", "qr_44" }));
}
@Override
protected List<String> getSearchByMac_ExpectedPage1SingleSortDescStrings() {
return new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
}
@Override
protected List<String> getClientPagination_ExpectedPage1SingleSortDescStrings() {
return getClientPagination_ExpectedPage1EmptySortStrings();
@@ -54,12 +48,12 @@ public class ClientDatastoreCassandraTests extends BaseClientDatastoreTest {
@Override
protected List<String> getClientSessionPagination_expectedPage1EmptySortStrings(){
return new ArrayList<>(Arrays.asList(new String[]{"qr_30", "qr_43", "qr_18", "qr_9", "qr_10", "qr_23", "qr_20", "qr_47", "qr_1", "qr_40" }));
return new ArrayList<>(Arrays.asList(new String[]{"qr_12", "qr_47", "qr_4", "qr_1", "qr_21", "qr_42", "qr_45", "qr_35", "qr_14", "qr_0" }));
}
@Override
protected List<String> getClientSessionPagination_expectedPage3Strings(){
return new ArrayList<>(Arrays.asList(new String[]{"qr_42", "qr_16", "qr_27", "qr_36", "qr_48", "qr_13", "qr_39", "qr_28", "qr_15", "qr_29" }));
return new ArrayList<>(Arrays.asList(new String[]{"qr_28", "qr_32", "qr_6", "qr_19", "qr_49", "qr_31", "qr_33", "qr_25", "qr_7", "qr_40" }));
}
@Override

View File

@@ -125,13 +125,42 @@ select * from client_session_by_location where locationId in (1,2,3) and equipme
select customerId, locationId, equipmentId, macAddress from client_session_by_location where locationId in (1,2,3) and equipmentId in (1,2,3);
-- Index table for looking up client sessions by macAddress substring:
-- insert into it when client record is inserted
-- delete from it when client record is deleted
-- no update
insert into client_session_by_mac (customerId, locationId, equipmentId, macAddress, macAddressString) values ( 1, 1, 1, 1, 'A1:1');
insert into client_session_by_mac (customerId, locationId, equipmentId, macAddress, macAddressString) values ( 1, 1, 2, 2, 'A1:2');
insert into client_session_by_mac (customerId, locationId, equipmentId, macAddress, macAddressString) values ( 1, 2, 1, 3, 'A1:3');
insert into client_session_by_mac (customerId, locationId, equipmentId, macAddress, macAddressString) values ( 1, 2, 2, 3, 'B1:3');
insert into client_session_by_mac (customerId, locationId, equipmentId, macAddress, macAddressString) values ( 1, 3, 2, 3, 'B1:3');
insert into client_session_by_mac_and_equipment (customerId, locationId, equipmentId, macAddress, macAddressString) values ( 1, 1, 1, 1, 'A1:1');
insert into client_session_by_mac_and_equipment (customerId, locationId, equipmentId, macAddress, macAddressString) values ( 1, 1, 2, 2, 'A1:2');
insert into client_session_by_mac_and_equipment (customerId, locationId, equipmentId, macAddress, macAddressString) values ( 1, 2, 1, 3, 'A1:3');
insert into client_session_by_mac_and_equipment (customerId, locationId, equipmentId, macAddress, macAddressString) values ( 1, 2, 2, 3, 'B1:3');
insert into client_session_by_mac_and_equipment (customerId, locationId, equipmentId, macAddress, macAddressString) values ( 1, 3, 2, 3, 'B1:3');
select macAddress from client_session_by_mac where macAddressString like '%A1%';
select macAddress from client_session_by_mac where macAddressString like '%A1%' and locationId in (2);
select macAddress from client_session_by_mac where macAddressString like '%A1%' and locationId in (1,2);
select macAddress from client_session_by_mac_and_equipment where macAddressString like '%A1%' and equipmentId in (2);
select macAddress from client_session_by_mac_and_equipment where macAddressString like '%A1%' and equipmentId in (1,3);
delete from client_session_by_mac where locationId = 1 and equipmentId = 1 and macAddressString = 'A1:1';
delete from client_session_by_mac_and_equipment where locationId = 1 and equipmentId = 1 and macAddressString = 'A1:1';
--------------------------------------------------------------------------------
-- Commands to clean up after the test
--------------------------------------------------------------------------------
TRUNCATE TABLE client_session_by_location ;
TRUNCATE TABLE client_session_by_equipment ;
TRUNCATE TABLE client_session_by_location;
TRUNCATE TABLE client_session_by_equipment;
TRUNCATE TABLE client_session_by_mac;
TRUNCATE TABLE client_session_by_mac_and_equipment;
TRUNCATE TABLE client_session;
TRUNCATE TABLE client_by_mac_string;
TRUNCATE TABLE client;

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -158,214 +158,6 @@ public abstract class BaseClientDatastoreTest {
}
@Test
public void testSearchByMacAddress() {
//create 100 Clients
Client mdl;
int customerId_1 = (int) testSequence.incrementAndGet();
List<Client> created_models = new ArrayList<>();
int apNameIdx = 0;
for(int i = 0; i< 50; i++){
mdl = new Client();
mdl.setCustomerId(customerId_1);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("qr_"+apNameIdx);
mdl.setDetails(details);
mdl.setMacAddress(new MacAddress("A1:FF:FF:FF:FF:" + Integer.toHexString(i)));
apNameIdx++;
mdl = testInterface.create(mdl);
created_models.add(mdl);
}
for(int i = 0; i< 50; i++){
mdl = new Client();
mdl.setCustomerId(customerId_1);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("cr_"+apNameIdx);
mdl.setDetails(details );
mdl.setMacAddress(new MacAddress("B1:FF:FF:FF:FF:" + Integer.toHexString(i)));
apNameIdx++;
mdl = testInterface.create(mdl);
created_models.add(mdl);
}
//paginate over Clients
List<ColumnAndSort> sortBy = new ArrayList<>();
sortBy.addAll(Arrays.asList(new ColumnAndSort("macAddress")));
PaginationContext<Client> context = new PaginationContext<>(10);
PaginationResponse<Client> page1 = testInterface.searchByMacAddress(customerId_1, "A1", sortBy, context);
PaginationResponse<Client> page2 = testInterface.searchByMacAddress(customerId_1, "A1", sortBy, page1.getContext());
PaginationResponse<Client> page3 = testInterface.searchByMacAddress(customerId_1, "A1", sortBy, page2.getContext());
PaginationResponse<Client> page4 = testInterface.searchByMacAddress(customerId_1, "A1", sortBy, page3.getContext());
PaginationResponse<Client> page5 = testInterface.searchByMacAddress(customerId_1, "A1", sortBy, page4.getContext());
PaginationResponse<Client> page6 = testInterface.searchByMacAddress(customerId_1, "A1", sortBy, page5.getContext());
PaginationResponse<Client> page7 = testInterface.searchByMacAddress(customerId_1, "A1", sortBy, page6.getContext());
//verify returned pages
assertEquals(10, page1.getItems().size());
assertEquals(10, page2.getItems().size());
assertEquals(10, page3.getItems().size());
assertEquals(10, page4.getItems().size());
assertEquals(10, page5.getItems().size());
page1.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()) );
page2.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()) );
page3.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()) );
page4.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()) );
page5.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()) );
assertEquals(0, page6.getItems().size());
assertEquals(0, page7.getItems().size());
assertFalse(page1.getContext().isLastPage());
assertFalse(page2.getContext().isLastPage());
assertFalse(page3.getContext().isLastPage());
assertFalse(page4.getContext().isLastPage());
assertFalse(page5.getContext().isLastPage());
assertTrue(page6.getContext().isLastPage());
assertTrue(page7.getContext().isLastPage());
List<String> expectedPage3Strings = new ArrayList<>(Arrays.asList(new String[]{"qr_20", "qr_21", "qr_22", "qr_23", "qr_24", "qr_25", "qr_26", "qr_27", "qr_28", "qr_29" }));
List<String> actualPage3Strings = new ArrayList<>();
page3.getItems().stream().forEach( ce -> actualPage3Strings.add(((ClientInfoDetails)ce.getDetails()).getAlias()) );
assertEquals(expectedPage3Strings, actualPage3Strings);
//test first page of the results with empty sort order -> default sort order (by Id ascending)
PaginationResponse<Client> page1EmptySort = testInterface.searchByMacAddress(customerId_1, "A1", Collections.emptyList(), context);
assertEquals(10, page1EmptySort.getItems().size());
List<String> expectedPage1EmptySortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
List<String> actualPage1EmptySortStrings = new ArrayList<>();
page1EmptySort.getItems().stream().forEach( ce -> actualPage1EmptySortStrings.add(((ClientInfoDetails)ce.getDetails()).getAlias()) );
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
//test first page of the results with null sort order -> default sort order (by Id ascending)
PaginationResponse<Client> page1NullSort = testInterface.searchByMacAddress(customerId_1, "A1", null, context);
assertEquals(10, page1NullSort.getItems().size());
List<String> expectedPage1NullSortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
List<String> actualPage1NullSortStrings = new ArrayList<>();
page1NullSort.getItems().stream().forEach( ce -> actualPage1NullSortStrings.add(((ClientInfoDetails)ce.getDetails()).getAlias()) );
assertEquals(expectedPage1NullSortStrings, actualPage1NullSortStrings);
//test first page of the results with sort descending order by a macAddress property
PaginationResponse<Client> page1SingleSortDesc = testInterface.searchByMacAddress(customerId_1, "A1", Collections.singletonList(new ColumnAndSort("macAddress", SortOrder.desc)), context);
assertEquals(10, page1SingleSortDesc.getItems().size());
List<String> expectedPage1SingleSortDescStrings = getSearchByMac_ExpectedPage1SingleSortDescStrings();
List<String> actualPage1SingleSortDescStrings = new ArrayList<>();
page1SingleSortDesc.getItems().stream().forEach( ce -> actualPage1SingleSortDescStrings.add(((ClientInfoDetails)ce.getDetails()).getAlias()) );
assertEquals(expectedPage1SingleSortDescStrings, actualPage1SingleSortDescStrings);
created_models.forEach(m -> testInterface.delete(m.getCustomerId(), m.getMacAddress()));
}
/**
* This method is overridden in the cassandra datastore because cassandra does not handle sort order
*/
protected List<String> getSearchByMac_ExpectedPage1SingleSortDescStrings(){
return new ArrayList<>(Arrays.asList(new String[]{"qr_49", "qr_48", "qr_47", "qr_46", "qr_45", "qr_44", "qr_43", "qr_42", "qr_41", "qr_40" }));
}
@Test
public void testEmptyNullSearchMacSubstring() {
Client mdl;
int customerId = (int) testSequence.incrementAndGet();
int apNameIdx = 0;
List<Client> created_models = new ArrayList<>();
for(int i = 0; i< 50; i++){
mdl = new Client();
mdl.setCustomerId(customerId);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("qr_"+apNameIdx);
mdl.setDetails(details);
mdl.setMacAddress(new MacAddress("A1:FF:FF:FF:FF:" + Integer.toHexString(i)));
apNameIdx++;
mdl = testInterface.create(mdl);
created_models.add(mdl);
}
for(int i = 0; i< 50; i++){
mdl = new Client();
mdl.setCustomerId(customerId);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("cr_"+apNameIdx);
mdl.setDetails(details );
mdl.setMacAddress(new MacAddress("B1:FF:FF:FF:FF:" + Integer.toHexString(i)));
apNameIdx++;
mdl = testInterface.create(mdl);
created_models.add(mdl);
}
List<ColumnAndSort> sortBy = new ArrayList<>();
PaginationContext<Client> context = new PaginationContext<>(10);
//test null and empty string macSubstring inputs, expecting to get all results
PaginationResponse<Client> emptySubstringPage1 = testInterface.searchByMacAddress(customerId, "", sortBy, context);
PaginationResponse<Client> emptySubstringPage2 = testInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage1.getContext());
PaginationResponse<Client> emptySubstringPage3 = testInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage2.getContext());
PaginationResponse<Client> emptySubstringPage4 = testInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage3.getContext());
PaginationResponse<Client> emptySubstringPage5 = testInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage4.getContext());
PaginationResponse<Client> emptySubstringPage6 = testInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage5.getContext());
PaginationResponse<Client> emptySubstringPage7 = testInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage6.getContext());
PaginationResponse<Client> emptySubstringPage8 = testInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage7.getContext());
PaginationResponse<Client> emptySubstringPage9 = testInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage8.getContext());
PaginationResponse<Client> emptySubstringPage10 = testInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage9.getContext());
PaginationResponse<Client> emptySubstringPage11 = testInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage10.getContext());
assertEquals(10, emptySubstringPage1.getItems().size());
assertEquals(10, emptySubstringPage2.getItems().size());
assertEquals(10, emptySubstringPage3.getItems().size());
assertEquals(10, emptySubstringPage4.getItems().size());
assertEquals(10, emptySubstringPage5.getItems().size());
assertEquals(10, emptySubstringPage6.getItems().size());
assertEquals(10, emptySubstringPage7.getItems().size());
assertEquals(10, emptySubstringPage8.getItems().size());
assertEquals(10, emptySubstringPage9.getItems().size());
assertEquals(10, emptySubstringPage10.getItems().size());
assertEquals(0, emptySubstringPage11.getItems().size());
PaginationResponse<Client> nullSubstringPage1 = testInterface.searchByMacAddress(customerId, null, sortBy, context);
PaginationResponse<Client> nullSubstringPage2 = testInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage1.getContext());
PaginationResponse<Client> nullSubstringPage3 = testInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage2.getContext());
PaginationResponse<Client> nullSubstringPage4 = testInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage3.getContext());
PaginationResponse<Client> nullSubstringPage5 = testInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage4.getContext());
PaginationResponse<Client> nullSubstringPage6 = testInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage5.getContext());
PaginationResponse<Client> nullSubstringPage7 = testInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage6.getContext());
PaginationResponse<Client> nullSubstringPage8 = testInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage7.getContext());
PaginationResponse<Client> nullSubstringPage9 = testInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage8.getContext());
PaginationResponse<Client> nullSubstringPage10 = testInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage9.getContext());
PaginationResponse<Client> nullSubstringPage11 = testInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage10.getContext());
assertEquals(10, nullSubstringPage1.getItems().size());
assertEquals(10, nullSubstringPage2.getItems().size());
assertEquals(10, nullSubstringPage3.getItems().size());
assertEquals(10, nullSubstringPage4.getItems().size());
assertEquals(10, nullSubstringPage5.getItems().size());
assertEquals(10, nullSubstringPage6.getItems().size());
assertEquals(10, nullSubstringPage7.getItems().size());
assertEquals(10, nullSubstringPage8.getItems().size());
assertEquals(10, nullSubstringPage9.getItems().size());
assertEquals(10, nullSubstringPage10.getItems().size());
assertEquals(0, nullSubstringPage11.getItems().size());
created_models.forEach(m -> testInterface.delete(m.getCustomerId(), m.getMacAddress()));
}
@Test
public void testClientPagination()
{
@@ -383,8 +175,12 @@ public abstract class BaseClientDatastoreTest {
mdl.setCustomerId(customerId_1);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("qr_"+apNameIdx);
mdl.setDetails(details );
mdl.setMacAddress(new MacAddress((long)i));
mdl.setDetails(details);
if (i < 20) {
mdl.setMacAddress(new MacAddress("A1:FF:FF:FF:FF:" + Integer.toHexString(i)));
} else {
mdl.setMacAddress(new MacAddress("B1:FF:FF:FF:FF:" + Integer.toHexString(i)));
}
apNameIdx++;
mdl = testInterface.create(mdl);
@@ -396,8 +192,8 @@ public abstract class BaseClientDatastoreTest {
mdl.setCustomerId(customerId_2);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("qr_"+apNameIdx);
mdl.setDetails(details );
mdl.setMacAddress(new MacAddress((long)i));
mdl.setDetails(details);
mdl.setMacAddress(new MacAddress("B1:FF:FF:FF:FF:" + Integer.toHexString(i)));
apNameIdx++;
mdl = testInterface.create(mdl);
@@ -410,13 +206,13 @@ public abstract class BaseClientDatastoreTest {
sortBy.addAll(Arrays.asList(new ColumnAndSort("macAddress")));
PaginationContext<Client> context = new PaginationContext<>(10);
PaginationResponse<Client> page1 = testInterface.getForCustomer(customerId_1, sortBy, context);
PaginationResponse<Client> page2 = testInterface.getForCustomer(customerId_1, sortBy, page1.getContext());
PaginationResponse<Client> page3 = testInterface.getForCustomer(customerId_1, sortBy, page2.getContext());
PaginationResponse<Client> page4 = testInterface.getForCustomer(customerId_1, sortBy, page3.getContext());
PaginationResponse<Client> page5 = testInterface.getForCustomer(customerId_1, sortBy, page4.getContext());
PaginationResponse<Client> page6 = testInterface.getForCustomer(customerId_1, sortBy, page5.getContext());
PaginationResponse<Client> page7 = testInterface.getForCustomer(customerId_1, sortBy, page6.getContext());
PaginationResponse<Client> page1 = testInterface.getForCustomer(customerId_1, null, sortBy, context);
PaginationResponse<Client> page2 = testInterface.getForCustomer(customerId_1, null, sortBy, page1.getContext());
PaginationResponse<Client> page3 = testInterface.getForCustomer(customerId_1, null, sortBy, page2.getContext());
PaginationResponse<Client> page4 = testInterface.getForCustomer(customerId_1, null, sortBy, page3.getContext());
PaginationResponse<Client> page5 = testInterface.getForCustomer(customerId_1, null, sortBy, page4.getContext());
PaginationResponse<Client> page6 = testInterface.getForCustomer(customerId_1, null, sortBy, page5.getContext());
PaginationResponse<Client> page7 = testInterface.getForCustomer(customerId_1, null, sortBy, page6.getContext());
//verify returned pages
assertEquals(10, page1.getItems().size());
@@ -448,10 +244,47 @@ public abstract class BaseClientDatastoreTest {
page3.getItems().stream().forEach( ce -> actualPage3Strings.add(((ClientInfoDetails)ce.getDetails()).getAlias()) );
assertEquals(expectedPage3Strings, actualPage3Strings);
// empty and null substring should return the same result
PaginationResponse<Client> page1EmptySubstring = testInterface.getForCustomer(customerId_1, "", sortBy, context);
PaginationResponse<Client> page2EmptySubstring = testInterface.getForCustomer(customerId_1, "", sortBy, page1EmptySubstring.getContext());
PaginationResponse<Client> page3EmptySubstring = testInterface.getForCustomer(customerId_1, "", sortBy, page2EmptySubstring.getContext());
PaginationResponse<Client> page4EmptySubstring = testInterface.getForCustomer(customerId_1, "", sortBy, page3EmptySubstring.getContext());
PaginationResponse<Client> page5EmptySubstring = testInterface.getForCustomer(customerId_1, "", sortBy, page4EmptySubstring.getContext());
//verify returned pages
assertEquals(10, page1EmptySubstring.getItems().size());
assertEquals(10, page2EmptySubstring.getItems().size());
assertEquals(10, page3EmptySubstring.getItems().size());
assertEquals(10, page4EmptySubstring.getItems().size());
assertEquals(10, page5EmptySubstring.getItems().size());
assertEquals(page1.getItems(), page1EmptySubstring.getItems());
assertEquals(page2.getItems(), page2EmptySubstring.getItems());
assertEquals(page3.getItems(), page3EmptySubstring.getItems());
assertEquals(page4.getItems(), page4EmptySubstring.getItems());
assertEquals(page5.getItems(), page5EmptySubstring.getItems());
// Test macAddress search
PaginationResponse<Client> page1SearchMac = testInterface.getForCustomer(customerId_1, "A1", sortBy, context);
PaginationResponse<Client> page2SearchMac = testInterface.getForCustomer(customerId_1, "A1", sortBy, page1SearchMac.getContext());
PaginationResponse<Client> page3SearchMac = testInterface.getForCustomer(customerId_1, "A1", sortBy, page2SearchMac.getContext());
//verify returned pages
assertEquals(10, page1SearchMac.getItems().size());
assertEquals(10, page2SearchMac.getItems().size());
assertEquals(0, page3SearchMac.getItems().size());
page1SearchMac.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()));
page2SearchMac.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()));
page1SearchMac.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
page2SearchMac.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
assertTrue(page3SearchMac.getContext().isLastPage());
//test first page of the results with empty sort order -> default sort order (by Id ascending)
PaginationResponse<Client> page1EmptySort = testInterface.getForCustomer(customerId_1, Collections.emptyList(), context);
PaginationResponse<Client> page1EmptySort = testInterface.getForCustomer(customerId_1, null, Collections.emptyList(), context);
assertEquals(10, page1EmptySort.getItems().size());
List<String> expectedPage1EmptySortStrings = getClientPagination_ExpectedPage1EmptySortStrings();
@@ -461,7 +294,7 @@ public abstract class BaseClientDatastoreTest {
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
//test first page of the results with null sort order -> default sort order (by Id ascending)
PaginationResponse<Client> page1NullSort = testInterface.getForCustomer(customerId_1, null, context);
PaginationResponse<Client> page1NullSort = testInterface.getForCustomer(customerId_1, null, null, context);
assertEquals(10, page1NullSort.getItems().size());
List<String> expectedPage1NullSortStrings = new ArrayList<>(expectedPage1EmptySortStrings);
@@ -472,7 +305,7 @@ public abstract class BaseClientDatastoreTest {
//test first page of the results with sort descending order by a macAddress property
PaginationResponse<Client> page1SingleSortDesc = testInterface.getForCustomer(customerId_1, Collections.singletonList(new ColumnAndSort("macAddress", SortOrder.desc)), context);
PaginationResponse<Client> page1SingleSortDesc = testInterface.getForCustomer(customerId_1, null, Collections.singletonList(new ColumnAndSort("macAddress", SortOrder.desc)), context);
assertEquals(10, page1SingleSortDesc.getItems().size());
List<String> expectedPage1SingleSortDescStrings = getClientPagination_ExpectedPage1SingleSortDescStrings();
@@ -787,17 +620,19 @@ public abstract class BaseClientDatastoreTest {
if(i<10) {
mdl.setEquipmentId(equipmentId_1);
mdl.setLocationId(locationId_1);
mdl.setMacAddress(new MacAddress("A1:FF:FF:FF:FF:" + Integer.toHexString(i)));
} else if(i<20) {
mdl.setEquipmentId(equipmentId_2);
mdl.setLocationId(locationId_2);
mdl.setMacAddress(new MacAddress("A1:FF:FF:FF:FF:" + Integer.toHexString(i)));
} else {
mdl.setEquipmentId(testSequence.incrementAndGet());
mdl.setMacAddress(new MacAddress("B1:FF:FF:FF:FF:" + Integer.toHexString(i)));
}
ClientSessionDetails details = new ClientSessionDetails();
details.setApFingerprint("qr_"+apNameIdx);
mdl.setDetails(details );
mdl.setMacAddress(new MacAddress((long)i));
apNameIdx++;
@@ -836,13 +671,13 @@ public abstract class BaseClientDatastoreTest {
sortBy.addAll(Arrays.asList(new ColumnAndSort("macAddress")));
PaginationContext<ClientSession> context = new PaginationContext<>(10);
PaginationResponse<ClientSession> page1 = testInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, context);
PaginationResponse<ClientSession> page2 = testInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page1.getContext());
PaginationResponse<ClientSession> page3 = testInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page2.getContext());
PaginationResponse<ClientSession> page4 = testInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page3.getContext());
PaginationResponse<ClientSession> page5 = testInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page4.getContext());
PaginationResponse<ClientSession> page6 = testInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page5.getContext());
PaginationResponse<ClientSession> page7 = testInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page6.getContext());
PaginationResponse<ClientSession> page1 = testInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, context);
PaginationResponse<ClientSession> page2 = testInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page1.getContext());
PaginationResponse<ClientSession> page3 = testInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page2.getContext());
PaginationResponse<ClientSession> page4 = testInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page3.getContext());
PaginationResponse<ClientSession> page5 = testInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page4.getContext());
PaginationResponse<ClientSession> page6 = testInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page5.getContext());
PaginationResponse<ClientSession> page7 = testInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page6.getContext());
//verify returned pages
assertEquals(10, page1.getItems().size());
@@ -868,6 +703,26 @@ public abstract class BaseClientDatastoreTest {
assertTrue(page6.getContext().isLastPage());
assertTrue(page7.getContext().isLastPage());
// when remote interface receives macSubstring = null, it will pass on macSubstring = "" instead.
PaginationResponse<ClientSession> page1EmptySubstring = testInterface.getSessionsForCustomer(customerId_1, null, null, "", sortBy, context);
PaginationResponse<ClientSession> page2EmptySubstring = testInterface.getSessionsForCustomer(customerId_1, null, null, "", sortBy, page1.getContext());
PaginationResponse<ClientSession> page3EmptySubstring = testInterface.getSessionsForCustomer(customerId_1, null, null, "", sortBy, page2.getContext());
PaginationResponse<ClientSession> page4EmptySubstring = testInterface.getSessionsForCustomer(customerId_1, null, null, "", sortBy, page3.getContext());
PaginationResponse<ClientSession> page5EmptySubstring = testInterface.getSessionsForCustomer(customerId_1, null, null, "", sortBy, page4.getContext());
//verify returned pages
assertEquals(10, page1EmptySubstring.getItems().size());
assertEquals(10, page2EmptySubstring.getItems().size());
assertEquals(10, page3EmptySubstring.getItems().size());
assertEquals(10, page4EmptySubstring.getItems().size());
assertEquals(10, page5EmptySubstring.getItems().size());
assertEquals(page1.getItems(), page1EmptySubstring.getItems());
assertEquals(page2.getItems(), page2EmptySubstring.getItems());
assertEquals(page3.getItems(), page3EmptySubstring.getItems());
assertEquals(page4.getItems(), page4EmptySubstring.getItems());
assertEquals(page5.getItems(), page5EmptySubstring.getItems());
Set<String> expectedAllPagesStrings = new HashSet<>();
for(int i=0; i<50; i++) {
@@ -888,10 +743,62 @@ public abstract class BaseClientDatastoreTest {
page3.getItems().stream().forEach( ce -> actualPage3Strings.add(((ClientSessionDetails)ce.getDetails()).getApFingerprint()) );
assertEquals(expectedPage3Strings, actualPage3Strings);
// Test macAddress search
PaginationResponse<ClientSession> page1SearchMac = testInterface.getSessionsForCustomer(customerId_1, null, null, "A1", sortBy, context);
PaginationResponse<ClientSession> page2SearchMac = testInterface.getSessionsForCustomer(customerId_1, null, null, "A1", sortBy, page1SearchMac.getContext());
PaginationResponse<ClientSession> page3SearchMac = testInterface.getSessionsForCustomer(customerId_1, null, null, "A1", sortBy, page2SearchMac.getContext());
//verify returned pages
assertEquals(10, page1SearchMac.getItems().size());
assertEquals(10, page2SearchMac.getItems().size());
assertEquals(0, page3SearchMac.getItems().size());
page1SearchMac.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
page2SearchMac.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
// Test macAddress search with locationId
Set<Long> locationSearchSet = new HashSet<Long>(Arrays.asList(locationId_1));
PaginationResponse<ClientSession> page1SearchMacAndLocation = testInterface.getSessionsForCustomer(customerId_1, null, locationSearchSet, "A1", sortBy, context);
PaginationResponse<ClientSession> page2SearchMacAndLocation = testInterface.getSessionsForCustomer(customerId_1, null, locationSearchSet, "A1", sortBy, page1SearchMacAndLocation.getContext());
PaginationResponse<ClientSession> page3SearchMacAndLocation = testInterface.getSessionsForCustomer(customerId_1, null, locationSearchSet, "A1", sortBy, page2SearchMacAndLocation.getContext());
//verify returned pages
assertEquals(10, page1SearchMacAndLocation.getItems().size());
assertEquals(0, page2SearchMacAndLocation.getItems().size());
assertEquals(0, page3SearchMacAndLocation.getItems().size());
page1SearchMacAndLocation.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
page1SearchMacAndLocation.getItems().forEach(e -> assertEquals(locationId_1, e.getLocationId()));
// Test macAddress search with equipmentId
Set<Long> equipmentSearchSet = new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2));
PaginationResponse<ClientSession> page1SearchMacAndEquipment = testInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, null, "A1", sortBy, context);
PaginationResponse<ClientSession> page2SearchMacAndEquipment = testInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, null, "A1", sortBy, page1SearchMacAndEquipment.getContext());
PaginationResponse<ClientSession> page3SearchMacAndEquipment = testInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, null, "A1", sortBy, page2SearchMacAndEquipment.getContext());
//verify returned pages
assertEquals(10, page1SearchMacAndEquipment.getItems().size());
assertEquals(10, page2SearchMacAndEquipment.getItems().size());
assertEquals(0, page3SearchMacAndEquipment.getItems().size());
page1SearchMacAndEquipment.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
page1SearchMacAndEquipment.getItems().forEach(e -> assertTrue(equipmentSearchSet.contains(e.getEquipmentId())));
// Test macAddress search with equipmentId and locationId
PaginationResponse<ClientSession> page1SearchMacAndEquipmentAndLocation = testInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, locationSearchSet, "A1", sortBy, context);
PaginationResponse<ClientSession> page2SearchMacAndEquipmentAndLocation = testInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, locationSearchSet, "A1", sortBy, page1SearchMacAndEquipmentAndLocation.getContext());
PaginationResponse<ClientSession> page3SearchMacAndEquipmentAndLocation = testInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, locationSearchSet, "A1", sortBy, page2SearchMacAndEquipmentAndLocation.getContext());
//verify returned pages
assertEquals(10, page1SearchMacAndEquipmentAndLocation.getItems().size());
assertEquals(0, page2SearchMacAndEquipmentAndLocation.getItems().size());
assertEquals(0, page3SearchMacAndEquipmentAndLocation.getItems().size());
page1SearchMacAndEquipmentAndLocation.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
page1SearchMacAndEquipmentAndLocation.getItems().forEach(e -> assertEquals(equipmentId_1, e.getEquipmentId()));
page1SearchMacAndEquipmentAndLocation.getItems().forEach(e -> assertEquals(locationId_1, e.getLocationId()));
//test first page of the results with empty sort order -> default sort order (by Id ascending)
PaginationResponse<ClientSession> page1EmptySort = testInterface.getSessionsForCustomer(customerId_1, null, null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page1EmptySort = testInterface.getSessionsForCustomer(customerId_1, null, null, null, Collections.emptyList(), context);
assertEquals(10, page1EmptySort.getItems().size());
List<String> expectedPage1EmptySortStrings = getClientSessionPagination_expectedPage1EmptySortStrings();
@@ -901,7 +808,7 @@ public abstract class BaseClientDatastoreTest {
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
//test first page of the results with null sort order -> default sort order (by Id ascending)
PaginationResponse<ClientSession> page1NullSort = testInterface.getSessionsForCustomer(customerId_1, null, null, null, context);
PaginationResponse<ClientSession> page1NullSort = testInterface.getSessionsForCustomer(customerId_1, null, null, null, null, context);
assertEquals(10, page1NullSort.getItems().size());
List<String> expectedPage1NullSortStrings = getClientSessionPagination_expectedPage1EmptySortStrings();
@@ -912,7 +819,7 @@ public abstract class BaseClientDatastoreTest {
//test first page of the results with sort descending order by a macAddress property
PaginationResponse<ClientSession> page1SingleSortDesc = testInterface.getSessionsForCustomer(customerId_1, null, null, Collections.singletonList(new ColumnAndSort("macAddress", SortOrder.desc)), context);
PaginationResponse<ClientSession> page1SingleSortDesc = testInterface.getSessionsForCustomer(customerId_1, null, null, null, Collections.singletonList(new ColumnAndSort("macAddress", SortOrder.desc)), context);
assertEquals(10, page1SingleSortDesc.getItems().size());
List<String> expectedPage1SingleSortDescStrings = getClientSessionPagination_expectedPage1SingleSortDescStrings();
@@ -922,8 +829,8 @@ public abstract class BaseClientDatastoreTest {
assertEquals(expectedPage1SingleSortDescStrings, actualPage1SingleSortDescStrings);
//test the results for equipment_1 only
PaginationResponse<ClientSession> page1Eq_1 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_1 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), null, Collections.emptyList(), page1Eq_1.getContext());
PaginationResponse<ClientSession> page1Eq_1 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), null, null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_1 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), null, null, Collections.emptyList(), page1Eq_1.getContext());
assertEquals(10, page1Eq_1.getItems().size());
assertEquals(0, page2Eq_1.getItems().size());
@@ -937,8 +844,8 @@ public abstract class BaseClientDatastoreTest {
assertEquals(expectedPage1Eq_1Strings, actualPage1Eq_1Strings);
//test the results for equipment_2 only
PaginationResponse<ClientSession> page1Eq_2 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_2)), null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_2 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_2)), null, Collections.emptyList(), page1Eq_2.getContext());
PaginationResponse<ClientSession> page1Eq_2 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_2)), null, null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_2 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_2)), null, null, Collections.emptyList(), page1Eq_2.getContext());
assertEquals(10, page1Eq_2.getItems().size());
assertEquals(0, page2Eq_2.getItems().size());
@@ -953,9 +860,9 @@ public abstract class BaseClientDatastoreTest {
//test the results for equipment_1 or equipment_2 only
PaginationResponse<ClientSession> page1Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, Collections.emptyList(), page1Eq_1or2.getContext());
PaginationResponse<ClientSession> page3Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, Collections.emptyList(), page2Eq_1or2.getContext());
PaginationResponse<ClientSession> page1Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, null, Collections.emptyList(), page1Eq_1or2.getContext());
PaginationResponse<ClientSession> page3Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, null, Collections.emptyList(), page2Eq_1or2.getContext());
assertEquals(10, page1Eq_1or2.getItems().size());
assertEquals(10, page2Eq_1or2.getItems().size());
@@ -981,8 +888,8 @@ public abstract class BaseClientDatastoreTest {
//
//test the results for location_1 only
page1Eq_1 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1)), Collections.emptyList(), context);
page2Eq_1 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1)), Collections.emptyList(), page1Eq_1.getContext());
page1Eq_1 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1)), null, Collections.emptyList(), context);
page2Eq_1 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1)), null, Collections.emptyList(), page1Eq_1.getContext());
assertEquals(10, page1Eq_1.getItems().size());
assertEquals(0, page2Eq_1.getItems().size());
@@ -996,8 +903,8 @@ public abstract class BaseClientDatastoreTest {
assertEquals(expectedPage1Eq_1Strings, actualPage1Loc_1Strings);
//test the results for location_2 only
page1Eq_2 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_2)), Collections.emptyList(), context);
page2Eq_2 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_2)), Collections.emptyList(), page1Eq_2.getContext());
page1Eq_2 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_2)), null, Collections.emptyList(), context);
page2Eq_2 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_2)), null, Collections.emptyList(), page1Eq_2.getContext());
assertEquals(10, page1Eq_2.getItems().size());
assertEquals(0, page2Eq_2.getItems().size());
@@ -1012,9 +919,9 @@ public abstract class BaseClientDatastoreTest {
//test the results for location_1 or location_2 only
page1Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), Collections.emptyList(), context);
page2Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), Collections.emptyList(), page1Eq_1or2.getContext());
page3Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), Collections.emptyList(), page2Eq_1or2.getContext());
page1Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), null, Collections.emptyList(), context);
page2Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), null, Collections.emptyList(), page1Eq_1or2.getContext());
page3Eq_1or2 = testInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), null, Collections.emptyList(), page2Eq_1or2.getContext());
assertEquals(10, page1Eq_1or2.getItems().size());
assertEquals(10, page2Eq_1or2.getItems().size());
@@ -1036,8 +943,8 @@ public abstract class BaseClientDatastoreTest {
assertEquals(expectedPage2Eq_1or2Strings, actualPage2Loc_1or2Strings);
//test the results for ( location_1 or location_2 ) and equipment_1only
page1Eq_1 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), Collections.emptyList(), context);
page2Eq_1 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), Collections.emptyList(), page1Eq_1.getContext());
page1Eq_1 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), null, Collections.emptyList(), context);
page2Eq_1 = testInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), null, Collections.emptyList(), page1Eq_1.getContext());
assertEquals(10, page1Eq_1.getItems().size());
assertEquals(0, page2Eq_1.getItems().size());

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,19 +15,19 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-datastore-inmemory</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -176,113 +176,6 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
return ret;
}
@Override
public PaginationResponse<Client> searchByMacAddress(int customerId, String macSubstring,
final List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
if(context == null) {
context = new PaginationContext<>();
}
PaginationResponse<Client> ret = new PaginationResponse<>();
ret.setContext(context.clone());
if (ret.getContext().isLastPage()) {
// no more pages available according to the context
return ret;
}
List<Client> items = new LinkedList<>();
if(macSubstring != null) {
idToClientMap.forEach(
(k, c) -> {
if(k.customerId == customerId && k.mac.getAddressAsString().toLowerCase().contains(macSubstring.toLowerCase())) {
items.add(c.clone());
}
}
);
} else {
idToClientMap.forEach(
(k, c) -> {
if(k.customerId == customerId) {
items.add(c.clone());
}
}
);
}
// apply sortBy columns
Collections.sort(items, new Comparator<Client>() {
@Override
public int compare(Client o1, Client o2) {
if (sortBy == null || sortBy.isEmpty()) {
// sort ascending by id by default
return o1.getMacAddress().compareTo(o2.getMacAddress());
} else {
int cmp;
for (ColumnAndSort column : sortBy) {
switch (column.getColumnName()) {
case "macAddress":
cmp = o1.getMacAddress().compareTo(o2.getMacAddress());
break;
default:
// skip unknown column
continue;
}
if (cmp != 0) {
return (column.getSortOrder() == SortOrder.asc) ? cmp : (-cmp);
}
}
}
return 0;
}
});
// now select only items for the requested page
// find first item to add
int fromIndex = 0;
if (context.getStartAfterItem() != null) {
for (Client mdl : items) {
fromIndex++;
if (mdl.getCustomerId() == context.getStartAfterItem().getCustomerId()
&& mdl.getMacAddress().equals(context.getStartAfterItem().getMacAddress())) {
break;
}
}
}
// find last item to add
int toIndexExclusive = fromIndex + context.getMaxItemsPerPage();
if (toIndexExclusive > items.size()) {
toIndexExclusive = items.size();
}
// copy page items into result
List<Client> selectedItems = new ArrayList<>(context.getMaxItemsPerPage());
for (Client mdl : items.subList(fromIndex, toIndexExclusive)) {
selectedItems.add(mdl.clone());
}
ret.setItems(selectedItems);
// adjust context for the next page
ret.prepareForNextPage();
if(ret.getContext().getStartAfterItem()!=null) {
//this datastore is only interested in the last item's id, so we'll clear all other fields on the startAfterItem in the pagination context
Client newStartAfterItem = new Client();
newStartAfterItem.setCustomerId(ret.getContext().getStartAfterItem().getCustomerId());
newStartAfterItem.setMacAddress(ret.getContext().getStartAfterItem().getMacAddress());
ret.getContext().setStartAfterItem(newStartAfterItem);
}
return ret;
}
@Override
public List<Client> getBlockedClients(int customerId) {
@@ -305,7 +198,7 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
}
@Override
public PaginationResponse<Client> getForCustomer(int customerId,
public PaginationResponse<Client> getForCustomer(int customerId, String macSubstring,
final List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
if(context == null) {
@@ -328,8 +221,11 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
if (mdl.getCustomerId() != customerId) {
continue;
}
items.add(mdl);
if (macSubstring == null ||
mdl.getMacAddress().getAddressAsString().toLowerCase().contains(macSubstring.toLowerCase())) {
items.add(mdl);
}
}
// apply sortBy columns
@@ -491,6 +387,7 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
public PaginationResponse<ClientSession> getSessionsForCustomer(int customerId,
Set<Long> equipmentIds,
Set<Long> locationIds,
String macSubstring,
final List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context) {
if(context == null) {
@@ -520,7 +417,12 @@ public class ClientDatastoreInMemory extends BaseInMemoryDatastore implements Cl
locationIds == null
|| locationIds.isEmpty()
|| locationIds.contains(mdl.getLocationId())
)
) &&
(
macSubstring == null
|| macSubstring.isEmpty()
|| mdl.getMacAddress().getAddressAsString().toLowerCase().contains(macSubstring.toLowerCase())
)
) {
items.add(mdl);
}

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-exceptions</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -29,17 +29,9 @@ public interface ClientDatastore {
* @return list of matching Client objects.
*/
List<Client> get(int customerId, Set<MacAddress> clientMacSet);
/**
* Retrieves a list of Client records that have mac addresses that match a given substring.
*
* @param macSubstring
* @return next page of matching Client objects.
*/
PaginationResponse<Client> searchByMacAddress(int customerId, String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<Client> context);
/**
* <br>Retrieves all of the Client records that are mapped to the provided customerId.
* <br>Retrieves all of the Client records that are mapped to the provided customerId and optional macSubstring filter.
* Results are returned in pages.
*
* <br>When changing sort order or filters, pagination should be restarted again from the first page.
@@ -52,9 +44,10 @@ public interface ClientDatastore {
*<li> "macAddress"
*<br>
* @param customerId
* @param macSubstring
* @return next page of matching Client objects.
*/
PaginationResponse<Client> getForCustomer(int customerId, List<ColumnAndSort> sortBy, PaginationContext<Client> context);
PaginationResponse<Client> getForCustomer(int customerId, String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<Client> context);
/**
* @param customerId
@@ -105,10 +98,11 @@ public interface ClientDatastore {
* @param customerId
* @param equipmentIds - set of equipment ids for which to retrieve session objects. Empty set or null means retrieve for all customer's equipment.
* @param locationIds - set of location ids for which to retrieve session objects. Empty set or null means retrieve for all customer's locations.
* @param macSubstring - To match with MacAddress
*
* @return next page of matching Client session objects.
*/
PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context);
PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context);
}

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc-tests</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>client-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -388,126 +388,35 @@ public class ClientDAO extends BaseJdbcDao {
LOG.debug("get({}, {}) returns {} record(s)", customerId, clientMacSet, results.size());
return results;
}
public PaginationResponse<Client> searchByMacAddress(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
LOG.debug("calling searchByMacAddress({}, {})", customerId, macSubstring);
public PaginationResponse<Client> getForCustomer(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
PaginationResponse<Client> ret = new PaginationResponse<>();
ret.setContext(context.clone());
if (ret.getContext().isLastPage()) {
// no more pages available according to the context
LOG.debug(
"No more pages available when looking up Clients for customer {} and macSubstring {} with last returned page number {}",
"No more pages available when looking up Clients for customer {} macSubstring {} with last returned page number {}",
customerId, macSubstring, context.getLastReturnedPageNumber());
return ret;
}
LOG.debug("Looking up Clients for customer {} and macSubstring {} with last returned page number {}",
LOG.debug("Looking up Clients for customer {} macSubstring {} with last returned page number {}",
customerId, macSubstring, context.getLastReturnedPageNumber());
String query;
ArrayList<Object> queryArgs = new ArrayList<>();
if (macSubstring != null) {
query = SQL_GET_BY_CUSTOMER_ID + SQL_APPEND_SEARCH_MAC_SUBSTRING;
// add filters for the query
queryArgs.add(customerId);
queryArgs.add("%" + macSubstring.toLowerCase() + "%");
} else {
query = SQL_GET_BY_CUSTOMER_ID;
// add filters for the query
queryArgs.add(customerId);
}
// add sorting options for the query
StringBuilder strbSort = new StringBuilder(100);
strbSort.append(" order by ");
if (sortBy != null && !sortBy.isEmpty()) {
// use supplied sorting options
for (ColumnAndSort column : sortBy) {
if (!ALL_COLUMNS_LOWERCASE.contains(column.getColumnName().toLowerCase())) {
// unknown column, skip it
continue;
}
strbSort.append(column.getColumnName());
if (column.getSortOrder() == SortOrder.desc) {
strbSort.append(" desc");
}
strbSort.append(",");
}
// remove last ','
strbSort.deleteCharAt(strbSort.length() - 1);
} else {
// no sort order was specified - sort by id to have consistent
// paging
strbSort.append(COL_ID);
}
query += strbSort.toString();
// add pagination parameters for the query
query += SQL_PAGING_SUFFIX ;
queryArgs.add(context.getMaxItemsPerPage());
queryArgs.add(context.getTotalItemsReturned());
/*
* https://www.citusdata.com/blog/2016/03/30/five-ways-to-paginate/
* Choosing offset=1000 makes cost about 19 and has a 0.609 ms execution
* time. Once offset=5,000,000 the cost goes up to 92734 and execution
* time is 758.484 ms. - DT: still acceptable for our use case
*/
List<Client> pageItems = this.jdbcTemplate.query(query, queryArgs.toArray(),
clientRowMapper);
LOG.debug("Found {} Clients for customer {} and macSubstring {} with last returned page number {}",
pageItems.size(), customerId, macSubstring, context.getLastReturnedPageNumber());
ret.setItems(pageItems);
// adjust context for the next page
ret.prepareForNextPage();
// startAfterItem is not used in RDBMS datastores, set it to null
ret.getContext().setStartAfterItem(null);
return ret;
}
public PaginationResponse<Client> getForCustomer(int customerId, List<ColumnAndSort> sortBy,
PaginationContext<Client> context) {
PaginationResponse<Client> ret = new PaginationResponse<>();
ret.setContext(context.clone());
if (ret.getContext().isLastPage()) {
// no more pages available according to the context
LOG.debug(
"No more pages available when looking up Clients for customer {} with last returned page number {}",
customerId, context.getLastReturnedPageNumber());
return ret;
}
LOG.debug("Looking up Clients for customer {} with last returned page number {}",
customerId, context.getLastReturnedPageNumber());
String query = SQL_GET_BY_CUSTOMER_ID;
// add filters for the query
ArrayList<Object> queryArgs = new ArrayList<>();
queryArgs.add(customerId);
if (macSubstring != null) {
query += SQL_APPEND_SEARCH_MAC_SUBSTRING;
queryArgs.add("%" + macSubstring.toLowerCase() + "%");
}
// add sorting options for the query
StringBuilder strbSort = new StringBuilder(100);
@@ -557,8 +466,8 @@ public class ClientDAO extends BaseJdbcDao {
List<Client> pageItems = this.jdbcTemplate.query(query, queryArgs.toArray(),
clientRowMapper);
LOG.debug("Found {} Clients for customer {} with last returned page number {}",
pageItems.size(), customerId, context.getLastReturnedPageNumber());
LOG.debug("Found {} Clients for customer {} macSubstring {} with last returned page number {}",
pageItems.size(), customerId, macSubstring, context.getLastReturnedPageNumber());
ret.setItems(pageItems);

View File

@@ -50,26 +50,20 @@ public class ClientDatastoreRdbms implements ClientDatastore {
return clientDAO.get(customerId, clientMacSet);
}
@Override
public PaginationResponse<Client> searchByMacAddress(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
return clientDAO.searchByMacAddress(customerId, macSubstring, sortBy, context);
}
@Override
public List<Client> getBlockedClients(int customerId) {
return clientDAO.getBlockedClients(customerId);
}
@Override
public PaginationResponse<Client> getForCustomer(int customerId, List<ColumnAndSort> sortBy,
PaginationContext<Client> context) {
public PaginationResponse<Client> getForCustomer(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
if(context == null) {
context = new PaginationContext<>();
}
return clientDAO.getForCustomer( customerId, sortBy, context);
return clientDAO.getForCustomer(customerId, macSubstring, sortBy, context);
}
@Override
@@ -94,13 +88,13 @@ public class ClientDatastoreRdbms implements ClientDatastore {
@Override
public PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds,
List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context) {
String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context) {
if(context == null) {
context = new PaginationContext<>();
}
return clientSessionDAO.getSessionsForCustomer(customerId, equipmentIds, locationIds, sortBy, context);
return clientSessionDAO.getSessionsForCustomer(customerId, equipmentIds, locationIds, macSubstring, sortBy, context);
}

View File

@@ -51,6 +51,7 @@ public class ClientSessionDAO extends BaseJdbcDao {
private static final String[] ALL_COLUMNS_LIST = {
COL_ID,
"macAddressString",
//TODO: add colums from properties ClientSession in here
"customerId",
@@ -63,7 +64,7 @@ public class ClientSessionDAO extends BaseJdbcDao {
};
private static final Set<String> columnsToSkipForInsert = new HashSet<>(Arrays.asList());
private static final Set<String> columnsToSkipForUpdate = new HashSet<>(Arrays.asList(COL_ID, "customerId", "equipmentId"));
private static final Set<String> columnsToSkipForUpdate = new HashSet<>(Arrays.asList(COL_ID, "macAddressString", "customerId", "equipmentId"));
private static final String TABLE_NAME = "client_session";
private static final String TABLE_PREFIX = "s.";
@@ -149,6 +150,9 @@ public class ClientSessionDAO extends BaseJdbcDao {
;
private static final String SQL_GET_ALL_IN_SET = "select " + ALL_COLUMNS + " from "+TABLE_NAME + " where customerId = ? and "+ COL_ID +" in ";
private static final String SQL_APPEND_SEARCH_MAC_SUBSTRING =
"and macAddressString like ? ";
private static final String SQL_PAGING_SUFFIX = " LIMIT ? OFFSET ? ";
private static final String SORT_SUFFIX = "";
@@ -181,6 +185,7 @@ public class ClientSessionDAO extends BaseJdbcDao {
//TODO: add remaining properties from Client here
ps.setLong(colIdx++, clientSession.getMacAddress().getAddressAsLong());
ps.setString(colIdx++, clientSession.getMacAddress().getAddressAsString());
ps.setInt(colIdx++, clientSession.getCustomerId());
ps.setLong(colIdx++, clientSession.getEquipmentId());
ps.setLong(colIdx++, clientSession.getLocationId());
@@ -332,8 +337,8 @@ public class ClientSessionDAO extends BaseJdbcDao {
}
public PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, List<ColumnAndSort> sortBy,
PaginationContext<ClientSession> context) {
public PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds,
String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context) {
PaginationResponse<ClientSession> ret = new PaginationResponse<>();
ret.setContext(context.clone());
@@ -388,6 +393,13 @@ public class ClientSessionDAO extends BaseJdbcDao {
query += strb.toString();
}
//add macSubstring filter
if (macSubstring != null && !macSubstring.isEmpty()) {
query += SQL_APPEND_SEARCH_MAC_SUBSTRING;
queryArgs.add("%" + macSubstring.toLowerCase() + "%");
}
// add sorting options for the query
StringBuilder strbSort = new StringBuilder(100);

View File

@@ -28,7 +28,9 @@ public class ClientSessionRowMapper implements RowMapper<ClientSession> {
ClientSession clientSession = new ClientSession();
int colIdx=1;
clientSession.setMacAddress(new MacAddress(rs.getLong(colIdx++)));
// macAddressString here does not need to map again to ClientSession Object
colIdx++;
//TODO: add columns from properties ClientSession in here.
//make sure order of fields is the same as defined in ClientSession
clientSession.setCustomerId(rs.getInt(colIdx++));

View File

@@ -12,10 +12,11 @@ create table if not exists client (
primary key (customerId, macAddress)
);
alter table client add column if not exists macAddressString varchar(100);
create index if not exists idx_client_customerId on client (customerId);
create index if not exists idx_client_customerId_macAddressString on client (customerId, macAddressString);
create table if not exists client_blocklist (
-- postgresql
customerId int,
@@ -28,6 +29,7 @@ create table if not exists client_blocklist (
create table if not exists client_session (
-- postgresql
macAddress bigint ,
macAddressString varchar(100) ,
customerId int,
equipmentId bigint,
@@ -39,6 +41,10 @@ create table if not exists client_session (
primary key (customerId, equipmentId, macAddress)
);
alter table client_session add column if not exists macAddressString varchar(100);
create index if not exists idx_clientSession_customerId on client_session (customerId);
create index if not exists idx_clientSession_locationId on client_session (customerId, locationId);
create index if not exists idx_clientSession_customerId_macAddressString on client_session (customerId, macAddressString);

View File

@@ -30,6 +30,7 @@ create table if not exists client_blocklist (
create table client_session (
-- postgresql
macAddress bigint ,
macAddressString varchar(100),
customerId int,
equipmentId bigint,
@@ -43,4 +44,6 @@ create table client_session (
create index idx_clientSession_customerId on client_session (customerId);
create index idx_clientSession_locationId on client_session (customerId, locationId);
create index if not exists idx_clientSession_customerId_macAddressString on client_session (customerId, macAddressString);

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>system-event-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>client-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -43,14 +43,6 @@ public interface ClientServiceInterface {
*/
List<Client> get(int customerId, Set<MacAddress> clientMacSet);
/**
* Retrieves a list of Client records that have mac addresses that match a given substring.
*
* @param macSubstring
* @return next page of matching Client objects.
*/
PaginationResponse<Client> searchByMacAddress(int customerId, String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<Client> context);
/**
* Updates Client
*
@@ -70,7 +62,7 @@ public interface ClientServiceInterface {
Client delete(int customerId, MacAddress clientMac );
/**
* <br>Retrieves all of the Client records that are mapped to the provided customerId.
* <br>Retrieves all of the Client records that are mapped to the provided customerId and optional macSubstring filter.
* Results are returned in pages.
*
* <br>When changing sort order or filters, pagination should be restarted again from the first page.
@@ -83,9 +75,10 @@ public interface ClientServiceInterface {
*<li> "macAddress"
*<br>
* @param customerId
* @param macSubstring
* @return next page of matching Client objects.
*/
PaginationResponse<Client> getForCustomer(int customerId, List<ColumnAndSort> sortBy, PaginationContext<Client> context);
PaginationResponse<Client> getForCustomer(int customerId, String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<Client> context);
/**
* @param customerId
@@ -128,9 +121,10 @@ public interface ClientServiceInterface {
* @param customerId
* @param equipmentIds - set of equipment ids for which to retrieve session objects. Empty set or null means retrieve for all customer's equipment.
* @param locationIds - set of location ids for which to retrieve session objects. Empty set or null means retrieve for all customer's locations.
* @param macSubstring - To match with MacAddress
*
* @return next page of matching Client session objects.
*/
PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context);
PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds, String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context);
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,13 +16,13 @@
<dependency>
<artifactId>client-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -43,15 +43,9 @@ public class ClientServiceLocal implements ClientServiceInterface {
}
@Override
public PaginationResponse<Client> searchByMacAddress(int customerId, String macSubstring,
public PaginationResponse<Client> getForCustomer(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> paginationContext) {
return clientController.searchByMacAddress(customerId, macSubstring, sortBy, paginationContext);
}
@Override
public PaginationResponse<Client> getForCustomer(int customerId, List<ColumnAndSort> sortBy,
PaginationContext<Client> paginationContext) {
return clientController.getForCustomer(customerId, sortBy, paginationContext);
return clientController.getForCustomer(customerId, macSubstring, sortBy, paginationContext);
}
@Override
@@ -86,8 +80,8 @@ public class ClientServiceLocal implements ClientServiceInterface {
@Override
public PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds,
List<ColumnAndSort> sortBy, PaginationContext<ClientSession> paginationContext) {
return clientController.getSessionsForCustomer(customerId, equipmentIds, locationIds, sortBy, paginationContext);
String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> paginationContext) {
return clientController.getSessionsForCustomer(customerId, equipmentIds, locationIds, macSubstring, sortBy, paginationContext);
}
@Override

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,41 +15,41 @@
<dependency>
<artifactId>client-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-client</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Dependencies for the unit tests -->
<dependency>
<artifactId>base-remote-tests</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>client-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>client-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -107,27 +107,6 @@ public class ClientServiceRemote extends BaseRemoteClient implements ClientServi
}
@Override
public PaginationResponse<Client> searchByMacAddress(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
LOG.debug("searchByMacAddress({} {})", customerId, macSubstring);
try {
ResponseEntity<PaginationResponse<Client>> responseEntity = restTemplate.exchange(
getBaseUrl() + "/searchByMac?customerId={customerId}&macSubstring={macSubstring}&sortBy={sortBy}&paginationContext={context}",
HttpMethod.GET, null, Client_PAGINATION_RESPONSE_CLASS_TOKEN, customerId, macSubstring, sortBy, context);
PaginationResponse<Client> result = responseEntity.getBody();
LOG.debug("searchByMacAddress({} {}) return {} entries", customerId, macSubstring, result.getItems().size());
return result;
} catch (Exception exp) {
LOG.error("searchByMacAddress({} {}) exception ", customerId, macSubstring, exp);
throw exp;
}
}
@Override
public List<Client> getBlockedClients(int customerId) {
LOG.debug("getBlockedClients {}", customerId);
@@ -150,15 +129,15 @@ public class ClientServiceRemote extends BaseRemoteClient implements ClientServi
}
@Override
public PaginationResponse<Client> getForCustomer(int customerId, List<ColumnAndSort> sortBy,
PaginationContext<Client> context) {
public PaginationResponse<Client> getForCustomer(int customerId, String macSubstring,
List<ColumnAndSort> sortBy, PaginationContext<Client> context) {
LOG.debug("calling getForCustomer( {}, {}, {} )", customerId, sortBy, context);
LOG.debug("calling getForCustomer( {}, {}, {}, {} )", customerId, macSubstring, sortBy, context);
ResponseEntity<PaginationResponse<Client>> responseEntity = restTemplate.exchange(
getBaseUrl()
+ "/forCustomer?customerId={customerId}&sortBy={sortBy}&paginationContext={paginationContext}",
HttpMethod.GET, null, Client_PAGINATION_RESPONSE_CLASS_TOKEN, customerId, sortBy, context);
+ "/forCustomer?customerId={customerId}&macSubstring={macSubstring}&sortBy={sortBy}&paginationContext={paginationContext}",
HttpMethod.GET, null, Client_PAGINATION_RESPONSE_CLASS_TOKEN, customerId, macSubstring, sortBy, context);
PaginationResponse<Client> ret = responseEntity.getBody();
LOG.debug("completed getForCustomer {} ", ret.getItems().size());
@@ -255,9 +234,9 @@ public class ClientServiceRemote extends BaseRemoteClient implements ClientServi
@Override
public PaginationResponse<ClientSession> getSessionsForCustomer(int customerId, Set<Long> equipmentIds, Set<Long> locationIds,
List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context) {
String macSubstring, List<ColumnAndSort> sortBy, PaginationContext<ClientSession> context) {
LOG.debug("calling getSessionsForCustomer( {}, {}, {}, {} )", equipmentIds, customerId, sortBy, context);
LOG.debug("calling getSessionsForCustomer( {}, {}, {}, {}, {}, {} )", customerId, equipmentIds, locationIds, macSubstring, sortBy, context);
String equipmentIdsStr = null;
if (equipmentIds != null && !equipmentIds.isEmpty()) {
@@ -277,8 +256,8 @@ public class ClientServiceRemote extends BaseRemoteClient implements ClientServi
ResponseEntity<PaginationResponse<ClientSession>> responseEntity = restTemplate.exchange(
getBaseUrl()
+ "/session/forCustomer?customerId={customerId}&equipmentIds={equipmentIdsStr}&locationIds={locationIdsStr}&sortBy={sortBy}&paginationContext={paginationContext}",
HttpMethod.GET, null, ClientSession_PAGINATION_RESPONSE_CLASS_TOKEN, customerId, equipmentIdsStr, locationIdsStr, sortBy, context);
+ "/session/forCustomer?customerId={customerId}&equipmentIds={equipmentIdsStr}&locationIds={locationIdsStr}&macSubstring={macSubstring}&sortBy={sortBy}&paginationContext={paginationContext}",
HttpMethod.GET, null, ClientSession_PAGINATION_RESPONSE_CLASS_TOKEN, customerId, equipmentIdsStr, locationIdsStr, macSubstring, sortBy, context);
PaginationResponse<ClientSession> ret = responseEntity.getBody();
LOG.debug("completed getSessionsForCustomer {} ", ret.getItems().size());

View File

@@ -176,207 +176,6 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
}
}
@Test
public void testSearchByMacAddress() {
//create 100 Clients
Client mdl;
int customerId_1 = getNextCustomerId();
List<Client> created_models = new ArrayList<>();
int apNameIdx = 0;
for(int i = 0; i< 50; i++){
mdl = new Client();
mdl.setCustomerId(customerId_1);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("qr_"+apNameIdx);
mdl.setDetails(details);
mdl.setMacAddress(new MacAddress("A1:FF:FF:FF:FF:" + Integer.toHexString(i)));
apNameIdx++;
mdl = remoteInterface.create(mdl);
created_models.add(mdl);
}
for(int i = 0; i< 50; i++){
mdl = new Client();
mdl.setCustomerId(customerId_1);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("cr_"+apNameIdx);
mdl.setDetails(details );
mdl.setMacAddress(new MacAddress("B1:FF:FF:FF:FF:" + Integer.toHexString(i)));
apNameIdx++;
mdl = remoteInterface.create(mdl);
created_models.add(mdl);
}
//paginate over Clients
List<ColumnAndSort> sortBy = new ArrayList<>();
sortBy.addAll(Arrays.asList(new ColumnAndSort("macAddress")));
PaginationContext<Client> context = new PaginationContext<>(10);
PaginationResponse<Client> page1 = remoteInterface.searchByMacAddress(customerId_1, "A1", sortBy, context);
PaginationResponse<Client> page2 = remoteInterface.searchByMacAddress(customerId_1, "A1", sortBy, page1.getContext());
PaginationResponse<Client> page3 = remoteInterface.searchByMacAddress(customerId_1, "A1", sortBy, page2.getContext());
PaginationResponse<Client> page4 = remoteInterface.searchByMacAddress(customerId_1, "A1", sortBy, page3.getContext());
PaginationResponse<Client> page5 = remoteInterface.searchByMacAddress(customerId_1, "A1", sortBy, page4.getContext());
PaginationResponse<Client> page6 = remoteInterface.searchByMacAddress(customerId_1, "A1", sortBy, page5.getContext());
PaginationResponse<Client> page7 = remoteInterface.searchByMacAddress(customerId_1, "A1", sortBy, page6.getContext());
//verify returned pages
assertEquals(10, page1.getItems().size());
assertEquals(10, page2.getItems().size());
assertEquals(10, page3.getItems().size());
assertEquals(10, page4.getItems().size());
assertEquals(10, page5.getItems().size());
page1.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()) );
page2.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()) );
page3.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()) );
page4.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()) );
page5.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()) );
assertEquals(0, page6.getItems().size());
assertEquals(0, page7.getItems().size());
assertFalse(page1.getContext().isLastPage());
assertFalse(page2.getContext().isLastPage());
assertFalse(page3.getContext().isLastPage());
assertFalse(page4.getContext().isLastPage());
assertFalse(page5.getContext().isLastPage());
assertTrue(page6.getContext().isLastPage());
assertTrue(page7.getContext().isLastPage());
List<String> expectedPage3Strings = new ArrayList<>(Arrays.asList(new String[]{"qr_20", "qr_21", "qr_22", "qr_23", "qr_24", "qr_25", "qr_26", "qr_27", "qr_28", "qr_29" }));
List<String> actualPage3Strings = new ArrayList<>();
page3.getItems().stream().forEach( ce -> actualPage3Strings.add(((ClientInfoDetails)ce.getDetails()).getAlias()) );
assertEquals(expectedPage3Strings, actualPage3Strings);
//test first page of the results with empty sort order -> default sort order (by Id ascending)
PaginationResponse<Client> page1EmptySort = remoteInterface.searchByMacAddress(customerId_1, "A1", Collections.emptyList(), context);
assertEquals(10, page1EmptySort.getItems().size());
List<String> expectedPage1EmptySortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
List<String> actualPage1EmptySortStrings = new ArrayList<>();
page1EmptySort.getItems().stream().forEach( ce -> actualPage1EmptySortStrings.add(((ClientInfoDetails)ce.getDetails()).getAlias()) );
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
//test first page of the results with null sort order -> default sort order (by Id ascending)
PaginationResponse<Client> page1NullSort = remoteInterface.searchByMacAddress(customerId_1, "A1", null, context);
assertEquals(10, page1NullSort.getItems().size());
List<String> expectedPage1NullSortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
List<String> actualPage1NullSortStrings = new ArrayList<>();
page1NullSort.getItems().stream().forEach( ce -> actualPage1NullSortStrings.add(((ClientInfoDetails)ce.getDetails()).getAlias()) );
assertEquals(expectedPage1NullSortStrings, actualPage1NullSortStrings);
//test first page of the results with sort descending order by a macAddress property
PaginationResponse<Client> page1SingleSortDesc = remoteInterface.searchByMacAddress(customerId_1, "A1", Collections.singletonList(new ColumnAndSort("macAddress", SortOrder.desc)), context);
assertEquals(10, page1SingleSortDesc.getItems().size());
List<String> expectedPage1SingleSortDescStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_49", "qr_48", "qr_47", "qr_46", "qr_45", "qr_44", "qr_43", "qr_42", "qr_41", "qr_40" }));
List<String> actualPage1SingleSortDescStrings = new ArrayList<>();
page1SingleSortDesc.getItems().stream().forEach( ce -> actualPage1SingleSortDescStrings.add(((ClientInfoDetails)ce.getDetails()).getAlias()) );
assertEquals(expectedPage1SingleSortDescStrings, actualPage1SingleSortDescStrings);
created_models.forEach(m -> remoteInterface.delete(m.getCustomerId(), m.getMacAddress()));
}
@Test
public void testEmptyNullSearchMacSubstring() {
Client mdl;
int customerId = getNextCustomerId();
int apNameIdx = 0;
List<Client> created_models = new ArrayList<>();
for(int i = 0; i< 50; i++){
mdl = new Client();
mdl.setCustomerId(customerId);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("qr_"+apNameIdx);
mdl.setDetails(details);
mdl.setMacAddress(new MacAddress("A1:FF:FF:FF:FF:" + Integer.toHexString(i)));
apNameIdx++;
mdl = remoteInterface.create(mdl);
created_models.add(mdl);
}
for(int i = 0; i< 50; i++){
mdl = new Client();
mdl.setCustomerId(customerId);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("cr_"+apNameIdx);
mdl.setDetails(details );
mdl.setMacAddress(new MacAddress("B1:FF:FF:FF:FF:" + Integer.toHexString(i)));
apNameIdx++;
mdl = remoteInterface.create(mdl);
created_models.add(mdl);
}
List<ColumnAndSort> sortBy = new ArrayList<>();
PaginationContext<Client> context = new PaginationContext<>(10);
//test null and empty string macSubstring inputs, expecting to get all results
PaginationResponse<Client> emptySubstringPage1 = remoteInterface.searchByMacAddress(customerId, "", sortBy, context);
PaginationResponse<Client> emptySubstringPage2 = remoteInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage1.getContext());
PaginationResponse<Client> emptySubstringPage3 = remoteInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage2.getContext());
PaginationResponse<Client> emptySubstringPage4 = remoteInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage3.getContext());
PaginationResponse<Client> emptySubstringPage5 = remoteInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage4.getContext());
PaginationResponse<Client> emptySubstringPage6 = remoteInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage5.getContext());
PaginationResponse<Client> emptySubstringPage7 = remoteInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage6.getContext());
PaginationResponse<Client> emptySubstringPage8 = remoteInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage7.getContext());
PaginationResponse<Client> emptySubstringPage9 = remoteInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage8.getContext());
PaginationResponse<Client> emptySubstringPage10 = remoteInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage9.getContext());
PaginationResponse<Client> emptySubstringPage11 = remoteInterface.searchByMacAddress(customerId, "", sortBy, emptySubstringPage10.getContext());
assertEquals(10, emptySubstringPage1.getItems().size());
assertEquals(10, emptySubstringPage2.getItems().size());
assertEquals(10, emptySubstringPage3.getItems().size());
assertEquals(10, emptySubstringPage4.getItems().size());
assertEquals(10, emptySubstringPage5.getItems().size());
assertEquals(10, emptySubstringPage6.getItems().size());
assertEquals(10, emptySubstringPage7.getItems().size());
assertEquals(10, emptySubstringPage8.getItems().size());
assertEquals(10, emptySubstringPage9.getItems().size());
assertEquals(10, emptySubstringPage10.getItems().size());
assertEquals(0, emptySubstringPage11.getItems().size());
PaginationResponse<Client> nullSubstringPage1 = remoteInterface.searchByMacAddress(customerId, null, sortBy, context);
PaginationResponse<Client> nullSubstringPage2 = remoteInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage1.getContext());
PaginationResponse<Client> nullSubstringPage3 = remoteInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage2.getContext());
PaginationResponse<Client> nullSubstringPage4 = remoteInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage3.getContext());
PaginationResponse<Client> nullSubstringPage5 = remoteInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage4.getContext());
PaginationResponse<Client> nullSubstringPage6 = remoteInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage5.getContext());
PaginationResponse<Client> nullSubstringPage7 = remoteInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage6.getContext());
PaginationResponse<Client> nullSubstringPage8 = remoteInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage7.getContext());
PaginationResponse<Client> nullSubstringPage9 = remoteInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage8.getContext());
PaginationResponse<Client> nullSubstringPage10 = remoteInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage9.getContext());
PaginationResponse<Client> nullSubstringPage11 = remoteInterface.searchByMacAddress(customerId, null, sortBy, nullSubstringPage10.getContext());
assertEquals(10, nullSubstringPage1.getItems().size());
assertEquals(10, nullSubstringPage2.getItems().size());
assertEquals(10, nullSubstringPage3.getItems().size());
assertEquals(10, nullSubstringPage4.getItems().size());
assertEquals(10, nullSubstringPage5.getItems().size());
assertEquals(10, nullSubstringPage6.getItems().size());
assertEquals(10, nullSubstringPage7.getItems().size());
assertEquals(10, nullSubstringPage8.getItems().size());
assertEquals(10, nullSubstringPage9.getItems().size());
assertEquals(10, nullSubstringPage10.getItems().size());
assertEquals(0, nullSubstringPage11.getItems().size());
created_models.forEach(m -> remoteInterface.delete(m.getCustomerId(), m.getMacAddress()));
}
@Test
public void testGetBlockedClients() {
@@ -458,8 +257,12 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
mdl.setCustomerId(customerId_1);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("qr_"+apNameIdx);
mdl.setDetails(details );
mdl.setMacAddress(new MacAddress((long)i));
mdl.setDetails(details);
if (i < 20) {
mdl.setMacAddress(new MacAddress("A1:FF:FF:FF:FF:" + Integer.toHexString(i)));
} else {
mdl.setMacAddress(new MacAddress("B1:FF:FF:FF:FF:" + Integer.toHexString(i)));
}
apNameIdx++;
remoteInterface.create(mdl);
@@ -470,8 +273,8 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
mdl.setCustomerId(customerId_2);
ClientInfoDetails details = new ClientInfoDetails();
details.setAlias("qr_"+apNameIdx);
mdl.setDetails(details );
mdl.setMacAddress(new MacAddress((long)i));
mdl.setDetails(details);
mdl.setMacAddress(new MacAddress("B1:FF:FF:FF:FF:" + Integer.toHexString(i)));
apNameIdx++;
remoteInterface.create(mdl);
@@ -483,13 +286,13 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
sortBy.addAll(Arrays.asList(new ColumnAndSort("macAddress")));
PaginationContext<Client> context = new PaginationContext<>(10);
PaginationResponse<Client> page1 = remoteInterface.getForCustomer(customerId_1, sortBy, context);
PaginationResponse<Client> page2 = remoteInterface.getForCustomer(customerId_1, sortBy, page1.getContext());
PaginationResponse<Client> page3 = remoteInterface.getForCustomer(customerId_1, sortBy, page2.getContext());
PaginationResponse<Client> page4 = remoteInterface.getForCustomer(customerId_1, sortBy, page3.getContext());
PaginationResponse<Client> page5 = remoteInterface.getForCustomer(customerId_1, sortBy, page4.getContext());
PaginationResponse<Client> page6 = remoteInterface.getForCustomer(customerId_1, sortBy, page5.getContext());
PaginationResponse<Client> page7 = remoteInterface.getForCustomer(customerId_1, sortBy, page6.getContext());
PaginationResponse<Client> page1 = remoteInterface.getForCustomer(customerId_1, null, sortBy, context);
PaginationResponse<Client> page2 = remoteInterface.getForCustomer(customerId_1, null, sortBy, page1.getContext());
PaginationResponse<Client> page3 = remoteInterface.getForCustomer(customerId_1, null, sortBy, page2.getContext());
PaginationResponse<Client> page4 = remoteInterface.getForCustomer(customerId_1, null, sortBy, page3.getContext());
PaginationResponse<Client> page5 = remoteInterface.getForCustomer(customerId_1, null, sortBy, page4.getContext());
PaginationResponse<Client> page6 = remoteInterface.getForCustomer(customerId_1, null, sortBy, page5.getContext());
PaginationResponse<Client> page7 = remoteInterface.getForCustomer(customerId_1, null, sortBy, page6.getContext());
//verify returned pages
assertEquals(10, page1.getItems().size());
@@ -521,6 +324,44 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
page3.getItems().stream().forEach( ce -> actualPage3Strings.add(((ClientInfoDetails)ce.getDetails()).getAlias()) );
assertEquals(expectedPage3Strings, actualPage3Strings);
// empty and null substring should return the same result
PaginationResponse<Client> page1EmptySubstring = remoteInterface.getForCustomer(customerId_1, "", sortBy, context);
PaginationResponse<Client> page2EmptySubstring = remoteInterface.getForCustomer(customerId_1, "", sortBy, page1EmptySubstring.getContext());
PaginationResponse<Client> page3EmptySubstring = remoteInterface.getForCustomer(customerId_1, "", sortBy, page2EmptySubstring.getContext());
PaginationResponse<Client> page4EmptySubstring = remoteInterface.getForCustomer(customerId_1, "", sortBy, page3EmptySubstring.getContext());
PaginationResponse<Client> page5EmptySubstring = remoteInterface.getForCustomer(customerId_1, "", sortBy, page4EmptySubstring.getContext());
//verify returned pages
assertEquals(10, page1EmptySubstring.getItems().size());
assertEquals(10, page2EmptySubstring.getItems().size());
assertEquals(10, page3EmptySubstring.getItems().size());
assertEquals(10, page4EmptySubstring.getItems().size());
assertEquals(10, page5EmptySubstring.getItems().size());
assertEquals(page1.getItems(), page1EmptySubstring.getItems());
assertEquals(page2.getItems(), page2EmptySubstring.getItems());
assertEquals(page3.getItems(), page3EmptySubstring.getItems());
assertEquals(page4.getItems(), page4EmptySubstring.getItems());
assertEquals(page5.getItems(), page5EmptySubstring.getItems());
// Test macAddress search
PaginationResponse<Client> page1SearchMac = remoteInterface.getForCustomer(customerId_1, "A1", sortBy, context);
PaginationResponse<Client> page2SearchMac = remoteInterface.getForCustomer(customerId_1, "A1", sortBy, page1SearchMac.getContext());
PaginationResponse<Client> page3SearchMac = remoteInterface.getForCustomer(customerId_1, "A1", sortBy, page2SearchMac.getContext());
//verify returned pages
assertEquals(10, page1SearchMac.getItems().size());
assertEquals(10, page2SearchMac.getItems().size());
assertEquals(0, page3SearchMac.getItems().size());
page1SearchMac.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()));
page2SearchMac.getItems().forEach(e -> assertEquals(customerId_1, e.getCustomerId()));
page1SearchMac.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
page2SearchMac.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
assertTrue(page3SearchMac.getContext().isLastPage());
// System.out.println("================================");
// for(Client pmdl: page3.getItems()){
@@ -531,7 +372,7 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
// System.out.println("================================");
//test first page of the results with empty sort order -> default sort order (by Id ascending)
PaginationResponse<Client> page1EmptySort = remoteInterface.getForCustomer(customerId_1, Collections.emptyList(), context);
PaginationResponse<Client> page1EmptySort = remoteInterface.getForCustomer(customerId_1, null, Collections.emptyList(), context);
assertEquals(10, page1EmptySort.getItems().size());
List<String> expectedPage1EmptySortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
@@ -541,7 +382,7 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
//test first page of the results with null sort order -> default sort order (by Id ascending)
PaginationResponse<Client> page1NullSort = remoteInterface.getForCustomer(customerId_1, null, context);
PaginationResponse<Client> page1NullSort = remoteInterface.getForCustomer(customerId_1, null, null, context);
assertEquals(10, page1NullSort.getItems().size());
List<String> expectedPage1NullSortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
@@ -552,7 +393,7 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
//test first page of the results with sort descending order by a macAddress property
PaginationResponse<Client> page1SingleSortDesc = remoteInterface.getForCustomer(customerId_1, Collections.singletonList(new ColumnAndSort("macAddress", SortOrder.desc)), context);
PaginationResponse<Client> page1SingleSortDesc = remoteInterface.getForCustomer(customerId_1, null, Collections.singletonList(new ColumnAndSort("macAddress", SortOrder.desc)), context);
assertEquals(10, page1SingleSortDesc.getItems().size());
List<String> expectedPage1SingleSortDescStrings = new ArrayList< >(Arrays.asList(new String[]{"qr_49", "qr_48", "qr_47", "qr_46", "qr_45", "qr_44", "qr_43", "qr_42", "qr_41", "qr_40" }));
@@ -697,17 +538,19 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
if(i<10) {
mdl.setEquipmentId(equipmentId_1);
mdl.setLocationId(locationId_1);
mdl.setMacAddress(new MacAddress("A1:FF:FF:FF:FF:" + Integer.toHexString(i)));
} else if(i<20) {
mdl.setEquipmentId(equipmentId_2);
mdl.setLocationId(locationId_2);
mdl.setMacAddress(new MacAddress("A1:FF:FF:FF:FF:" + Integer.toHexString(i)));
} else {
mdl.setEquipmentId(getNextEquipmentId());
mdl.setMacAddress(new MacAddress("B1:FF:FF:FF:FF:" + Integer.toHexString(i)));
}
ClientSessionDetails details = new ClientSessionDetails();
details.setApFingerprint("qr_"+apNameIdx);
mdl.setDetails(details );
mdl.setMacAddress(new MacAddress((long)i));
apNameIdx++;
@@ -743,13 +586,13 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
sortBy.addAll(Arrays.asList(new ColumnAndSort("macAddress")));
PaginationContext<ClientSession> context = new PaginationContext<>(10);
PaginationResponse<ClientSession> page1 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, context);
PaginationResponse<ClientSession> page2 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page1.getContext());
PaginationResponse<ClientSession> page3 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page2.getContext());
PaginationResponse<ClientSession> page4 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page3.getContext());
PaginationResponse<ClientSession> page5 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page4.getContext());
PaginationResponse<ClientSession> page6 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page5.getContext());
PaginationResponse<ClientSession> page7 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, sortBy, page6.getContext());
PaginationResponse<ClientSession> page1 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, context);
PaginationResponse<ClientSession> page2 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page1.getContext());
PaginationResponse<ClientSession> page3 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page2.getContext());
PaginationResponse<ClientSession> page4 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page3.getContext());
PaginationResponse<ClientSession> page5 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page4.getContext());
PaginationResponse<ClientSession> page6 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page5.getContext());
PaginationResponse<ClientSession> page7 = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, sortBy, page6.getContext());
//verify returned pages
assertEquals(10, page1.getItems().size());
@@ -776,11 +619,81 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
assertTrue(page6.getContext().isLastPage());
assertTrue(page7.getContext().isLastPage());
PaginationResponse<ClientSession> page1EmptySubstring = remoteInterface.getSessionsForCustomer(customerId_1, null, null, "", sortBy, context);
PaginationResponse<ClientSession> page2EmptySubstring = remoteInterface.getSessionsForCustomer(customerId_1, null, null, "", sortBy, page1.getContext());
PaginationResponse<ClientSession> page3EmptySubstring = remoteInterface.getSessionsForCustomer(customerId_1, null, null, "", sortBy, page2.getContext());
PaginationResponse<ClientSession> page4EmptySubstring = remoteInterface.getSessionsForCustomer(customerId_1, null, null, "", sortBy, page3.getContext());
PaginationResponse<ClientSession> page5EmptySubstring = remoteInterface.getSessionsForCustomer(customerId_1, null, null, "", sortBy, page4.getContext());
//verify returned pages
assertEquals(10, page1EmptySubstring.getItems().size());
assertEquals(10, page2EmptySubstring.getItems().size());
assertEquals(10, page3EmptySubstring.getItems().size());
assertEquals(10, page4EmptySubstring.getItems().size());
assertEquals(10, page5EmptySubstring.getItems().size());
assertEquals(page1.getItems(), page1EmptySubstring.getItems());
assertEquals(page2.getItems(), page2EmptySubstring.getItems());
assertEquals(page3.getItems(), page3EmptySubstring.getItems());
assertEquals(page4.getItems(), page4EmptySubstring.getItems());
assertEquals(page5.getItems(), page5EmptySubstring.getItems());
List<String> expectedPage3Strings = new ArrayList< >(Arrays.asList(new String[]{"qr_20", "qr_21", "qr_22", "qr_23", "qr_24", "qr_25", "qr_26", "qr_27", "qr_28", "qr_29" }));
List<String> actualPage3Strings = new ArrayList<>();
page3.getItems().stream().forEach( ce -> actualPage3Strings.add(((ClientSessionDetails)ce.getDetails()).getApFingerprint()) );
assertEquals(expectedPage3Strings, actualPage3Strings);
// Test macAddress search
PaginationResponse<ClientSession> page1SearchMac = remoteInterface.getSessionsForCustomer(customerId_1, null, null, "A1", sortBy, context);
PaginationResponse<ClientSession> page2SearchMac = remoteInterface.getSessionsForCustomer(customerId_1, null, null, "A1", sortBy, page1SearchMac.getContext());
PaginationResponse<ClientSession> page3SearchMac = remoteInterface.getSessionsForCustomer(customerId_1, null, null, "A1", sortBy, page2SearchMac.getContext());
//verify returned pages
assertEquals(10, page1SearchMac.getItems().size());
assertEquals(10, page2SearchMac.getItems().size());
assertEquals(0, page3SearchMac.getItems().size());
page1SearchMac.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
page2SearchMac.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
// Test macAddress search with locationId
Set<Long> locationSearchSet = new HashSet<Long>(Arrays.asList(locationId_1));
PaginationResponse<ClientSession> page1SearchMacAndLocation = remoteInterface.getSessionsForCustomer(customerId_1, null, locationSearchSet, "A1", sortBy, context);
PaginationResponse<ClientSession> page2SearchMacAndLocation = remoteInterface.getSessionsForCustomer(customerId_1, null, locationSearchSet, "A1", sortBy, page1SearchMacAndLocation.getContext());
PaginationResponse<ClientSession> page3SearchMacAndLocation = remoteInterface.getSessionsForCustomer(customerId_1, null, locationSearchSet, "A1", sortBy, page2SearchMacAndLocation.getContext());
//verify returned pages
assertEquals(10, page1SearchMacAndLocation.getItems().size());
assertEquals(0, page2SearchMacAndLocation.getItems().size());
assertEquals(0, page3SearchMacAndLocation.getItems().size());
page1SearchMacAndLocation.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
page1SearchMacAndLocation.getItems().forEach(e -> assertEquals(locationId_1, e.getLocationId()));
// Test macAddress search with equipmentId
Set<Long> equipmentSearchSet = new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2));
PaginationResponse<ClientSession> page1SearchMacAndEquipment = remoteInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, null, "A1", sortBy, context);
PaginationResponse<ClientSession> page2SearchMacAndEquipment = remoteInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, null, "A1", sortBy, page1SearchMacAndEquipment.getContext());
PaginationResponse<ClientSession> page3SearchMacAndEquipment = remoteInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, null, "A1", sortBy, page2SearchMacAndEquipment.getContext());
//verify returned pages
assertEquals(10, page1SearchMacAndEquipment.getItems().size());
assertEquals(10, page2SearchMacAndEquipment.getItems().size());
assertEquals(0, page3SearchMacAndEquipment.getItems().size());
page1SearchMacAndEquipment.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
page1SearchMacAndEquipment.getItems().forEach(e -> assertTrue(equipmentSearchSet.contains(e.getEquipmentId())));
// Test macAddress search with equipmentId and locationId
PaginationResponse<ClientSession> page1SearchMacAndEquipmentAndLocation = remoteInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, locationSearchSet, "A1", sortBy, context);
PaginationResponse<ClientSession> page2SearchMacAndEquipmentAndLocation = remoteInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, locationSearchSet, "A1", sortBy, page1SearchMacAndEquipmentAndLocation.getContext());
PaginationResponse<ClientSession> page3SearchMacAndEquipmentAndLocation = remoteInterface.getSessionsForCustomer(customerId_1, equipmentSearchSet, locationSearchSet, "A1", sortBy, page2SearchMacAndEquipmentAndLocation.getContext());
//verify returned pages
assertEquals(10, page1SearchMacAndEquipmentAndLocation.getItems().size());
assertEquals(0, page2SearchMacAndEquipmentAndLocation.getItems().size());
assertEquals(0, page3SearchMacAndEquipmentAndLocation.getItems().size());
page1SearchMacAndEquipmentAndLocation.getItems().forEach(e -> assertTrue(e.getMacAddress().getAddressAsString().contains("A1".toLowerCase())));
page1SearchMacAndEquipmentAndLocation.getItems().forEach(e -> assertEquals(equipmentId_1, e.getEquipmentId()));
page1SearchMacAndEquipmentAndLocation.getItems().forEach(e -> assertEquals(locationId_1, e.getLocationId()));
// System.out.println("================================");
// for(Client pmdl: page3.getItems()){
@@ -791,7 +704,7 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
// System.out.println("================================");
//test first page of the results with empty sort order -> default sort order (by Id ascending)
PaginationResponse<ClientSession> page1EmptySort = remoteInterface.getSessionsForCustomer(customerId_1, null, null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page1EmptySort = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, Collections.emptyList(), context);
assertEquals(10, page1EmptySort.getItems().size());
List<String> expectedPage1EmptySortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
@@ -801,7 +714,7 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
assertEquals(expectedPage1EmptySortStrings, actualPage1EmptySortStrings);
//test first page of the results with null sort order -> default sort order (by Id ascending)
PaginationResponse<ClientSession> page1NullSort = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, context);
PaginationResponse<ClientSession> page1NullSort = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, null, context);
assertEquals(10, page1NullSort.getItems().size());
List<String> expectedPage1NullSortStrings = new ArrayList<>(Arrays.asList(new String[]{"qr_0", "qr_1", "qr_2", "qr_3", "qr_4", "qr_5", "qr_6", "qr_7", "qr_8", "qr_9" }));
@@ -812,7 +725,7 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
//test first page of the results with sort descending order by a macAddress property
PaginationResponse<ClientSession> page1SingleSortDesc = remoteInterface.getSessionsForCustomer(customerId_1, null, null, Collections.singletonList(new ColumnAndSort("macAddress", SortOrder.desc)), context);
PaginationResponse<ClientSession> page1SingleSortDesc = remoteInterface.getSessionsForCustomer(customerId_1, null, null, null, Collections.singletonList(new ColumnAndSort("macAddress", SortOrder.desc)), context);
assertEquals(10, page1SingleSortDesc.getItems().size());
List<String> expectedPage1SingleSortDescStrings = new ArrayList< >(Arrays.asList(new String[]{"qr_49", "qr_48", "qr_47", "qr_46", "qr_45", "qr_44", "qr_43", "qr_42", "qr_41", "qr_40" }));
@@ -822,8 +735,8 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
assertEquals(expectedPage1SingleSortDescStrings, actualPage1SingleSortDescStrings);
//test the results for equipment_1 only
PaginationResponse<ClientSession> page1Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), null, Collections.emptyList(), page1Eq_1.getContext());
PaginationResponse<ClientSession> page1Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), null, null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), null, null, Collections.emptyList(), page1Eq_1.getContext());
assertEquals(10, page1Eq_1.getItems().size());
assertEquals(0, page2Eq_1.getItems().size());
@@ -837,8 +750,8 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
assertEquals(expectedPage1Eq_1Strings, actualPage1Eq_1Strings);
//test the results for equipment_2 only
PaginationResponse<ClientSession> page1Eq_2 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_2)), null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_2 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_2)), null, Collections.emptyList(), page1Eq_2.getContext());
PaginationResponse<ClientSession> page1Eq_2 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_2)), null, null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_2 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_2)), null, null, Collections.emptyList(), page1Eq_2.getContext());
assertEquals(10, page1Eq_2.getItems().size());
assertEquals(0, page2Eq_2.getItems().size());
@@ -853,9 +766,9 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
//test the results for equipment_1 or equipment_2 only
PaginationResponse<ClientSession> page1Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, Collections.emptyList(), page1Eq_1or2.getContext());
PaginationResponse<ClientSession> page3Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, Collections.emptyList(), page2Eq_1or2.getContext());
PaginationResponse<ClientSession> page1Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, null, Collections.emptyList(), context);
PaginationResponse<ClientSession> page2Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, null, Collections.emptyList(), page1Eq_1or2.getContext());
PaginationResponse<ClientSession> page3Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1, equipmentId_2)), null, null, Collections.emptyList(), page2Eq_1or2.getContext());
assertEquals(10, page1Eq_1or2.getItems().size());
assertEquals(10, page2Eq_1or2.getItems().size());
@@ -881,8 +794,8 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
//
//test the results for location_1 only
page1Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1)), Collections.emptyList(), context);
page2Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1)), Collections.emptyList(), page1Eq_1.getContext());
page1Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1)), null, Collections.emptyList(), context);
page2Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1)), null, Collections.emptyList(), page1Eq_1.getContext());
assertEquals(10, page1Eq_1.getItems().size());
assertEquals(0, page2Eq_1.getItems().size());
@@ -896,8 +809,8 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
assertEquals(expectedPage1Eq_1Strings, actualPage1Loc_1Strings);
//test the results for location_2 only
page1Eq_2 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_2)), Collections.emptyList(), context);
page2Eq_2 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_2)), Collections.emptyList(), page1Eq_2.getContext());
page1Eq_2 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_2)), null, Collections.emptyList(), context);
page2Eq_2 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_2)), null, Collections.emptyList(), page1Eq_2.getContext());
assertEquals(10, page1Eq_2.getItems().size());
assertEquals(0, page2Eq_2.getItems().size());
@@ -912,9 +825,9 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
//test the results for location_1 or location_2 only
page1Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), Collections.emptyList(), context);
page2Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), Collections.emptyList(), page1Eq_1or2.getContext());
page3Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), Collections.emptyList(), page2Eq_1or2.getContext());
page1Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), null, Collections.emptyList(), context);
page2Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), null, Collections.emptyList(), page1Eq_1or2.getContext());
page3Eq_1or2 = remoteInterface.getSessionsForCustomer(customerId_1, null, new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), null, Collections.emptyList(), page2Eq_1or2.getContext());
assertEquals(10, page1Eq_1or2.getItems().size());
assertEquals(10, page2Eq_1or2.getItems().size());
@@ -936,8 +849,8 @@ public class ClientServiceRemoteTest extends BaseRemoteTest {
assertEquals(expectedPage2Eq_1or2Strings, actualPage2Loc_1or2Strings);
//test the results for ( location_1 or location_2 ) and equipment_1only
page1Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), Collections.emptyList(), context);
page2Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), Collections.emptyList(), page1Eq_1.getContext());
page1Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), null, Collections.emptyList(), context);
page2Eq_1 = remoteInterface.getSessionsForCustomer(customerId_1, new HashSet<Long>(Arrays.asList(equipmentId_1)), new HashSet<Long>(Arrays.asList(locationId_1, locationId_2)), null, Collections.emptyList(), page1Eq_1.getContext());
assertEquals(10, page1Eq_1.getItems().size());
assertEquals(0, page2Eq_1.getItems().size());

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,29 +15,29 @@
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-datastore-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -45,7 +45,7 @@
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -128,43 +128,6 @@ public class ClientController {
}
}
@RequestMapping(value = "/searchByMac", method = RequestMethod.GET)
public PaginationResponse<Client> searchByMacAddress(@RequestParam int customerId,
@RequestParam(required = false) String macSubstring,
@RequestParam(required = false) List<ColumnAndSort> sortBy,
@RequestParam(required = false) PaginationContext<Client> paginationContext) {
LOG.debug("searchByMacAddress({}, {})", customerId, macSubstring);
if(paginationContext == null) {
paginationContext = new PaginationContext<>();
}
LOG.debug("Looking up Clients for customer {} and macSubstring {} with last returned page number {}",
customerId, macSubstring, paginationContext.getLastReturnedPageNumber());
PaginationResponse<Client> ret = new PaginationResponse<>();
if (paginationContext.isLastPage()) {
// no more pages available according to the context
LOG.debug(
"No more pages available when looking up Clients for customer {} and macSubstring {} with last returned page number {}",
customerId, macSubstring, paginationContext.getLastReturnedPageNumber());
ret.setContext(paginationContext);
return ret;
}
PaginationResponse<Client> onePage = this.clientDatastore
.searchByMacAddress(customerId, macSubstring, sortBy, paginationContext);
ret.setContext(onePage.getContext());
ret.getItems().addAll(onePage.getItems());
LOG.debug("Retrieved {} Clients for customer {} and macSubstring {} ", onePage.getItems().size(),
customerId, macSubstring);
return ret;
}
/**
* @param customerId
* @return list of Clients for the customer that are marked as blocked. This per-customer list of blocked clients is pushed to every AP, so it has to be limited in size.
@@ -187,34 +150,35 @@ public class ClientController {
@RequestMapping(value = "/forCustomer", method = RequestMethod.GET)
public PaginationResponse<Client> getForCustomer(@RequestParam int customerId,
@RequestParam List<ColumnAndSort> sortBy,
@RequestParam(required = false) String macSubstring,
@RequestParam(required = false) List<ColumnAndSort> sortBy,
@RequestParam(required = false) PaginationContext<Client> paginationContext) {
if(paginationContext == null) {
paginationContext = new PaginationContext<>();
}
LOG.debug("Looking up Clients for customer {} with last returned page number {}",
customerId, paginationContext.getLastReturnedPageNumber());
LOG.debug("Looking up Clients for customer {} macSubstring {} with last returned page number {}",
customerId, macSubstring, paginationContext.getLastReturnedPageNumber());
PaginationResponse<Client> ret = new PaginationResponse<>();
if (paginationContext.isLastPage()) {
// no more pages available according to the context
LOG.debug(
"No more pages available when looking up Clients for customer {} with last returned page number {}",
customerId, paginationContext.getLastReturnedPageNumber());
"No more pages available when looking up Clients for customer {} macSubstring {} with last returned page number {}",
customerId, macSubstring, paginationContext.getLastReturnedPageNumber());
ret.setContext(paginationContext);
return ret;
}
PaginationResponse<Client> onePage = this.clientDatastore
.getForCustomer(customerId, sortBy, paginationContext);
.getForCustomer(customerId, macSubstring, sortBy, paginationContext);
ret.setContext(onePage.getContext());
ret.getItems().addAll(onePage.getItems());
LOG.debug("Retrieved {} Clients for customer {} ", onePage.getItems().size(),
customerId);
LOG.debug("Retrieved {} Clients for customer {} macSubstring {}", onePage.getItems().size(),
customerId, macSubstring);
return ret;
}
@@ -323,31 +287,32 @@ public class ClientController {
@RequestMapping(value = "/session/forCustomer", method = RequestMethod.GET)
public PaginationResponse<ClientSession> getSessionsForCustomer(@RequestParam int customerId,
@RequestParam Set<Long> equipmentIds,
@RequestParam Set<Long> locationIds,
@RequestParam List<ColumnAndSort> sortBy,
@RequestParam(required = false) Set<Long> equipmentIds,
@RequestParam(required = false) Set<Long> locationIds,
@RequestParam(required = false) String macSubstring,
@RequestParam(required = false) List<ColumnAndSort> sortBy,
@RequestParam(required = false) PaginationContext<ClientSession> paginationContext) {
if(paginationContext == null) {
paginationContext = new PaginationContext<>();
}
LOG.debug("Looking up Client sessions for customer {} with last returned page number {}",
customerId, paginationContext.getLastReturnedPageNumber());
LOG.debug("Looking up Client sessions for customer {} equipment {} locations {} macSubstring {} with last returned page number {}",
customerId, equipmentIds, locationIds, macSubstring, paginationContext.getLastReturnedPageNumber());
PaginationResponse<ClientSession> ret = new PaginationResponse<>();
if (paginationContext.isLastPage()) {
// no more pages available according to the context
LOG.debug(
"No more pages available when looking up Client sessions for customer {} with last returned page number {}",
customerId, paginationContext.getLastReturnedPageNumber());
"No more pages available when looking up Client sessions for customer {} equipment {} locations {} macSubstring {} with last returned page number {}",
customerId, equipmentIds, locationIds, macSubstring, paginationContext.getLastReturnedPageNumber());
ret.setContext(paginationContext);
return ret;
}
PaginationResponse<ClientSession> onePage = this.clientDatastore
.getSessionsForCustomer(customerId, equipmentIds, locationIds, sortBy, paginationContext);
.getSessionsForCustomer(customerId, equipmentIds, locationIds, macSubstring, sortBy, paginationContext);
ret.setContext(onePage.getContext());
ret.getItems().addAll(onePage.getItems());

View File

@@ -749,51 +749,6 @@ paths:
schema:
type: integer
format: int32
- name: sortBy
in: query
description: sort options
required: true
schema:
type: array
items:
$ref: '#/components/schemas/SortColumnsClient'
- name: paginationContext
in: query
description: pagination context
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/PaginationContextClient'
examples:
initialPginationContext:
value:
model_type: PaginationContext
maxItemsPerPage: 10
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/PaginationResponseClient'
500:
$ref: '#/components/responses/GenericApiError'
/portal/client/searchByMac:
get:
tags:
- Client Data
summary: Get list of Clients for customerId and searching by macSubstring.
operationId: searchByMacAddress
parameters:
- name: customerId
in: query
description: customer id
required: true
schema:
type: integer
format: int32
- name: macSubstring
in: query
description: MacAddress search criteria
@@ -984,7 +939,7 @@ paths:
- name: equipmentIds
in: query
description: Equipment ID
required: true
required: false
content:
text/plain:
schema:
@@ -995,7 +950,7 @@ paths:
- name: locationIds
in: query
description: Location IDs
required: true
required: false
content:
text/plain:
schema:
@@ -1003,10 +958,16 @@ paths:
items:
type: integer
format: long
- name: macSubstring
in: query
description: MacAddress search criteria
required: false
schema:
type: string
- name: sortBy
in: query
description: sort options
required: true
required: false
schema:
type: array
items:
@@ -1014,7 +975,7 @@ paths:
- name: paginationContext
in: query
description: pagination context
required: true
required: false
content:
application/json:
schema:

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,72 +15,72 @@
<dependency>
<artifactId>base-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>portal-user-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>client-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>firmware-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>manufacturer-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>cloud-event-dispatcher</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,48 +15,48 @@
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-client</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Dependencies for the unit tests -->
<dependency>
<artifactId>base-remote-tests</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -64,49 +64,49 @@
<dependency>
<artifactId>base-stream-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>service-metric-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>service-metric-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>service-metric-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>system-event-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>system-event-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>system-event-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,37 +15,37 @@
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-stream-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-metrics</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -2894,11 +2894,12 @@ components:
type: integer
format: int64
radiusAcountingServiceInterval:
description: If this is set (i.e. non-null), RadiusAccountingService is configured, and SsidSecureMode is configured as Enterprise/Radius, ap will send interim accounting updates every N seconds
description: If this is set between 60-600, RadiusAccountingService is configured, and SsidSecureMode is configured as Enterprise/Radius, ap will send interim accounting updates every N seconds, if it is set to 0, Radius determines the interval
type: integer
format: int32
minimum: 60
minimum: 0
maximum: 600
default: 0
radiusNasConfiguration:
$ref: '#/components/schemas/RadiusNasConfiguration'
captivePortalId:
@@ -3144,6 +3145,7 @@ components:
- $ref: '#/components/schemas/NetworkAggregateStatusData'
- $ref: '#/components/schemas/OperatingSystemPerformance'
- $ref: '#/components/schemas/RadioUtilizationReport'
- $ref: '#/components/schemas/EquipmentChannelStatusData'
discriminator:
propertyName: model_type
@@ -4051,6 +4053,21 @@ components:
description: The percentage of the overall capacity that is currently being used by associated clients.
type: integer
format: int32
EquipmentChannelStatusData:
description: Equipment Channel Status Data.
type: object
properties:
model_type:
type: string
enum:
- EquipmentChannelStatusData
statusDataType:
type: string
enum:
- RADIO_CHANNEL
channelNumberStatusDataMap:
$ref: '#/components/schemas/IntegerPerRadioTypeMap'
#
# Equipment configuration data models

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,18 +15,18 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-datastore-inmemory</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-exceptions</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc-tests</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>customer-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>system-event-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>customer-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,12 +15,12 @@
<dependency>
<artifactId>customer-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,41 +15,41 @@
<dependency>
<artifactId>customer-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-client</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Dependencies for the unit tests -->
<dependency>
<artifactId>base-remote-tests</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>customer-service</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>customer-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,24 +15,24 @@
<dependency>
<artifactId>base-container</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>customer-datastore-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>cloud-metrics</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,75 +15,75 @@
<dependency>
<artifactId>base-stream-consumer</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<!-- this is needed so that the stream processors can directly post messages to topics - to aggregate partial results, etc. -->
<artifactId>base-stream-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>base-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>routing-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-gateway-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>location-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>profile-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- models used by the application logic of the stream processor -->

View File

@@ -151,13 +151,13 @@ public class CustomerPortalDashboardPartialAggregator extends StreamProcessor {
CustomerPortalDashboardPartialEvent partialEvent = context.getOrCreatePartialEvent(timeBucketId);
// Update counters on the context and/or CustomerPortalDashboardPartialEvent
context.getEquipmentIds().add(equipmentId);
partialEvent.getEquipmentIds().add(equipmentId);
if(model.getClientCount() > 0) {
context.getEquipmentIdsWithClients().add(equipmentId);
partialEvent.getEquipmentIdsWithClients().add(equipmentId);
}
context.addClientMacs(model);
partialEvent.addClientMacs(model.getClientMacAddressesPerRadio());
AtomicLong txBytes = new AtomicLong();
model.getTxBytesPerRadio().values().forEach(v -> txBytes.addAndGet(v));
@@ -195,22 +195,29 @@ public class CustomerPortalDashboardPartialAggregator extends StreamProcessor {
CustomerPortalDashboardPartialEvent oldestPartialEvent = context.getOldestPartialEventOrNull();
if(oldestPartialEvent!=null && oldestPartialEvent.getTimeBucketId() < System.currentTimeMillis() - timeBucketsInFlight * timeBucketMs) {
// finalize oldestPartialEvent counters, and put it into customerEventStream
oldestPartialEvent.getEquipmentInServiceCount().set(context.getEquipmentIds().size());
oldestPartialEvent.getEquipmentWithClientsCount().set(context.getEquipmentIdsWithClients().size());
context.getClientCountsPerRadio().forEach((rt, cnt) -> oldestPartialEvent.getAssociatedClientsCountPerRadio().put(rt, new AtomicInteger(cnt)));
context.getClientMacCountsPerOui().forEach((oui, cnt) -> oldestPartialEvent.getClientCountPerOui().put(oui, cnt));
oldestPartialEvent.aggregateCounters();
AlarmCounts alarmCounts = alarmServiceInterface.getAlarmCounts(context.getCustomerId(), context.getEquipmentIds(), Collections.emptySet());
AlarmCounts alarmCounts = alarmServiceInterface.getAlarmCounts(context.getCustomerId(), oldestPartialEvent.getEquipmentIds(), Collections.emptySet());
for (Entry<AlarmCode, AtomicInteger> entry : alarmCounts.getTotalCountsPerAlarmCodeMap().entrySet()) {
oldestPartialEvent.incrementAlarmsCountBySeverity(entry.getKey().getSeverity(), entry.getValue().get());
}
customerEventStream.publish(new SystemEventRecord(oldestPartialEvent));
context.setLastPublishedTimestampMs(System.currentTimeMillis());
//remove that oldest CustomerPortalDashboardPartialEvent from the context
context.removePartialEvent(oldestPartialEvent.getTimeBucketId());
LOG.trace("Finalized processing of {}", oldestPartialEvent);
}
if(oldestPartialEvent == null && context.getLastPublishedTimestampMs() < System.currentTimeMillis() - timeBucketsInFlight * timeBucketMs) {
//there have not been any metrics reported for this subset of customer equipment in a while,
//we'll create an empty partial event and will post 0 counters for it
long timestamp = System.currentTimeMillis();
long timeBucketId = timestamp - ( timestamp % timeBucketMs);
context.getOrCreatePartialEvent(timeBucketId);
}
} catch(Exception e) {
LOG.error("Error when processing context for customer {}", context.getCustomerId(), e);
}

View File

@@ -1,27 +1,15 @@
package com.telecominfraproject.wlan.streams.dashboard;
import java.util.Collections;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
import com.telecominfraproject.wlan.servicemetric.apnode.models.ApNodeMetrics;
import com.telecominfraproject.wlan.status.dashboard.models.events.CustomerPortalDashboardPartialEvent;
public class CustomerPortalDashboardPartialContext {
private int customerId;
private ConcurrentHashMap<Long, CustomerPortalDashboardPartialEvent> timeBucketToPartialEventMap = new ConcurrentHashMap<>();
private Set<Long> equipmentIds = Collections.synchronizedSet(new HashSet<>());
private Set<Long> equipmentIdsWithClients = Collections.synchronizedSet(new HashSet<>());
private Map<RadioType, Set<MacAddress>> clientMacsPerRadio = new EnumMap<>(RadioType.class);
private long lastPublishedTimestampMs;
public CustomerPortalDashboardPartialContext(int customerId) {
this.customerId = customerId;
@@ -42,13 +30,6 @@ public class CustomerPortalDashboardPartialContext {
return ret;
}
public Set<Long> getEquipmentIds() {
return equipmentIds;
}
public Set<Long> getEquipmentIdsWithClients() {
return equipmentIdsWithClients;
}
/**
* Get the CustomerPortalDashboardPartialEvent for the specified time bucket, or create one is it is not present
* @param timeBucketId
@@ -85,50 +66,12 @@ public class CustomerPortalDashboardPartialContext {
timeBucketToPartialEventMap.remove(timeBucketId);
}
public void addClientMacs(ApNodeMetrics model) {
//make sure all required sets exist
model.getClientMacAddressesPerRadio().keySet().forEach((rt) -> {
Set<MacAddress> macSet = clientMacsPerRadio.get(rt);
if(macSet == null) {
macSet = Collections.synchronizedSet(new HashSet<>());
macSet = clientMacsPerRadio.putIfAbsent(rt, macSet);
if(macSet == null) {
macSet = clientMacsPerRadio.get(rt);
}
}
});
//add each client mac into appropriate set
model.getClientMacAddressesPerRadio().forEach((rt, macList) -> {
Set<MacAddress> macSet = clientMacsPerRadio.get(rt);
macList.forEach(m -> macSet.add(m));
});
public long getLastPublishedTimestampMs() {
return lastPublishedTimestampMs;
}
}
public Map<String, AtomicInteger> getClientMacCountsPerOui(){
Map<String, AtomicInteger> ret = new HashMap<>();
clientMacsPerRadio.values().forEach(macSet -> macSet.forEach( m-> {
String oui = m.toOuiString();
AtomicInteger cnt = ret.get(oui);
if(cnt == null) {
cnt = new AtomicInteger();
cnt = ret.putIfAbsent(oui, cnt);
if(cnt == null) {
cnt = ret.get(oui);
}
}
cnt.incrementAndGet();
}));
return ret;
}
public Map<RadioType, Integer> getClientCountsPerRadio(){
Map<RadioType, Integer> ret = new HashMap<>();
clientMacsPerRadio.forEach( (rt,macSet) -> ret.put(rt, macSet.size()));
return ret;
}
public void setLastPublishedTimestampMs(long lastPublishedTimestampMs) {
this.lastPublishedTimestampMs = lastPublishedTimestampMs;
}
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,93 +15,93 @@
<dependency>
<artifactId>base-stream-consumer</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>service-metric-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>system-event-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>alarm-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>status-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>equipment-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- unit tests dependencies -->
<dependency>
<artifactId>single-process-streams</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>alarm-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>status-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-service-local</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>alarm-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>status-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>equipment-datastore-inmemory</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>cloud-event-dispatcher-empty</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,7 +15,7 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>equipment-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,19 +15,19 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-datastore-inmemory</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>equipment-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>equipment-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,12 +15,12 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>equipment-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-exceptions</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,26 +15,26 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>equipment-datastore-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-jdbc-tests</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>equipment-datastore-common-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>

View File

@@ -1,10 +1,9 @@
<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">
<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>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -16,19 +15,19 @@
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>base-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>status-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>firmware-models</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>equipment-gateway-service-interface</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.telecominfraproject.wlan</groupId>
<artifactId>tip-wlan-cloud-root-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../wlan-cloud-root</relativePath>
</parent>
@@ -15,7 +15,7 @@
<dependency>
<artifactId>equipment-gateway-models</artifactId>
<groupId>com.telecominfraproject.wlan</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

Some files were not shown because too many files have changed in this diff Show More