diff options
author | Ivan Martinez <ivanfmartinez@users.noreply.github.com> | 2018-03-25 22:16:09 -0300 |
---|---|---|
committer | Ivan Martinez <ivanfmartinez@users.noreply.github.com> | 2018-04-01 18:09:50 -0300 |
commit | bb289a69fa4d292378c5c534e10985be65b2e392 (patch) | |
tree | 43ded3eed61aabf70d8212e663aa6c966b55a9dc /src/org/traccar/Context.java | |
parent | 0117dfeef0a7ffbc7a47d9681811177136336730 (diff) | |
download | trackermap-server-bb289a69fa4d292378c5c534e10985be65b2e392.tar.gz trackermap-server-bb289a69fa4d292378c5c534e10985be65b2e392.tar.bz2 trackermap-server-bb289a69fa4d292378c5c534e10985be65b2e392.zip |
generalization for notifications processing
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r-- | src/org/traccar/Context.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 09e3c619b..c9ac4ec12 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -74,7 +74,7 @@ import org.traccar.notification.EventForwarder; import org.traccar.notification.JsonTypeEventForwarder; import org.traccar.notification.MultiPartEventForwarder; import org.traccar.reports.model.TripsConfig; -import org.traccar.smpp.SmppClient; +import org.traccar.sms.SMSManager; import org.traccar.web.WebServer; public final class Context { @@ -238,10 +238,10 @@ public final class Context { return statisticsManager; } - private static SmppClient smppClient; + private static SMSManager smsManager; - public static SmppClient getSmppManager() { - return smppClient; + public static SMSManager getSmsManager() { + return smsManager; } private static MotionEventHandler motionEventHandler; @@ -388,7 +388,12 @@ public final class Context { statisticsManager = new StatisticsManager(); if (config.getBoolean("sms.smpp.enable")) { - smppClient = new SmppClient(); + final String smsManagerClass = config.getString("sms.manager.class", "org.traccar.smpp.SmppClient"); + try { + smsManager = (SMSManager) Class.forName(smsManagerClass).newInstance(); + } catch (ClassNotFoundException e) { + Log.warning("Error loading SMS Manager class : " + smsManagerClass, e); + } } } |