From 1dbab6b07a8996a7f291e0ddc4b02c0d3e15a64d Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 26 Sep 2013 11:32:21 +0200 Subject: -- add AssertionID to Single LogOut session information -- split hibernate configuration into two files (moasession and statistic) --- .../moa/id/commons/db/MOASessionDBUtils.java | 2 +- .../moa/id/commons/db/StatisticLogDBUtils.java | 2 +- .../db/dao/session/AuthenticatedSessionStore.java | 1 + .../id/commons/db/dao/session/OASessionStore.java | 21 +++++++++++++++++++-- .../src/main/resources/config/hibernate.cfg.xml | 14 -------------- .../resources/config/hibernate_moasession.cfg.xml | 14 ++++++++++++++ .../resources/config/hibernate_statistic.cfg.xml | 11 +++++++++++ 7 files changed, 47 insertions(+), 18 deletions(-) delete mode 100644 id/server/moa-id-commons/src/main/resources/config/hibernate.cfg.xml create mode 100644 id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml create mode 100644 id/server/moa-id-commons/src/main/resources/config/hibernate_statistic.cfg.xml (limited to 'id/server/moa-id-commons/src/main') 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 057ccdef7..2d7d21989 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 @@ -44,7 +44,7 @@ public final class MOASessionDBUtils { //Create the SessionFactory Logger.debug("Creating initial MOASession session factory..."); - config.configure(); + config.configure("hibernate_moasession.cfg.xml"); serviceRegistry = new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry(); sessionFactory = config.buildSessionFactory(serviceRegistry); Logger.debug("Initial MOASession session factory successfully created."); 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 b60075788..537f1ca79 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 @@ -44,7 +44,7 @@ public final class StatisticLogDBUtils { //Create the SessionFactory Logger.debug("Creating initial StatisicLogger session factory..."); - config.configure(); + config.configure("hibernate_statistic.cfg.xml"); serviceRegistry = new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry(); sessionFactory = config.buildSessionFactory(serviceRegistry); Logger.debug("Initial StatisicLogger session factory successfully created."); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java index ed865d70f..3c48efc7b 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java @@ -20,6 +20,7 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; +import javax.persistence.Transient; import org.hibernate.annotations.DynamicUpdate; diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/OASessionStore.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/OASessionStore.java index 3872397f7..2d3fdb665 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/OASessionStore.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/OASessionStore.java @@ -31,6 +31,9 @@ public class OASessionStore implements Serializable{ @Column(name = "oaurlprefix", unique=false, nullable=false) private String oaurlprefix; + @Column(name = "assertionSessionID", unique=false, nullable=true) + private String assertionSessionID; + @Column(name = "created", updatable=false, nullable=false) // @Temporal(TemporalType.TIMESTAMP) private Date created; @@ -75,8 +78,22 @@ public class OASessionStore implements Serializable{ public void setCreated(Date created) { this.created = created; } - - + /** + * @return the assertionSessionID + */ + public String getAssertionSessionID() { + return assertionSessionID; + } + + /** + * @param assertionSessionID the assertionSessionID to set + */ + public void setAssertionSessionID(String assertionSessionID) { + this.assertionSessionID = assertionSessionID; + } + + + } diff --git a/id/server/moa-id-commons/src/main/resources/config/hibernate.cfg.xml b/id/server/moa-id-commons/src/main/resources/config/hibernate.cfg.xml deleted file mode 100644 index 4841481b6..000000000 --- a/id/server/moa-id-commons/src/main/resources/config/hibernate.cfg.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml b/id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml new file mode 100644 index 000000000..4841481b6 --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/resources/config/hibernate_statistic.cfg.xml b/id/server/moa-id-commons/src/main/resources/config/hibernate_statistic.cfg.xml new file mode 100644 index 000000000..aa77a9c67 --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/config/hibernate_statistic.cfg.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file -- cgit v1.2.3