aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java119
1 files changed, 99 insertions, 20 deletions
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 af5950c98..6333451b9 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
@@ -31,14 +31,11 @@ import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
-import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;
import javax.persistence.Temporal;
@@ -68,7 +65,7 @@ public class AuthenticatedSessionStore implements Serializable{
private static final long serialVersionUID = 1L;
@Id
- @GeneratedValue(strategy = GenerationType.AUTO)
+ //@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id", unique=true, nullable=false)
private long id;
@@ -130,46 +127,115 @@ public class AuthenticatedSessionStore implements Serializable{
this.id = id;
}
+ /**
+ * Get the internal ID of this MOASession
+ *
+ * @return moaSessionID, but never null
+ */
public String getSessionid() {
return sessionid;
+
}
+ /**
+ * Set the internal ID of this MOASession.
+ *
+ * @param sessionid The internal ID of this MOASession, but never null
+ **/
public void setSessionid(String sessionid) {
this.sessionid = sessionid;
}
+ /**
+ * Get the Single Sign-On SessionID of this MOASession
+ *
+ * @return SSO SessionID
+ */
public String getSSOsessionid() {
return SSOsessionid;
}
+ /**
+ * Set the Single Sign-On SessionID for this MOASession
+ *
+ * @param sSOsessionid SSO SessionID
+ */
public void setSSOsessionid(String sSOsessionid) {
SSOsessionid = sSOsessionid;
}
+ /**
+ * Get the serialized (and encrypted) AuthenticatedData DAO, which contains the user
+ * identification and authentication information.
+ *
+ * @return serialized (and encryped) authenticationData, but never null
+ */
public byte[] getSession() {
return authSession;
}
+ /**
+ * Set the AuthenticationData DAO, as serialized (and encrypted) blob.<br><br>
+ *
+ * <strong>This method should only be used, since MOASesion is not authenticated
+ * <code>this.isAuthenticated() == false</code>. If the MOASession is already authenticated,
+ * the corresponding user authentication data should not be changed any more.</strong>
+ *
+ * @param session the serialized (and encryped) authenticationData
+ */
public void setSession(byte[] session) {
this.authSession = session;
}
+ /**
+ * Indicates this MOASession is already authenticated. <br><br>
+ *
+ * A authenticated MOASession contains all information, which are
+ * needed build protocol specific authentication information.
+ * Therefore, a user has already performed a full identification and
+ * authentication process.
+ *
+ * @return true, if this MOASession is authenticated, otherwise false
+ */
public boolean isAuthenticated() {
return isAuthenticated;
}
+ /**
+ * Mark a MOASession as authenticated. <br><br>
+ *
+ * A MOASession had to be marked as authenticated, if the user
+ * identification and authentication process is completed.
+ *
+ * @param isAuthenticated
+ */
public void setAuthenticated(boolean isAuthenticated) {
this.isAuthenticated = isAuthenticated;
}
+ /**
+ * Indicates this MOASession as a Single Sign-On session
+ *
+ * @return true if it is a SSO session, otherwise false
+ */
public boolean isSSOSession() {
return isSSOSession;
}
+ /**
+ * Mark this MOASession as a Single Sign-On session
+ *
+ * @param isSSOSession true, if this MOASession is a SSO session, otherwise false
+ */
public void setSSOSession(boolean isSSOSession) {
this.isSSOSession = isSSOSession;
}
+ /**
+ * Get a timestamp when this MOASession was created
+ *
+ * @return timestamp
+ */
public Date getCreated() {
return created;
}
@@ -178,6 +244,11 @@ public class AuthenticatedSessionStore implements Serializable{
this.created = created;
}
+ /**
+ * Get a timestamp, when this MOASession was updated last time
+ *
+ * @return timestamp
+ */
public Date getUpdated() {
return updated;
}
@@ -186,6 +257,12 @@ public class AuthenticatedSessionStore implements Serializable{
this.updated = updated;
}
+ /**
+ * Get a List of Service Providers, which has received a authentication information by using
+ * Single Sign-On
+ *
+ * @return
+ */
public List<OASessionStore> getActiveOAsessions() {
return activeOAsessions;
}
@@ -198,6 +275,12 @@ public class AuthenticatedSessionStore implements Serializable{
this.activeOAsessions = activeOAsessions;
}
+ /**
+ * Get a List of old Single Sign-On SessionIDs, which are already used for this MOASession.
+ * Every SSO SessionID can only be used once.
+ *
+ * @return
+ */
public List<OldSSOSessionIDStore> getOldssosessionids() {
return oldssosessionids;
}
@@ -207,6 +290,8 @@ public class AuthenticatedSessionStore implements Serializable{
}
/**
+ * Get a List of federated IDPs which are already used in this Session
+ *
* @return the inderfederation
*/
public List<InterfederationSessionStore> getInderfederation() {
@@ -221,20 +306,8 @@ public class AuthenticatedSessionStore implements Serializable{
}
/**
- * @return the pendingRequestID
- */
- public String getPendingRequestID() {
- return pendingRequestID;
- }
-
- /**
- * @param pendingRequestID the pendingRequestID to set
- */
- public void setPendingRequestID(String pendingRequestID) {
- this.pendingRequestID = pendingRequestID;
- }
-
- /**
+ * Get the initial vector for AuthenticationData encryption
+ *
* @return the iv
*/
public byte[] getIv() {
@@ -242,6 +315,8 @@ public class AuthenticatedSessionStore implements Serializable{
}
/**
+ * Set the inital vector for AuthenticationData encryption
+ *
* @param iv the iv to set
*/
public void setIv(byte[] iv) {
@@ -249,14 +324,18 @@ public class AuthenticatedSessionStore implements Serializable{
}
/**
- * @return the isInterfederatedSSOSession
+ * Indicates this MOASession as an federated session
+ *
+ * @return true if it is a federated session, otherwise false
*/
public boolean isInterfederatedSSOSession() {
return isInterfederatedSSOSession;
}
/**
- * @param isInterfederatedSSOSession the isInterfederatedSSOSession to set
+ * Mark this MOASession as an federated session
+ *
+ * @param isInterfederatedSSOSession true, if this MOASession is a federated session
*/
public void setInterfederatedSSOSession(boolean isInterfederatedSSOSession) {
this.isInterfederatedSSOSession = isInterfederatedSSOSession;