aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/WebDataHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-16 07:09:00 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-16 07:09:00 -0700
commitd3e83f9fa0d066e5a15fde225599cc43071c031a (patch)
tree0ed36805063b795fb5f2e30ad785a9222ef00990 /src/main/java/org/traccar/WebDataHandler.java
parentd3fd20d4a4f7dc647e75c5a0cb962759630ed967 (diff)
downloadtrackermap-server-d3e83f9fa0d066e5a15fde225599cc43071c031a.tar.gz
trackermap-server-d3e83f9fa0d066e5a15fde225599cc43071c031a.tar.bz2
trackermap-server-d3e83f9fa0d066e5a15fde225599cc43071c031a.zip
Remove groups manager
Diffstat (limited to 'src/main/java/org/traccar/WebDataHandler.java')
-rw-r--r--src/main/java/org/traccar/WebDataHandler.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/WebDataHandler.java b/src/main/java/org/traccar/WebDataHandler.java
index 2c0aa0f8e..db99ecaf8 100644
--- a/src/main/java/org/traccar/WebDataHandler.java
+++ b/src/main/java/org/traccar/WebDataHandler.java
@@ -31,6 +31,7 @@ import org.traccar.helper.Checksum;
import org.traccar.model.Device;
import org.traccar.model.Position;
import org.traccar.model.Group;
+import org.traccar.session.cache.CacheManager;
import javax.inject.Inject;
import javax.ws.rs.core.HttpHeaders;
@@ -60,6 +61,7 @@ public class WebDataHandler extends BaseDataHandler {
private static final String KEY_POSITION = "position";
private static final String KEY_DEVICE = "device";
+ private final CacheManager cacheManager;
private final IdentityManager identityManager;
private final ObjectMapper objectMapper;
private final Client client;
@@ -78,8 +80,10 @@ public class WebDataHandler extends BaseDataHandler {
@Inject
public WebDataHandler(
- Config config, IdentityManager identityManager, ObjectMapper objectMapper, Client client) {
+ Config config, CacheManager cacheManager, IdentityManager identityManager,
+ ObjectMapper objectMapper, Client client) {
+ this.cacheManager = cacheManager;
this.identityManager = identityManager;
this.objectMapper = objectMapper;
this.client = client;
@@ -171,7 +175,7 @@ public class WebDataHandler extends BaseDataHandler {
if (request.contains("{group}")) {
String deviceGroupName = "";
if (device.getGroupId() != 0) {
- Group group = Context.getGroupsManager().getById(device.getGroupId());
+ Group group = cacheManager.getObject(Group.class, device.getGroupId());
if (group != null) {
deviceGroupName = group.getName();
}