aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/WebDataHandler.java
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/WebDataHandler.java
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/WebDataHandler.java')
-rw-r--r--src/main/java/org/traccar/WebDataHandler.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/WebDataHandler.java b/src/main/java/org/traccar/WebDataHandler.java
index db99ecaf8..192a15bcf 100644
--- a/src/main/java/org/traccar/WebDataHandler.java
+++ b/src/main/java/org/traccar/WebDataHandler.java
@@ -26,7 +26,6 @@ import org.slf4j.LoggerFactory;
import org.traccar.config.Config;
import org.traccar.config.Keys;
-import org.traccar.database.IdentityManager;
import org.traccar.helper.Checksum;
import org.traccar.model.Device;
import org.traccar.model.Position;
@@ -62,7 +61,6 @@ public class WebDataHandler extends BaseDataHandler {
private static final String KEY_DEVICE = "device";
private final CacheManager cacheManager;
- private final IdentityManager identityManager;
private final ObjectMapper objectMapper;
private final Client client;
@@ -80,11 +78,9 @@ public class WebDataHandler extends BaseDataHandler {
@Inject
public WebDataHandler(
- Config config, CacheManager cacheManager, IdentityManager identityManager,
- ObjectMapper objectMapper, Client client) {
+ Config config, CacheManager cacheManager, ObjectMapper objectMapper, Client client) {
this.cacheManager = cacheManager;
- this.identityManager = identityManager;
this.objectMapper = objectMapper;
this.client = client;
this.url = config.getString(Keys.FORWARD_URL);
@@ -138,7 +134,7 @@ public class WebDataHandler extends BaseDataHandler {
public String formatRequest(Position position) throws UnsupportedEncodingException, JsonProcessingException {
- Device device = identityManager.getById(position.getDeviceId());
+ Device device = cacheManager.getObject(Device.class, position.getDeviceId());
String request = url
.replace("{name}", URLEncoder.encode(device.getName(), StandardCharsets.UTF_8.name()))
@@ -302,7 +298,7 @@ public class WebDataHandler extends BaseDataHandler {
private Map<String, Object> prepareJsonPayload(Position position) {
Map<String, Object> data = new HashMap<>();
- Device device = identityManager.getById(position.getDeviceId());
+ Device device = cacheManager.getObject(Device.class, position.getDeviceId());
data.put(KEY_POSITION, position);