aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/broadcast/MulticastBroadcastService.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-09-29 17:57:22 -0700
committerAnton Tananaev <anton@traccar.org>2022-09-29 17:57:22 -0700
commit0a853f2aa3556554acd0b43a5008c43c345fa300 (patch)
treeafbcf9d7924ba44e9bd0b33654f1e1fee0ff1104 /src/main/java/org/traccar/broadcast/MulticastBroadcastService.java
parente7bd758824386e4f77f78ceca57675ef7934435a (diff)
downloadtrackermap-server-0a853f2aa3556554acd0b43a5008c43c345fa300.tar.gz
trackermap-server-0a853f2aa3556554acd0b43a5008c43c345fa300.tar.bz2
trackermap-server-0a853f2aa3556554acd0b43a5008c43c345fa300.zip
Synchronize queued commands
Diffstat (limited to 'src/main/java/org/traccar/broadcast/MulticastBroadcastService.java')
-rw-r--r--src/main/java/org/traccar/broadcast/MulticastBroadcastService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/broadcast/MulticastBroadcastService.java b/src/main/java/org/traccar/broadcast/MulticastBroadcastService.java
index be65b7826..b1b66f1e3 100644
--- a/src/main/java/org/traccar/broadcast/MulticastBroadcastService.java
+++ b/src/main/java/org/traccar/broadcast/MulticastBroadcastService.java
@@ -103,6 +103,13 @@ public class MulticastBroadcastService implements BroadcastService {
}
@Override
+ public void updateCommand(boolean local, long deviceId) {
+ BroadcastMessage message = new BroadcastMessage();
+ message.setCommandDeviceId(deviceId);
+ sendMessage(message);
+ }
+
+ @Override
public void invalidateObject(boolean local, Class<? extends BaseModel> clazz, long id) {
BroadcastMessage message = new BroadcastMessage();
message.setChanges(Map.of(Permission.getKey(clazz), id));
@@ -136,6 +143,8 @@ public class MulticastBroadcastService implements BroadcastService {
listeners.forEach(listener -> listener.updatePosition(false, message.getPosition()));
} else if (message.getUserId() != null && message.getEvent() != null) {
listeners.forEach(listener -> listener.updateEvent(false, message.getUserId(), message.getEvent()));
+ } else if (message.getCommandDeviceId() != null) {
+ listeners.forEach(listener -> listener.updateCommand(false, message.getCommandDeviceId()));
} else if (message.getChanges() != null) {
var iterator = message.getChanges().entrySet().iterator();
if (iterator.hasNext()) {