[java-identity-provider COMMIT] /trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/WebFlowMessageH...

noreply at shibboleth.net noreply at shibboleth.net
Tue Apr 15 14:02:08 EDT 2014


Author: scantor
Date: Tue Apr 15 14:02:08 2014
New Revision: 5729

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5729&view=rev
Log:
Rebase message handler adaptor on our base class, fixes event processing.

Modified:
    trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/WebFlowMessageHandlerAdaptor.java

Modified: trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/WebFlowMessageHandlerAdaptor.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/WebFlowMessageHandlerAdaptor.java?rev=5729&r1=5728&r2=5729&view=diff
==============================================================================
--- trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/WebFlowMessageHandlerAdaptor.java (original)
+++ trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/WebFlowMessageHandlerAdaptor.java Tue Apr 15 14:02:08 2014
@@ -20,24 +20,19 @@
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
-import net.shibboleth.idp.profile.ActionSupport;
-import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
-import net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent;
+import net.shibboleth.idp.profile.AbstractProfileAction;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
 import org.opensaml.messaging.context.MessageContext;
 import org.opensaml.messaging.handler.MessageHandler;
 import org.opensaml.messaging.handler.MessageHandlerException;
+import org.opensaml.profile.ProfileException;
+import org.opensaml.profile.action.ActionSupport;
 import org.opensaml.profile.action.EventIds;
-import org.opensaml.profile.context.EventContext;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.webflow.core.collection.AttributeMap;
-import org.springframework.webflow.execution.Action;
-import org.springframework.webflow.execution.Event;
-import org.springframework.webflow.execution.RequestContext;
 
 import com.google.common.base.Function;
 
@@ -66,7 +61,7 @@
  * @event {@link EventIds#INVALID_MSG_CTX}
  */
 public class WebFlowMessageHandlerAdaptor<InboundMessageType, OutboundMessageType> 
-        extends AbstractIdentifiableInitializableComponent implements Action {
+        extends AbstractProfileAction<InboundMessageType, OutboundMessageType> {
     
     /** Used to indicate the target message context for invocation of the adapted message handler. */
     public enum Direction {
@@ -91,9 +86,6 @@
     
     /** The direction of execution for this action instance. */
     private final Direction direction;
-    
-    /** Strategy used to lookup the {@link ProfileRequestContext} from a given WebFlow {@link RequestContext}. */
-    @Nonnull private final Function<RequestContext, ProfileRequestContext> profileContextLookupStrategy;
 
     /**
      * Constructor.
@@ -102,7 +94,6 @@
      */
     private WebFlowMessageHandlerAdaptor(@Nonnull final Direction executionDirection) {
         direction = Constraint.isNotNull(executionDirection, "Execution direction cannot be null");
-        profileContextLookupStrategy = new WebflowRequestContextProfileRequestContextLookup();
     }
     
     /**
@@ -133,22 +124,14 @@
     
     /** {@inheritDoc} */
     @Override
-    public Event execute(RequestContext springRequestContext) throws Exception {
+    public void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) throws ProfileException {
         ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
-        
-        final ProfileRequestContext<InboundMessageType, OutboundMessageType> profileRequestContext =
-                profileContextLookupStrategy.apply(springRequestContext);
-        if (profileRequestContext == null) {
-            log.error("Action {}: Profile request context is not available", getId());
-            return ActionSupport.buildEvent(this, EventIds.INVALID_PROFILE_CTX);
-        
-        }
         
         if (handler == null) {
             handler = handlerLookupStrategy.apply(profileRequestContext);
             if (handler == null) {
-                log.debug("Action {}: No message handler returned by lookup function, nothing to do");
-                return ActionSupport.buildProceedEvent(handler);
+                log.debug("{} No message handler returned by lookup function, nothing to do", getLogPrefix());
+                return;
             }
         }
         
@@ -156,72 +139,35 @@
         switch (direction) {
             case INBOUND:
                 target = profileRequestContext.getInboundMessageContext();
-                log.debug("Action {}: Invoking message handler of type '{}' on INBOUND message context", getId(), 

[... 80 lines stripped ...]


More information about the commits mailing list