aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorRafael E. Ajuria <reajuria@users.noreply.github.com>2023-06-09 01:15:52 +0000
committerRafael E. Ajuria <reajuria@users.noreply.github.com>2023-06-09 01:15:52 +0000
commita39af3b4d72f3ed8a6dfe868d365d6bbf34e18d3 (patch)
tree521c6e41e75fc3bf6ad29a6a4ee222ee3a4300ba /src/main/java/org/traccar/MainModule.java
parent3397d4f07ef7fae909c0d6258dbc1263c4acc68b (diff)
downloadtrackermap-server-a39af3b4d72f3ed8a6dfe868d365d6bbf34e18d3.tar.gz
trackermap-server-a39af3b4d72f3ed8a6dfe868d365d6bbf34e18d3.tar.bz2
trackermap-server-a39af3b4d72f3ed8a6dfe868d365d6bbf34e18d3.zip
cleanup
Breaking change: if using multicast must set broadcast.type="multicast"
Diffstat (limited to 'src/main/java/org/traccar/MainModule.java')
-rw-r--r--src/main/java/org/traccar/MainModule.java18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/main/java/org/traccar/MainModule.java b/src/main/java/org/traccar/MainModule.java
index 29d846154..950a7278a 100644
--- a/src/main/java/org/traccar/MainModule.java
+++ b/src/main/java/org/traccar/MainModule.java
@@ -341,18 +341,14 @@ public class MainModule extends AbstractModule {
@Provides
public static BroadcastService provideBroadcastService(
Config config, ObjectMapper objectMapper) throws IOException {
- String broadcastType = config.getString(Keys.BROADCAST_TYPE);
- if (config.hasKey(Keys.BROADCAST_ADDRESS)) {
- switch (broadcastType) {
- case "multicast":
- return new MulticastBroadcastService(config, objectMapper);
- case "redis":
- return new RedisBroadcastService(config, objectMapper);
- default:
- break;
- }
+ switch (config.getString(Keys.BROADCAST_TYPE)) {
+ case "multicast":
+ return new MulticastBroadcastService(config, objectMapper);
+ case "redis":
+ return new RedisBroadcastService(config, objectMapper);
+ default:
+ return new NullBroadcastService();
}
- return new NullBroadcastService();
}
@Singleton