[java-identity-provider COMMIT] in /trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session: AuthenticationEvent...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Aug 24 17:09:50 BST 2011
Author: lajoie
Date: Wed Aug 24 17:09:49 2011
New Revision: 4032
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4032&view=rev
Log:
rework and lock down session APIs
Removed:
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session/BasicSessionFactory.java
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session/SessionFactory.java
Modified:
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session/AuthenticationEvent.java
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session/IdPSession.java
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session/IdPSessionSubcontext.java
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session/ServiceSession.java
Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session/AuthenticationEvent.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session/AuthenticationEvent.java?rev=4032&r1=4031&r2=4032&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session/AuthenticationEvent.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/session/AuthenticationEvent.java Wed Aug 24 17:09:49 2011
@@ -19,54 +19,43 @@
import java.security.Principal;
+import net.jcip.annotations.ThreadSafe;
+
import org.opensaml.messaging.context.AbstractSubcontextContainer;
import org.opensaml.util.Assert;
import org.opensaml.util.ObjectSupport;
import org.opensaml.util.StringSupport;
-/**
- * Describes an authentication event that took place within the scope of an {@link IdPSession}.
- *
- * Properties of this object <strong>must not</strong> be modifiable directly. Instead, use the modification methods
- * available via the {@link SessionStore} that created the associate {@link IdPSession}.
- */
-public class AuthenticationEvent extends AbstractSubcontextContainer {
-
- /** Service for which the principal was authenticated. */
- private String serviceId;
+/** Describes an authentication event that took place within the scope of an {@link IdPSession}. */
+ at ThreadSafe
+public final class AuthenticationEvent extends AbstractSubcontextContainer {
/** The principal established by the authentication event. */
- private Principal principal;
+ private Principal authenticatedPrincipal;
/** The identifier of the method used to authenticate the principal. */
- private String authnMethod;
+ private String authenticationWorkflow;
/** The time, in milliseconds since the epoch, that the authentication completed. */
- private long autnInstant;
+ private long authenticationInstant;
+
+ /** The last activity instant, in milliseconds since the epoch, for this event. */
+ private long lastActivityInstant;
/**
- * Time, in milliseconds since the epoch, when this authentication method expires. A value of 0 or less indicates
- * the authentication method does not have an absolute expiration instant.
+ * Constructor. Initializes authentication instant time to the current time.
+ *
+ * @param workflow the workflow used to authenticate the principal, can not be null or empty
+ * @param principal the principal that was authenticated, can not be null
*/
- private long expirationInstant;
+ public AuthenticationEvent(String workflow, Principal principal) {
+ authenticationWorkflow = StringSupport.trimOrNull(workflow);
+ Assert.isNotNull(authenticationWorkflow, "Authentication method can not be null nor empty");
- /**
- * Gets the identifier of the service for which the principal was authenticated.
- *
- * @return identifier of the service for which the principal was authenticated
- */
- public String getServiceId() {
- return serviceId;
- }
+ Assert.isNotNull(principal, "Authenticationed princpal can not be null");
+ authenticatedPrincipal = principal;
- /**
- * Sets the identifier of the service for which the principal was authenticated.
- *
- * @param id identifier of the service for which the principal was authenticated, may not be null or empty
- */
- protected void setServiceId(String id) {
- serviceId = StringSupport.trimOrNull(id);
- Assert.isNotNull(serviceId, "Service ID can not be null or empty");
+ authenticationInstant = System.currentTimeMillis();
}
/**
@@ -75,37 +64,16 @@
* @return principal established by the authentication event, never null
*/
public Principal getPrincipal() {
- return principal;
+ return authenticatedPrincipal;
}
/**
- * Sets the principal established by the authentication event.
+ * Gets the workflow used to authenticate the principal.
*
- * @param authenticationPrincipal principal established by the authentication event, never null
+ * @return workflow used to authenticate the principal, never null
*/
[... 835 lines stripped ...]
More information about the commits
mailing list