[java-identity-provider COMMIT] in /trunk: idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAc...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Apr 11 16:10:19 EDT 2013
Author: scantor
Date: Thu Apr 11 16:10:19 2013
New Revision: 4401
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4401&view=rev
Log:
Better linkage between IdP and OpenSAML action base classes.
Added:
trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/
trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/SpringRequestContext.java (with props)
trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/context/package-info.java (with props)
Modified:
trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java
trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/impl/WebFlowProfileActionAdaptor.java
Modified: trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java?rev=4401&r1=4400&r2=4401&view=diff
==============================================================================
--- trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java (original)
+++ trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java Thu Apr 11 16:10:19 2013
@@ -22,16 +22,16 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import net.shibboleth.idp.profile.context.SpringRequestContext;
import net.shibboleth.idp.profile.navigate.WebflowRequestContextHttpServletRequestLookup;
import net.shibboleth.idp.profile.navigate.WebflowRequestContextHttpServletResponseLookup;
import net.shibboleth.idp.profile.navigate.WebflowRequestContextProfileRequestContextLookup;
-import net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
-import net.shibboleth.utilities.java.support.component.ComponentValidationException;
-import net.shibboleth.utilities.java.support.component.ValidatableComponent;
import net.shibboleth.utilities.java.support.logic.Constraint;
import org.opensaml.profile.ProfileException;
+import org.opensaml.profile.action.ProfileAction;
+import org.opensaml.profile.context.EventContext;
import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
@@ -62,7 +62,7 @@
*/
@ThreadSafe
public abstract class AbstractProfileAction<InboundMessageType, OutboundMessageType> extends
- AbstractIdentifiableInitializableComponent implements ValidatableComponent, Action {
+ org.opensaml.profile.action.AbstractProfileAction<InboundMessageType, OutboundMessageType> implements Action {
/** Class logger. */
private final Logger log = LoggerFactory.getLogger(AbstractProfileAction.class);
@@ -94,11 +94,6 @@
profileContextLookupStrategy = new WebflowRequestContextProfileRequestContextLookup();
}
- /** {@inheritDoc} */
- public synchronized void setId(String componentId) {
- super.setId(componentId);
- }
-
/**
* Gets the strategy used to lookup the {@link HttpServletRequest} from a given WebFlow {@link RequestContext}.
*
@@ -171,10 +166,7 @@
/** {@inheritDoc} */
@Nonnull public Event execute(@Nonnull final RequestContext springRequestContext) throws ProfileException {
ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
-
- // we assume Spring set up its request context properly, if we needed to check this we would put a
- // checking action anywhere in a flow where a request would be (re-)entering a flow
-
+
final HttpServletRequest httpRequest = httpRequestLookupStrategy.apply(springRequestContext);
final HttpServletResponse httpResponse = httpResponseLookupStrategy.apply(springRequestContext);
@@ -191,24 +183,70 @@
return doExecute(springRequestContext, profileRequestContext);
}
- /** {@inheritDoc} */
- public void validate() throws ComponentValidationException {
- // nothing to do here
- }
-
- /**
- * Performs this action. Default implementation returns a "proceed" event.
- *
- * @param springRequestContext current WebFlow request context
- * @param profileRequestContext the current IdP profile request context
- *
- * @return the result of this action
- *
- * @throws ProfileException thrown if there is a problem executing the profile action
+ /**
+ * Spring-aware actions can override this method to fully control the execution of an Action
+ * by the Web Flow engine.
+ *
+ * <p>Alternatively they may override {@link #doExecute(ProfileRequestContext)} and access
+ * Spring information via a {@link SpringRequestContext} attached to the profile request context.</p>
+ *
+ * <p>The default implementation attaches the Spring Web Flow request context to the profile
[... 117 lines stripped ...]
More information about the commits
mailing list