aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ExtendedObjectDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/ExtendedObjectDecoder.java')
-rw-r--r--src/org/traccar/ExtendedObjectDecoder.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/ExtendedObjectDecoder.java b/src/org/traccar/ExtendedObjectDecoder.java
index 268e6f688..a9b3a1053 100644
--- a/src/org/traccar/ExtendedObjectDecoder.java
+++ b/src/org/traccar/ExtendedObjectDecoder.java
@@ -29,6 +29,9 @@ import javax.xml.bind.DatatypeConverter;
import java.net.SocketAddress;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
public abstract class ExtendedObjectDecoder implements ChannelUpstreamHandler {
@@ -69,6 +72,16 @@ public abstract class ExtendedObjectDecoder implements ChannelUpstreamHandler {
saveOriginal(o, originalMessage);
Channels.fireMessageReceived(ctx, o, e.getRemoteAddress());
}
+ } else if (decodedMessage instanceof Map) {
+ Iterator it = ((Map) decodedMessage).entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry pair = (Map.Entry) it.next();
+ List<Position> positions = (List<Position>) pair.getValue();
+ for (Position position : positions) {
+ saveOriginal(position, originalMessage);
+ Channels.fireMessageReceived(ctx, position, e.getRemoteAddress());
+ }
+ }
} else {
saveOriginal(decodedMessage, originalMessage);
Channels.fireMessageReceived(ctx, decodedMessage, e.getRemoteAddress());