[java-opensaml COMMIT] in /trunk/opensaml-saml-impl/src: main/java/org/opensaml/saml/saml2/profile/impl/AbstractRespo...
noreply at shibboleth.net
noreply at shibboleth.net
Thu May 1 12:32:33 EDT 2014
Author: scantor
Date: Thu May 1 12:32:32 2014
New Revision: 3833
URL: http://svn.shibboleth.net/view/java-opensaml?rev=3833&view=rev
Log:
Generalize response shell action for all response types.
Added:
trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AbstractResponseShellAction.java (with props)
trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddStatusResponseShell.java
- copied, changed from r3831, trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddResponseShell.java
trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/profile/impl/AddStatusResponseShellTest.java
- copied, changed from r3831, trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/profile/impl/AddResponseShellTest.java
Modified:
trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddResponseShell.java
trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/profile/impl/AddResponseShellTest.java
Copied: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddStatusResponseShell.java (from r3831, trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddResponseShell.java)
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddStatusResponseShell.java?p2=trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddStatusResponseShell.java&p1=trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddResponseShell.java&r1=3831&r2=3833&rev=3833&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddResponseShell.java (original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddStatusResponseShell.java Thu May 1 12:32:32 2014
@@ -19,7 +19,10 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-
+import javax.xml.namespace.QName;
+
+import net.shibboleth.utilities.java.support.annotation.constraint.NonnullAfterInit;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
import net.shibboleth.utilities.java.support.logic.Constraint;
import net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy;
@@ -34,27 +37,26 @@
import org.opensaml.profile.action.ActionSupport;
import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
+import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.common.SAMLObjectBuilder;
import org.opensaml.saml.common.SAMLVersion;
import org.opensaml.saml.saml2.core.Issuer;
-import org.opensaml.saml.saml2.core.Response;
import org.opensaml.saml.saml2.core.Status;
import org.opensaml.saml.saml2.core.StatusCode;
+import org.opensaml.saml.saml2.core.StatusResponseType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Function;
/**
- * Action that creates an empty {@link Response}, and sets it as the message returned by
- * {@link ProfileRequestContext#getOutboundMessageContext()}.
+ * Action that creates an empty object derived from {@link StatusResponseType},
+ * and sets it as the message returned by {@link ProfileRequestContext#getOutboundMessageContext()}.
*
* <p>The {@link Status} is set to {@link StatusCode#SUCCESS_URI} as a default assumption,
* and this can be overridden by subsequent actions.</p>
*
- * <p>If the {@link RelyingPartyContext} contains a responder identity (via
- * {@link net.shibboleth.idp.relyingparty.RelyingPartyConfiguration#getResponderId()},
- * it is set as the Issuer of the message.</p>
+ * <p>If an issuer value is returned via a lookup strategy, then it's set as the Issuer of the message.</p>
*
* @event {@link EventIds#PROCEED_EVENT_ID}
* @event {@link EventIds#INVALID_MSG_CTX}
@@ -63,11 +65,14 @@
*
* @post ProfileRequestContext.getOutboundMessageContext().getMessage() != null
*/
-public class AddResponseShell extends AbstractProfileAction {
+public class AddStatusResponseShell extends AbstractProfileAction {
/** Class logger. */
- @Nonnull private Logger log = LoggerFactory.getLogger(AddResponseShell.class);
-
+ @Nonnull private Logger log = LoggerFactory.getLogger(AbstractResponseShellAction.class);
+
+ /** Message type to create. */
+ @NonnullAfterInit private QName messageType;
+
/** Overwrite an existing message? */
private boolean overwriteExisting;
@@ -84,7 +89,7 @@
@Nullable private String issuerId;
/** Constructor. */
- public AddResponseShell() {
+ public AddStatusResponseShell() {
// Default strategy is a 16-byte secure random source.
idGeneratorLookupStrategy = new Function<ProfileRequestContext,IdentifierGenerationStrategy>() {
[... 226 lines stripped ...]
More information about the commits
mailing list