aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage
diff options
context:
space:
mode:
authorChristian Maierhofer <cmaierhofer@iaik.tugraz.at>2016-04-28 13:35:55 +0200
committerChristian Maierhofer <cmaierhofer@iaik.tugraz.at>2016-04-28 13:35:55 +0200
commit61661f2ea4978d56691f7a672469c6d43e9dba41 (patch)
tree2ea7048bfffa662ee6b2d04858f00fb1cb6a2fea /id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage
parent6f353de9f09b26440f67f62ba8186ae82f16adb5 (diff)
downloadmoa-id-spss-61661f2ea4978d56691f7a672469c6d43e9dba41.tar.gz
moa-id-spss-61661f2ea4978d56691f7a672469c6d43e9dba41.tar.bz2
moa-id-spss-61661f2ea4978d56691f7a672469c6d43e9dba41.zip
Modifiing MOASessionDBUtils
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java54
1 files changed, 27 insertions, 27 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java
index 094e25040..cb470a7b9 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/DBAuthenticationSessionStoreage.java
@@ -65,7 +65,7 @@ import at.gv.egovernment.moa.util.MiscUtil;
public class DBAuthenticationSessionStoreage implements IAuthenticationSessionStoreage{
@Autowired AuthConfiguration authConfig;
-
+ @Autowired MOASessionDBUtils moaSessionDBUtils;
private static JsonMapper mapper = new JsonMapper();
@Override
@@ -104,7 +104,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
encryptSession(session, dbsession);
//store AssertionStore element to Database
- MOASessionDBUtils.saveOrUpdate(dbsession);
+ moaSessionDBUtils.saveOrUpdate(dbsession);
Logger.info("Create MOASession with sessionID: " + id);
return session;
@@ -166,7 +166,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
dbsession.setAdditionalInformation(
mapper.serialize(sessionExtensions));
- MOASessionDBUtils.saveOrUpdate(dbsession);
+ moaSessionDBUtils.saveOrUpdate(dbsession);
Logger.debug("MOASession with sessionID=" + sessionID + " is stored in Database");
@@ -193,7 +193,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
dbsession.setAuthenticated(session.isAuthenticated());
dbsession.setUpdated(new Date());
- MOASessionDBUtils.saveOrUpdate(dbsession);
+ moaSessionDBUtils.saveOrUpdate(dbsession);
Logger.debug("MOASession with sessionID=" + session.getSessionID() + " is stored in Database");
} catch (MOADatabaseException e) {
@@ -205,7 +205,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
@Override
public void destroySession(String moaSessionID) throws MOADatabaseException {
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List<AuthenticatedSessionStore> result;
Transaction tx = null;
@@ -257,7 +257,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
//set Timestamp in this state, because automated timestamp generation is buggy in Hibernate 4.2.1
dbsession.setUpdated(new Date());
- MOASessionDBUtils.saveOrUpdate(dbsession);
+ moaSessionDBUtils.saveOrUpdate(dbsession);
Logger.trace("Change SessionID complete.");
@@ -281,7 +281,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
try {
session = searchInDatabase(moaSessionID, true);
session.setAuthenticated(isAuthenticated);
- MOASessionDBUtils.saveOrUpdate(session);
+ moaSessionDBUtils.saveOrUpdate(session);
} catch (MOADatabaseException e) {
@@ -293,7 +293,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
public String getMOASessionSSOID(String SSOSessionID) {
MiscUtil.assertNotNull(SSOSessionID, "SSOsessionID");
Logger.trace("Get authenticated session with SSOID " + SSOSessionID + " from database.");
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List<AuthenticatedSessionStore> result;
Transaction tx = null;
@@ -346,7 +346,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
//TODO: is this method really needed??
MiscUtil.assertNotNull(SSOId, "SSOSessionID");
Logger.trace("Get authenticated session with SSOID " + SSOId + " from database.");
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List<AuthenticatedSessionStore> result;
Transaction tx = null;
@@ -387,7 +387,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
try {
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List<AuthenticatedSessionStore> result;
Logger.trace("Add SSO information to session " + moaSessionID);
@@ -495,7 +495,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
AuthenticatedSessionStore dbsession = searchInDatabase(moaSession.getSessionID(), false);
oas.addAll(dbsession.getActiveOAsessions());
- session = MOASessionDBUtils.getCurrentSession();
+ session = moaSessionDBUtils.getCurrentSession();
session.getTransaction().commit();
return oas;
@@ -525,7 +525,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
AuthenticatedSessionStore dbsession = searchInDatabase(moaSession.getSessionID(), false);
idps.addAll(dbsession.getInderfederation());
- session = MOASessionDBUtils.getCurrentSession();
+ session = moaSessionDBUtils.getCurrentSession();
session.getTransaction().commit();
return idps;
@@ -552,7 +552,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
MiscUtil.assertNotNull(userNameID, "userNameID");
Logger.trace("Get moaSession for userNameID " + userNameID + " and OA "
+ oaID + " from database.");
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
Transaction tx = null;
List<AuthenticatedSessionStore> result = null;;
@@ -598,7 +598,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
MiscUtil.assertNotNull(protocolType, "usedProtocol");
Logger.trace("Get active OnlineApplication for sessionID " + moaSession.getSessionID() + " with OAID "
+ oaID + " from database.");
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List<AuthenticatedSessionStore> result;
Transaction tx = null;
@@ -640,7 +640,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
try {
MiscUtil.assertNotNull(nameID, "nameID");
Logger.trace("Get authenticated session with pedingRequestID " + nameID + " from database.");
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List<AuthenticatedSessionStore> result;
@@ -677,7 +677,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
public InterfederationSessionStore searchInterfederatedIDPFORSSOWithMOASession(String sessionID) {
MiscUtil.assertNotNull(sessionID, "MOASession");
Logger.trace("Get interfederated IDP for SSO with sessionID " + sessionID + " from database.");
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List<AuthenticatedSessionStore> result;
Transaction tx = null;
@@ -714,7 +714,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
MiscUtil.assertNotNull(sessionID, "MOASession");
MiscUtil.assertNotNull(idpID, "Interfederated IDP ID");
Logger.trace("Get interfederated IDP "+ idpID + " for SSO with sessionID " + sessionID + " from database.");
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List<AuthenticatedSessionStore> result;
Transaction tx = null;
@@ -818,7 +818,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
//store AssertionStore element to Database
try {
- MOASessionDBUtils.saveOrUpdate(dbsession);
+ moaSessionDBUtils.saveOrUpdate(dbsession);
} catch (MOADatabaseException e) {
Logger.warn("MOASession could not be created.");
@@ -831,7 +831,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
public InterfederationSessionStore searchInterfederatedIDPFORAttributeQueryWithSessionID(String moaSessionID) {
MiscUtil.assertNotNull(moaSessionID, "MOASessionID");
Logger.trace("Get interfederated IDP for AttributeQuery with sessionID " + moaSessionID + " from database.");
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List<AuthenticatedSessionStore> result;
Transaction tx = null;
@@ -872,7 +872,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
MiscUtil.assertNotNull(pedingRequestID, "pedingRequestID");
Logger.trace("Get authenticated session with pedingRequestID " + pedingRequestID + " from database.");
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List<AuthenticatedSessionStore> result;
@@ -907,7 +907,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
}
}
- MOASessionDBUtils.saveOrUpdate(authsession);
+ moaSessionDBUtils.saveOrUpdate(authsession);
return true;
} catch (Throwable e) {
@@ -922,7 +922,7 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
Date expioredateupdate = new Date(now.getTime() - authDataTimeOutUpdated);
List<AuthenticatedSessionStore> results;
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
Transaction tx = null;
try {
synchronized (session) {
@@ -972,26 +972,26 @@ public class DBAuthenticationSessionStoreage implements IAuthenticationSessionSt
}
- private static void cleanDelete(AuthenticatedSessionStore result) {
+ private void cleanDelete(AuthenticatedSessionStore result) {
try {
result.setSession("blank".getBytes());
- MOASessionDBUtils.saveOrUpdate(result);
+ moaSessionDBUtils.saveOrUpdate(result);
} catch (MOADatabaseException e) {
Logger.warn("Blank authenticated session with sessionID=" + result.getSessionid() + " FAILED.", e);
} finally {
- if (!MOASessionDBUtils.delete(result))
+ if (!moaSessionDBUtils.delete(result))
Logger.error("Authenticated session with sessionID=" + result.getSessionid() + " not removed! (Error during Database communication)");
}
}
@SuppressWarnings("rawtypes")
- private static AuthenticatedSessionStore searchInDatabase(String sessionID, boolean commit) throws MOADatabaseException {
+ private AuthenticatedSessionStore searchInDatabase(String sessionID, boolean commit) throws MOADatabaseException {
MiscUtil.assertNotNull(sessionID, "moasessionID");
Logger.trace("Get authenticated session with sessionID " + sessionID + " from database.");
- Session session = MOASessionDBUtils.getCurrentSession();
+ Session session = moaSessionDBUtils.getCurrentSession();
List result;
Transaction tx = null;