diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2010-04-19 16:03:31 +0000 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2010-04-19 16:03:31 +0000 |
commit | 69c75bec0b0423e038452bf126c39baa7196adfd (patch) | |
tree | be568862a1995f39321a429a5bf041457b743981 /src/net/sourceforge/opentracking/TrackerEventHandler.java | |
parent | 79cb531f8511d0a4f34327b0df4f858bd7cf68f3 (diff) | |
download | trackermap-server-69c75bec0b0423e038452bf126c39baa7196adfd.tar.gz trackermap-server-69c75bec0b0423e038452bf126c39baa7196adfd.tar.bz2 trackermap-server-69c75bec0b0423e038452bf126c39baa7196adfd.zip |
Diffstat (limited to 'src/net/sourceforge/opentracking/TrackerEventHandler.java')
-rw-r--r-- | src/net/sourceforge/opentracking/TrackerEventHandler.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/net/sourceforge/opentracking/TrackerEventHandler.java b/src/net/sourceforge/opentracking/TrackerEventHandler.java index b47f3be5a..d052cb86e 100644 --- a/src/net/sourceforge/opentracking/TrackerEventHandler.java +++ b/src/net/sourceforge/opentracking/TrackerEventHandler.java @@ -40,21 +40,23 @@ public class TrackerEventHandler extends SimpleChannelHandler { @Override public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) { - //System.out.println("message recieved"); - if (e.getMessage() instanceof Position) { + + Position position = (Position) e.getMessage(); + + System.out.println("id: " + position.getDeviceId() + ", lat: " + position.getLatitude() + ", lon: " + position.getLongitude() ); // Write position to database try { - dataManager.setPosition((Position) e.getMessage()); + dataManager.setPosition(position); } catch (Exception error) { + System.out.println(error.getMessage()); } } } @Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) { - //System.out.println("error: " + e.getCause().getMessage()); e.getChannel().close(); } |