diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-17 18:05:14 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-17 18:05:14 +1200 |
commit | cdcb8c504e01d941e6ea4c3ed8998088af4a0d90 (patch) | |
tree | 97aba07eabe93410b9d7c4cbb9f92badfa384acc /src/org/traccar/BasePipelineFactory.java | |
parent | a1d91f3b8a80758d5f3e7804afec66256ab27e68 (diff) | |
download | trackermap-server-cdcb8c504e01d941e6ea4c3ed8998088af4a0d90.tar.gz trackermap-server-cdcb8c504e01d941e6ea4c3ed8998088af4a0d90.tar.bz2 trackermap-server-cdcb8c504e01d941e6ea4c3ed8998088af4a0d90.zip |
Implement fuel drop events
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r-- | src/org/traccar/BasePipelineFactory.java | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index 33f778885..620c4729a 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -30,6 +30,7 @@ import org.jboss.netty.channel.SimpleChannelHandler; import org.jboss.netty.handler.logging.LoggingHandler; import org.jboss.netty.handler.timeout.IdleStateHandler; import org.traccar.events.CommandResultEventHandler; +import org.traccar.events.FuelDropEventHandler; import org.traccar.events.GeofenceEventHandler; import org.traccar.events.IgnitionEventHandler; import org.traccar.events.MaintenanceEventHandler; @@ -55,6 +56,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { private CommandResultEventHandler commandResultEventHandler; private OverspeedEventHandler overspeedEventHandler; + private FuelDropEventHandler fuelDropEventHandler; private MotionEventHandler motionEventHandler; private GeofenceEventHandler geofenceEventHandler; private AlertEventHandler alertEventHandler; @@ -153,25 +155,12 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { if (Context.getConfig().getBoolean("event.enable")) { commandResultEventHandler = new CommandResultEventHandler(); - - if (Context.getConfig().getBoolean("event.overspeedHandler")) { - overspeedEventHandler = new OverspeedEventHandler(); - } - - if (Context.getConfig().getBoolean("event.motionHandler")) { - motionEventHandler = new MotionEventHandler(); - } - } - if (Context.getConfig().getBoolean("event.geofenceHandler")) { + overspeedEventHandler = new OverspeedEventHandler(); + fuelDropEventHandler = new FuelDropEventHandler(); + motionEventHandler = new MotionEventHandler(); geofenceEventHandler = new GeofenceEventHandler(); - } - if (Context.getConfig().getBoolean("event.alertHandler")) { alertEventHandler = new AlertEventHandler(); - } - if (Context.getConfig().getBoolean("event.ignitionHandler")) { ignitionEventHandler = new IgnitionEventHandler(); - } - if (Context.getConfig().getBoolean("event.maintenanceHandler")) { maintenanceEventHandler = new MaintenanceEventHandler(); } } @@ -236,6 +225,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { pipeline.addLast("OverspeedEventHandler", overspeedEventHandler); } + if (fuelDropEventHandler != null) { + pipeline.addLast("FuelDropEventHandler", fuelDropEventHandler); + } + if (motionEventHandler != null) { pipeline.addLast("MotionEventHandler", motionEventHandler); } |