[java-identity-provider COMMIT] in /trunk: idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/reso...

noreply at shibboleth.net noreply at shibboleth.net
Mon Mar 30 03:49:01 EDT 2015


Author: rdw
Date: Mon Mar 30 03:49:01 2015
New Revision: 7456

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7456&view=rev
Log:
IDP-665 Warn if an attribute definition contains dependent attributes and sourceAttributeID was either different or absent.

Modified:
    trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java
    trunk/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/attribute-resolver.xml

Modified: trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java?rev=7456&r1=7455&r2=7456&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java (original)
+++ trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/PluginDependencySupport.java Mon Mar 30 03:49:01 2015
@@ -32,9 +32,15 @@
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /** Support class for working with {@link ResolverPluginDependency}. */
 public final class PluginDependencySupport {
 
+    /** Log. */
+    private static final Logger LOG = LoggerFactory.getLogger(PluginDependencySupport.class);
+
     /** Constructor. */
     private PluginDependencySupport() {
 
@@ -42,21 +48,21 @@
 
     /**
      * Gets the values, as a single list, from all dependencies. This method only supports dependencies which contain an
-     * attribute specifier (i.e. {@link ResolverPluginDependency#getDependencyAttributeId()} does not equal null). It
-     * is therefore used inside Attribute definitions which only process a single attribute as input.
+     * attribute specifier (i.e. {@link ResolverPluginDependency#getDependencyAttributeId()} does not equal null). It is
+     * therefore used inside Attribute definitions which only process a single attribute as input.
      * 
      * <p>
      * <strong>NOTE</strong>, this method does *not* actually trigger any attribute definition or data connector
-     * resolution, it only looks for the cached results of previously resolved plugins within the current work
-     * context.
+     * resolution, it only looks for the cached results of previously resolved plugins within the current work context.
      * </p>
      * 
      * @param workContext current attribute resolver work context
      * @param dependencies set of dependencies
-     * 
+     * @deprecated use
+     *  {@link PluginDependencySupport#getMergedAttributeValues(AttributeResolverWorkContext, Collection, String)}
      * @return the merged value set
      */
-    @Nonnull @NonnullElements public static List<IdPAttributeValue<?>> getMergedAttributeValues(
+    @Deprecated @Nonnull @NonnullElements public static List<IdPAttributeValue<?>> getMergedAttributeValues(
             @Nonnull final AttributeResolverWorkContext workContext,
             @Nonnull @NonnullElements final Collection<ResolverPluginDependency> dependencies) {
         Constraint.isNotNull(workContext, "Attribute resolution context cannot be null");
@@ -94,16 +100,80 @@
     }
 
     /**
+     * Gets the values, as a single list, from all dependencies. This method only supports dependencies which contain an
+     * attribute specifier (i.e. {@link ResolverPluginDependency#getDependencyAttributeId()} does not equal null). It is
+     * therefore used inside Attribute definitions which only process a single attribute as input.
+     * 
+     * <p>
+     * <strong>NOTE</strong>, this method does *not* actually trigger any attribute definition or data connector
+     * resolution, it only looks for the cached results of previously resolved plugins within the current work context.
+     * </p>
+     * 
+     * @param workContext current attribute resolver work context
+     * @param dependencies set of dependencies
+     * @param attributeDefinitionId the attributeID that these values will be associated with.
+     * @return the merged value set
+     */
+    @Nonnull @NonnullElements public static List<IdPAttributeValue<?>> getMergedAttributeValues(
+            @Nonnull final AttributeResolverWorkContext workContext,
+            @Nonnull @NonnullElements final Collection<ResolverPluginDependency> dependencies,
+            @Nonnull final String attributeDefinitionId) {
+        Constraint.isNotNull(workContext, "Attribute resolution context cannot be null");
+        Constraint.isNotNull(dependencies, "Resolver dependency collection cannot be null");
+
+        final List<IdPAttributeValue<?>> values = new ArrayList<>();
+
+        for (final ResolverPluginDependency dependency : dependencies) {

[... 97 lines stripped ...]


More information about the commits mailing list