diff options
author | jon-stumpf <jon.stumpf@gmail.com> | 2014-11-14 15:07:44 -0500 |
---|---|---|
committer | jon-stumpf <jon.stumpf@gmail.com> | 2014-11-14 21:10:31 -0500 |
commit | a54bd7f41229a0244c2a44fc571fc70feebe13a0 (patch) | |
tree | cd558989f491287b5d51ff511daf2c7db87f6ab7 /src/org/traccar/BasePipelineFactory.java | |
parent | 74f88cf2cc40680869233bcdb97cece139985f96 (diff) | |
download | trackermap-server-a54bd7f41229a0244c2a44fc571fc70feebe13a0.tar.gz trackermap-server-a54bd7f41229a0244c2a44fc571fc70feebe13a0.tar.bz2 trackermap-server-a54bd7f41229a0244c2a44fc571fc70feebe13a0.zip |
Added option to choose if one ReverseGeoCodes invalid positions
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r-- | src/org/traccar/BasePipelineFactory.java | 9 |
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; |