aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/config
diff options
context:
space:
mode:
authorAnton Tananaev <atananaev@lyft.com>2020-12-28 11:06:25 -0800
committerAnton Tananaev <atananaev@lyft.com>2020-12-28 11:06:25 -0800
commitf54ec00be2611c274e442cd6b2fd5ccdcf433ae5 (patch)
tree5387cd15a36187d6a739aae47ddd51e4721c8a2a /src/main/java/org/traccar/config
parent04cd9f4d14111b6d568a8ddd7e5501873276b339 (diff)
downloadtrackermap-server-f54ec00be2611c274e442cd6b2fd5ccdcf433ae5.tar.gz
trackermap-server-f54ec00be2611c274e442cd6b2fd5ccdcf433ae5.tar.bz2
trackermap-server-f54ec00be2611c274e442cd6b2fd5ccdcf433ae5.zip
Migrate more config keys
Diffstat (limited to 'src/main/java/org/traccar/config')
-rw-r--r--src/main/java/org/traccar/config/Config.java12
-rw-r--r--src/main/java/org/traccar/config/Keys.java19
2 files changed, 24 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/config/Config.java b/src/main/java/org/traccar/config/Config.java
index 77184a528..1231918c6 100644
--- a/src/main/java/org/traccar/config/Config.java
+++ b/src/main/java/org/traccar/config/Config.java
@@ -15,6 +15,8 @@
*/
package org.traccar.config;
+import com.google.common.annotations.VisibleForTesting;
+
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -133,18 +135,14 @@ public class Config {
}
public double getDouble(ConfigKey key) {
- return getDouble(key.getKey(), 0.0);
+ return getDouble(key, 0.0);
}
public double getDouble(ConfigKey key, double defaultValue) {
- return getDouble(key.getKey(), defaultValue);
- }
-
- @Deprecated
- public double getDouble(String key, double defaultValue) {
- return hasKey(key) ? Double.parseDouble(getString(key)) : defaultValue;
+ return hasKey(key.getKey()) ? Double.parseDouble(getString(key.getKey())) : defaultValue;
}
+ @VisibleForTesting
public void setString(ConfigKey key, String value) {
properties.put(key.getKey(), value);
}
diff --git a/src/main/java/org/traccar/config/Keys.java b/src/main/java/org/traccar/config/Keys.java
index 206295499..c8d3f4ccc 100644
--- a/src/main/java/org/traccar/config/Keys.java
+++ b/src/main/java/org/traccar/config/Keys.java
@@ -70,6 +70,25 @@ public final class Keys {
"event.ignoreDuplicateAlerts", Boolean.class);
/**
+ * If set to true, invalid positions will be considered for motion logic.
+ */
+ public static final ConfigKey EVENT_MOTION_PROCESS_INVALID_POSITIONS = new ConfigKey(
+ "event.motion.processInvalidPositions", Boolean.class);
+
+ /**
+ * If the speed is above specified value, the object is considered to be in motion. Default value is 0.01 knots.
+ */
+ public static final ConfigKey EVENT_MOTION_SPEED_THRESHOLD = new ConfigKey(
+ "event.motion.speedThreshold", Double.class);
+
+ /**
+ * Global polyline geofence distance. Within that distance from the polyline, point is considered within the
+ * geofence. Each individual geofence can also has 'polylineDistance' attribute which will take precedence.
+ */
+ public static final ConfigKey GEOFENCE_POLYLINE_DISTANCE = new ConfigKey(
+ "geofence.polylineDistance", Double.class);
+
+ /**
* List of external handler classes to use in Netty pipeline.
*/
public static final ConfigKey EXTRA_HANDLERS = new ConfigKey(