[java-identity-provider COMMIT] in /trunk: idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDes...

noreply at shibboleth.net noreply at shibboleth.net
Wed Oct 2 20:02:27 EDT 2013


Author: scantor
Date: Wed Oct  2 20:02:27 2013
New Revision: 4817

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4817&view=rev
Log:
Streamline AuthnResult serialization through flow descriptor class.

Modified:
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java
    trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/DefaultAuthenticationResultSerializer.java
    trunk/idp-authn-api/src/test/java/net/shibboleth/idp/authn/DefaultAuthenticationResultSerializerTest.java
    trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedIdPSession.java
    trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java
    trunk/idp-session-impl/src/test/java/net/shibboleth/idp/session/impl/StorageBackedSessionManagerTest.java

Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java?rev=4817&r1=4816&r2=4817&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java Wed Oct  2 20:02:27 2013
@@ -17,6 +17,7 @@
 
 package net.shibboleth.idp.authn;
 
+import java.io.IOException;
 import java.security.Principal;
 import java.util.Collection;
 import java.util.Set;
@@ -32,6 +33,7 @@
 import com.google.common.collect.Collections2;
 
 import net.shibboleth.utilities.java.support.annotation.Duration;
+import net.shibboleth.utilities.java.support.annotation.constraint.NonNegative;
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
@@ -47,10 +49,14 @@
  * directly exposed as properties of the flow, and others can be found by examining the list
  * of extended {@link Principal}s that the flow exposes.</p>
  */
-public class AuthenticationFlowDescriptor implements IdentifiableComponent, PrincipalSupportingComponent {
-
+public class AuthenticationFlowDescriptor implements IdentifiableComponent, PrincipalSupportingComponent,
+        StorageSerializer<AuthenticationResult> {
+
+    /** Default serializer for result objects. */
+    private static final StorageSerializer<AuthenticationResult> DEFAULT_SERIALIZER;
+    
     /** The unique identifier of the authentication flow. */
-    private final String flowId;
+    @Nonnull @NotEmpty private final String flowId;
 
     /** Whether this flow supports passive authentication. */
     private boolean supportsPassive;
@@ -59,10 +65,10 @@
     private boolean supportsForced;
 
     /** Maximum amount of time in milliseconds, since first usage, a flow should be considered active. */
-    @Duration private long lifetime;
+    @Duration @NonNegative private long lifetime;
     
     /** Maximum amount of time in milliseconds, since last usage, a flow should be considered active. */
-    @Duration private long inactivityTimeout;
+    @Duration @NonNegative private long inactivityTimeout;
     
     /**
      * Supported principals, indexed by type, that the flow can produce.
@@ -131,7 +137,7 @@
      * 
      * @return maximum amount of time in milliseconds a flow should be considered active, never less than 0
      */
-    public long getLifetime() {
+    @NonNegative public long getLifetime() {
         return lifetime;
     }
 
@@ -141,7 +147,7 @@
      * 
      * @param flowLifetime the lifetime for the flow, must be 0 or greater
      */
-    public void setLifetime(@Duration final long flowLifetime) {
+    public void setLifetime(@Duration @NonNegative final long flowLifetime) {
         lifetime = Constraint.isGreaterThanOrEqual(0, flowLifetime, "Lifetime must be greater than or equal to 0");
     }
 
@@ -151,7 +157,7 @@
      * 
      * @return the duration.
      */
-    public long getInactivityTimeout() {
+    @NonNegative public long getInactivityTimeout() {
         return inactivityTimeout;
     }
 
@@ -161,7 +167,7 @@
      * 
      * @param timeout the flow inactivity timeout, must be 0 or greater
      */
-    public void setInactivityTimeout(@Duration final long timeout) {
+    public void setInactivityTimeout(@Duration @NonNegative final long timeout) {
         inactivityTimeout = Constraint.isGreaterThanOrEqual(0, timeout,
                 "Inactivity timeout must be greater than or equal to 0");
     }
@@ -217,25 +223,40 @@
         supportedPrincipals.getPrincipals().clear();
         supportedPrincipals.getPrincipals().addAll(Collections2.filter(principals, Predicates.notNull()));
     }
-   
-    /**
-     * Get the custom serializer for results produced by this flow.
-     * 
-     * @return the custom serializer, or null
-     */

[... 239 lines stripped ...]


More information about the commits mailing list