aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-01 16:04:07 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-01 16:04:07 -0700
commit914cc6e85ba8696727edff2d8a600ae695bc410d (patch)
tree1c4841cb097b9b84bc0234e46ca8a20cd6bf8e24 /src/main/java/org/traccar/model
parentcad2b8497c7cbd2cde4e50ec1ce2af1ceb37d02c (diff)
downloadtrackermap-server-914cc6e85ba8696727edff2d8a600ae695bc410d.tar.gz
trackermap-server-914cc6e85ba8696727edff2d8a600ae695bc410d.tar.bz2
trackermap-server-914cc6e85ba8696727edff2d8a600ae695bc410d.zip
Add calendar based filtering
Diffstat (limited to 'src/main/java/org/traccar/model')
-rw-r--r--src/main/java/org/traccar/model/Device.java16
-rw-r--r--src/main/java/org/traccar/model/Geofence.java16
-rw-r--r--src/main/java/org/traccar/model/Notification.java14
-rw-r--r--src/main/java/org/traccar/model/Report.java16
-rw-r--r--src/main/java/org/traccar/model/Schedulable.java (renamed from src/main/java/org/traccar/model/ScheduledModel.java)16
5 files changed, 59 insertions, 19 deletions
diff --git a/src/main/java/org/traccar/model/Device.java b/src/main/java/org/traccar/model/Device.java
index b7cffac49..2c582328e 100644
--- a/src/main/java/org/traccar/model/Device.java
+++ b/src/main/java/org/traccar/model/Device.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2022 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2023 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.
@@ -22,7 +22,19 @@ import org.traccar.storage.StorageName;
import java.util.Date;
@StorageName("tc_devices")
-public class Device extends GroupedModel implements Disableable {
+public class Device extends GroupedModel implements Disableable, Schedulable {
+
+ private long calendarId;
+
+ @Override
+ public long getCalendarId() {
+ return calendarId;
+ }
+
+ @Override
+ public void setCalendarId(long calendarId) {
+ this.calendarId = calendarId;
+ }
private String name;
diff --git a/src/main/java/org/traccar/model/Geofence.java b/src/main/java/org/traccar/model/Geofence.java
index 9259028fb..ca6293651 100644
--- a/src/main/java/org/traccar/model/Geofence.java
+++ b/src/main/java/org/traccar/model/Geofence.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 - 2022 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2023 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.
@@ -26,7 +26,19 @@ import org.traccar.storage.StorageName;
import java.text.ParseException;
@StorageName("tc_geofences")
-public class Geofence extends ScheduledModel {
+public class Geofence extends ExtendedModel implements Schedulable {
+
+ private long calendarId;
+
+ @Override
+ public long getCalendarId() {
+ return calendarId;
+ }
+
+ @Override
+ public void setCalendarId(long calendarId) {
+ this.calendarId = calendarId;
+ }
private String name;
diff --git a/src/main/java/org/traccar/model/Notification.java b/src/main/java/org/traccar/model/Notification.java
index b6a6e4cf5..6dcd9c9de 100644
--- a/src/main/java/org/traccar/model/Notification.java
+++ b/src/main/java/org/traccar/model/Notification.java
@@ -24,7 +24,19 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import org.traccar.storage.StorageName;
@StorageName("tc_notifications")
-public class Notification extends ScheduledModel {
+public class Notification extends ExtendedModel implements Schedulable {
+
+ private long calendarId;
+
+ @Override
+ public long getCalendarId() {
+ return calendarId;
+ }
+
+ @Override
+ public void setCalendarId(long calendarId) {
+ this.calendarId = calendarId;
+ }
private boolean always;
diff --git a/src/main/java/org/traccar/model/Report.java b/src/main/java/org/traccar/model/Report.java
index 1556ecc9e..2ee7ae288 100644
--- a/src/main/java/org/traccar/model/Report.java
+++ b/src/main/java/org/traccar/model/Report.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 Anton Tananaev (anton@traccar.org)
+ * Copyright 2022 - 2023 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.
@@ -18,7 +18,19 @@ package org.traccar.model;
import org.traccar.storage.StorageName;
@StorageName("tc_reports")
-public class Report extends ScheduledModel {
+public class Report extends ExtendedModel implements Schedulable {
+
+ private long calendarId;
+
+ @Override
+ public long getCalendarId() {
+ return calendarId;
+ }
+
+ @Override
+ public void setCalendarId(long calendarId) {
+ this.calendarId = calendarId;
+ }
private String type;
diff --git a/src/main/java/org/traccar/model/ScheduledModel.java b/src/main/java/org/traccar/model/Schedulable.java
index 9e6a4b9a6..331e77583 100644
--- a/src/main/java/org/traccar/model/ScheduledModel.java
+++ b/src/main/java/org/traccar/model/Schedulable.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2018 - 2023 Anton Tananaev (anton@traccar.org)
* Copyright 2018 Andrey Kunitsyn (andrey@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,15 +16,7 @@
*/
package org.traccar.model;
-public class ScheduledModel extends ExtendedModel {
-
- private long calendarId;
-
- public long getCalendarId() {
- return calendarId;
- }
-
- public void setCalendarId(long calendarId) {
- this.calendarId = calendarId;
- }
+public interface Schedulable {
+ long getCalendarId();
+ void setCalendarId(long calendarId);
}