diff options
author | Anton Tananaev <atananaev@lyft.com> | 2020-12-28 17:02:23 -0800 |
---|---|---|
committer | Anton Tananaev <atananaev@lyft.com> | 2020-12-28 17:02:23 -0800 |
commit | 51704590a835057bf4850a5eaf8c5037d20f648a (patch) | |
tree | c38acebce6cfec36ead21918d6272a99452b9ac5 /src/main/java/org/traccar/database/DeviceManager.java | |
parent | 551298664bbac541450d83a021a2f8d77e65b216 (diff) | |
download | trackermap-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.java | 9 |
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); } |