use of org.traccar.helper.SanitizerModule in project traccar by tananaev.
the class Context method init.
public static void init(String configFile) throws Exception {
try {
config = new Config(configFile);
Log.setupLogger(config);
} catch (Exception e) {
config = new Config();
Log.setupDefaultLogger();
throw e;
}
objectMapper = new ObjectMapper();
objectMapper.registerModule(new SanitizerModule());
objectMapper.registerModule(new JSR353Module());
objectMapper.setConfig(objectMapper.getSerializationConfig().without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS));
client = ClientBuilder.newClient().register(new ObjectMapperContextResolver());
if (config.hasKey(Keys.DATABASE_URL)) {
dataManager = new DataManager(config);
}
if (config.hasKey(Keys.LDAP_URL)) {
ldapProvider = new LdapProvider(config);
}
mailManager = new MailManager();
mediaManager = new MediaManager(config.getString(Keys.MEDIA_PATH));
if (dataManager != null) {
usersManager = new UsersManager(dataManager);
groupsManager = new GroupsManager(dataManager);
deviceManager = new DeviceManager(dataManager);
}
identityManager = deviceManager;
if (config.hasKey(Keys.WEB_PORT)) {
webServer = new WebServer(config);
}
permissionsManager = new PermissionsManager(dataManager, usersManager);
connectionManager = new ConnectionManager();
tripsConfig = initTripsConfig();
if (config.hasKey(Keys.SMS_HTTP_URL)) {
smsManager = new HttpSmsClient();
} else if (config.hasKey(Keys.SMS_AWS_REGION)) {
smsManager = new SnsSmsClient();
}
initEventsModule();
serverManager = new ServerManager();
scheduleManager = new ScheduleManager();
if (config.hasKey(Keys.EVENT_FORWARD_URL)) {
eventForwarder = new EventForwarder();
}
attributesManager = new AttributesManager(dataManager);
driversManager = new DriversManager(dataManager);
commandsManager = new CommandsManager(dataManager, config.getBoolean(Keys.COMMANDS_QUEUEING));
orderManager = new OrderManager(dataManager);
}
Aggregations