aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/model')
-rw-r--r--src/main/java/org/traccar/model/Event.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/model/Event.java b/src/main/java/org/traccar/model/Event.java
index 47b74811a..a7a134ecf 100644
--- a/src/main/java/org/traccar/model/Event.java
+++ b/src/main/java/org/traccar/model/Event.java
@@ -19,15 +19,17 @@ import java.util.Date;
public class Event extends Message {
- public Event(String type, long deviceId, long positionId) {
- this(type, deviceId);
- setPositionId(positionId);
+ public Event(String type, Position position) {
+ setType(type);
+ setPositionId(position.getId());
+ setDeviceId(position.getDeviceId());
+ eventTime = position.getDeviceTime();
}
public Event(String type, long deviceId) {
setType(type);
setDeviceId(deviceId);
- this.eventTime = new Date();
+ eventTime = new Date();
}
public Event() {