aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-05-13 11:01:48 +1200
committerGitHub <noreply@github.com>2017-05-13 11:01:48 +1200
commit713d6c55a007aa80850810f447308976516bfa63 (patch)
tree057e9147e724a56b6e2f3820fcf3d9ab67561fdf /src/org/traccar/BasePipelineFactory.java
parent51920cae6438f8888090f177761a82afff33067f (diff)
parent6c17f85d04b224ff2a09265918765c9f4fc8cf94 (diff)
downloadtraccar-server-713d6c55a007aa80850810f447308976516bfa63.tar.gz
traccar-server-713d6c55a007aa80850810f447308976516bfa63.tar.bz2
traccar-server-713d6c55a007aa80850810f447308976516bfa63.zip
Merge pull request #3156 from Abyss777/computed_attributes
Implement computed attributes
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index 620c4729a..11457905d 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2016 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2017 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,6 +38,8 @@ import org.traccar.events.MotionEventHandler;
import org.traccar.events.OverspeedEventHandler;
import org.traccar.events.AlertEventHandler;
import org.traccar.helper.Log;
+import org.traccar.processing.ComputedAttributesHandler;
+import org.traccar.processing.CopyAttributesHandler;
import java.net.InetSocketAddress;
@@ -53,6 +55,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private GeolocationHandler geolocationHandler;
private HemisphereHandler hemisphereHandler;
private CopyAttributesHandler copyAttributesHandler;
+ private ComputedAttributesHandler computedAttributesHandler;
private CommandResultEventHandler commandResultEventHandler;
private OverspeedEventHandler overspeedEventHandler;
@@ -153,6 +156,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
copyAttributesHandler = new CopyAttributesHandler();
}
+ if (Context.getConfig().getBoolean("processing.computedAttributes.enable")) {
+ computedAttributesHandler = new ComputedAttributesHandler();
+ }
+
if (Context.getConfig().getBoolean("event.enable")) {
commandResultEventHandler = new CommandResultEventHandler();
overspeedEventHandler = new OverspeedEventHandler();
@@ -209,6 +216,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
pipeline.addLast("copyAttributes", copyAttributesHandler);
}
+ if (computedAttributesHandler != null) {
+ pipeline.addLast("computedAttributes", computedAttributesHandler);
+ }
+
if (Context.getDataManager() != null) {
pipeline.addLast("dataHandler", new DefaultDataHandler());
}