Search in sources :

Example 1 with LdapProvider

use of org.traccar.database.LdapProvider in project traccar by tananaev.

the class Context method init.

public static void init(String[] arguments) throws Exception {
    config = new Config();
    if (arguments.length <= 0) {
        throw new RuntimeException("Configuration file is not provided");
    }
    config.load(arguments[0]);
    loggerEnabled = config.getBoolean("logger.enable");
    if (loggerEnabled) {
        Log.setupLogger(config);
    }
    objectMapper = new ObjectMapper();
    objectMapper.setConfig(objectMapper.getSerializationConfig().without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS));
    if (Context.getConfig().getBoolean("mapper.prettyPrintedJson")) {
        objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
    }
    if (config.hasKey("database.url")) {
        dataManager = new DataManager(config);
    }
    if (config.getBoolean("ldap.enable")) {
        ldapProvider = new LdapProvider(config);
    }
    mediaManager = new MediaManager(config.getString("media.path"));
    if (dataManager != null) {
        usersManager = new UsersManager(dataManager);
        groupsManager = new GroupsManager(dataManager);
        deviceManager = new DeviceManager(dataManager);
    }
    identityManager = deviceManager;
    if (config.getBoolean("geocoder.enable")) {
        geocoder = initGeocoder();
    }
    if (config.getBoolean("geolocation.enable")) {
        initGeolocationModule();
    }
    if (config.getBoolean("web.enable")) {
        webServer = new WebServer(config, dataManager.getDataSource());
    }
    permissionsManager = new PermissionsManager(dataManager, usersManager);
    connectionManager = new ConnectionManager();
    tripsConfig = initTripsConfig();
    if (config.getBoolean("event.enable")) {
        initEventsModule();
    }
    serverManager = new ServerManager();
    if (config.getBoolean("event.forward.enable")) {
        if (Context.getConfig().getBoolean("event.forward.payloadAsParamMode")) {
            eventForwarder = new MultiPartEventForwarder();
        } else {
            eventForwarder = new JsonTypeEventForwarder();
        }
    }
    attributesManager = new AttributesManager(dataManager);
    driversManager = new DriversManager(dataManager);
    commandsManager = new CommandsManager(dataManager);
    statisticsManager = new StatisticsManager();
    if (config.getBoolean("sms.smpp.enable")) {
        smppClient = new SmppClient();
    }
}
Also used : MultiPartEventForwarder(org.traccar.notification.MultiPartEventForwarder) TripsConfig(org.traccar.reports.model.TripsConfig) DriversManager(org.traccar.database.DriversManager) AttributesManager(org.traccar.database.AttributesManager) DataManager(org.traccar.database.DataManager) DeviceManager(org.traccar.database.DeviceManager) LdapProvider(org.traccar.database.LdapProvider) SmppClient(org.traccar.smpp.SmppClient) JsonTypeEventForwarder(org.traccar.notification.JsonTypeEventForwarder) UsersManager(org.traccar.database.UsersManager) ConnectionManager(org.traccar.database.ConnectionManager) StatisticsManager(org.traccar.database.StatisticsManager) WebServer(org.traccar.web.WebServer) MediaManager(org.traccar.database.MediaManager) PermissionsManager(org.traccar.database.PermissionsManager) CommandsManager(org.traccar.database.CommandsManager) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) GroupsManager(org.traccar.database.GroupsManager)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 AttributesManager (org.traccar.database.AttributesManager)1 CommandsManager (org.traccar.database.CommandsManager)1 ConnectionManager (org.traccar.database.ConnectionManager)1 DataManager (org.traccar.database.DataManager)1 DeviceManager (org.traccar.database.DeviceManager)1 DriversManager (org.traccar.database.DriversManager)1 GroupsManager (org.traccar.database.GroupsManager)1 LdapProvider (org.traccar.database.LdapProvider)1 MediaManager (org.traccar.database.MediaManager)1 PermissionsManager (org.traccar.database.PermissionsManager)1 StatisticsManager (org.traccar.database.StatisticsManager)1 UsersManager (org.traccar.database.UsersManager)1 JsonTypeEventForwarder (org.traccar.notification.JsonTypeEventForwarder)1 MultiPartEventForwarder (org.traccar.notification.MultiPartEventForwarder)1 TripsConfig (org.traccar.reports.model.TripsConfig)1 SmppClient (org.traccar.smpp.SmppClient)1 WebServer (org.traccar.web.WebServer)1