diff options
author | Shinryuken <watertext@hotmail.it> | 2017-11-07 19:17:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-07 19:17:43 +0100 |
commit | e61584b14a2cfe0075964bdc7207adb55062d61b (patch) | |
tree | 49c4b8976c88474d7525bce8be7112622b218d17 /src/org | |
parent | ccb2e9e5e0581406963ac63a9d08acb7c2549834 (diff) | |
download | traccar-server-e61584b14a2cfe0075964bdc7207adb55062d61b.tar.gz traccar-server-e61584b14a2cfe0075964bdc7207adb55062d61b.tar.bz2 traccar-server-e61584b14a2cfe0075964bdc7207adb55062d61b.zip |
User defaults when no User is available
Diffstat (limited to 'src/org')
-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(); |