diff --git a/.gitmodules b/.gitmodules index f93547e7..d810b691 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,4 +5,4 @@ [submodule "api/asn1_codec"] path = api/asn1_codec - url = https://github.com/iyourshaw/asn1_codec.git + url = https://github.com/usdot-jpo-ode/asn1_codec.git diff --git a/README.md b/README.md index 1d87585d..fc8fffa8 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ Once these components have been installed. Download and install additional depen ``` cd api/jpo-conflictvisualizer-api mvn clean install +mvn spring-boot:run ``` ### 2. Running Conflict Visualizer GUI Locally diff --git a/api/asn1_codec b/api/asn1_codec index 3b407666..6ce8588e 160000 --- a/api/asn1_codec +++ b/api/asn1_codec @@ -1 +1 @@ -Subproject commit 3b407666b09e2e7c3886bf6953d5821b43748e03 +Subproject commit 6ce8588e77cde969fa419f1cc960c4eb05829ff1 diff --git a/api/jpo-conflictmonitor b/api/jpo-conflictmonitor index c2c32e2b..eb191250 160000 --- a/api/jpo-conflictmonitor +++ b/api/jpo-conflictmonitor @@ -1 +1 @@ -Subproject commit c2c32e2bff8fe735d32dc9a6428e6357226e3d20 +Subproject commit eb191250b61ca1b2419cd0a1d37622231dc5acb7 diff --git a/api/jpo-conflictvisualizer-api/pom.xml b/api/jpo-conflictvisualizer-api/pom.xml index 95406f25..817305da 100644 --- a/api/jpo-conflictvisualizer-api/pom.xml +++ b/api/jpo-conflictvisualizer-api/pom.xml @@ -11,7 +11,7 @@ usdot.jpo.ode jpo-conflictvisualizer-api - 1.3.1-SNAPSHOT + 1.4.0-SNAPSHOT jar jpo-conflictvisualizer-api Conflict Visualizer @@ -98,7 +98,7 @@ usdot.jpo.ode jpo-ode-core - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT @@ -110,23 +110,23 @@ usdot.jpo.ode jpo-ode-plugins - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT usdot.jpo.ode jpo-ode-svcs - 2.1.0-SNAPSHOT + 3.0.0-SNAPSHOT usdot.jpo.ode jpo-geojsonconverter - 1.3.1-SNAPSHOT + 1.4.2-SNAPSHOT jpo-geojsonconverter usdot.jpo.ode jpo-conflictmonitor - 1.3.1-SNAPSHOT + 1.4.1-SNAPSHOT jpo-conflictmonitor diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/ConnectionOfTravelAssessment/ConnectionOfTravelAssessmentRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/ConnectionOfTravelAssessment/ConnectionOfTravelAssessmentRepository.java index 2b8403ec..e12550c2 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/ConnectionOfTravelAssessment/ConnectionOfTravelAssessmentRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/ConnectionOfTravelAssessment/ConnectionOfTravelAssessmentRepository.java @@ -11,7 +11,11 @@ public interface ConnectionOfTravelAssessmentRepository extends DataLoader find(Query query); + + } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/ConnectionOfTravelAssessment/ConnectionOfTravelAssessmentRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/ConnectionOfTravelAssessment/ConnectionOfTravelAssessmentRepositoryImpl.java index fc86954a..2fe0a0c4 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/ConnectionOfTravelAssessment/ConnectionOfTravelAssessmentRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/ConnectionOfTravelAssessment/ConnectionOfTravelAssessmentRepositoryImpl.java @@ -51,11 +51,20 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool return query; } + public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, ConnectionOfTravelAssessment.class, collectionName); } + // Removes the result limit on a count query. + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, ConnectionOfTravelAssessment.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, ConnectionOfTravelAssessment.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/LaneDirectionOfTravelAssessment/LaneDirectionOfTravelAssessmentRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/LaneDirectionOfTravelAssessment/LaneDirectionOfTravelAssessmentRepository.java index 4f74fe26..03636be3 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/LaneDirectionOfTravelAssessment/LaneDirectionOfTravelAssessmentRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/LaneDirectionOfTravelAssessment/LaneDirectionOfTravelAssessmentRepository.java @@ -11,6 +11,8 @@ public interface LaneDirectionOfTravelAssessmentRepository extends DataLoader find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/LaneDirectionOfTravelAssessment/LaneDirectionOfTravelAssessmentRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/LaneDirectionOfTravelAssessment/LaneDirectionOfTravelAssessmentRepositoryImpl.java index e70dee6f..bc1dd54c 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/LaneDirectionOfTravelAssessment/LaneDirectionOfTravelAssessmentRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/LaneDirectionOfTravelAssessment/LaneDirectionOfTravelAssessmentRepositoryImpl.java @@ -10,6 +10,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.assessments.LaneDirectionOfTravelAssessment; import us.dot.its.jpo.ode.api.ConflictMonitorApiProperties; @@ -51,14 +52,24 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool }else{ query.limit(props.getMaximumResponseSize()); } + return query; } + + public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, LaneDirectionOfTravelAssessment.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, LaneDirectionOfTravelAssessment.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, LaneDirectionOfTravelAssessment.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateAssessment/StopLineStopAssessmentRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateAssessment/StopLineStopAssessmentRepository.java index 1edea9d8..feb8afce 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateAssessment/StopLineStopAssessmentRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateAssessment/StopLineStopAssessmentRepository.java @@ -11,6 +11,8 @@ public interface StopLineStopAssessmentRepository extends DataLoader find(Query query); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateAssessment/StopLineStopAssessmentRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateAssessment/StopLineStopAssessmentRepositoryImpl.java index f1ebc584..576bda1f 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateAssessment/StopLineStopAssessmentRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateAssessment/StopLineStopAssessmentRepositoryImpl.java @@ -10,6 +10,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.assessments.StopLineStopAssessment; import us.dot.its.jpo.ode.api.ConflictMonitorApiProperties; @@ -52,10 +53,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, StopLineStopAssessment.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, StopLineStopAssessment.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, StopLineStopAssessment.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateEventAssessment/SignalStateEventAssessmentRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateEventAssessment/SignalStateEventAssessmentRepository.java index e8868095..7bcff32b 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateEventAssessment/SignalStateEventAssessmentRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateEventAssessment/SignalStateEventAssessmentRepository.java @@ -13,5 +13,7 @@ public interface SignalStateEventAssessmentRepository extends DataLoader find(Query query); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateEventAssessment/SignalStateEventAssessmentRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateEventAssessment/SignalStateEventAssessmentRepositoryImpl.java index dbd2974e..907c4e00 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateEventAssessment/SignalStateEventAssessmentRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/assessments/SignalStateEventAssessment/SignalStateEventAssessmentRepositoryImpl.java @@ -53,10 +53,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, StopLinePassageAssessment.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, StopLinePassageAssessment.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, StopLinePassageAssessment.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/BsmEvent/BsmEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/BsmEvent/BsmEventRepository.java index 8181847d..5bc10204 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/BsmEvent/BsmEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/BsmEvent/BsmEventRepository.java @@ -12,6 +12,8 @@ public interface BsmEventRepository extends DataLoader{ Query getQuery(Integer intersectionID, Long startTime, Long endTime, boolean latest); long getQueryResultCount(Query query); + + long getQueryFullCount(Query query); List find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/BsmEvent/BsmEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/BsmEvent/BsmEventRepositoryImpl.java index a0d5d54b..2a994244 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/BsmEvent/BsmEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/BsmEvent/BsmEventRepositoryImpl.java @@ -65,10 +65,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, BsmEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, BsmEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { List documents = mongoTemplate.find(query, Map.class, collectionName); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/ConnectionOfTravelEvent/ConnectionOfTravelEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/ConnectionOfTravelEvent/ConnectionOfTravelEventRepository.java index acbff3cb..90e72c37 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/ConnectionOfTravelEvent/ConnectionOfTravelEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/ConnectionOfTravelEvent/ConnectionOfTravelEventRepository.java @@ -13,6 +13,8 @@ public interface ConnectionOfTravelEventRepository extends DataLoader find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/ConnectionOfTravelEvent/ConnectionOfTravelEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/ConnectionOfTravelEvent/ConnectionOfTravelEventRepositoryImpl.java index 1ad1e3ac..e7337a10 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/ConnectionOfTravelEvent/ConnectionOfTravelEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/ConnectionOfTravelEvent/ConnectionOfTravelEventRepositoryImpl.java @@ -9,6 +9,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.events.ConnectionOfTravelEvent; import org.springframework.data.domain.Sort; @@ -59,10 +60,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, ConnectionOfTravelEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, ConnectionOfTravelEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, ConnectionOfTravelEvent.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/IntersectionReferenceAlignmentEvent/IntersectionReferenceAlignmentEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/IntersectionReferenceAlignmentEvent/IntersectionReferenceAlignmentEventRepository.java index abad84a5..84649419 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/IntersectionReferenceAlignmentEvent/IntersectionReferenceAlignmentEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/IntersectionReferenceAlignmentEvent/IntersectionReferenceAlignmentEventRepository.java @@ -12,6 +12,8 @@ public interface IntersectionReferenceAlignmentEventRepository extends DataLoade Query getQuery(Integer intersectionID, Long startTime, Long endTime, boolean latest); long getQueryResultCount(Query query); + + long getQueryFullCount(Query query); List find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/IntersectionReferenceAlignmentEvent/IntersectionReferenceAlignmentEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/IntersectionReferenceAlignmentEvent/IntersectionReferenceAlignmentEventRepositoryImpl.java index d7e39803..36245dd9 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/IntersectionReferenceAlignmentEvent/IntersectionReferenceAlignmentEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/IntersectionReferenceAlignmentEvent/IntersectionReferenceAlignmentEventRepositoryImpl.java @@ -12,6 +12,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.events.IntersectionReferenceAlignmentEvent; import us.dot.its.jpo.ode.api.ConflictMonitorApiProperties; import us.dot.its.jpo.ode.api.models.IDCount; @@ -58,11 +59,18 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, IntersectionReferenceAlignmentEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, IntersectionReferenceAlignmentEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, IntersectionReferenceAlignmentEvent.class, collectionName); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/LaneDirectionOfTravelEvent/LaneDirectionOfTravelEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/LaneDirectionOfTravelEvent/LaneDirectionOfTravelEventRepository.java index 5b7ae4cc..74ad3bb1 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/LaneDirectionOfTravelEvent/LaneDirectionOfTravelEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/LaneDirectionOfTravelEvent/LaneDirectionOfTravelEventRepository.java @@ -13,6 +13,8 @@ public interface LaneDirectionOfTravelEventRepository extends DataLoader find(Query query); List getLaneDirectionOfTravelEventsByDay(int intersectionID, Long startTime, Long endTime); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/LaneDirectionOfTravelEvent/LaneDirectionOfTravelEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/LaneDirectionOfTravelEvent/LaneDirectionOfTravelEventRepositoryImpl.java index c6c599d7..5a151da4 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/LaneDirectionOfTravelEvent/LaneDirectionOfTravelEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/LaneDirectionOfTravelEvent/LaneDirectionOfTravelEventRepositoryImpl.java @@ -63,10 +63,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, LaneDirectionOfTravelEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, LaneDirectionOfTravelEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, LaneDirectionOfTravelEvent.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapBroadcastRateEvents/MapBroadcastRateEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapBroadcastRateEvents/MapBroadcastRateEventRepository.java index f688581c..bc782867 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapBroadcastRateEvents/MapBroadcastRateEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapBroadcastRateEvents/MapBroadcastRateEventRepository.java @@ -11,6 +11,8 @@ public interface MapBroadcastRateEventRepository extends DataLoader find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapBroadcastRateEvents/MapBroadcastRateEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapBroadcastRateEvents/MapBroadcastRateEventRepositoryImpl.java index 07dcd43c..cf7109b5 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapBroadcastRateEvents/MapBroadcastRateEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapBroadcastRateEvents/MapBroadcastRateEventRepositoryImpl.java @@ -58,10 +58,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, MapBroadcastRateEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, MapBroadcastRateEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, MapBroadcastRateEvent.class, collectionName); } @@ -91,6 +98,8 @@ public List getMapBroadcastRateEventsByDay(int intersectionID, Long sta return results; } + + @Override public void add(MapBroadcastRateEvent item) { mongoTemplate.save(item, collectionName); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapMinimumDataEvent/MapMinimumDataEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapMinimumDataEvent/MapMinimumDataEventRepository.java index 4bca2440..56cd780b 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapMinimumDataEvent/MapMinimumDataEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapMinimumDataEvent/MapMinimumDataEventRepository.java @@ -10,6 +10,8 @@ public interface MapMinimumDataEventRepository extends DataLoader find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapMinimumDataEvent/MapMinimumDataEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapMinimumDataEvent/MapMinimumDataEventRepositoryImpl.java index 5e949ccf..ec512707 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapMinimumDataEvent/MapMinimumDataEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/MapMinimumDataEvent/MapMinimumDataEventRepositoryImpl.java @@ -58,10 +58,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, MapMinimumDataEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, MapMinimumDataEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, MapMinimumDataEvent.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalGroupAlignmentEvent/SignalGroupAlignmentEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalGroupAlignmentEvent/SignalGroupAlignmentEventRepository.java index 8d4ab572..631f0be7 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalGroupAlignmentEvent/SignalGroupAlignmentEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalGroupAlignmentEvent/SignalGroupAlignmentEventRepository.java @@ -12,6 +12,8 @@ public interface SignalGroupAlignmentEventRepository extends DataLoader find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalGroupAlignmentEvent/SignalGroupAlignmentEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalGroupAlignmentEvent/SignalGroupAlignmentEventRepositoryImpl.java index 0c948220..6616b4dc 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalGroupAlignmentEvent/SignalGroupAlignmentEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalGroupAlignmentEvent/SignalGroupAlignmentEventRepositoryImpl.java @@ -11,6 +11,7 @@ import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; import us.dot.its.jpo.conflictmonitor.monitor.models.events.SignalGroupAlignmentEvent; + import org.springframework.data.domain.Sort; import org.springframework.data.mongodb.core.aggregation.Aggregation; @@ -59,10 +60,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, SignalGroupAlignmentEvent.class, "CmSignalGroupAlignmentEvents"); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, SignalGroupAlignmentEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, SignalGroupAlignmentEvent.class, "CmSignalGroupAlignmentEvents"); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateConflictEvent/SignalStateConflictEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateConflictEvent/SignalStateConflictEventRepository.java index 67d72b1b..c8da23b8 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateConflictEvent/SignalStateConflictEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateConflictEvent/SignalStateConflictEventRepository.java @@ -13,6 +13,8 @@ public interface SignalStateConflictEventRepository extends DataLoader find(Query query); List getSignalStateConflictEventsByDay(int intersectionID, Long startTime, Long endTime); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateConflictEvent/SignalStateConflictEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateConflictEvent/SignalStateConflictEventRepositoryImpl.java index 430d6fba..25c25b7c 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateConflictEvent/SignalStateConflictEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateConflictEvent/SignalStateConflictEventRepositoryImpl.java @@ -9,6 +9,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.events.SignalStateConflictEvent; import org.springframework.data.domain.Sort; @@ -57,10 +58,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, SignalStateConflictEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, SignalStateConflictEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, SignalStateConflictEvent.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateEvent/SignalStateEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateEvent/SignalStateEventRepository.java index 81a3ac44..74731943 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateEvent/SignalStateEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateEvent/SignalStateEventRepository.java @@ -12,6 +12,8 @@ public interface SignalStateEventRepository extends DataLoader find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateEvent/SignalStateEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateEvent/SignalStateEventRepositoryImpl.java index b9b8a15a..6b02ec19 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateEvent/SignalStateEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateEvent/SignalStateEventRepositoryImpl.java @@ -10,6 +10,7 @@ import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; import org.springframework.data.domain.Sort; + import us.dot.its.jpo.conflictmonitor.monitor.models.events.StopLinePassageEvent; import org.springframework.data.mongodb.core.aggregation.Aggregation; @@ -57,10 +58,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, StopLinePassageEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, StopLinePassageEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, StopLinePassageEvent.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateStopEvent/SignalStateStopEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateStopEvent/SignalStateStopEventRepository.java index 3f004285..87c8d299 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateStopEvent/SignalStateStopEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateStopEvent/SignalStateStopEventRepository.java @@ -12,6 +12,8 @@ public interface SignalStateStopEventRepository extends DataLoader find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateStopEvent/SignalStateStopEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateStopEvent/SignalStateStopEventRepositoryImpl.java index 873b6fe2..370be103 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateStopEvent/SignalStateStopEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SignalStateStopEvent/SignalStateStopEventRepositoryImpl.java @@ -10,6 +10,7 @@ import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; import org.springframework.data.domain.Sort; + import us.dot.its.jpo.conflictmonitor.monitor.models.events.StopLineStopEvent; import org.springframework.data.mongodb.core.aggregation.Aggregation; @@ -57,10 +58,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, StopLineStopEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, StopLineStopEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, StopLineStopEvent.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatBroadcastRateEvent/SpatBroadcastRateEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatBroadcastRateEvent/SpatBroadcastRateEventRepository.java index 3b4fc320..c00124b8 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatBroadcastRateEvent/SpatBroadcastRateEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatBroadcastRateEvent/SpatBroadcastRateEventRepository.java @@ -11,6 +11,8 @@ public interface SpatBroadcastRateEventRepository extends DataLoader find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatBroadcastRateEvent/SpatBroadcastRateEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatBroadcastRateEvent/SpatBroadcastRateEventRepositoryImpl.java index fcaac8bc..13903564 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatBroadcastRateEvent/SpatBroadcastRateEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatBroadcastRateEvent/SpatBroadcastRateEventRepositoryImpl.java @@ -59,10 +59,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, SpatBroadcastRateEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, SpatBroadcastRateEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, SpatBroadcastRateEvent.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatMinimumDataEvent/SpatMinimumDataEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatMinimumDataEvent/SpatMinimumDataEventRepository.java index bf723faf..b8880e2a 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatMinimumDataEvent/SpatMinimumDataEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatMinimumDataEvent/SpatMinimumDataEventRepository.java @@ -11,6 +11,8 @@ public interface SpatMinimumDataEventRepository extends DataLoader find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatMinimumDataEvent/SpatMinimumDataEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatMinimumDataEvent/SpatMinimumDataEventRepositoryImpl.java index c921cc29..86577978 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatMinimumDataEvent/SpatMinimumDataEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/SpatMinimumDataEvent/SpatMinimumDataEventRepositoryImpl.java @@ -59,10 +59,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, SpatMinimumDataEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, SpatMinimumDataEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, SpatMinimumDataEvent.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/TimeChangeDetailsEvent/TimeChangeDetailsEventRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/TimeChangeDetailsEvent/TimeChangeDetailsEventRepository.java index 95e11a02..2ddd1cd1 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/TimeChangeDetailsEvent/TimeChangeDetailsEventRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/TimeChangeDetailsEvent/TimeChangeDetailsEventRepository.java @@ -12,6 +12,8 @@ public interface TimeChangeDetailsEventRepository extends DataLoader find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/TimeChangeDetailsEvent/TimeChangeDetailsEventRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/TimeChangeDetailsEvent/TimeChangeDetailsEventRepositoryImpl.java index d968e4bb..b1e24edf 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/TimeChangeDetailsEvent/TimeChangeDetailsEventRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/events/TimeChangeDetailsEvent/TimeChangeDetailsEventRepositoryImpl.java @@ -58,10 +58,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, TimeChangeDetailsEvent.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, TimeChangeDetailsEvent.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, TimeChangeDetailsEvent.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/OdeMapDataRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/OdeMapDataRepositoryImpl.java index 07631ee7..90395653 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/OdeMapDataRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/OdeMapDataRepositoryImpl.java @@ -53,10 +53,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, OdeMapData.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, OdeMapData.class, collectionName); + query.limit(limit); + return count; + } + public List findMaps(Query query) { return mongoTemplate.find(query, OdeMapData.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/ProcessedMapRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/ProcessedMapRepository.java index 4afb891e..ad8f97b0 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/ProcessedMapRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/ProcessedMapRepository.java @@ -22,4 +22,6 @@ public interface ProcessedMapRepository extends DataLoader getMapBroadcastRates(int intersectionID, Long startTime, Long endTime); List getMapBroadcastRateDistribution(int intersectionID, Long startTime, Long endTime); + + List getIntersectionsContainingPoint(double longitude, double latitude); } \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/ProcessedMapRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/ProcessedMapRepositoryImpl.java index 78693f36..24a3808a 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/ProcessedMapRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/map/ProcessedMapRepositoryImpl.java @@ -2,12 +2,14 @@ import java.time.Instant; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import org.bson.Document; import org.bson.conversions.Bson; +import org.locationtech.jts.geom.CoordinateXY; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -39,6 +41,8 @@ import us.dot.its.jpo.ode.api.ConflictMonitorApiProperties; import us.dot.its.jpo.ode.api.models.IDCount; import us.dot.its.jpo.ode.api.models.IntersectionReferenceData; +import us.dot.its.jpo.conflictmonitor.monitor.models.map.MapBoundingBox; +import us.dot.its.jpo.conflictmonitor.monitor.models.map.MapIndex; import us.dot.its.jpo.geojsonconverter.DateJsonMapper; import us.dot.its.jpo.geojsonconverter.pojos.geojson.LineString; @@ -92,10 +96,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, ProcessedMap.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, ProcessedMap.class, collectionName); + query.limit(limit); + return count; + } + public List> findProcessedMaps(Query query) { List documents = mongoTemplate.find(query, Map.class, collectionName); List> convertedList = new ArrayList<>(); @@ -158,6 +169,54 @@ public List getIntersectionIDs() { return referenceDataList; } + public List getIntersectionsContainingPoint(double longitude, double latitude){ + MongoCollection collection = mongoTemplate.getCollection(collectionName); + DistinctIterable docs = collection.distinct("properties.intersectionId", Integer.class); + MongoCursor results = docs.iterator(); + MapIndex index = new MapIndex(); + Map> mapLookup = new HashMap<>(); + while (results.hasNext()) { + Integer intersectionId = results.next(); + if (intersectionId != null){ + + + Query query = getQuery(intersectionId, null, null, true, true); + + List> maps = findProcessedMaps(query); + + if(maps.size() > 0){ + MapBoundingBox box = new MapBoundingBox(maps.getFirst()); + index.insert(box); + mapLookup.put(intersectionId, maps.getFirst()); + } + } + } + + List mapsContainingPoints = index.mapsContainingPoint(new CoordinateXY(longitude, latitude)); + + List result = new ArrayList<>(); + for(MapBoundingBox box: mapsContainingPoints){ + ProcessedMap map = mapLookup.get(box.getIntersectionId()); + IntersectionReferenceData data = new IntersectionReferenceData(); + data.setIntersectionID(map.getProperties().getIntersectionId()); + data.setRoadRegulatorID("-1"); + data.setRsuIP(map.getProperties().getOriginIp()); + + if(map.getProperties().getIntersectionName() != null && map.getProperties().getIntersectionName().isEmpty()){ + data.setIntersectionName(map.getProperties().getIntersectionName()); + } + + if (map.getProperties().getRefPoint() != null) { + data.setLatitude(map.getProperties().getRefPoint().getLatitude().doubleValue()); + data.setLongitude(map.getProperties().getRefPoint().getLongitude().doubleValue()); + } + result.add(data); + } + + return result; + + } + public List getMapBroadcastRates(int intersectionID, Long startTime, Long endTime) { String startTimeString = Instant.ofEpochMilli(0).toString(); @@ -231,6 +290,8 @@ public List getMapBroadcastRateDistribution(int intersectionID, Long st return results; } + + @Override public void add(ProcessedMap item) { mongoTemplate.save(item, collectionName); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ActiveNotification/ActiveNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ActiveNotification/ActiveNotificationRepository.java index 4f823180..616098bf 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ActiveNotification/ActiveNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ActiveNotification/ActiveNotificationRepository.java @@ -9,6 +9,8 @@ public interface ActiveNotificationRepository extends DataLoader{ Query getQuery(Integer intersectionID, Integer roadRegulatorID, String notificationType, String key); long getQueryResultCount(Query query); + + long getQueryFullCount(Query query); List find(Query query); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ActiveNotification/ActiveNotificationRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ActiveNotification/ActiveNotificationRepositoryImpl.java index 54648a49..407e68be 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ActiveNotification/ActiveNotificationRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ActiveNotification/ActiveNotificationRepositoryImpl.java @@ -51,10 +51,17 @@ public Query getQuery(Integer intersectionID, Integer roadRegulatorID, String no } public long getQueryResultCount(Query query){ - query.limit(-1); return mongoTemplate.count(query, Notification.class, "CmNotification"); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, Notification.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { List dbObjects = mongoTemplate.find(query, Bson.class, collectionName); diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ConnectionOfTravelNotification/ConnectionOfTravelNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ConnectionOfTravelNotification/ConnectionOfTravelNotificationRepository.java index 16754e3e..a88b7d2d 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ConnectionOfTravelNotification/ConnectionOfTravelNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ConnectionOfTravelNotification/ConnectionOfTravelNotificationRepository.java @@ -11,6 +11,8 @@ public interface ConnectionOfTravelNotificationRepository extends DataLoader find(Query query); } \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ConnectionOfTravelNotification/ConnectionOfTravelNotificationRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ConnectionOfTravelNotification/ConnectionOfTravelNotificationRepositoryImpl.java index 89bbe990..dfdb74e3 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ConnectionOfTravelNotification/ConnectionOfTravelNotificationRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/ConnectionOfTravelNotification/ConnectionOfTravelNotificationRepositoryImpl.java @@ -46,10 +46,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query){ - query.limit(-1); return mongoTemplate.count(query, ConnectionOfTravelNotification.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, ConnectionOfTravelNotification.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, ConnectionOfTravelNotification.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/IntersectionReferenceAlignmentNotification/IntersectionReferenceAlignmentNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/IntersectionReferenceAlignmentNotification/IntersectionReferenceAlignmentNotificationRepository.java index 3f2aa124..46872c34 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/IntersectionReferenceAlignmentNotification/IntersectionReferenceAlignmentNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/IntersectionReferenceAlignmentNotification/IntersectionReferenceAlignmentNotificationRepository.java @@ -10,6 +10,8 @@ public interface IntersectionReferenceAlignmentNotificationRepository extends Da Query getQuery(Integer intersectionID, Long startTime, Long endTime, boolean latest); long getQueryResultCount(Query query); + + long getQueryFullCount(Query query); List find(Query query); } \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/IntersectionReferenceAlignmentNotification/IntersectionReferenceAlignmentNotificationRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/IntersectionReferenceAlignmentNotification/IntersectionReferenceAlignmentNotificationRepositoryImpl.java index 215f4dcd..7d40e3e8 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/IntersectionReferenceAlignmentNotification/IntersectionReferenceAlignmentNotificationRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/IntersectionReferenceAlignmentNotification/IntersectionReferenceAlignmentNotificationRepositoryImpl.java @@ -8,6 +8,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.notifications.IntersectionReferenceAlignmentNotification; @Component @@ -45,10 +46,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query){ - query.limit(-1); return mongoTemplate.count(query, IntersectionReferenceAlignmentNotification.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, IntersectionReferenceAlignmentNotification.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, IntersectionReferenceAlignmentNotification.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/LaneDirectionOfTravelNotificationRepo/LaneDirectionOfTravelNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/LaneDirectionOfTravelNotificationRepo/LaneDirectionOfTravelNotificationRepository.java index 2800028d..ab55c99c 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/LaneDirectionOfTravelNotificationRepo/LaneDirectionOfTravelNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/LaneDirectionOfTravelNotificationRepo/LaneDirectionOfTravelNotificationRepository.java @@ -10,6 +10,8 @@ public interface LaneDirectionOfTravelNotificationRepository extends DataLoader< Query getQuery(Integer intersectionID, Long startTime, Long endTime, boolean latest); long getQueryResultCount(Query query); + + long getQueryFullCount(Query query); List find(Query query); } \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/LaneDirectionOfTravelNotificationRepo/LaneDirectionOfTravelNotificationRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/LaneDirectionOfTravelNotificationRepo/LaneDirectionOfTravelNotificationRepositoryImpl.java index ff3ba244..fd55b95d 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/LaneDirectionOfTravelNotificationRepo/LaneDirectionOfTravelNotificationRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/LaneDirectionOfTravelNotificationRepo/LaneDirectionOfTravelNotificationRepositoryImpl.java @@ -8,6 +8,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.notifications.LaneDirectionOfTravelNotification; @Component @@ -47,10 +48,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query){ - query.limit(-1); return mongoTemplate.count(query, LaneDirectionOfTravelNotification.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, LaneDirectionOfTravelNotification.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, LaneDirectionOfTravelNotification.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/MapBroadcastRateNotification/MapBroadcastRateNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/MapBroadcastRateNotification/MapBroadcastRateNotificationRepository.java index 6d733ca0..ea77a350 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/MapBroadcastRateNotification/MapBroadcastRateNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/MapBroadcastRateNotification/MapBroadcastRateNotificationRepository.java @@ -11,6 +11,8 @@ public interface MapBroadcastRateNotificationRepository extends DataLoader find(Query query); } \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/MapBroadcastRateNotification/MapBroadcastRateNotificationRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/MapBroadcastRateNotification/MapBroadcastRateNotificationRepositoryImpl.java index 4781ce6a..57c578fe 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/MapBroadcastRateNotification/MapBroadcastRateNotificationRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/MapBroadcastRateNotification/MapBroadcastRateNotificationRepositoryImpl.java @@ -9,6 +9,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.notifications.broadcast_rate.MapBroadcastRateNotification; @Component @@ -46,10 +47,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query){ - query.limit(-1); return mongoTemplate.count(query, MapBroadcastRateNotification.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, MapBroadcastRateNotification.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, MapBroadcastRateNotification.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalGroupAlignmentNotificationRepo/SignalGroupAlignmentNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalGroupAlignmentNotificationRepo/SignalGroupAlignmentNotificationRepository.java index c00d4d07..6de3cd87 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalGroupAlignmentNotificationRepo/SignalGroupAlignmentNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalGroupAlignmentNotificationRepo/SignalGroupAlignmentNotificationRepository.java @@ -10,6 +10,8 @@ public interface SignalGroupAlignmentNotificationRepository extends DataLoader find(Query query); } \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalGroupAlignmentNotificationRepo/SignalGroupAlignmentNotificationRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalGroupAlignmentNotificationRepo/SignalGroupAlignmentNotificationRepositoryImpl.java index 5e633837..7a50ffd0 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalGroupAlignmentNotificationRepo/SignalGroupAlignmentNotificationRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalGroupAlignmentNotificationRepo/SignalGroupAlignmentNotificationRepositoryImpl.java @@ -46,10 +46,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query) { - query.limit(-1); return mongoTemplate.count(query, SignalGroupAlignmentNotification.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, SignalGroupAlignmentNotification.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, SignalGroupAlignmentNotification.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalStateConflictNotification/SignalStateConflictNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalStateConflictNotification/SignalStateConflictNotificationRepository.java index 9a468453..10df7cc2 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalStateConflictNotification/SignalStateConflictNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalStateConflictNotification/SignalStateConflictNotificationRepository.java @@ -11,6 +11,8 @@ public interface SignalStateConflictNotificationRepository extends DataLoader find(Query query); } \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalStateConflictNotification/SignalStateConflictNotificationRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalStateConflictNotification/SignalStateConflictNotificationRepositoryImpl.java index 9a9b5154..e47e1144 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalStateConflictNotification/SignalStateConflictNotificationRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SignalStateConflictNotification/SignalStateConflictNotificationRepositoryImpl.java @@ -10,6 +10,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.notifications.SignalStateConflictNotification; @@ -49,10 +50,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query){ - query.limit(-1); return mongoTemplate.count(query, SignalStateConflictNotification.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, SignalStateConflictNotification.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, SignalStateConflictNotification.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SpatBroadcastRateNotification/SpatBroadcastRateNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SpatBroadcastRateNotification/SpatBroadcastRateNotificationRepository.java index 16bdcd02..511a373f 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SpatBroadcastRateNotification/SpatBroadcastRateNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SpatBroadcastRateNotification/SpatBroadcastRateNotificationRepository.java @@ -11,6 +11,8 @@ public interface SpatBroadcastRateNotificationRepository extends DataLoader find(Query query); } \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SpatBroadcastRateNotification/SpatBroadcastRateNotificationRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SpatBroadcastRateNotification/SpatBroadcastRateNotificationRepositoryImpl.java index f8ef9496..caaca97b 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SpatBroadcastRateNotification/SpatBroadcastRateNotificationRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/SpatBroadcastRateNotification/SpatBroadcastRateNotificationRepositoryImpl.java @@ -9,6 +9,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.notifications.broadcast_rate.SpatBroadcastRateNotification; @Component @@ -50,6 +51,14 @@ public long getQueryResultCount(Query query) { return mongoTemplate.count(query, SpatBroadcastRateNotification.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, SpatBroadcastRateNotification.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, SpatBroadcastRateNotification.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLinePassageNotification/StopLinePassageNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLinePassageNotification/StopLinePassageNotificationRepository.java index 0a1297e6..0ae36b10 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLinePassageNotification/StopLinePassageNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLinePassageNotification/StopLinePassageNotificationRepository.java @@ -10,6 +10,8 @@ public interface StopLinePassageNotificationRepository extends DataLoader find(Query query); } \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLinePassageNotification/StopLinePassageNotificationRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLinePassageNotification/StopLinePassageNotificationRepositoryImpl.java index 70b4d392..7d1045ef 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLinePassageNotification/StopLinePassageNotificationRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLinePassageNotification/StopLinePassageNotificationRepositoryImpl.java @@ -47,10 +47,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query){ - query.limit(-1); return mongoTemplate.count(query, StopLinePassageNotification.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, StopLinePassageNotification.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, StopLinePassageNotification.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLineStopNotification/StopLineStopNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLineStopNotification/StopLineStopNotificationRepository.java index 73ccf6f8..e282800c 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLineStopNotification/StopLineStopNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLineStopNotification/StopLineStopNotificationRepository.java @@ -10,6 +10,8 @@ public interface StopLineStopNotificationRepository extends DataLoader find(Query query); } \ No newline at end of file diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLineStopNotification/StopLineStopNotificationRepositoryImpl.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLineStopNotification/StopLineStopNotificationRepositoryImpl.java index 1c16fab6..980ee7a0 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLineStopNotification/StopLineStopNotificationRepositoryImpl.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/StopLineStopNotification/StopLineStopNotificationRepositoryImpl.java @@ -8,6 +8,7 @@ import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; + import us.dot.its.jpo.conflictmonitor.monitor.models.notifications.StopLineStopNotification; @Component @@ -47,10 +48,17 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime, bool } public long getQueryResultCount(Query query){ - query.limit(-1); return mongoTemplate.count(query, StopLineStopNotification.class, collectionName); } + public long getQueryFullCount(Query query){ + int limit = query.getLimit(); + query.limit(-1); + long count = mongoTemplate.count(query, StopLineStopNotification.class, collectionName); + query.limit(limit); + return count; + } + public List find(Query query) { return mongoTemplate.find(query, StopLineStopNotification.class, collectionName); } diff --git a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/TimeChangeDetailsNotification/TimeChangeDetailsNotificationRepository.java b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/TimeChangeDetailsNotification/TimeChangeDetailsNotificationRepository.java index a742f7e4..47d6e029 100644 --- a/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/TimeChangeDetailsNotification/TimeChangeDetailsNotificationRepository.java +++ b/api/jpo-conflictvisualizer-api/src/main/java/us/dot/its/jpo/ode/api/accessors/notifications/TimeChangeDetailsNotification/TimeChangeDetailsNotificationRepository.java @@ -10,6 +10,8 @@ public interface TimeChangeDetailsNotificationRepository extends DataLoader