use of de.symeda.sormas.api.externaljournal.SymptomJournalConfig in project SORMAS-Project by hzi-braunschweig.
the class ConfigFacadeEjb method getSymptomJournalConfig.
@Override
public SymptomJournalConfig getSymptomJournalConfig() {
SymptomJournalConfig config = new SymptomJournalConfig();
config.setUrl(getProperty(INTERFACE_SYMPTOM_JOURNAL_URL, null));
config.setAuthUrl(getProperty(INTERFACE_SYMPTOM_JOURNAL_AUTH_URL, null));
config.setClientId(getProperty(INTERFACE_SYMPTOM_JOURNAL_CLIENT_ID, null));
config.setSecret(getProperty(INTERFACE_SYMPTOM_JOURNAL_SECRET, null));
UserConfig userConfig = new UserConfig();
userConfig.setUsername(getProperty(INTERFACE_SYMPTOM_JOURNAL_DEFAULT_USER_USERNAME, null));
userConfig.setPassword(getProperty(INTERFACE_SYMPTOM_JOURNAL_DEFAULT_USER_PASSWORD, null));
if (StringUtils.isNoneBlank(userConfig.getUsername(), userConfig.getPassword())) {
config.setDefaultUser(userConfig);
}
return config;
}
use of de.symeda.sormas.api.externaljournal.SymptomJournalConfig in project SORMAS-Project by hzi-braunschweig.
the class StartupShutdownService method createOrUpdateSymptomJournalUser.
private void createOrUpdateSymptomJournalUser() {
SymptomJournalConfig symptomJournalConfig = configFacade.getSymptomJournalConfig();
UserConfig userConfig = symptomJournalConfig.getDefaultUser();
if (userConfig == null) {
logger.debug("Symptom journal default user not configured");
return;
}
createOrUpdateDefaultUser(new HashSet<>(Arrays.asList(UserRole.REST_USER, UserRole.REST_EXTERNAL_VISITS_USER)), userConfig.getUsername(), userConfig.getPassword(), "Symptom", "Journal");
}
Aggregations