diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/Context.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 4e7246095..2317b7039 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -70,6 +70,8 @@ import org.traccar.geolocation.GeolocationProvider; import org.traccar.geolocation.MozillaGeolocationProvider; import org.traccar.geolocation.OpenCellIdGeolocationProvider; import org.traccar.notification.EventForwarder; +import org.traccar.notification.FormTypeEventForwarder; +import org.traccar.notification.JsonTypeEventForwarder; import org.traccar.reports.model.TripsConfig; import org.traccar.smpp.SmppClient; import org.traccar.web.WebServer; @@ -404,7 +406,7 @@ public final class Context { serverManager = new ServerManager(); if (config.getBoolean("event.forward.enable")) { - eventForwarder = new EventForwarder(); + eventForwarder = getConfiguredEventForwarder(); } attributesManager = new AttributesManager(dataManager); @@ -421,6 +423,13 @@ public final class Context { } + private static EventForwarder getConfiguredEventForwarder() { + if (Context.getConfig().getBoolean("event.forward.payloadAsParamMode")) { + return new FormTypeEventForwarder(); + } + return new JsonTypeEventForwarder(); + } + public static void init(IdentityManager testIdentityManager) { config = new Config(); objectMapper = new ObjectMapper(); |