From 71da4a9bc7e2ff79b2fb4cf8903d15fd75372859 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 19 Jul 2013 11:50:19 +0200 Subject: SSO and Configuration updated TODO: --PVP2 from configuration --UseIFrame for OAs --SSO with mandates --Resign IdentityLink --Encrypted MOASession in Database --- .../moa/id/commons/db/ConfigurationDBRead.java | 2 +- .../moa/id/commons/db/ConfigurationDBUtils.java | 14 ++++----- .../src/main/resources/config/moaid_config_2.0.xsd | 36 ++++++++++++---------- 3 files changed, 28 insertions(+), 24 deletions(-) (limited to 'id/server/moa-id-commons/src') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java index 8970a82aa..7a6efc5ac 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java @@ -27,7 +27,7 @@ public class ConfigurationDBRead { List result; EntityManager session = ConfigurationDBUtils.getCurrentSession(); - + javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithID")); //query.setParameter("id", id+"%"); query.setParameter("id", id); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java index bc6a0b922..dc0e493d1 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java @@ -8,7 +8,7 @@ import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import org.hibernate.HibernateException; -import org.hibernate.Session; + import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.logging.Logger; @@ -18,7 +18,7 @@ public final class ConfigurationDBUtils { private static EntityManagerFactory entitymanagerfactory; @SuppressWarnings("rawtypes") - private static final ThreadLocal THREAD_LOCAL = new ThreadLocal(); + private static final ThreadLocal THREAD_LOCAL_CONFIG = new ThreadLocal(); private static boolean automaticSessionHandling = false; protected ConfigurationDBUtils() { } @@ -69,7 +69,7 @@ public final class ConfigurationDBUtils { return entitymanagerfactory.createEntityManager(); } - EntityManager session = (EntityManager) THREAD_LOCAL.get(); + EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get(); // Open a new Session, if this Thread has none yet if (session == null) { session = getNewSession(); @@ -84,7 +84,7 @@ public final class ConfigurationDBUtils { //return sessionFactory.getCurrentSession(); return entitymanagerfactory.createEntityManager(); } - EntityManager session = (EntityManager) THREAD_LOCAL.get(); + EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get(); if (session != null) { Logger.warn("Previous session has not been closed; closing session now."); closeSession(); @@ -92,7 +92,7 @@ public final class ConfigurationDBUtils { Logger.debug("Opening new hibernate session..."); try { session = entitymanagerfactory.createEntityManager(); - THREAD_LOCAL.set(session); + THREAD_LOCAL_CONFIG.set(session); } catch (HibernateException hex) { Logger.error(hex.getMessage()); } @@ -113,8 +113,8 @@ public final class ConfigurationDBUtils { return; } Logger.debug("Closing current hibernate session..."); - Session session = (Session) THREAD_LOCAL.get(); - THREAD_LOCAL.set(null); + EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get(); + THREAD_LOCAL_CONFIG.set(null); if (session != null) { try { session.close(); diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index e7ca2d0dd..b7982aca5 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -329,10 +329,13 @@ - + - - + + + + + @@ -538,14 +541,7 @@ - - - - - - - - + @@ -896,11 +892,11 @@ - - - - - + + + + + @@ -933,4 +929,12 @@ + + + + + + + + -- cgit v1.2.3