aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-08-18 13:22:16 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-08-18 13:22:16 +1200
commit17ff0791718807be18e9f63aa095ed86d4b82b1c (patch)
tree1e891f96c1b62e58f4de89def099def177af1b21 /src/org/traccar/BasePipelineFactory.java
parenta90ce59795690267a0924c2b911f14fe0340a6b4 (diff)
downloadtrackermap-server-17ff0791718807be18e9f63aa095ed86d4b82b1c.tar.gz
trackermap-server-17ff0791718807be18e9f63aa095ed86d4b82b1c.tar.bz2
trackermap-server-17ff0791718807be18e9f63aa095ed86d4b82b1c.zip
Re-factor server side classes
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index 6c4a6b5bd..216e48709 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -37,7 +37,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private int resetDelay;
private FilterHandler filterHandler;
- private OdometerHandler odometerHandler;
+ private DistanceHandler distanceHandler;
private ReverseGeocoderHandler reverseGeocoderHandler;
protected class OpenChannelHandler extends SimpleChannelHandler {
@@ -96,6 +96,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
reverseGeocoderHandler = new ReverseGeocoderHandler(
Context.getReverseGeocoder(), Context.getConfig().getBoolean("geocode.processInvalidPositions"));
}
+
+ if (Context.getConfig().getBoolean("distance.enable")) {
+ distanceHandler = new DistanceHandler();
+ }
}
protected abstract void addSpecificHandlers(ChannelPipeline pipeline);
@@ -114,8 +118,8 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
if (filterHandler != null) {
pipeline.addLast("filter", filterHandler);
}
- if (odometerHandler != null) {
- pipeline.addLast("odometer", odometerHandler);
+ if (distanceHandler != null) {
+ pipeline.addLast("distance", distanceHandler);
}
if (reverseGeocoderHandler != null) {
pipeline.addLast("geocoder", reverseGeocoderHandler);