diff options
author | Anton Tananaev <anton@traccar.org> | 2022-06-18 13:26:15 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-06-18 13:26:15 -0700 |
commit | 6fe1f8ed83680204fe7ec50382588dbe82fec1ba (patch) | |
tree | aa665fc9e514ede6200becd6617ba2c99715b6a3 /src/main/java/org/traccar/handler | |
parent | c79c71a734da5cb4c84dd660744e58675b1d6fb7 (diff) | |
download | trackermap-server-6fe1f8ed83680204fe7ec50382588dbe82fec1ba.tar.gz trackermap-server-6fe1f8ed83680204fe7ec50382588dbe82fec1ba.tar.bz2 trackermap-server-6fe1f8ed83680204fe7ec50382588dbe82fec1ba.zip |
Remove data manager
Diffstat (limited to 'src/main/java/org/traccar/handler')
-rw-r--r-- | src/main/java/org/traccar/handler/DefaultDataHandler.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/handler/DefaultDataHandler.java b/src/main/java/org/traccar/handler/DefaultDataHandler.java index c2adfd799..f6a20628b 100644 --- a/src/main/java/org/traccar/handler/DefaultDataHandler.java +++ b/src/main/java/org/traccar/handler/DefaultDataHandler.java @@ -19,8 +19,10 @@ import io.netty.channel.ChannelHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.traccar.BaseDataHandler; -import org.traccar.database.DataManager; import org.traccar.model.Position; +import org.traccar.storage.Storage; +import org.traccar.storage.query.Columns; +import org.traccar.storage.query.Request; import javax.inject.Inject; @@ -29,18 +31,18 @@ public class DefaultDataHandler extends BaseDataHandler { private static final Logger LOGGER = LoggerFactory.getLogger(DefaultDataHandler.class); - private final DataManager dataManager; + private final Storage storage; @Inject - public DefaultDataHandler(DataManager dataManager) { - this.dataManager = dataManager; + public DefaultDataHandler(Storage storage) { + this.storage = storage; } @Override protected Position handlePosition(Position position) { try { - dataManager.addObject(position); + position.setId(storage.addObject(position, new Request(new Columns.Exclude("id")))); } catch (Exception error) { LOGGER.warn("Failed to store position", error); } |