From b2c02091c1d1a6d1e1270886d4fb5a33a5f3ed04 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 21 Oct 2016 07:19:40 +0500 Subject: Implement copy attributes from last position --- src/org/traccar/BasePipelineFactory.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/org/traccar/BasePipelineFactory.java') diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index 837712e84..6d7089644 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -50,6 +50,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { private ReverseGeocoderHandler reverseGeocoderHandler; private LocationProviderHandler locationProviderHandler; private HemisphereHandler hemisphereHandler; + private CopyAttributesHandler copyAttributesHandler; private CommandResultEventHandler commandResultEventHandler; private OverspeedEventHandler overspeedEventHandler; @@ -139,6 +140,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { hemisphereHandler = new HemisphereHandler(); } + if (Context.getConfig().getBoolean("processing.copyAttributes.enable")) { + copyAttributesHandler = new CopyAttributesHandler(); + } + if (Context.getConfig().getBoolean("event.enable")) { commandResultEventHandler = new CommandResultEventHandler(); @@ -201,6 +206,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { pipeline.addLast("distance", distanceHandler); } + if (copyAttributesHandler != null) { + pipeline.addLast("copyAttributes", copyAttributesHandler); + } + if (Context.getDataManager() != null) { pipeline.addLast("dataHandler", new DefaultDataHandler()); } -- cgit v1.2.3