aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database/DeviceManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <atananaev@lyft.com>2020-12-28 17:02:23 -0800
committerAnton Tananaev <atananaev@lyft.com>2020-12-28 17:02:23 -0800
commit51704590a835057bf4850a5eaf8c5037d20f648a (patch)
treec38acebce6cfec36ead21918d6272a99452b9ac5 /src/main/java/org/traccar/database/DeviceManager.java
parent551298664bbac541450d83a021a2f8d77e65b216 (diff)
downloadtrackermap-server-51704590a835057bf4850a5eaf8c5037d20f648a.tar.gz
trackermap-server-51704590a835057bf4850a5eaf8c5037d20f648a.tar.bz2
trackermap-server-51704590a835057bf4850a5eaf8c5037d20f648a.zip
Migrate long config keys
Diffstat (limited to 'src/main/java/org/traccar/database/DeviceManager.java')
-rw-r--r--src/main/java/org/traccar/database/DeviceManager.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/database/DeviceManager.java b/src/main/java/org/traccar/database/DeviceManager.java
index c78526b3e..d238e9229 100644
--- a/src/main/java/org/traccar/database/DeviceManager.java
+++ b/src/main/java/org/traccar/database/DeviceManager.java
@@ -29,6 +29,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.traccar.config.Config;
import org.traccar.Context;
+import org.traccar.config.Keys;
import org.traccar.model.Command;
import org.traccar.model.Device;
import org.traccar.model.DeviceState;
@@ -41,8 +42,6 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity
private static final Logger LOGGER = LoggerFactory.getLogger(DeviceManager.class);
- public static final long DEFAULT_REFRESH_DELAY = 300;
-
private final Config config;
private final long dataRefreshDelay;
@@ -68,7 +67,7 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity
} finally {
writeUnlock();
}
- dataRefreshDelay = config.getLong("database.refreshDelay", DEFAULT_REFRESH_DELAY) * 1000;
+ dataRefreshDelay = config.getLong(Keys.DATABASE_REFRESH_DELAY) * 1000;
refreshLastPositions();
}
@@ -77,9 +76,9 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity
Device device = new Device();
device.setName(uniqueId);
device.setUniqueId(uniqueId);
- device.setCategory(Context.getConfig().getString("database.registerUnknown.defaultCategory"));
+ device.setCategory(Context.getConfig().getString(Keys.DATABASE_REGISTER_UNKNOWN_DEFAULT_CATEGORY));
- long defaultGroupId = Context.getConfig().getLong("database.registerUnknown.defaultGroupId");
+ long defaultGroupId = Context.getConfig().getLong(Keys.DATABASE_REGISTER_UNKNOWN_DEFAULT_GROUP_ID);
if (defaultGroupId != 0) {
device.setGroupId(defaultGroupId);
}