aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model/Position.java
diff options
context:
space:
mode:
authorChristoph Krey <c@ckrey.de>2018-04-16 10:45:11 +0200
committerGitHub <noreply@github.com>2018-04-16 10:45:11 +0200
commit3a602dd133b533cc69d5986d64a00fb3ed670f75 (patch)
tree97ff753db310a49ae7e53240b1db07fb8475679e /src/org/traccar/model/Position.java
parent232de5f0daef98f31b28d177d991fdbfa191f195 (diff)
parent6d4b8df25c7e942b9ad594db9444fe15bcb16be9 (diff)
downloadtrackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.tar.gz
trackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.tar.bz2
trackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.zip
Merge pull request #4 from traccar/master
upgrade to current master
Diffstat (limited to 'src/org/traccar/model/Position.java')
-rw-r--r--src/org/traccar/model/Position.java46
1 files changed, 16 insertions, 30 deletions
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java
index 4f78867c2..fca0f16e3 100644
--- a/src/org/traccar/model/Position.java
+++ b/src/org/traccar/model/Position.java
@@ -58,6 +58,7 @@ public class Position extends Message {
public static final String KEY_TYPE = "type";
public static final String KEY_IGNITION = "ignition";
public static final String KEY_FLAGS = "flags";
+ public static final String KEY_ANTENNA = "antenna";
public static final String KEY_CHARGE = "charge";
public static final String KEY_IP = "ip";
public static final String KEY_ARCHIVE = "archive";
@@ -115,6 +116,7 @@ public class Position extends Message {
public static final String ALARM_GPS_ANTENNA_CUT = "gpsAntennaCut";
public static final String ALARM_ACCIDENT = "accident";
public static final String ALARM_TOW = "tow";
+ public static final String ALARM_IDLE = "idle";
public static final String ALARM_ACCELERATION = "hardAcceleration";
public static final String ALARM_BRAKING = "hardBraking";
public static final String ALARM_CORNERING = "hardCornering";
@@ -131,6 +133,14 @@ public class Position extends Message {
public static final String ALARM_TAMPERING = "tampering";
public static final String ALARM_REMOVING = "removing";
+ public Position() {
+ }
+
+ public Position(String protocol) {
+ this.protocol = protocol;
+ this.serverTime = new Date();
+ }
+
private String protocol;
public String getProtocol() {
@@ -144,55 +154,31 @@ public class Position extends Message {
private Date serverTime;
public Date getServerTime() {
- if (serverTime != null) {
- return new Date(serverTime.getTime());
- } else {
- return null;
- }
+ return serverTime;
}
public void setServerTime(Date serverTime) {
- if (serverTime != null) {
- this.serverTime = new Date(serverTime.getTime());
- } else {
- this.serverTime = null;
- }
+ this.serverTime = serverTime;
}
private Date deviceTime;
public Date getDeviceTime() {
- if (deviceTime != null) {
- return new Date(deviceTime.getTime());
- } else {
- return null;
- }
+ return deviceTime;
}
public void setDeviceTime(Date deviceTime) {
- if (deviceTime != null) {
- this.deviceTime = new Date(deviceTime.getTime());
- } else {
- this.deviceTime = null;
- }
+ this.deviceTime = deviceTime;
}
private Date fixTime;
public Date getFixTime() {
- if (fixTime != null) {
- return new Date(fixTime.getTime());
- } else {
- return null;
- }
+ return fixTime;
}
public void setFixTime(Date fixTime) {
- if (fixTime != null) {
- this.fixTime = new Date(fixTime.getTime());
- } else {
- this.fixTime = null;
- }
+ this.fixTime = fixTime;
}
public void setTime(Date time) {