diff options
author | Anton Tananaev <anton@traccar.org> | 2022-06-16 18:48:08 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-06-16 18:48:08 -0700 |
commit | 15c4b6b21a31c63bc0f7e624e26d032d531c459d (patch) | |
tree | 524ca1dd9aca6ef0ea8db2910a16a3e227e8c1fb /src/main/java/org/traccar/session/cache | |
parent | ee9abd94265eb704b5f5dd2262f1a3460bbe2a8f (diff) | |
download | trackermap-server-15c4b6b21a31c63bc0f7e624e26d032d531c459d.tar.gz trackermap-server-15c4b6b21a31c63bc0f7e624e26d032d531c459d.tar.bz2 trackermap-server-15c4b6b21a31c63bc0f7e624e26d032d531c459d.zip |
Refactor geofence classes
Diffstat (limited to 'src/main/java/org/traccar/session/cache')
-rw-r--r-- | src/main/java/org/traccar/session/cache/CacheManager.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/session/cache/CacheManager.java b/src/main/java/org/traccar/session/cache/CacheManager.java index 18daeae15..14034f3d6 100644 --- a/src/main/java/org/traccar/session/cache/CacheManager.java +++ b/src/main/java/org/traccar/session/cache/CacheManager.java @@ -15,6 +15,7 @@ */ package org.traccar.session.cache; +import org.traccar.config.Config; import org.traccar.helper.model.GeofenceUtil; import org.traccar.model.Attribute; import org.traccar.model.BaseModel; @@ -53,6 +54,7 @@ public class CacheManager { private static final Collection<Class<? extends BaseModel>> CLASSES = Arrays.asList( Attribute.class, Driver.class, Geofence.class, Maintenance.class, Notification.class); + private final Config config; private final Storage storage; private final ReadWriteLock lock = new ReentrantReadWriteLock(); @@ -65,7 +67,8 @@ public class CacheManager { private final Map<Long, List<User>> notificationUsers = new HashMap<>(); @Inject - public CacheManager(Storage storage) throws StorageException { + public CacheManager(Config config, Storage storage) throws StorageException { + this.config = config; this.storage = storage; invalidateServer(); invalidateUsers(); @@ -315,7 +318,7 @@ public class CacheManager { private void invalidateDeviceGeofences(Device device) { Position position = getPosition(device.getId()); if (position != null) { - device.setGeofenceIds(GeofenceUtil.getCurrentGeofences(this, position)); + device.setGeofenceIds(GeofenceUtil.getCurrentGeofences(config, this, position)); } } |