aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/OwnTracksProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/OwnTracksProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/OwnTracksProtocolDecoder.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/OwnTracksProtocolDecoder.java b/src/org/traccar/protocol/OwnTracksProtocolDecoder.java
index 120995dfb..00a63d712 100644
--- a/src/org/traccar/protocol/OwnTracksProtocolDecoder.java
+++ b/src/org/traccar/protocol/OwnTracksProtocolDecoder.java
@@ -1,6 +1,6 @@
/*
* Copyright 2017 Jan-Piet Mens (jpmens@gmail.com)
- * Copyright 2017 Anton Tananaev (anton@traccar.org)
+ * Copyright 2017 - 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.
@@ -16,9 +16,9 @@
*/
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 io.netty.channel.Channel;
+import io.netty.handler.codec.http.FullHttpRequest;
+import io.netty.handler.codec.http.HttpResponseStatus;
import org.traccar.BaseHttpProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.UnitsConverter;
@@ -41,9 +41,9 @@ public class OwnTracksProtocolDecoder extends BaseHttpProtocolDecoder {
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
- HttpRequest request = (HttpRequest) msg;
+ FullHttpRequest request = (FullHttpRequest) msg;
JsonObject root = Json.createReader(
- new StringReader(request.getContent().toString(StandardCharsets.US_ASCII))).readObject();
+ new StringReader(request.content().toString(StandardCharsets.US_ASCII))).readObject();
if (!root.containsKey("_type") || !root.getString("_type").equals("location")) {
sendResponse(channel, HttpResponseStatus.OK);
@@ -98,4 +98,5 @@ public class OwnTracksProtocolDecoder extends BaseHttpProtocolDecoder {
sendResponse(channel, HttpResponseStatus.OK);
return position;
}
+
}