diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-04-16 09:41:22 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-16 09:41:22 +1200 |
commit | e4d7d815fe0d05aa7753c2752a99fa4c7cc7a326 (patch) | |
tree | 772381d37eb1d2e69c2052eb9695aeffc5eefa3c /src/org/traccar/Context.java | |
parent | 994efc29d550e3f4a69f65ee60aa51816f352d45 (diff) | |
parent | 30ae3d104e9b0446364ebc316dc10d0f811e1480 (diff) | |
download | trackermap-server-e4d7d815fe0d05aa7753c2752a99fa4c7cc7a326.tar.gz trackermap-server-e4d7d815fe0d05aa7753c2752a99fa4c7cc7a326.tar.bz2 trackermap-server-e4d7d815fe0d05aa7753c2752a99fa4c7cc7a326.zip |
Merge pull request #3842 from Abyss777/multi_maintenance
Add support of multiple Maintenances
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r-- | src/org/traccar/Context.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 09e3c619b..67fd02f75 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() { @@ -419,6 +427,7 @@ public final class Context { geofenceManager = new GeofenceManager(dataManager); calendarManager = new CalendarManager(dataManager); + maintenancesManager = new MaintenancesManager(dataManager); notificationManager = new NotificationManager(dataManager); Properties velocityProperties = new Properties(); velocityProperties.setProperty("file.resource.loader.path", @@ -469,6 +478,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; } |