aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-03-09 20:00:11 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-03-09 20:00:11 -0800
commitc7e9f996ed7d183442a7dd2fbbc5c9329981f261 (patch)
tree7b4ffe903970396e04a2bcdbe0acd66cba156395 /src/org/traccar/MainModule.java
parent312f5d2a3af3ec53cc6ff73cd3424d68a2774dcd (diff)
downloadtrackermap-server-c7e9f996ed7d183442a7dd2fbbc5c9329981f261.tar.gz
trackermap-server-c7e9f996ed7d183442a7dd2fbbc5c9329981f261.tar.bz2
trackermap-server-c7e9f996ed7d183442a7dd2fbbc5c9329981f261.zip
Refactor maintenance handler
Diffstat (limited to 'src/org/traccar/MainModule.java')
-rw-r--r--src/org/traccar/MainModule.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/org/traccar/MainModule.java b/src/org/traccar/MainModule.java
index 16a78b109..b459d824d 100644
--- a/src/org/traccar/MainModule.java
+++ b/src/org/traccar/MainModule.java
@@ -27,6 +27,7 @@ import org.traccar.database.DataManager;
import org.traccar.database.DeviceManager;
import org.traccar.database.GeofenceManager;
import org.traccar.database.IdentityManager;
+import org.traccar.database.MaintenancesManager;
import org.traccar.database.StatisticsManager;
import org.traccar.geocoder.AddressFormat;
import org.traccar.geocoder.BanGeocoder;
@@ -63,6 +64,7 @@ import org.traccar.handler.events.CommandResultEventHandler;
import org.traccar.handler.events.FuelDropEventHandler;
import org.traccar.handler.events.GeofenceEventHandler;
import org.traccar.handler.events.IgnitionEventHandler;
+import org.traccar.handler.events.MaintenanceEventHandler;
import org.traccar.handler.events.MotionEventHandler;
import org.traccar.handler.events.OverspeedEventHandler;
import org.traccar.reports.model.TripsConfig;
@@ -122,6 +124,11 @@ public class MainModule extends AbstractModule {
return Context.getAttributesManager();
}
+ @Provides
+ public static MaintenancesManager provideMaintenancesManager() {
+ return Context.getMaintenancesManager();
+ }
+
@Singleton
@Provides
public static StatisticsManager provideStatisticsManager(Config config, DataManager dataManager, Client client) {
@@ -344,6 +351,13 @@ public class MainModule extends AbstractModule {
return new IgnitionEventHandler(identityManager);
}
+ @Singleton
+ @Provides
+ public static MaintenanceEventHandler provideMaintenanceEventHandler(
+ IdentityManager identityManager, MaintenancesManager maintenancesManager) {
+ return new MaintenanceEventHandler(identityManager, maintenancesManager);
+ }
+
@Override
protected void configure() {
binder().requireExplicitBindings();