|
@@ -61,11 +61,21 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Unit>> allUnitsByIdentity(String userIdentity) {
|
|
|
|
|
+ return allUnits();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Unit> findUnitById(long unitId) {
|
|
public Future<Unit> findUnitById(long unitId) {
|
|
|
return Future.succeededFuture(Unit.of(1000, "mock(name)", "mock(imei)", "mock(description)"));
|
|
return Future.succeededFuture(Unit.of(1000, "mock(name)", "mock(imei)", "mock(description)"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<Unit> findUnitByIdentityAndId(String userIdentity, long unitId) {
|
|
|
|
|
+ return findUnitById(unitId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Unit> findUnitByIMEI(String imei) {
|
|
public Future<Unit> findUnitByIMEI(String imei) {
|
|
|
return Future.succeededFuture(Unit.of(1000, "mock(imei)"));
|
|
return Future.succeededFuture(Unit.of(1000, "mock(imei)"));
|
|
|
}
|
|
}
|
|
@@ -80,6 +90,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Unit>> findUnitsByIdentityAndSensorId(String userIdentity, long sensorId) {
|
|
|
|
|
+ return findUnitsBySensorId(sensorId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<CampaignUnit>> findUnitsByCampaignId(long campaignId) {
|
|
public Future<List<CampaignUnit>> findUnitsByCampaignId(long campaignId) {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
@@ -89,6 +104,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<CampaignUnit>> findUnitsByIdentityAndCampaignId(String userIdentity, long campaignId) {
|
|
|
|
|
+ return findUnitsByCampaignId(campaignId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Set<Long>> findUnitsIDByCampaignId(long campaignId) {
|
|
public Future<Set<Long>> findUnitsIDByCampaignId(long campaignId) {
|
|
|
return Future.succeededFuture(Set.of(1000L, 2000L, 3000L));
|
|
return Future.succeededFuture(Set.of(1000L, 2000L, 3000L));
|
|
|
}
|
|
}
|
|
@@ -100,16 +120,31 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<CampaignUnit> findUnitByIdentityAndIdAndCampaignId(String userIdentity, long unitId, long campaignId) {
|
|
|
|
|
+ return findUnitByIdAndCampaignId(unitId, campaignId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Unit> findUnitByIdAndEntityId(long unitId, int entityId) {
|
|
public Future<Unit> findUnitByIdAndEntityId(long unitId, int entityId) {
|
|
|
return Future.succeededFuture(Unit.of(1000, "mock(name)", "mock(imei)", "mock(description)"));
|
|
return Future.succeededFuture(Unit.of(1000, "mock(name)", "mock(imei)", "mock(description)"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<Unit> findUnitByIdentityAndIdAndEntityId(String userIdentity, long unitId, int entityId) {
|
|
|
|
|
+ return findUnitByIdAndEntityId(unitId, entityId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Unit> findUnitByIdAndEntityIdAndActionId(long unitId, int entityId, int actionId) {
|
|
public Future<Unit> findUnitByIdAndEntityIdAndActionId(long unitId, int entityId, int actionId) {
|
|
|
return Future.succeededFuture(Unit.of(1000, "mock(name)", "mock(imei)", "mock(description)"));
|
|
return Future.succeededFuture(Unit.of(1000, "mock(name)", "mock(imei)", "mock(description)"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<Unit> findUnitByIdentityAndIdAndEntityIdAndActionId(String userIdentity, long unitId, int entityId, int actionId) {
|
|
|
|
|
+ return findUnitByIdAndEntityIdAndActionId(unitId, entityId, actionId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Unit>> findUnitsByEntityIdAndActionId(int entityId, int actionId) {
|
|
public Future<List<Unit>> findUnitsByEntityIdAndActionId(int entityId, int actionId) {
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
|
Unit.of(1000, "mock(name)", "mock(imei)", "mock(description)"),
|
|
Unit.of(1000, "mock(name)", "mock(imei)", "mock(description)"),
|
|
@@ -119,6 +154,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Unit>> findUnitsByIdentityAndEntityIdAndActionId(String userIdentity, int entityId, int actionId) {
|
|
|
|
|
+ return findUnitsByEntityIdAndActionId(entityId, actionId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Long>> findUnitIdsByCampaignId(long campaignId) {
|
|
public Future<List<Long>> findUnitIdsByCampaignId(long campaignId) {
|
|
|
return Future.succeededFuture(List.of(1L,2L,3L));
|
|
return Future.succeededFuture(List.of(1L,2L,3L));
|
|
|
}
|
|
}
|
|
@@ -133,6 +173,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Sensor>> allSensorsByIdentity(String userIdentity) {
|
|
|
|
|
+ return allSensors();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Sensor> findSensorById(long sensorId) {
|
|
public Future<Sensor> findSensorById(long sensorId) {
|
|
|
return Future.succeededFuture(
|
|
return Future.succeededFuture(
|
|
|
Sensor.of(105, "mock(name)", "M", 98, Phenomenon.of(15, "mock(phenomenon)"), "mock(description)")
|
|
Sensor.of(105, "mock(name)", "M", 98, Phenomenon.of(15, "mock(phenomenon)"), "mock(description)")
|
|
@@ -140,6 +185,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<Sensor> findSensorByIdentityAndId(String userIdentity, long sensorId) {
|
|
|
|
|
+ return findSensorById(sensorId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Sensor> findSensorByIOAndUnitId(int ioID, long unitId) {
|
|
public Future<Sensor> findSensorByIOAndUnitId(int ioID, long unitId) {
|
|
|
return Future.succeededFuture(Sensor.of(105, "mock(name)", "M", 98, Phenomenon.of(15, "mock(phenomenon)"), "mock(description)"));
|
|
return Future.succeededFuture(Sensor.of(105, "mock(name)", "M", 98, Phenomenon.of(15, "mock(phenomenon)"), "mock(description)"));
|
|
|
}
|
|
}
|
|
@@ -177,6 +227,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Sensor>> findSensorsByIdentityAndUnitId(String userIdentity, long unitId) {
|
|
|
|
|
+ return findSensorsByUnitId(unitId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Sensor>> findSensorsByPhenomenonId(long phenomenonId) {
|
|
public Future<List<Sensor>> findSensorsByPhenomenonId(long phenomenonId) {
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
|
Sensor.of(105, "mock(name)", "M", 98, Phenomenon.of(15, "mock(phenomenon)"), "mock(description)"),
|
|
Sensor.of(105, "mock(name)", "M", 98, Phenomenon.of(15, "mock(phenomenon)"), "mock(description)"),
|
|
@@ -186,6 +241,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Sensor>> findSensorsByIdentityAndPhenomenonId(String userIdentity, long phenomenonId) {
|
|
|
|
|
+ return findSensorsByPhenomenonId(phenomenonId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Sensor>> findSensorsByCampaignIdAndUnitId(long campaignId, long unitId) {
|
|
public Future<List<Sensor>> findSensorsByCampaignIdAndUnitId(long campaignId, long unitId) {
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
|
Sensor.of(105, "mock(name)", "M"),
|
|
Sensor.of(105, "mock(name)", "M"),
|
|
@@ -195,6 +255,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Sensor>> findSensorsByIdentityAndCampaignIdAndUnitId(String userIdentity, long campaignId, long unitId) {
|
|
|
|
|
+ return findSensorsByCampaignIdAndUnitId(campaignId, unitId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Sensor> findSensorByCampaignIdAndUnitId(long campaignId, long unitId, long sensorId) {
|
|
public Future<Sensor> findSensorByCampaignIdAndUnitId(long campaignId, long unitId, long sensorId) {
|
|
|
return Future.succeededFuture(
|
|
return Future.succeededFuture(
|
|
|
Sensor.of(105, "mock(name)", "M", 98, Phenomenon.of(15, "mock(phenomenon)"), "mock(description)")
|
|
Sensor.of(105, "mock(name)", "M", 98, Phenomenon.of(15, "mock(phenomenon)"), "mock(description)")
|
|
@@ -202,6 +267,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<Sensor> findSensorByIdentityAndCampaignIdAndUnitId(String userIdentity, long campaignId, long unitId, long sensorId) {
|
|
|
|
|
+ return findSensorByCampaignIdAndUnitId(campaignId, unitId, sensorId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Phenomenon>> allPhenomenons() {
|
|
public Future<List<Phenomenon>> allPhenomenons() {
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
|
Phenomenon.of(1, "mock(name)"),
|
|
Phenomenon.of(1, "mock(name)"),
|
|
@@ -211,11 +281,21 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Phenomenon>> allPhenomenonsByIdentity(String userIdentity) {
|
|
|
|
|
+ return allPhenomenons();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Phenomenon> findPhenomenonById(long phenomenonId) {
|
|
public Future<Phenomenon> findPhenomenonById(long phenomenonId) {
|
|
|
return Future.succeededFuture(Phenomenon.of(1, "mock(name)", "mock(uom)", "http://uomlink"));
|
|
return Future.succeededFuture(Phenomenon.of(1, "mock(name)", "mock(uom)", "http://uomlink"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<Phenomenon> findPhenomenonByIdentityAndId(String userIdentity, long phenomenonId) {
|
|
|
|
|
+ return findPhenomenonById(phenomenonId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Campaign>> allCampaigns() {
|
|
public Future<List<Campaign>> allCampaigns() {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
@@ -224,13 +304,23 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Campaign>> allCampaignsByIdentity(String userIdentity) {
|
|
|
|
|
+ return allCampaigns();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Campaign> findCampaignById(long campaignId) {
|
|
public Future<Campaign> findCampaignById(long campaignId) {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(Campaign.of(1, "mock(description)", baseTimestamp, baseTimestamp.plusYears(1)));
|
|
return Future.succeededFuture(Campaign.of(1, "mock(description)", baseTimestamp, baseTimestamp.plusYears(1)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<List<Campaign>> findCampaignsByUnitId(long unitId, ZoneId zone) {
|
|
|
|
|
|
|
+ public Future<Campaign> findCampaignByIdentityAndId(String userIdentity, long campaignId) {
|
|
|
|
|
+ return findCampaignById(campaignId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<List<Campaign>> findCampaignsByUnitId(long unitId) {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
|
Campaign.of(1, "mock(description)", baseTimestamp, baseTimestamp.plusMonths(1)),
|
|
Campaign.of(1, "mock(description)", baseTimestamp, baseTimestamp.plusMonths(1)),
|
|
@@ -240,6 +330,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Campaign>> findCampaignsByIdentityAndUnitId(String userIdentity, long unitId) {
|
|
|
|
|
+ return findCampaignsByUnitId(unitId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Entity>> allEntities() {
|
|
public Future<List<Entity>> allEntities() {
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
|
Entity.of(1, "mock(name)"),
|
|
Entity.of(1, "mock(name)"),
|
|
@@ -249,11 +344,21 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Entity>> allEntitiesByIdentity(String userIdentity) {
|
|
|
|
|
+ return allEntities();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Entity> findEntityById(int entityId) {
|
|
public Future<Entity> findEntityById(int entityId) {
|
|
|
return Future.succeededFuture(Entity.of(1, "mock(name)"));
|
|
return Future.succeededFuture(Entity.of(1, "mock(name)"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<Entity> findEntityByIdentityId(String userIdentity, int entityId) {
|
|
|
|
|
+ return findEntityById(entityId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Entity>> findEntitiesByUnitId(long unitId) {
|
|
public Future<List<Entity>> findEntitiesByUnitId(long unitId) {
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
|
Entity.of(1, "mock(name)"),
|
|
Entity.of(1, "mock(name)"),
|
|
@@ -262,6 +367,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Entity>> findEntitiesByIdentityAndUnitId(String userIdentity, long unitId) {
|
|
|
|
|
+ return findEntitiesByUnitId(unitId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Action>> findActionsByEntityIdAndUnitId(int entityId, long unitId) {
|
|
public Future<List<Action>> findActionsByEntityIdAndUnitId(int entityId, long unitId) {
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
|
Action.of(1, "mock(name)"),
|
|
Action.of(1, "mock(name)"),
|
|
@@ -271,6 +381,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Action>> findActionsByIdentityAndEntityIdAndUnitId(String userIdentity, int entityId, long unitId) {
|
|
|
|
|
+ return findActionsByEntityIdAndUnitId(entityId, unitId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Action>> findActionsByEntityId(int entityId, OffsetDateTime from, OffsetDateTime to) {
|
|
public Future<List<Action>> findActionsByEntityId(int entityId, OffsetDateTime from, OffsetDateTime to) {
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
|
Action.of(1, "mock(name)"),
|
|
Action.of(1, "mock(name)"),
|
|
@@ -280,16 +395,31 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Action>> findActionsByIdentityAndEntityId(String userIdentity, int entityId, OffsetDateTime from, OffsetDateTime to) {
|
|
|
|
|
+ return findActionsByEntityId(entityId, from, to);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Action> findActionByIdAndEntityId(int actionId, int entityId) {
|
|
public Future<Action> findActionByIdAndEntityId(int actionId, int entityId) {
|
|
|
return Future.succeededFuture(Action.of(1, "mock(name)"));
|
|
return Future.succeededFuture(Action.of(1, "mock(name)"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<Action> findActionByIdentityIdAndEntityId(String userIdentity, int actionId, int entityId) {
|
|
|
|
|
+ return findActionByIdAndEntityId(actionId, entityId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Action> findActionByIdAndEntityIdAndUnitId(int actionId, int entityId, long unitId) {
|
|
public Future<Action> findActionByIdAndEntityIdAndUnitId(int actionId, int entityId, long unitId) {
|
|
|
return Future.succeededFuture(Action.of(1, "mock(name)"));
|
|
return Future.succeededFuture(Action.of(1, "mock(name)"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<Action> findActionByIdentityAndIdAndEntityIdAndUnitId(String userIdentity, int actionId, int entityId, long unitId) {
|
|
|
|
|
+ return findActionByIdAndEntityIdAndUnitId(actionId, entityId, unitId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Event>> findEventsByEntityIdAndUnitIdAndActionId(int entityId, long unitId, int actionId) {
|
|
public Future<List<Event>> findEventsByEntityIdAndUnitIdAndActionId(int entityId, long unitId, int actionId) {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
@@ -300,12 +430,22 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Event>> findEventsByIdentityAndEntityIdAndUnitIdAndActionId(String userIdentity, int entityId, long unitId, int actionId) {
|
|
|
|
|
+ return findEventsByEntityIdAndUnitIdAndActionId(entityId, unitId, actionId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Event> findEventById(long eventId) {
|
|
public Future<Event> findEventById(long eventId) {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(Event.of(1, 1, 1,1000, baseTimestamp, baseTimestamp.plusHours(8)));
|
|
return Future.succeededFuture(Event.of(1, 1, 1,1000, baseTimestamp, baseTimestamp.plusHours(8)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<Event> findEventByIdentityAndId(String userIdentity, long eventId) {
|
|
|
|
|
+ return findEventById(eventId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Unit>> findUnitsByEntityId(int entityId, OffsetDateTime from, OffsetDateTime to) {
|
|
public Future<List<Unit>> findUnitsByEntityId(int entityId, OffsetDateTime from, OffsetDateTime to) {
|
|
|
return Future.succeededFuture(List.of(
|
|
return Future.succeededFuture(List.of(
|
|
|
Unit.of(1000, "mock(name)", "mock(imei)", "mock(description)"),
|
|
Unit.of(1000, "mock(name)", "mock(imei)", "mock(description)"),
|
|
@@ -314,6 +454,11 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
));
|
|
));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<List<Unit>> findUnitsByIdentityAndEntityId(String userIdentity, int entityId, OffsetDateTime from, OffsetDateTime to) {
|
|
|
|
|
+ return findUnitsByEntityId(entityId, from, to);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private static List<UnitTelemetry> mockUnitTelemetries() {
|
|
private static List<UnitTelemetry> mockUnitTelemetries() {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
Location location = Location.of(14f, 49f, 450f, 0);
|
|
Location location = Location.of(14f, 49f, 450f, 0);
|
|
@@ -326,34 +471,65 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<List<UnitTelemetry>> findObservationsByCampaignId(long campaignId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<List<UnitTelemetry>> findObservationsByCampaignId(long campaignId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
return Future.succeededFuture(mockUnitTelemetries());
|
|
return Future.succeededFuture(mockUnitTelemetries());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<PagingRetrieve<List<UnitTelemetry>>> findObservationsByCampaignIdWithPaging(long campaignId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<PagingRetrieve<List<UnitTelemetry>>> findObservationsByCampaignIdWithPaging(long campaignId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
List<UnitTelemetry> observations = mockUnitTelemetries();
|
|
List<UnitTelemetry> observations = mockUnitTelemetries();
|
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, observations.size(), observations));
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, observations.size(), observations));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<List<UnitTelemetry>> findObservationsByCampaignIdAndUnitId(long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<List<UnitTelemetry>> findObservationsByIdentityAndCampaignId(String userIdentity, long campaignId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ return findObservationsByCampaignId(campaignId, from, to, offset, limit, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<PagingRetrieve<List<UnitTelemetry>>> findObservationsByIdentityAndCampaignIdWithPaging(String userIdentity, long campaignId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ return findObservationsByCampaignIdWithPaging(campaignId, from, to, offset, limit, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<List<UnitTelemetry>> findObservationsByCampaignIdAndUnitId(long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
return Future.succeededFuture(mockUnitTelemetries());
|
|
return Future.succeededFuture(mockUnitTelemetries());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<PagingRetrieve<List<UnitTelemetry>>> findObservationsByCampaignIdAndUnitIdWithPaging(long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<PagingRetrieve<List<UnitTelemetry>>> findObservationsByCampaignIdAndUnitIdWithPaging(long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
List<UnitTelemetry> observations = mockUnitTelemetries();
|
|
List<UnitTelemetry> observations = mockUnitTelemetries();
|
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, observations.size(), observations));
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, observations.size(), observations));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<List<UnitTelemetry>> findObservationsByEventId(long eventId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<List<UnitTelemetry>> findObservationsByIdentityAndCampaignIdAndUnitId(String userIdentity, long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ return findObservationsByCampaignIdAndUnitId(campaignId, unitId, from, to, offset, limit, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<PagingRetrieve<List<UnitTelemetry>>> findObservationsByIdentityAndCampaignIdAndUnitIdWithPaging(String userIdentity, long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ return findObservationsByCampaignIdAndUnitIdWithPaging(campaignId, unitId, from, to, offset, limit, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<List<UnitTelemetry>> findObservationsByEventId(long eventId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
return Future.succeededFuture(mockUnitTelemetries());
|
|
return Future.succeededFuture(mockUnitTelemetries());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<PagingRetrieve<List<UnitTelemetry>>> findObservationsByEventIdWithPaging(long eventId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<PagingRetrieve<List<UnitTelemetry>>> findObservationsByEventIdWithPaging(long eventId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ List<UnitTelemetry> observations = mockUnitTelemetries();
|
|
|
|
|
+ return Future.succeededFuture(new PagingRetrieve<>(true, observations.size(), observations));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<List<UnitTelemetry>> findObservationsByIdentityAndEventId(String userIdentity, long eventId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ return findObservationsByEventId(eventId, from, to, offset, limit, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<PagingRetrieve<List<UnitTelemetry>>> findObservationsByIdentityAndEventIdWithPaging(String userIdentity, long eventId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
List<UnitTelemetry> observations = mockUnitTelemetries();
|
|
List<UnitTelemetry> observations = mockUnitTelemetries();
|
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, observations.size(), observations));
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, observations.size(), observations));
|
|
|
}
|
|
}
|
|
@@ -369,16 +545,26 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<List<SensorTelemetry>> findObservationsByCampaignIdAndUnitIdAndSensorId(long campaignId, long unitId, long sensorId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<List<SensorTelemetry>> findObservationsByCampaignIdAndUnitIdAndSensorId(long campaignId, long unitId, long sensorId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
return Future.succeededFuture(mockSensorTelemetries());
|
|
return Future.succeededFuture(mockSensorTelemetries());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<PagingRetrieve<List<SensorTelemetry>>> findObservationsByCampaignIdAndUnitIdAndSensorIdWithPaging(long campaignId, long unitId, long sensorId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<PagingRetrieve<List<SensorTelemetry>>> findObservationsByCampaignIdAndUnitIdAndSensorIdWithPaging(long campaignId, long unitId, long sensorId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
List<SensorTelemetry> mock = mockSensorTelemetries();
|
|
List<SensorTelemetry> mock = mockSensorTelemetries();
|
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, mock.size(), mock));
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, mock.size(), mock));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<List<SensorTelemetry>> findObservationsByIdentityAndCampaignIdAndUnitIdAndSensorId(String userIdentity, long campaignId, long unitId, long sensorId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ return findObservationsByCampaignIdAndUnitIdAndSensorId(campaignId, unitId, sensorId, from, to, offset, limit, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<PagingRetrieve<List<SensorTelemetry>>> findObservationsByIdentityAndCampaignIdAndUnitIdAndSensorIdWithPaging(String userIdentity, long campaignId, long unitId, long sensorId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ return SensLogRepository.super.findObservationsByIdentityAndCampaignIdAndUnitIdAndSensorIdWithPaging(userIdentity, campaignId, unitId, sensorId, from, to, offset, limit, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private static List<UnitLocation> mockUnitLocations() {
|
|
private static List<UnitLocation> mockUnitLocations() {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
Location location = Location.of(14f, 49f, 450f, 0);
|
|
Location location = Location.of(14f, 49f, 450f, 0);
|
|
@@ -390,39 +576,70 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<List<UnitLocation>> findLocationsByCampaignIdAndUnitId(long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<List<UnitLocation>> findLocationsByCampaignIdAndUnitId(long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
return Future.succeededFuture(mockUnitLocations());
|
|
return Future.succeededFuture(mockUnitLocations());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<PagingRetrieve<List<UnitLocation>>> findLocationsByCampaignIdAndUnitIdWithPaging(long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<PagingRetrieve<List<UnitLocation>>> findLocationsByCampaignIdAndUnitIdWithPaging(long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
List<UnitLocation> mock = mockUnitLocations();
|
|
List<UnitLocation> mock = mockUnitLocations();
|
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, mock.size(), mock));
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, mock.size(), mock));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<List<UnitLocation>> findLocationsByEventId(long eventId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<List<UnitLocation>> findLocationsByIdentityCampaignIdAndUnitId(String userIdentity, long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ return findLocationsByCampaignIdAndUnitId(campaignId, unitId, from, to, offset, limit, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<PagingRetrieve<List<UnitLocation>>> findLocationsByIdentityCampaignIdAndUnitIdWithPaging(String userIdentity, long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ return findLocationsByCampaignIdAndUnitIdWithPaging(campaignId, unitId, from, to, offset, limit, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<List<UnitLocation>> findLocationsByEventId(long eventId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
return Future.succeededFuture(mockUnitLocations());
|
|
return Future.succeededFuture(mockUnitLocations());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<PagingRetrieve<List<UnitLocation>>> findLocationsByEventIdWithPaging(long eventId, OffsetDateTime from, OffsetDateTime to, ZoneId zone, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<PagingRetrieve<List<UnitLocation>>> findLocationsByEventIdWithPaging(long eventId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
List<UnitLocation> mock = mockUnitLocations();
|
|
List<UnitLocation> mock = mockUnitLocations();
|
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, mock.size(), mock));
|
|
return Future.succeededFuture(new PagingRetrieve<>(true, mock.size(), mock));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Future<List<UnitLocation>> findUnitsLocationsByCampaignId(long campaignId, int limitPerUnit, OffsetDateTime from, OffsetDateTime to, ZoneId zone, SortType sort, List<Filter> filters) {
|
|
|
|
|
|
|
+ public Future<List<UnitLocation>> findLocationsByIdentityAndEventId(String userIdentity, long eventId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ return findLocationsByEventId(eventId, from, to, offset, limit, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<PagingRetrieve<List<UnitLocation>>> findLocationsByIdentityAndEventIdWithPaging(String userIdentity, long eventId, OffsetDateTime from, OffsetDateTime to, int offset, int limit, List<Filter> filters) {
|
|
|
|
|
+ List<UnitLocation> mock = mockUnitLocations();
|
|
|
|
|
+ return Future.succeededFuture(new PagingRetrieve<>(true, mock.size(), mock));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<List<UnitLocation>> findUnitsLocationsByCampaignId(long campaignId, int limitPerUnit, OffsetDateTime from, OffsetDateTime to, SortType sort, List<Filter> filters) {
|
|
|
return Future.succeededFuture(mockUnitLocations());
|
|
return Future.succeededFuture(mockUnitLocations());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<UnitLocation>> findUnitsLocationsByIdentityAndCampaignId(String userIdentity, long campaignId, int limitPerUnit, OffsetDateTime from, OffsetDateTime to, SortType sort, List<Filter> filters) {
|
|
|
|
|
+ return findUnitsLocationsByCampaignId(campaignId, limitPerUnit, from, to, sort, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<CampaignUnitAlert> findAlertById(long alertId) {
|
|
public Future<CampaignUnitAlert> findAlertById(long alertId) {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(CampaignUnitAlert.of(1, 1, 1000, "mock(message)", baseTimestamp, AlertStatus.CREATED));
|
|
return Future.succeededFuture(CampaignUnitAlert.of(1, 1, 1000, "mock(message)", baseTimestamp, AlertStatus.CREATED));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<CampaignUnitAlert> findAlertByIdentityAndId(String userIdentity, long alertId) {
|
|
|
|
|
+ return findAlertById(alertId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<Long> updateAlert(long alertId, AlertStatus status) {
|
|
public Future<Long> updateAlert(long alertId, AlertStatus status) {
|
|
|
return Future.succeededFuture(1L);
|
|
return Future.succeededFuture(1L);
|
|
|
}
|
|
}
|
|
@@ -444,26 +661,51 @@ public class MockSensLogRepository implements SensLogRepository {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<Alert>> findAlertsByIdentityAndEventId(String userIdentity, long eventId, Set<AlertStatus> statusFilter, SortType sortType) {
|
|
|
|
|
+ return findAlertsByEventId(eventId, statusFilter, sortType);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<EventAlert> findAlertByIdAndEventId(long alertId, long eventId) {
|
|
public Future<EventAlert> findAlertByIdAndEventId(long alertId, long eventId) {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(EventAlert.of(1, 1, 1000, "mock(message)", baseTimestamp, AlertStatus.CREATED));
|
|
return Future.succeededFuture(EventAlert.of(1, 1, 1000, "mock(message)", baseTimestamp, AlertStatus.CREATED));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<EventAlert> findAlertByIdentityAndIdAndEventId(String userIdentity, long alertId, long eventId) {
|
|
|
|
|
+ return findAlertByIdAndEventId(alertId, eventId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<CampaignUnitAlert>> findAlertsByCampaignId(long campaignId, OffsetDateTime from, OffsetDateTime to, Set<AlertStatus> statusFilter, SortType sort) {
|
|
public Future<List<CampaignUnitAlert>> findAlertsByCampaignId(long campaignId, OffsetDateTime from, OffsetDateTime to, Set<AlertStatus> statusFilter, SortType sort) {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(List.of(CampaignUnitAlert.of(1, 1, 1000, "mock(message)", baseTimestamp, AlertStatus.CREATED)));
|
|
return Future.succeededFuture(List.of(CampaignUnitAlert.of(1, 1, 1000, "mock(message)", baseTimestamp, AlertStatus.CREATED)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<CampaignUnitAlert>> findAlertsByIdentityAndCampaignId(String userIdentity, long campaignId, OffsetDateTime from, OffsetDateTime to, Set<AlertStatus> statusFilter, SortType sort) {
|
|
|
|
|
+ return findAlertsByCampaignId(campaignId, from, to, statusFilter, sort);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<UnitAlert>> findAlertsByCampaignIdAndUnitId(long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, Set<AlertStatus> statusFilter, SortType sort) {
|
|
public Future<List<UnitAlert>> findAlertsByCampaignIdAndUnitId(long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, Set<AlertStatus> statusFilter, SortType sort) {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(List.of(UnitAlert.of(1, 1, "mock(message)", baseTimestamp, AlertStatus.CREATED)));
|
|
return Future.succeededFuture(List.of(UnitAlert.of(1, 1, "mock(message)", baseTimestamp, AlertStatus.CREATED)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public Future<List<UnitAlert>> findAlertsByIdentityAndCampaignIdAndUnitId(String userIdentity, long campaignId, long unitId, OffsetDateTime from, OffsetDateTime to, Set<AlertStatus> statusFilter, SortType sort) {
|
|
|
|
|
+ return findAlertsByCampaignIdAndUnitId(campaignId, unitId, from, to, statusFilter, sort);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public Future<List<Alert>> findAlertsByEntityIdAndActionIdAndUnitId(long driverId, long actionId, long unitId, Set<AlertStatus> statusFilter, SortType sort) {
|
|
public Future<List<Alert>> findAlertsByEntityIdAndActionIdAndUnitId(long driverId, long actionId, long unitId, Set<AlertStatus> statusFilter, SortType sort) {
|
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
OffsetDateTime baseTimestamp = OffsetDateTime.ofInstant(BASE_INSTANT_TIMESTAMP, ZoneOffset.UTC);
|
|
|
return Future.succeededFuture(List.of(Alert.of(1, "mock(message)", baseTimestamp, AlertStatus.CREATED)));
|
|
return Future.succeededFuture(List.of(Alert.of(1, "mock(message)", baseTimestamp, AlertStatus.CREATED)));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Future<List<Alert>> findAlertsByIdentityAndEntityIdAndActionIdAndUnitId(String userIdentity, long entityId, long actionId, long unitId, Set<AlertStatus> statusFilter, SortType sort) {
|
|
|
|
|
+ return findAlertsByEntityIdAndActionIdAndUnitId(entityId, actionId, unitId, statusFilter, sort);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|