diff options
author | Abyss777 <abyss@fox5.ru> | 2018-04-11 14:55:11 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2018-04-11 14:55:31 +0500 |
commit | f7a4d1977e71797b231ebb9a55308fee7c2b64d7 (patch) | |
tree | 3b879aed22d40ebe405a792f7bdd3446d7b38aaa /src/org/traccar/Context.java | |
parent | bb071de84dd000ec3067991bb523fe5ef24b76e9 (diff) | |
download | trackermap-server-f7a4d1977e71797b231ebb9a55308fee7c2b64d7.tar.gz trackermap-server-f7a4d1977e71797b231ebb9a55308fee7c2b64d7.tar.bz2 trackermap-server-f7a4d1977e71797b231ebb9a55308fee7c2b64d7.zip |
Add support of multiple Maintenances
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r-- | src/org/traccar/Context.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 09e3c619b..a1a5f5a8e 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 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. @@ -35,6 +35,7 @@ import org.traccar.database.DeviceManager; import org.traccar.database.DriversManager; import org.traccar.database.IdentityManager; import org.traccar.database.LdapProvider; +import org.traccar.database.MaintenancesManager; import org.traccar.database.MediaManager; import org.traccar.database.NotificationManager; import org.traccar.database.PermissionsManager; @@ -64,6 +65,7 @@ import org.traccar.model.Device; import org.traccar.model.Driver; import org.traccar.model.Geofence; import org.traccar.model.Group; +import org.traccar.model.Maintenance; import org.traccar.model.Notification; import org.traccar.model.User; import org.traccar.geolocation.GoogleGeolocationProvider; @@ -232,6 +234,12 @@ public final class Context { return commandsManager; } + private static MaintenancesManager maintenancesManager; + + public static MaintenancesManager getMaintenancesManager() { + return maintenancesManager; + } + private static StatisticsManager statisticsManager; public static StatisticsManager getStatisticsManager() { @@ -385,6 +393,8 @@ public final class Context { commandsManager = new CommandsManager(dataManager); + maintenancesManager = new MaintenancesManager(dataManager); + statisticsManager = new StatisticsManager(); if (config.getBoolean("sms.smpp.enable")) { @@ -469,6 +479,8 @@ public final class Context { return (BaseObjectManager<T>) driversManager; } else if (clazz.equals(Command.class)) { return (BaseObjectManager<T>) commandsManager; + } else if (clazz.equals(Maintenance.class)) { + return (BaseObjectManager<T>) maintenancesManager; } else if (clazz.equals(Notification.class)) { return (BaseObjectManager<T>) notificationManager; } |