aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-16 18:48:08 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-16 18:48:08 -0700
commit15c4b6b21a31c63bc0f7e624e26d032d531c459d (patch)
tree524ca1dd9aca6ef0ea8db2910a16a3e227e8c1fb /src/main/java/org/traccar/handler
parentee9abd94265eb704b5f5dd2262f1a3460bbe2a8f (diff)
downloadtrackermap-server-15c4b6b21a31c63bc0f7e624e26d032d531c459d.tar.gz
trackermap-server-15c4b6b21a31c63bc0f7e624e26d032d531c459d.tar.bz2
trackermap-server-15c4b6b21a31c63bc0f7e624e26d032d531c459d.zip
Refactor geofence classes
Diffstat (limited to 'src/main/java/org/traccar/handler')
-rw-r--r--src/main/java/org/traccar/handler/events/GeofenceEventHandler.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java b/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java
index 724f8f0d0..0a924cfc3 100644
--- a/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java
+++ b/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java
@@ -16,6 +16,7 @@
package org.traccar.handler.events;
import io.netty.channel.ChannelHandler;
+import org.traccar.config.Config;
import org.traccar.helper.model.GeofenceUtil;
import org.traccar.helper.model.PositionUtil;
import org.traccar.model.Calendar;
@@ -35,11 +36,13 @@ import java.util.Map;
@ChannelHandler.Sharable
public class GeofenceEventHandler extends BaseEventHandler {
+ private final Config config;
private final CacheManager cacheManager;
private final ConnectionManager connectionManager;
@Inject
- public GeofenceEventHandler(CacheManager cacheManager, ConnectionManager connectionManager) {
+ public GeofenceEventHandler(Config config, CacheManager cacheManager, ConnectionManager connectionManager) {
+ this.config = config;
this.cacheManager = cacheManager;
this.connectionManager = connectionManager;
}
@@ -54,7 +57,7 @@ public class GeofenceEventHandler extends BaseEventHandler {
return null;
}
- List<Long> currentGeofences = GeofenceUtil.getCurrentGeofences(cacheManager, position);
+ List<Long> currentGeofences = GeofenceUtil.getCurrentGeofences(config, cacheManager, position);
List<Long> oldGeofences = new ArrayList<>();
if (device.getGeofenceIds() != null) {
oldGeofences.addAll(device.getGeofenceIds());