[java-opensaml COMMIT] in /trunk/opensaml-saml-impl/src: main/java/org/opensaml/saml/common/profile/impl/ChainingName...

noreply at shibboleth.net noreply at shibboleth.net
Thu May 1 19:26:54 EDT 2014


Author: scantor
Date: Thu May  1 19:26:54 2014
New Revision: 3835

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3835&view=rev
Log:
IDP-403 - Streamline interface between actions and NameID generation

Added:
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/profile/impl/ChainingNameIdentifierGenerator.java   (with props)
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/profile/impl/ChainingSAML1NameIdentifierGenerator.java   (with props)
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/ChainingSAML2NameIDGenerator.java   (with props)
Modified:
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/profile/impl/AddNameIdentifierToSubjects.java
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/profile/impl/AddNameIDToSubjects.java
    trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml1/profile/impl/AddNameIdentifierToSubjectsTest.java
    trunk/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/profile/impl/AddNameIDToSubjectsTest.java

Modified: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/profile/impl/AddNameIdentifierToSubjects.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/profile/impl/AddNameIdentifierToSubjects.java?rev=3835&r1=3834&r2=3835&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/profile/impl/AddNameIdentifierToSubjects.java (original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml1/profile/impl/AddNameIdentifierToSubjects.java Thu May  1 19:26:54 2014
@@ -29,8 +29,9 @@
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.profile.context.navigate.OutboundMessageContextLookup;
 
+import net.shibboleth.utilities.java.support.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
-import net.shibboleth.utilities.java.support.annotation.constraint.NullableElements;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
@@ -38,7 +39,6 @@
 import org.opensaml.messaging.context.navigate.MessageLookup;
 import org.opensaml.saml.common.SAMLException;
 import org.opensaml.saml.common.SAMLObjectBuilder;
-import org.opensaml.saml.common.profile.FormatSpecificNameIdentifierGenerator;
 import org.opensaml.saml.common.profile.logic.MetadataNameIdentifierFormatStrategy;
 import org.opensaml.saml.saml1.core.Assertion;
 import org.opensaml.saml.saml1.core.NameIdentifier;
@@ -52,11 +52,6 @@
 
 import com.google.common.base.Function;
 import com.google.common.base.Functions;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.ListMultimap;
-import com.google.common.collect.Lists;
 
 /**
  * Action that builds a {@link NameIdentifier} and adds it to the {@link Subject} of all the statements
@@ -92,12 +87,9 @@
 
     /** Strategy used to determine the formats to try. */
     @Nonnull private Function<ProfileRequestContext, List<String>> formatLookupStrategy;
-    
-    /** Map of formats to generators. */
-    @Nonnull @NonnullElements private ListMultimap<String, SAML1NameIdentifierGenerator> nameIdGeneratorMap;
-
-    /** Fallback generator, generally for legacy support. */
-    @Nullable private SAML1NameIdentifierGenerator defaultNameIdGenerator;
+
+    /** Generator to use. */
+    @NonnullAfterInit private SAML1NameIdentifierGenerator generator;
     
     /** Formats to try. */
     @Nonnull @NonnullElements private List<String> formats;
@@ -119,7 +111,6 @@
         responseLookupStrategy =
                 Functions.compose(new MessageLookup<>(Response.class), new OutboundMessageContextLookup());
         formatLookupStrategy = new MetadataNameIdentifierFormatStrategy();
-        nameIdGeneratorMap = ArrayListMultimap.create();
         formats = Collections.emptyList();
     }
     
@@ -157,45 +148,28 @@
         
         formatLookupStrategy = Constraint.isNotNull(strategy, "Format lookup strategy cannot be null");
     }
-    
-    /**
-     * Set the format-specific name identifier generators to use.
-     * 
-     * <p>Only generators that support the {@link FormatSpecificNameIdentifierGenerator} interface are
-     * installed, and the generators are prioritized for a given format by the order they are supplied.</p> 
-     * 
-     * @param generators generators to use
-     */
-    public synchronized void setNameIdentifierGenerators(
-            @Nonnull @NullableElements List<SAML1NameIdentifierGenerator> generators) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        Constraint.isNotNull(generators, "NameIdentifierGenerator list cannot be null");

[... 521 lines stripped ...]


More information about the commits mailing list