aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Context.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-07-15 15:33:08 +0500
committerAbyss777 <abyss@fox5.ru>2016-07-15 15:33:08 +0500
commitd71210f1f408c757d4fe3da07829bbc3362a7e93 (patch)
treed5c3a2c5e6856cc3bd145d5030b9acec7184acda /src/org/traccar/Context.java
parent1f411961db56f7024d3e88cfaef89f1ab26fc9f1 (diff)
downloadtrackermap-server-d71210f1f408c757d4fe3da07829bbc3362a7e93.tar.gz
trackermap-server-d71210f1f408c757d4fe3da07829bbc3362a7e93.tar.bz2
trackermap-server-d71210f1f408c757d4fe3da07829bbc3362a7e93.zip
Move code related to devices to DeviceManager
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r--src/org/traccar/Context.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index 0bb18b675..d32837755 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -18,6 +18,7 @@ package org.traccar;
import com.ning.http.client.AsyncHttpClient;
import org.traccar.database.ConnectionManager;
import org.traccar.database.DataManager;
+import org.traccar.database.DeviceManager;
import org.traccar.database.IdentityManager;
import org.traccar.database.NotificationManager;
import org.traccar.database.PermissionsManager;
@@ -67,6 +68,12 @@ public final class Context {
return dataManager;
}
+ private static DeviceManager deviceManager;
+
+ public static DeviceManager getDeviceManager() {
+ return deviceManager;
+ }
+
private static ConnectionManager connectionManager;
public static ConnectionManager getConnectionManager() {
@@ -142,7 +149,12 @@ public final class Context {
if (config.hasKey("database.url")) {
dataManager = new DataManager(config);
}
- identityManager = dataManager;
+
+ if (dataManager != null) {
+ deviceManager = new DeviceManager(dataManager);
+ }
+
+ identityManager = deviceManager;
if (config.getBoolean("geocoder.enable")) {
String type = config.getString("geocoder.type", "google");
@@ -205,7 +217,7 @@ public final class Context {
permissionsManager = new PermissionsManager(dataManager);
- connectionManager = new ConnectionManager(dataManager);
+ connectionManager = new ConnectionManager();
if (config.getBoolean("event.geofenceHandler")) {
geofenceManager = new GeofenceManager(dataManager);
@@ -225,7 +237,6 @@ public final class Context {
public static void init(IdentityManager testIdentityManager) {
config = new Config();
- connectionManager = new ConnectionManager(null);
identityManager = testIdentityManager;
}