[java-identity-provider COMMIT] /trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/SetRPUIInformation.java
noreply at shibboleth.net
noreply at shibboleth.net
Mon Sep 8 14:20:31 EDT 2014
Author: scantor
Date: Mon Sep 8 14:20:31 2014
New Revision: 6505
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6505&view=rev
Log:
Some cleanup.
Modified:
trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/SetRPUIInformation.java
Modified: trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/SetRPUIInformation.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/SetRPUIInformation.java?rev=6505&r1=6504&r2=6505&view=diff
==============================================================================
--- trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/SetRPUIInformation.java (original)
+++ trunk/idp-ui/src/main/java/net/shibboleth/idp/ui/context/SetRPUIInformation.java Mon Sep 8 14:20:31 2014
@@ -31,6 +31,8 @@
import org.opensaml.core.xml.XMLObject;
import org.opensaml.messaging.context.navigate.ChildContextLookup;
+import org.opensaml.profile.action.ActionSupport;
+import org.opensaml.profile.action.EventIds;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.profile.context.navigate.OutboundMessageContextLookup;
import org.opensaml.saml.common.messaging.context.AttributeConsumingServiceContext;
@@ -42,25 +44,31 @@
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml.saml2.metadata.RoleDescriptor;
import org.opensaml.saml.saml2.metadata.SPSSODescriptor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.base.Function;
import com.google.common.base.Functions;
/**
* Action to populate the {@link ProfileRequestContext} with a {@link RelyingPartyUIContext}. The contents are populated
- * by applying the XXX
+ * by accessing a {@link SAMLMetadataContext} via lookup function and using it to copy data over to the UI context.
+ *
+ * @event {@link EventIds#PROCEED_EVENT_ID}
+ * @event {@link EventIds#INVALID_PROFILE_CTX}
+ * @post If a lookup function returns a SAMLMetadataContext, then a RelyingPartyUIContext is created and data copied
+ * into it.
*/
public class SetRPUIInformation extends AbstractProfileAction {
+ /** Class logger. */
+ @Nonnull private final Logger log = LoggerFactory.getLogger(SetRPUIInformation.class);
+
/** Strategy function for access to {@link SAMLMetadataContext}. */
- private Function<ProfileRequestContext, SAMLMetadataContext> metadataContextLookupStrategy = Functions.compose(
- new ChildContextLookup<>(SAMLMetadataContext.class), Functions.compose(new ChildContextLookup<>(
- SAMLPeerEntityContext.class), new OutboundMessageContextLookup()));
+ private Function<ProfileRequestContext,SAMLMetadataContext> metadataContextLookupStrategy;
/** Strategy function to create the {@link RelyingPartyUIContext}. */
- private Function<ProfileRequestContext, RelyingPartyUIContext> rpUIContextCreateStrategy = Functions.compose(
- new ChildContextLookup<AuthenticationContext, RelyingPartyUIContext>(RelyingPartyUIContext.class, true),
- new ChildContextLookup<ProfileRequestContext, AuthenticationContext>(AuthenticationContext.class, true));
+ private Function<ProfileRequestContext,RelyingPartyUIContext> rpUIContextCreateStrategy;
/**
* The {@link EntityDescriptor}. If we cannot find this we short cut the {@link #doExecute(ProfileRequestContext)}
@@ -76,13 +84,24 @@
/** The ACS context. */
private AttributeConsumingService acsDesriptor;
+
+ /** Constructor. */
+ public SetRPUIInformation() {
+ metadataContextLookupStrategy = Functions.compose(new ChildContextLookup<>(SAMLMetadataContext.class),
+ Functions.compose(new ChildContextLookup<>(SAMLPeerEntityContext.class),
+ new OutboundMessageContextLookup()));
+
+ rpUIContextCreateStrategy = Functions.compose(
+ new ChildContextLookup<>(RelyingPartyUIContext.class, true),
+ new ChildContextLookup<ProfileRequestContext,AuthenticationContext>(AuthenticationContext.class, true));
+ }
/**
* Get the mechanism to go from the {@link ProfileRequestContext} to the {@link SAMLMetadataContext}.
*
* @return lookup strategy
*/
- public Function<ProfileRequestContext, SAMLMetadataContext> getMetadataContextLookupStrategy() {
+ public Function<ProfileRequestContext,SAMLMetadataContext> getMetadataContextLookupStrategy() {
return metadataContextLookupStrategy;
}
@@ -91,7 +110,7 @@
*
* @param strgy what to set.
*/
- public void setMetadataContextLookupStrategy(@Nonnull Function<ProfileRequestContext, SAMLMetadataContext> strgy) {
+ public void setMetadataContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SAMLMetadataContext> strgy) {
metadataContextLookupStrategy = Constraint.isNotNull(strgy, "Injected Metadata Strategy cannot be null");
}
@@ -100,7 +119,7 @@
*
[... 58 lines stripped ...]
More information about the commits
mailing list