aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ExtendedObjectDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-09 10:47:43 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-09 10:47:43 +1300
commit9ec7166889b9b0492a18a338e6dc5352743209b8 (patch)
tree455782947763d7d6e4828276b8b7843222356ef3 /src/org/traccar/ExtendedObjectDecoder.java
parentf727af19cb994517ca3685239e506ff6beeaaa76 (diff)
downloadtrackermap-server-9ec7166889b9b0492a18a338e6dc5352743209b8.tar.gz
trackermap-server-9ec7166889b9b0492a18a338e6dc5352743209b8.tar.bz2
trackermap-server-9ec7166889b9b0492a18a338e6dc5352743209b8.zip
Add initial code for device status
Diffstat (limited to 'src/org/traccar/ExtendedObjectDecoder.java')
-rw-r--r--src/org/traccar/ExtendedObjectDecoder.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/org/traccar/ExtendedObjectDecoder.java b/src/org/traccar/ExtendedObjectDecoder.java
index 382ef869d..ca4561a3f 100644
--- a/src/org/traccar/ExtendedObjectDecoder.java
+++ b/src/org/traccar/ExtendedObjectDecoder.java
@@ -37,6 +37,7 @@ public abstract class ExtendedObjectDecoder implements ChannelUpstreamHandler {
MessageEvent e = (MessageEvent) evt;
Object originalMessage = e.getMessage();
Object decodedMessage = decode(e.getChannel(), e.getRemoteAddress(), originalMessage);
+ onMessageEvent(e.getChannel(), e.getRemoteAddress(), originalMessage); // call after decode
if (originalMessage == decodedMessage) {
ctx.sendUpstream(evt);
} else if (decodedMessage != null) {
@@ -50,6 +51,9 @@ public abstract class ExtendedObjectDecoder implements ChannelUpstreamHandler {
}
}
+ protected void onMessageEvent(Channel channel, SocketAddress remoteAddress, Object msg) {
+ }
+
protected abstract Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception;
}