aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorninioe <ninioe@gmail.com>2016-07-17 09:54:15 +0300
committerninioe <ninioe@gmail.com>2016-07-17 09:54:15 +0300
commit4d55b911bd252c90d1d0ec4053d8502154192676 (patch)
tree5cb88f24fb5ba9edbec1bd0593ed2878c401bb2d /src/org/traccar/BasePipelineFactory.java
parent636f6e19b4ae7fbd80ff083498fface8c12ee9c8 (diff)
downloadtrackermap-server-4d55b911bd252c90d1d0ec4053d8502154192676.tar.gz
trackermap-server-4d55b911bd252c90d1d0ec4053d8502154192676.tar.bz2
trackermap-server-4d55b911bd252c90d1d0ec4053d8502154192676.zip
Added AlertEventHandler & Mute button for all notifications
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index 44f1b0657..eb08c7e08 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -29,10 +29,7 @@ import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelHandler;
import org.jboss.netty.handler.logging.LoggingHandler;
import org.jboss.netty.handler.timeout.IdleStateHandler;
-import org.traccar.events.CommandResultEventHandler;
-import org.traccar.events.GeofenceEventHandler;
-import org.traccar.events.MotionEventHandler;
-import org.traccar.events.OverspeedEventHandler;
+import org.traccar.events.*;
import org.traccar.helper.Log;
import java.net.InetSocketAddress;
@@ -52,6 +49,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private OverspeedEventHandler overspeedEventHandler;
private MotionEventHandler motionEventHandler;
private GeofenceEventHandler geofenceEventHandler;
+ private AlertEventHandler alertEventHandler;
private static final class OpenChannelHandler extends SimpleChannelHandler {
@@ -146,6 +144,9 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
if (Context.getConfig().getBoolean("event.geofenceHandler")) {
geofenceEventHandler = new GeofenceEventHandler();
}
+ if (Context.getConfig().getBoolean("event.alertHandler")) {
+ alertEventHandler = new AlertEventHandler();
+ }
}
protected abstract void addSpecificHandlers(ChannelPipeline pipeline);
@@ -207,6 +208,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
pipeline.addLast("GeofenceEventHandler", geofenceEventHandler);
}
+ if (alertEventHandler != null) {
+ pipeline.addLast("AlertEventHandler", alertEventHandler);
+ }
+
pipeline.addLast("mainHandler", new MainEventHandler());
return pipeline;
}