aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainEventHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-25 13:33:35 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-25 13:33:35 -0700
commitc53d98c668af9c79767e22964f05c7bf7dc866f2 (patch)
tree42d664009487232e3a21514bb5ab52c7571262a6 /src/main/java/org/traccar/MainEventHandler.java
parent5a732a26c85785a9b801583f2fff0ce47314aa03 (diff)
downloadtrackermap-server-c53d98c668af9c79767e22964f05c7bf7dc866f2.tar.gz
trackermap-server-c53d98c668af9c79767e22964f05c7bf7dc866f2.tar.bz2
trackermap-server-c53d98c668af9c79767e22964f05c7bf7dc866f2.zip
Integrate broadcast service
Diffstat (limited to 'src/main/java/org/traccar/MainEventHandler.java')
-rw-r--r--src/main/java/org/traccar/MainEventHandler.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/MainEventHandler.java b/src/main/java/org/traccar/MainEventHandler.java
index 06791c540..0a8c69b54 100644
--- a/src/main/java/org/traccar/MainEventHandler.java
+++ b/src/main/java/org/traccar/MainEventHandler.java
@@ -23,6 +23,7 @@ import io.netty.handler.codec.http.HttpRequestDecoder;
import io.netty.handler.timeout.IdleStateEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.traccar.broadcast.BroadcastService;
import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.database.StatisticsManager;
@@ -56,15 +57,17 @@ public class MainEventHandler extends ChannelInboundHandlerAdapter {
private final Storage storage;
private final ConnectionManager connectionManager;
private final StatisticsManager statisticsManager;
+ private final BroadcastService broadcastService;
@Inject
public MainEventHandler(
- Config config, CacheManager cacheManager, Storage storage,
- ConnectionManager connectionManager, StatisticsManager statisticsManager) {
+ Config config, CacheManager cacheManager, Storage storage, ConnectionManager connectionManager,
+ StatisticsManager statisticsManager, BroadcastService broadcastService) {
this.cacheManager = cacheManager;
this.storage = storage;
this.connectionManager = connectionManager;
this.statisticsManager = statisticsManager;
+ this.broadcastService = broadcastService;
String connectionlessProtocolList = config.getString(Keys.STATUS_IGNORE_OFFLINE);
if (connectionlessProtocolList != null) {
connectionlessProtocols.addAll(Arrays.asList(connectionlessProtocolList.split("[, ]")));
@@ -90,6 +93,7 @@ public class MainEventHandler extends ChannelInboundHandlerAdapter {
cacheManager.updatePosition(position);
connectionManager.updatePosition(position);
+ broadcastService.updatePosition(position);
}
} catch (StorageException error) {
LOGGER.warn("Failed to update device", error);