aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorChristian Maierhofer <cmaierhofer@iaik.tugraz.at>2016-06-29 11:18:55 +0200
committerChristian Maierhofer <cmaierhofer@iaik.tugraz.at>2016-06-29 11:18:55 +0200
commit7ef57c3ceb296f06aa76ba3e6d3499b3a2772aff (patch)
treed39951674642c0e2381dfa36084ae9e412440e05 /id
parentad156aaec0e4e8cd97a6eee6aa96e9d5700d0b4f (diff)
downloadmoa-id-spss-7ef57c3ceb296f06aa76ba3e6d3499b3a2772aff.tar.gz
moa-id-spss-7ef57c3ceb296f06aa76ba3e6d3499b3a2772aff.tar.bz2
moa-id-spss-7ef57c3ceb296f06aa76ba3e6d3499b3a2772aff.zip
using annotations for hibernate configuration now
Diffstat (limited to 'id')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java1
-rw-r--r--id/server/idserverlib/src/main/resources/session.common.beans.xml22
-rw-r--r--id/server/idserverlib/src/main/resources/session.db.beans.xml20
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOASessionDBUtils.java2
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/StatisticLogDBUtils.java6
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java2
-rw-r--r--id/server/moa-id-commons/src/main/resources/statistic.logging.beans.xml12
-rw-r--r--id/server/modules/moa-id-module-openID/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/json/OAuth20SignatureUtil.java4
-rw-r--r--id/server/modules/moa-id-module-openID/src/test/java/test/at/gv/egovernment/moa/id/auth/oauth/CertTest.java4
9 files changed, 37 insertions, 36 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java
index d15d80efc..34bdd350b 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java
@@ -62,7 +62,6 @@ import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.MiscUtil;
@Service("StatisticLogger")
-@Profile("advancedLogOn")
public class StatisticLogger implements IStatisticLogger{
private static final String GENERIC_LOCALBKU = ":3496/https-security-layer-request";
diff --git a/id/server/idserverlib/src/main/resources/session.common.beans.xml b/id/server/idserverlib/src/main/resources/session.common.beans.xml
index e63e87ae1..defa47ec0 100644
--- a/id/server/idserverlib/src/main/resources/session.common.beans.xml
+++ b/id/server/idserverlib/src/main/resources/session.common.beans.xml
@@ -33,7 +33,7 @@
<property name="validationQuery" value="${moasession.dbcp.validationQuery}" />
</bean>
- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
+ <bean id="sessionSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="sessionDataSource"/>
<property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db.dao.session" />
<property name="hibernateProperties">
@@ -48,9 +48,27 @@
</property>
</bean>
+ <!-- MYSQL Conector -->
+ <tx:annotation-driven transaction-manager="sessionTransactionManager"/>
+
+ <bean id="sessionJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+ <property name="showSql" value="${moasession.hibernate.show_sql}" />
+ <property name="generateDdl" value="${moasession.jpaVendorAdapter.generateDdl}" />
+ <property name="databasePlatform" value="${moasession.hibernate.dialect}" />
+ </bean>
+
+ <bean name="session" id="session" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" depends-on="sessionDataSource">
+ <property name="dataSource" ref="sessionDataSource" />
+ <property name="jpaVendorAdapter" ref="sessionJpaVendorAdapter" />
+ <property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db.dao.session" />
+ <property name="persistenceUnitName" value="session" />
+ </bean>
+
+ <bean name="sessionTransactionManager" id="sessionTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+ <property name="entityManagerFactory" ref="session" />
+ </bean>
<bean id="moaSessionDBUtils" class="at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils">
</bean>
-
</beans> \ No newline at end of file
diff --git a/id/server/idserverlib/src/main/resources/session.db.beans.xml b/id/server/idserverlib/src/main/resources/session.db.beans.xml
index 47aa9fde9..5ed390ffe 100644
--- a/id/server/idserverlib/src/main/resources/session.db.beans.xml
+++ b/id/server/idserverlib/src/main/resources/session.db.beans.xml
@@ -17,24 +17,4 @@
class="at.gv.egovernment.moa.id.storage.DBTransactionStorage"
/>
- <!-- MYSQL Conector -->
- <tx:annotation-driven transaction-manager="sessionTransactionManager"/>
-
- <bean id="sessionJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
- <property name="showSql" value="${moasession.hibernate.show_sql}" />
- <property name="generateDdl" value="${moasession.jpaVendorAdapter.generateDdl}" />
- <property name="databasePlatform" value="${moasession.hibernate.dialect}" />
- </bean>
-
- <bean name="session" id="session" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" depends-on="sessionDataSource">
- <property name="dataSource" ref="sessionDataSource" />
- <property name="jpaVendorAdapter" ref="sessionJpaVendorAdapter" />
- <property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db.dao.session" />
- <property name="persistenceUnitName" value="session" />
- </bean>
-
- <bean name="sessionTransactionManager" id="sessionTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
- <property name="entityManagerFactory" ref="session" />
- </bean>
-
</beans> \ No newline at end of file
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOASessionDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOASessionDBUtils.java
index a3d833f62..5cdd607ac 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOASessionDBUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOASessionDBUtils.java
@@ -30,6 +30,7 @@ import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@@ -43,6 +44,7 @@ public class MOASessionDBUtils {
private SessionFactory sessionFactory;
@Autowired
+ @Qualifier("sessionSessionFactory")
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/StatisticLogDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/StatisticLogDBUtils.java
index f8ea1c8f6..51bb0eb6d 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/StatisticLogDBUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/StatisticLogDBUtils.java
@@ -29,6 +29,7 @@ import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.transaction.annotation.Transactional;
import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
@@ -36,11 +37,12 @@ import at.gv.egovernment.moa.logging.Logger;
@Transactional("statisticLogTransactionManager")
public class StatisticLogDBUtils {
-
+
private SessionFactory sessionFactory;
@Autowired
- public void setSessionFactory(SessionFactory sessionFactory) {
+ @Qualifier("statisticLogSessionFactory")
+ public void setstatisticLogSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java
index 97f26812f..ba48f8caf 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/statistic/StatisticLog.java
@@ -39,7 +39,7 @@ import org.hibernate.annotations.DynamicUpdate;
@Entity
-@DynamicUpdate(value=true)
+//@DynamicUpdate(value=true)
@Table(name = "statisticlog")
@NamedQueries({
@NamedQuery(name="getAllEntriesNotBeforeTimeStamp", query = "select statisiclog from StatisticLog statisiclog where statisiclog.timestamp > :timeout")
diff --git a/id/server/moa-id-commons/src/main/resources/statistic.logging.beans.xml b/id/server/moa-id-commons/src/main/resources/statistic.logging.beans.xml
index fc8edf44e..5f80c6439 100644
--- a/id/server/moa-id-commons/src/main/resources/statistic.logging.beans.xml
+++ b/id/server/moa-id-commons/src/main/resources/statistic.logging.beans.xml
@@ -11,8 +11,8 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
- <context:annotation-config/>
-
+ <context:annotation-config></context:annotation-config>
+ <tx:annotation-driven transaction-manager="statisticLogTransactionManager"/>
<bean id="statisticLogDataSource" class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true" destroy-method="close">
<aop:scoped-proxy/>
@@ -35,7 +35,9 @@
<bean id="statisticLogSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="statisticLogDataSource"/>
+ <property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db.dao.statistic" />
<property name="hibernateProperties">
+
<props>
<prop key="hibernate.dialect">${advancedlogging.hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${advancedlogging.hibernate.show_sql}</prop>
@@ -52,7 +54,7 @@
</bean>
<bean name="statisticLogTransactionManager" id="statisticLogTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
- <property name="entityManagerFactory" ref="statisticEntityManagerFactory" />
+ <property name="entityManagerFactory" ref="statistic" />
</bean>
<bean id="statisticJpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
@@ -61,13 +63,13 @@
<property name="databasePlatform" value="${advancedlogging.hibernate.dialect}" />
</bean>
- <bean name="statisticLog" id="statisticEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+ <bean name="statistic" id="statistic" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="statisticLogDataSource" />
<property name="jpaVendorAdapter" ref="statisticJpaVendorAdapter" />
<property name="packagesToScan" value="at.gv.egovernment.moa.id.commons.db.dao.statistic" />
<property name="persistenceUnitName" value="statistic" />
</bean>
- <tx:annotation-driven transaction-manager="statisticLogTransactionManager"/>
+
</beans> \ No newline at end of file
diff --git a/id/server/modules/moa-id-module-openID/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/json/OAuth20SignatureUtil.java b/id/server/modules/moa-id-module-openID/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/json/OAuth20SignatureUtil.java
index 9f20ee956..cd7b8312d 100644
--- a/id/server/modules/moa-id-module-openID/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/json/OAuth20SignatureUtil.java
+++ b/id/server/modules/moa-id-module-openID/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/json/OAuth20SignatureUtil.java
@@ -54,7 +54,7 @@ public final class OAuth20SignatureUtil {
} else if (key instanceof ECPrivateKey) {
Logger.debug("OAuth - going to uses SHA256withECDSA signature");
return OAuthSignatureAlgorithm.ECDSA256;
- } else if (key instanceof iaik.security.ecc.ecdsa.ECPrivateKey) {
+ } else if (key instanceof iaik.security.ec.common.ECPrivateKey) {
Logger.debug("OAuth - going to uses SHA256withECDSA signature with iaik");
return OAuthSignatureAlgorithm.ECDSA256_IAKIK;
} else {
@@ -69,7 +69,7 @@ public final class OAuth20SignatureUtil {
} else if (key instanceof ECPublicKey) {
Logger.debug("OAuth - going to uses SHA256withECDSA signature");
return OAuthSignatureAlgorithm.ECDSA256;
- } else if (key instanceof iaik.security.ecc.ecdsa.ECPublicKey) {
+ } else if (key instanceof iaik.security.ec.common.ECPublicKey) {
Logger.debug("OAuth - going to uses SHA256withECDSA signature with iaik");
return OAuthSignatureAlgorithm.ECDSA256_IAKIK;
} else {
diff --git a/id/server/modules/moa-id-module-openID/src/test/java/test/at/gv/egovernment/moa/id/auth/oauth/CertTest.java b/id/server/modules/moa-id-module-openID/src/test/java/test/at/gv/egovernment/moa/id/auth/oauth/CertTest.java
index 6cf1e8280..22c98b152 100644
--- a/id/server/modules/moa-id-module-openID/src/test/java/test/at/gv/egovernment/moa/id/auth/oauth/CertTest.java
+++ b/id/server/modules/moa-id-module-openID/src/test/java/test/at/gv/egovernment/moa/id/auth/oauth/CertTest.java
@@ -22,8 +22,6 @@
*******************************************************************************/
package test.at.gv.egovernment.moa.id.auth.oauth;
-import iaik.security.ecc.provider.ECCProvider;
-
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
@@ -122,7 +120,7 @@ public class CertTest {
@Test
public void testECDSA() throws Exception {
- ECCProvider.addAsProvider();
+ //ECCProvider.addAsProvider();
// Security.addProvider(new ECCProvider());
BasicX509Credential credential = this.getCredentials(this.ecdsaKeyStorePath);