aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-18 11:44:40 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-18 11:44:40 -0700
commit03b50c61afd7c9d7e19a76feb261147dd0f69588 (patch)
tree575f1737e3006c66844c1fa9e06a3323bac7746c /src/main/java/org/traccar/handler
parentddbe4d7de6ae7590e2b927066312597efa129393 (diff)
downloadtrackermap-server-03b50c61afd7c9d7e19a76feb261147dd0f69588.tar.gz
trackermap-server-03b50c61afd7c9d7e19a76feb261147dd0f69588.tar.bz2
trackermap-server-03b50c61afd7c9d7e19a76feb261147dd0f69588.zip
Remove identity manager
Diffstat (limited to 'src/main/java/org/traccar/handler')
-rw-r--r--src/main/java/org/traccar/handler/ComputedAttributesHandler.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/handler/ComputedAttributesHandler.java b/src/main/java/org/traccar/handler/ComputedAttributesHandler.java
index bec3d38e0..82ac4e804 100644
--- a/src/main/java/org/traccar/handler/ComputedAttributesHandler.java
+++ b/src/main/java/org/traccar/handler/ComputedAttributesHandler.java
@@ -34,7 +34,6 @@ import org.slf4j.LoggerFactory;
import org.traccar.BaseDataHandler;
import org.traccar.config.Config;
import org.traccar.config.Keys;
-import org.traccar.database.IdentityManager;
import org.traccar.model.Attribute;
import org.traccar.model.Device;
import org.traccar.model.Position;
@@ -47,7 +46,6 @@ public class ComputedAttributesHandler extends BaseDataHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(ComputedAttributesHandler.class);
- private final IdentityManager identityManager;
private final CacheManager cacheManager;
private final JexlEngine engine;
@@ -55,9 +53,7 @@ public class ComputedAttributesHandler extends BaseDataHandler {
private final boolean includeDeviceAttributes;
@Inject
- public ComputedAttributesHandler(
- Config config, IdentityManager identityManager, CacheManager cacheManager) {
- this.identityManager = identityManager;
+ public ComputedAttributesHandler(Config config, CacheManager cacheManager) {
this.cacheManager = cacheManager;
engine = new JexlEngine();
engine.setStrict(true);
@@ -68,7 +64,7 @@ public class ComputedAttributesHandler extends BaseDataHandler {
private MapContext prepareContext(Position position) {
MapContext result = new MapContext();
if (includeDeviceAttributes) {
- Device device = identityManager.getById(position.getDeviceId());
+ Device device = cacheManager.getObject(Device.class, position.getDeviceId());
if (device != null) {
for (Object key : device.getAttributes().keySet()) {
result.set((String) key, device.getAttributes().get(key));