[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
Thu Mar 29 08:18:48 BST 2012


Author: rdw
Date: Thu Mar 29 08:18:48 2012
New Revision: 4145

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4145&view=rev
Log:
Bug fixes and first round of improved coverage

Modified:
    trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AttributeResolver.java
    trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/BaseAttributeDefinition.java
    trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/BaseResolverPlugin.java
    trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AttributeResolverTest.java
    trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/BaseAttributeDefinitionTest.java
    trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/BaseResolverPluginTest.java
    trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/MockAttributeDefinition.java
    trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/MockAttributeEncoder.java
    trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/MockDataConnector.java
    trunk/idp-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/ResolverPluginDependencyTest.java

Modified: trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AttributeResolver.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AttributeResolver.java?rev=4145&r1=4144&r2=4145&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AttributeResolver.java (original)
+++ trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AttributeResolver.java Thu Mar 29 08:18:48 2012
@@ -130,7 +130,9 @@
         final LazyList<String> invalidDataConnectors = new LazyList<String>();
         for (BaseDataConnector plugin : dataConnectors.values()) {
             log.debug("Attribute resolver {}: checking if data connector {} is valid", getId(), plugin.getId());
-            validateDataConnector(plugin, invalidDataConnectors);
+            if (!validateDataConnector(plugin, invalidDataConnectors)) {
+                invalidDataConnectors.add(plugin.getId());
+            }
         }
 
         final LazyList<String> invalidAttributeDefinitions = new LazyList<String>();
@@ -268,17 +270,8 @@
 
         Optional<Attribute> resolvedAttribute = Optional.absent();
 
-        try {
-            log.debug("Attribute Resolver {}: resolving attribute definition {}", getId(), attributeId);
-            resolvedAttribute = definition.resolve(resolutionContext);
-        } catch (AttributeResolutionException e) {
-            if (!definition.isPropagateResolutionExceptions()) {
-                log.debug("Attribute Resolver {}: attribute definition {} produced the following"
-                        + " error but was configured not to propogate it.", new Object[] {getId(), attributeId, e,});
-            } else {
-                throw e;
-            }
-        }
+        log.debug("Attribute Resolver {}: resolving attribute definition {}", getId(), attributeId);
+        resolvedAttribute = definition.resolve(resolutionContext);
 
         if (!resolvedAttribute.isPresent()) {
             log.debug("Attribute Resolver {}: attribute definition {} produced no attribute", getId(), attributeId);
@@ -333,13 +326,9 @@
                 resolveDataConnector(failoverDataConnectorId.get(), resolutionContext);
                 return;
             } else {
-                if (connector.isPropagateResolutionExceptions()) {
-                    log.debug("Attribute Resolver {}: data connector {} produced the"
-                            + " following error but was configured not to propogate it.", new Object[] {getId(),
-                            connectorId, e,});
-                } else {
-                    throw e;
-                }
+                // Pass it on.  Do not look at propagateException because this is handled in the
+                // connector code logic. 
+                throw e;
             }
         }
 
@@ -442,10 +431,21 @@
             @Nonnull LazyList<String> invalidDataConnectors) {
         assert connector != null;
         assert invalidDataConnectors != null;
+
+        if (connector.getFailoverDataConnectorId().isPresent()) {
+            String id = connector.getFailoverDataConnectorId().get();
+            if (!dataConnectors.containsKey(id)) {
+                log.warn("Attribute resolver {}: failover data connector {} for {} cannot be found", new Object[] {
+                        getId(), id, connector.getId(),});
+                return false;
+            }
+        }
+
+        boolean returnValue;
         try {
             connector.validate();

[... 756 lines stripped ...]


More information about the commits mailing list