aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-11-15 16:30:26 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-11-15 16:30:26 +1300
commit419920eb18e775690736fd9eec048b3a186744e3 (patch)
tree74b2a6da3b9866d32100c2d5d920735c7bc35f8a /src/org/traccar/BasePipelineFactory.java
parent74f88cf2cc40680869233bcdb97cece139985f96 (diff)
parentcee5be49edbcef85e9eb7072a9b6723e2474c9cf (diff)
downloadtrackermap-server-419920eb18e775690736fd9eec048b3a186744e3.tar.gz
trackermap-server-419920eb18e775690736fd9eec048b3a186744e3.tar.bz2
trackermap-server-419920eb18e775690736fd9eec048b3a186744e3.zip
Merge pull request #973 from jon-stumpf/enhancement-new-geocode-option
Added geocode.processInvalidPositions option
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index 83207b91f..aba568de6 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -36,6 +36,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private final ReverseGeocoder reverseGeocoder;
private FilterHandler filterHandler;
private Integer resetDelay;
+ private Boolean processInvalidPositions;
/**
* Open channel handler
@@ -100,6 +101,12 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
if (enableFilter != null && Boolean.valueOf(enableFilter)) {
filterHandler = new FilterHandler(serverManager);
}
+
+ if (reverseGeocoder != null) {
+ // Default behavior is to process invalid positions (i.e., the "null" case)
+ String invalidPositions = serverManager.getProperties().getProperty("geocode.processInvalidPositions");
+ processInvalidPositions = (invalidPositions == null || Boolean.valueOf(invalidPositions));
+ }
}
protected DataManager getDataManager() {
@@ -123,7 +130,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
pipeline.addLast("filter", filterHandler);
}
if (reverseGeocoder != null) {
- pipeline.addLast("geocoder", new ReverseGeocoderHandler(reverseGeocoder));
+ pipeline.addLast("geocoder", new ReverseGeocoderHandler(reverseGeocoder, processInvalidPositions));
}
pipeline.addLast("handler", new TrackerEventHandler(dataManager));
return pipeline;