diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-23 15:33:33 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-23 15:33:33 -0800 |
commit | b7d48127e60bcaa5d01f45d8df5203f28f9a1667 (patch) | |
tree | a5c6c85460775db357b39e8ac401db3c8d218dc6 /src/org/traccar/BasePipelineFactory.java | |
parent | 563243a8da888244e910a4a7a10fb86ad525fdd4 (diff) | |
download | trackermap-server-b7d48127e60bcaa5d01f45d8df5203f28f9a1667.tar.gz trackermap-server-b7d48127e60bcaa5d01f45d8df5203f28f9a1667.tar.bz2 trackermap-server-b7d48127e60bcaa5d01f45d8df5203f28f9a1667.zip |
Refactor distance handler
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r-- | src/org/traccar/BasePipelineFactory.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index 7f617c470..d32e1fc6c 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -36,6 +36,7 @@ import org.traccar.events.MotionEventHandler; import org.traccar.events.OverspeedEventHandler; import org.traccar.handler.ComputedAttributesHandler; import org.traccar.handler.CopyAttributesHandler; +import org.traccar.handler.DistanceHandler; import org.traccar.handler.FilterHandler; import org.traccar.handler.NetworkMessageHandler; import org.traccar.handler.OpenChannelHandler; @@ -50,7 +51,6 @@ public abstract class BasePipelineFactory extends ChannelInitializer<Channel> { private final TrackerServer server; private int timeout; - private DistanceHandler distanceHandler; private EngineHoursHandler engineHoursHandler; private RemoteAddressHandler remoteAddressHandler; private MotionHandler motionHandler; @@ -78,11 +78,6 @@ public abstract class BasePipelineFactory extends ChannelInitializer<Channel> { timeout = Context.getConfig().getInteger(Keys.SERVER_TIMEOUT); } - distanceHandler = new DistanceHandler( - Context.getConfig().getBoolean("coordinates.filter"), - Context.getConfig().getInteger("coordinates.minError"), - Context.getConfig().getInteger("coordinates.maxError")); - if (Context.getConfig().getBoolean("handler.remoteAddress.enable")) { remoteAddressHandler = new RemoteAddressHandler(); } @@ -182,7 +177,7 @@ public abstract class BasePipelineFactory extends ChannelInitializer<Channel> { pipeline, geolocationHandler, hemisphereHandler, - distanceHandler, + Main.getInjector().getInstance(DistanceHandler.class), remoteAddressHandler); addDynamicHandlers(pipeline); |