aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorIrving Gonzalez <ialexis93@gmail.com>2015-06-10 20:06:30 -0600
committerIrving Gonzalez <ialexis93@gmail.com>2015-06-10 20:06:30 -0600
commit5dc81b6197b9a1387adffdc2628c24ca483d2376 (patch)
tree812748a9516801cd07bb20006d4c9afddce1a65b /src/org/traccar/BasePipelineFactory.java
parent81e7ae399eab4e93113af68de2361cea1b82b58b (diff)
downloadtrackermap-server-5dc81b6197b9a1387adffdc2628c24ca483d2376.tar.gz
trackermap-server-5dc81b6197b9a1387adffdc2628c24ca483d2376.tar.bz2
trackermap-server-5dc81b6197b9a1387adffdc2628c24ca483d2376.zip
Begin implementing alerts
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index fcb6266ef..1f18ce48e 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -32,6 +32,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private final TrackerServer server;
private FilterHandler filterHandler;
+ private AlertHandler alertHandler;
private Integer resetDelay;
private Boolean processInvalidPositions;
@@ -93,6 +94,11 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
if (enableFilter != null && Boolean.valueOf(enableFilter)) {
filterHandler = new FilterHandler();
}
+
+ String enableAlerts = Context.getProps().getProperty("alert.enable");
+ if(enableAlerts != null && Boolean.valueOf(enableAlerts)){
+ alertHandler = new AlertHandler();
+ }
if (Context.getReverseGeocoder() != null) {
// Default behavior is to process invalid positions (i.e., the "null" case)
@@ -117,6 +123,9 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
if (filterHandler != null) {
pipeline.addLast("filter", filterHandler);
}
+ if (alertHandler != null) {
+ pipeline.addLast("alert", alertHandler);
+ }
if (Context.getReverseGeocoder() != null) {
pipeline.addLast("geocoder", new ReverseGeocoderHandler(Context.getReverseGeocoder(), processInvalidPositions));
}