From a129cfd3159c02b4f3996dbdfb5299ac95a6720c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 23 Feb 2019 15:40:41 -0800 Subject: Refactor remote address handler --- src/org/traccar/BasePipelineFactory.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/org/traccar/BasePipelineFactory.java') diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index d32e1fc6c..d5a90390e 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -40,6 +40,7 @@ import org.traccar.handler.DistanceHandler; import org.traccar.handler.FilterHandler; import org.traccar.handler.NetworkMessageHandler; import org.traccar.handler.OpenChannelHandler; +import org.traccar.handler.RemoteAddressHandler; import org.traccar.handler.StandardLoggingHandler; import java.util.Map; @@ -52,7 +53,6 @@ public abstract class BasePipelineFactory extends ChannelInitializer { private int timeout; private EngineHoursHandler engineHoursHandler; - private RemoteAddressHandler remoteAddressHandler; private MotionHandler motionHandler; private GeocoderHandler geocoderHandler; private GeolocationHandler geolocationHandler; @@ -78,10 +78,6 @@ public abstract class BasePipelineFactory extends ChannelInitializer { timeout = Context.getConfig().getInteger(Keys.SERVER_TIMEOUT); } - if (Context.getConfig().getBoolean("handler.remoteAddress.enable")) { - remoteAddressHandler = new RemoteAddressHandler(); - } - if (Context.getGeocoder() != null && !Context.getConfig().getBoolean("geocoder.ignorePositions")) { geocoderHandler = new GeocoderHandler( Context.getGeocoder(), @@ -105,7 +101,7 @@ public abstract class BasePipelineFactory extends ChannelInitializer { hemisphereHandler = new HemisphereHandler(); } - if (Context.getConfig().getBoolean("handler.copyAttributes.enable")) { + if (Context.getConfig().getBoolean("processing.copyAttributes.enable")) { copyAttributesHandler = new CopyAttributesHandler(); } @@ -178,7 +174,7 @@ public abstract class BasePipelineFactory extends ChannelInitializer { geolocationHandler, hemisphereHandler, Main.getInjector().getInstance(DistanceHandler.class), - remoteAddressHandler); + Main.getInjector().getInstance(RemoteAddressHandler.class)); addDynamicHandlers(pipeline); -- cgit v1.2.3