[java-opensaml COMMIT] in /trunk: opensaml-profile-api/src/main/java/org/opensaml/profile/action/AbstractProfileActio...

noreply at shibboleth.net noreply at shibboleth.net
Thu Apr 24 16:59:51 EDT 2014


Author: scantor
Date: Thu Apr 24 16:59:51 2014
New Revision: 3818

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3818&view=rev
Log:
Alter contract such that successful events return no event, and refactor flows to take advantage.

Modified:
    trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/AbstractProfileAction.java
    trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/ActionSupport.java
    trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/ProfileAction.java
    trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/context/ErrorEventContext.java
    trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/SavePreviousEventAsError.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/impl/CheckErrorHandlingStrategy.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/profile/impl/AddStatusToResponse.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddStatusToResponse.java
    trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/common/profile/impl/CheckErrorHandlingStrategyTest.java

Modified: trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/AbstractProfileAction.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/AbstractProfileAction.java?rev=3818&r1=3817&r2=3818&view=diff
==============================================================================
--- trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/AbstractProfileAction.java (original)
+++ trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/AbstractProfileAction.java Thu Apr 24 16:59:51 2014
@@ -97,14 +97,12 @@
             @Nonnull final ProfileRequestContext<InboundMessageType, OutboundMessageType> profileRequestContext) {
 
         // Clear any existing EventContext that might be hanging around, and if it exists,
-        // copy the Event to a PreviousEventContext.
+        // copy the Event to a PreviousEventContext. Don't clear any existing PreviousEventContext
+        // because it may be from an earlier error of interest to other actions.
         EventContext previousEvent = profileRequestContext.getSubcontext(EventContext.class, false);
         if (previousEvent != null) {
             profileRequestContext.getSubcontext(PreviousEventContext.class, true).setEvent(previousEvent.getEvent());
             profileRequestContext.removeSubcontext(EventContext.class);
-        } else {
-            // If there's no previous event, don't expose one.
-            profileRequestContext.removeSubcontext(PreviousEventContext.class);
         }
 
         // The try/catch logic is designed to suppress a checked exception raised by

Modified: trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/ActionSupport.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/ActionSupport.java?rev=3818&r1=3817&r2=3818&view=diff
==============================================================================
--- trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/ActionSupport.java (original)
+++ trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/ActionSupport.java Thu Apr 24 16:59:51 2014
@@ -34,12 +34,12 @@
     }
 
     /**
-     * Builds a {@link EventIds#PROCEED_EVENT_ID} {@link EventContext} with no related attributes.
+     * Signals a successful outcome by an action.
      * 
      * @param profileRequestContext the context to carry the event
      */
     public static void buildProceedEvent(@Nonnull final ProfileRequestContext profileRequestContext) {
-        buildEvent(profileRequestContext, EventIds.PROCEED_EVENT_ID);
+        profileRequestContext.removeSubcontext(EventContext.class);
     }
 
     /**

Modified: trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/ProfileAction.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/ProfileAction.java?rev=3818&r1=3817&r2=3818&view=diff
==============================================================================
--- trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/ProfileAction.java (original)
+++ trunk/opensaml-profile-api/src/main/java/org/opensaml/profile/action/ProfileAction.java Thu Apr 24 16:59:51 2014
@@ -28,7 +28,7 @@
  * 
  * <p>Actions are expected to interact with the environment, access data,
  * and produce results using the context tree provided at execution time.
- * They signal state transitions by attaching an {@link org.opensaml.profile.context.EventContext}
+ * They signal unusual state transitions by attaching an {@link org.opensaml.profile.context.EventContext}
  * to the tree.</p>
  * 
  * <p>Actions may be stateful or stateless, and are therefore not inherently thread-safe.</p>


[... 173 lines stripped ...]


More information about the commits mailing list