diff options
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java index e87d360f2..f2b068568 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -56,6 +56,7 @@ import at.gv.egovernment.moa.id.auth.AuthenticationServer; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils; +import at.gv.egovernment.moa.id.commons.db.StatisticLogDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; import at.gv.egovernment.moa.id.commons.db.dao.config.Contact; @@ -81,6 +82,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.session.AssertionStore; import at.gv.egovernment.moa.id.commons.db.dao.session.AuthenticatedSessionStore; import at.gv.egovernment.moa.id.commons.db.dao.session.OASessionStore; import at.gv.egovernment.moa.id.commons.db.dao.session.OldSSOSessionIDStore; +import at.gv.egovernment.moa.id.commons.db.dao.statistic.StatisticLog; import at.gv.egovernment.moa.id.config.legacy.BuildFromLegacyConfig; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; @@ -272,7 +274,6 @@ public class AuthConfigurationProvider extends ConfigurationProvider { fis = new FileInputStream(propertiesFile); props.load(fis); - //TODO: maybe some general hibnerate config!!! // read MOAID Session Hibernate properties Properties moaSessionProp = new Properties(); for (Object key : props.keySet()) { @@ -292,6 +293,16 @@ public class AuthConfigurationProvider extends ConfigurationProvider { configProp.put(propertyName, props.get(key.toString())); } } + + // read advanced logging properties + Properties statisticProps = new Properties(); + for (Object key : props.keySet()) { + String propPrefix = "advancedlogging."; + if (key.toString().startsWith(propPrefix+"hibernate")) { + String propertyName = key.toString().substring(propPrefix.length()); + statisticProps.put(propertyName, props.get(key.toString())); + } + } // initialize hibernate synchronized (AuthConfigurationProvider.class) { @@ -308,6 +319,16 @@ public class AuthConfigurationProvider extends ConfigurationProvider { config.addProperties(moaSessionProp); MOASessionDBUtils.initHibernate(config, moaSessionProp); + //initial advanced logging + if (isAdvancedLoggingActive()) { + Logger.info("Advanced statistic log is activated, starting initialization process ..."); + Configuration statisticconfig = new Configuration(); + statisticconfig.addAnnotatedClass(StatisticLog.class); + statisticconfig.addProperties(statisticProps); + StatisticLogDBUtils.initHibernate(statisticconfig, statisticProps); + Logger.info("Advanced statistic log is initialized."); + } + } Logger.trace("Hibernate initialization finished."); @@ -864,10 +885,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider { public boolean isIdentityLinkResigning() { String prop = props.getProperty("configuration.resignidentitylink.active", "false"); - if (Boolean.valueOf(prop)) - return true; - else - return false; + return Boolean.valueOf(prop); } public String getIdentityLinkResigningKey() { @@ -880,10 +898,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider { public boolean isMonitoringActive() { String prop = props.getProperty("configuration.monitoring.active", "false"); - if (Boolean.valueOf(prop)) - return true; - else - return false; + return Boolean.valueOf(prop); } public String getTestIdentityLinkURL() { @@ -896,10 +911,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider { public boolean isAdvancedLoggingActive() { String prop = props.getProperty("configuration.advancedlogging.active", "false"); - if (Boolean.valueOf(prop)) - return true; - else - return false; + return Boolean.valueOf(prop); } /** |