aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-04 09:59:13 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-04 09:59:13 -0700
commitfd84b0dcb86208c2c9c64fbe067cf7d4324892ac (patch)
tree4cab6727dba45c1a9610814df668c59783fff09b /src/main/java/org/traccar/MainModule.java
parent4b0c47095c4fdd8d8b6849e36aac2761226b5b7e (diff)
downloadtrackermap-server-fd84b0dcb86208c2c9c64fbe067cf7d4324892ac.tar.gz
trackermap-server-fd84b0dcb86208c2c9c64fbe067cf7d4324892ac.tar.bz2
trackermap-server-fd84b0dcb86208c2c9c64fbe067cf7d4324892ac.zip
Remove ldap from context
Diffstat (limited to 'src/main/java/org/traccar/MainModule.java')
-rw-r--r--src/main/java/org/traccar/MainModule.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/MainModule.java b/src/main/java/org/traccar/MainModule.java
index 7b46656b3..15b9cefda 100644
--- a/src/main/java/org/traccar/MainModule.java
+++ b/src/main/java/org/traccar/MainModule.java
@@ -19,12 +19,12 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Scopes;
-import com.google.inject.Singleton;
import io.netty.util.HashedWheelTimer;
import io.netty.util.Timer;
import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.database.CalendarManager;
+import org.traccar.database.LdapProvider;
import org.traccar.session.ConnectionManager;
import org.traccar.database.DataManager;
import org.traccar.database.DeviceManager;
@@ -66,6 +66,7 @@ import org.traccar.speedlimit.SpeedLimitProvider;
import org.traccar.storage.Storage;
import javax.annotation.Nullable;
+import javax.inject.Singleton;
import javax.ws.rs.client.Client;
public class MainModule extends AbstractModule {
@@ -142,6 +143,15 @@ public class MainModule extends AbstractModule {
@Singleton
@Provides
+ public static LdapProvider provideLdapProvider(Config config) {
+ if (config.hasKey(Keys.LDAP_URL)) {
+ return new LdapProvider(config);
+ }
+ return null;
+ }
+
+ @Singleton
+ @Provides
public static Geocoder provideGeocoder(Config config) {
if (config.getBoolean(Keys.GEOCODER_ENABLE)) {
String type = config.getString(Keys.GEOCODER_TYPE, "google");