aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/OsmAndProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-05 21:58:26 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-05 21:58:26 +1200
commit1d04cfbd052946ac8eb00cd4c8045a31d4d75da3 (patch)
tree84b0705737639860c6655dd3f479d2d913a5f7a8 /src/org/traccar/protocol/OsmAndProtocolDecoder.java
parent6a3d70c2e591edbb34af15dcaa45a9a7114c1dd3 (diff)
downloadtrackermap-server-1d04cfbd052946ac8eb00cd4c8045a31d4d75da3.tar.gz
trackermap-server-1d04cfbd052946ac8eb00cd4c8045a31d4d75da3.tar.bz2
trackermap-server-1d04cfbd052946ac8eb00cd4c8045a31d4d75da3.zip
Update OsmAnd protocol
Diffstat (limited to 'src/org/traccar/protocol/OsmAndProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/OsmAndProtocolDecoder.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
index 03abdd588..c75e9519c 100644
--- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java
+++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 - 2017 Anton Tananaev (anton@traccar.org)
+ * Copyright 2013 - 2018 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,10 +15,10 @@
*/
package org.traccar.protocol;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.handler.codec.http.HttpRequest;
-import org.jboss.netty.handler.codec.http.HttpResponseStatus;
-import org.jboss.netty.handler.codec.http.QueryStringDecoder;
+import io.netty.channel.Channel;
+import io.netty.handler.codec.http.FullHttpRequest;
+import io.netty.handler.codec.http.HttpResponseStatus;
+import io.netty.handler.codec.http.QueryStringDecoder;
import org.joda.time.format.ISODateTimeFormat;
import org.traccar.BaseHttpProtocolDecoder;
import org.traccar.DeviceSession;
@@ -42,15 +42,14 @@ public class OsmAndProtocolDecoder extends BaseHttpProtocolDecoder {
}
@Override
- protected Object decode(
- Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
+ protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
- HttpRequest request = (HttpRequest) msg;
- QueryStringDecoder decoder = new QueryStringDecoder(request.getUri());
- Map<String, List<String>> params = decoder.getParameters();
+ FullHttpRequest request = (FullHttpRequest) msg;
+ QueryStringDecoder decoder = new QueryStringDecoder(request.uri());
+ Map<String, List<String>> params = decoder.parameters();
if (params.isEmpty()) {
- decoder = new QueryStringDecoder(request.getContent().toString(StandardCharsets.US_ASCII), false);
- params = decoder.getParameters();
+ decoder = new QueryStringDecoder(request.content().toString(StandardCharsets.US_ASCII), false);
+ params = decoder.parameters();
}
Position position = new Position(getProtocolName());