Cache result of failover dependency on a per-request basis.
authorcantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 17 Nov 2003 03:24:18 +0000 (03:24 +0000)
committercantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 17 Nov 2003 03:24:18 +0000 (03:24 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@790 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/attrresolv/AttributeResolver.java

index 21a478b..dfc3176 100644 (file)
@@ -524,26 +524,27 @@ public class AttributeResolver {
         try {
             resolvedAttributes = currentDefinition.resolve(principal, requester, depends);
 
-            //Add attribute resolution to cache
-            if (currentDefinition.getTTL() > 0) {
-                resolverCache.cacheConnectorResolution(
-                    principal,
-                    currentDefinition.getId(),
-                    currentDefinition.getTTL(),
-                    resolvedAttributes);
-            }
+                       //Add attribute resolution to cache
+                       if (currentDefinition.getTTL() > 0) {
+                               resolverCache.cacheConnectorResolution(
+                                       principal,
+                                       currentDefinition.getId(),
+                                       currentDefinition.getTTL(),
+                                       resolvedAttributes);
+                       }
         }
         catch (ResolutionPlugInException e) {
             // Something went wrong, so check for a fail-over...
             if (currentDefinition.getFailoverDependencyId() != null) {
-                return resolveConnector(
+               log.info("Connector (" + currentDefinition.getId() + ") failed, invoking failover dependency");
+                resolvedAttributes = resolveConnector(
                     currentDefinition.getFailoverDependencyId(), principal, requester, requestCache, requestedAttributes
                     );
             }
-            
-            if (currentDefinition.getPropagateErrors()) {
+            else if (currentDefinition.getPropagateErrors()) {
                 throw e;
-            } else {
+            }
+            else {
                 log.warn(
                     "Connector (" + currentDefinition.getId() + ") returning empty attribute set instead of propagating error: " + e);
                 resolvedAttributes = new BasicAttributes();