aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/OsmAndProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-08 15:05:44 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-08 15:05:44 +1300
commit9feb2168fda27b89b20f5c1cac68547107a8589d (patch)
tree2ec633a74b38b725187a643ef2847c6f7c8c4714 /src/org/traccar/protocol/OsmAndProtocolDecoder.java
parent38134454c55b4a36f7c82686e3a29a9610050e6e (diff)
downloadtrackermap-server-9feb2168fda27b89b20f5c1cac68547107a8589d.tar.gz
trackermap-server-9feb2168fda27b89b20f5c1cac68547107a8589d.tar.bz2
trackermap-server-9feb2168fda27b89b20f5c1cac68547107a8589d.zip
Clean up Java code formatting
Diffstat (limited to 'src/org/traccar/protocol/OsmAndProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/OsmAndProtocolDecoder.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
index f128c6414..529a2940e 100644
--- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java
+++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2013 - 2015 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,8 +42,7 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder {
@Override
protected Object decode(
- Channel channel, SocketAddress remoteAddress, Object msg)
- throws Exception {
+ Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
HttpRequest request = (HttpRequest) msg;
QueryStringDecoder decoder = new QueryStringDecoder(request.getUri());
@@ -54,11 +53,9 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder {
params = decoder.getParameters();
}
- // Create new position
Position position = new Position();
position.setProtocol(getProtocolName());
- // Identification
String id;
if (params.containsKey("id")) {
id = params.get("id").get(0);
@@ -70,7 +67,6 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder {
}
position.setDeviceId(getDeviceId());
- // Decode position
position.setValid(true);
if (params.containsKey("timestamp")) {
try {
@@ -89,7 +85,6 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder {
position.setLatitude(Double.parseDouble(params.get("lat").get(0)));
position.setLongitude(Double.parseDouble(params.get("lon").get(0)));
- // Optional parameters
if (params.containsKey("speed")) {
position.setSpeed(Double.parseDouble(params.get("speed").get(0)));
}
@@ -124,7 +119,6 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder {
position.set("description", params.get("desc").get(0));
}
- // Send response
if (channel != null) {
HttpResponse response = new DefaultHttpResponse(
HttpVersion.HTTP_1_1, HttpResponseStatus.OK);