aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-08-08 10:31:49 +0300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-08-08 10:31:49 +0300
commitecf3ebdd176fafc0e9bfbdb1bca8f3a1cfd6cbb0 (patch)
tree9e4e98e2d35c36b2fcab3026169141fdc6ee2ba1 /src/org/traccar/BasePipelineFactory.java
parent5c0e9d5eff4f471837ad26aa763ac8b5dc7fc501 (diff)
downloadtrackermap-server-ecf3ebdd176fafc0e9bfbdb1bca8f3a1cfd6cbb0.tar.gz
trackermap-server-ecf3ebdd176fafc0e9bfbdb1bca8f3a1cfd6cbb0.tar.bz2
trackermap-server-ecf3ebdd176fafc0e9bfbdb1bca8f3a1cfd6cbb0.zip
Add coordinates filter (fix #2192)
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index 31845290f..2b5028f33 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -44,6 +44,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private int timeout;
private FilterHandler filterHandler;
+ private CoordinatesHandler coordinatesHandler;
private DistanceHandler distanceHandler;
private ReverseGeocoderHandler reverseGeocoderHandler;
private LocationProviderHandler locationProviderHandler;
@@ -115,6 +116,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
filterHandler = new FilterHandler();
}
+ if (Context.getConfig().getBoolean("coordinates.filter")) {
+ coordinatesHandler = new CoordinatesHandler();
+ }
+
if (Context.getReverseGeocoder() != null) {
reverseGeocoderHandler = new ReverseGeocoderHandler(
Context.getReverseGeocoder(), Context.getConfig().getBoolean("geocoder.processInvalidPositions"));
@@ -188,6 +193,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
pipeline.addLast("filter", filterHandler);
}
+ if (coordinatesHandler != null) {
+ pipeline.addLast("coordinatesHandler", coordinatesHandler);
+ }
+
if (Context.getDataManager() != null) {
pipeline.addLast("dataHandler", new DefaultDataHandler());
}