[java-identity-provider COMMIT] in /trunk/idp-saml-impl/src: main/java/net/shibboleth/idp/saml/impl/profile/saml1/Add...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Jan 2 15:15:38 EST 2014
Author: scantor
Date: Thu Jan 2 15:15:37 2014
New Revision: 5138
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5138&view=rev
Log:
Refactor action.
Modified:
trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddResponseShell.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/profile/saml1/AddResponseShellTest.java
Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddResponseShell.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddResponseShell.java?rev=5138&r1=5137&r2=5138&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddResponseShell.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/profile/saml1/AddResponseShell.java Thu Jan 2 15:15:37 2014
@@ -18,24 +18,24 @@
package net.shibboleth.idp.saml.impl.profile.saml1;
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
-import net.shibboleth.ext.spring.webflow.Event;
-import net.shibboleth.ext.spring.webflow.Events;
-import net.shibboleth.idp.profile.AbstractProfileAction;
-import net.shibboleth.idp.profile.ActionSupport;
import net.shibboleth.idp.profile.IdPEventIds;
import org.opensaml.profile.ProfileException;
+import org.opensaml.profile.action.AbstractProfileAction;
+import org.opensaml.profile.action.ActionSupport;
+import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import net.shibboleth.idp.profile.config.ProfileConfiguration;
import net.shibboleth.idp.relyingparty.RelyingPartyContext;
-import net.shibboleth.idp.saml.profile.SAMLEventIds;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
import net.shibboleth.utilities.java.support.logic.Constraint;
import org.joda.time.DateTime;
import org.joda.time.chrono.ISOChronology;
+import org.opensaml.core.xml.XMLObjectBuilderFactory;
import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
import org.opensaml.messaging.context.BasicMessageMetadataContext;
import org.opensaml.messaging.context.MessageContext;
@@ -47,50 +47,42 @@
import org.opensaml.saml.saml1.core.StatusCode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.webflow.execution.RequestContext;
import com.google.common.base.Function;
/**
- * A profile action that creates a {@link Response}, adds a {@link StatusCode#SUCCESS} status to it, and sets it as the
- * message for the {@link ProfileRequestContext#getOutboundMessageContext()}.
+ * Action that creates an empty {@link Response}, and sets it as the
+ * message returned by {@link ProfileRequestContext#getOutboundMessageContext()}.
+ *
+ * @event {@link EventIds#PROCEED_EVENT_ID}
+ * @event {@link EventIds#INVALID_MSG_CTX}
+ * @event {@link IdPEventIds#INVALID_RELYING_PARTY_CTX}
+ * @event {@link IdPEventIds#INVALID_PROFILE_CONFIG}
+ *
+ * @post ProfileRequestContext.getOutboundMessageContext().getMessage() != null
+ * @post ProfileRequestContext.getOutboundMessageContext().getSubcontext(
+ * BasicMessageMetadataContext.class, false) != null
*/
- at Events({
- @Event(id = org.opensaml.profile.action.EventIds.PROCEED_EVENT_ID),
- @Event(id = IdPEventIds.INVALID_RELYING_PARTY_CTX, description = "No relying party context available"),
- @Event(id = SAMLEventIds.RESPONSE_EXISTS,
- description = "If the outgoing message context already contains a message")})
public class AddResponseShell extends AbstractProfileAction<Object, Response> {
/** Class logger. */
- private Logger log = LoggerFactory.getLogger(AddResponseShell.class);
+ @Nonnull private Logger log = LoggerFactory.getLogger(AddResponseShell.class);
/**
* Strategy used to locate the {@link RelyingPartyContext} associated with a given {@link ProfileRequestContext}.
*/
- private Function<ProfileRequestContext, RelyingPartyContext> relyingPartyContextLookupStrategy;
+ @Nonnull private Function<ProfileRequestContext, RelyingPartyContext> relyingPartyContextLookupStrategy;
+ /** Profile configuration for request. */
+ @Nullable private ProfileConfiguration profileConfig;
+
/** Constructor. */
public AddResponseShell() {
- super();
-
- relyingPartyContextLookupStrategy =
- new ChildContextLookup<ProfileRequestContext, RelyingPartyContext>(RelyingPartyContext.class, false);
+ relyingPartyContextLookupStrategy = new ChildContextLookup<>(RelyingPartyContext.class, false);
}
/**
- * Gets the strategy used to locate the {@link RelyingPartyContext} associated with a given
- * {@link ProfileRequestContext}.
- *
- * @return strategy used to locate the {@link RelyingPartyContext} associated with a given
- * {@link ProfileRequestContext}
- */
[... 222 lines stripped ...]
More information about the commits
mailing list