Pass IdP identifier into resolver interfaces.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 19 May 2005 21:57:42 +0000 (21:57 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 19 May 2005 21:57:42 +0000 (21:57 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1550 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

20 files changed:
src/edu/internet2/middleware/shibboleth/aa/attrresolv/AttributeDefinitionPlugIn.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/AttributeResolver.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/DataConnectorPlugIn.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/CompositeAttributeDefinition.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/CustomAttributeDefinition.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/CustomDataConnector.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/FormattedAttributeDefinition.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/JDBCDataConnector.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/JDBCStatementCreator.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/JNDIDirectoryDataConnector.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/MappedAttributeDefinition.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/PersistentIDAttributeDefinition.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/RegExAttributeDefinition.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/SampleConnector.java
src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/SimpleAttributeDefinition.java
src/edu/internet2/middleware/shibboleth/idp/IdPProtocolSupport.java
src/edu/internet2/middleware/shibboleth/utils/ResolverTest.java
tests/edu/internet2/middleware/shibboleth/aa/attrresolv/FileConnector.java
tests/edu/internet2/middleware/shibboleth/aa/attrresolv/ResolverTests.java
tests/edu/internet2/middleware/shibboleth/aa/attrresolv/ScopeTestConnector.java

index 36eef7c..ceebef2 100644 (file)
@@ -1,50 +1,26 @@
-/* 
- * The Shibboleth License, Version 1. 
- * Copyright (c) 2002 
- * University Corporation for Advanced Internet Development, Inc. 
- * All rights reserved
- * 
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions are met:
- * 
- * Redistributions of source code must retain the above copyright notice, this 
- * list of conditions and the following disclaimer.
- * 
- * Redistributions in binary form must reproduce the above copyright notice, 
- * this list of conditions and the following disclaimer in the documentation 
- * and/or other materials provided with the distribution, if any, must include 
- * the following acknowledgment: "This product includes software developed by 
- * the University Corporation for Advanced Internet Development 
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement 
- * may appear in the software itself, if and wherever such third-party 
- * acknowledgments normally appear.
- * 
- * Neither the name of Shibboleth nor the names of its contributors, nor 
- * Internet2, nor the University Corporation for Advanced Internet Development, 
- * Inc., nor UCAID may be used to endorse or promote products derived from this 
- * software without specific prior written permission. For written permission, 
- * please contact shibboleth@shibboleth.org
- * 
- * Products derived from this software may not be called Shibboleth, Internet2, 
- * UCAID, or the University Corporation for Advanced Internet Development, nor 
- * may Shibboleth appear in their name, without prior written permission of the 
- * University Corporation for Advanced Internet Development.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK 
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. 
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY 
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, 
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 package edu.internet2.middleware.shibboleth.aa.attrresolv;
@@ -52,9 +28,8 @@ package edu.internet2.middleware.shibboleth.aa.attrresolv;
 import java.security.Principal;
 
 /**
- * Defines an Attribute Definition PlugIn for the AA Attribute Resolver.  Such plugins can
- * be realized at runtime by the resolver and subsequently resolved in conjunction with other
- * dependant plugins.
+ * Defines an Attribute Definition PlugIn for the AA Attribute Resolver. Such plugins can be realized at runtime by the
+ * resolver and subsequently resolved in conjunction with other dependant plugins.
  * 
  * @author Walter Hoehn (wassa@columbia.edu)
  */
@@ -64,12 +39,18 @@ public interface AttributeDefinitionPlugIn extends ResolutionPlugIn {
        /**
         * Resolves the values of an attribute.
         * 
-        * @param attribute The attribute to be resolved
-        * @param principal The principal for which the attribute should be resolved
-        * @param requester The name of the entity making the resolution request
-        * @param depends Resolution dependencies
+        * @param attribute
+        *            The attribute to be resolved
+        * @param principal
+        *            The principal for which the attribute should be resolved
+        * @param requester
+        *            The name of the entity making the resolution request
+        * @param responder
+        *            The name of the entity responding to the resolution request
+        * @param depends
+        *            Resolution dependencies
         * @throws ResolutionPlugInException
         */
-       public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
-               throws ResolutionPlugInException;
+       public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+                       Dependencies depends) throws ResolutionPlugInException;
 }
index cb91fc8..55afef0 100644 (file)
@@ -1,38 +1,26 @@
 /*
  * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved
- * 
- * 
- * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
- * following conditions are met:
- * 
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
- * disclaimer.
- * 
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the distribution, if any, must include the
- * following acknowledgment: "This product includes software developed by the University Corporation for Advanced
- * Internet Development <http://www.ucaid.edu> Internet2 Project. Alternately, this acknowledegement may appear in the
- * software itself, if and wherever such third-party acknowledgments normally appear.
- * 
- * Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor the University Corporation for
- * Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote products derived from this software
- * without specific prior written permission. For written permission, please contact shibboleth@shibboleth.org
- * 
- * Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the University Corporation
- * for Advanced Internet Development, nor may Shibboleth appear in their name, without prior written permission of the
- * University Corporation for Advanced Internet Development.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE,
- * ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu> Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 package edu.internet2.middleware.shibboleth.aa.attrresolv;
@@ -72,7 +60,6 @@ import edu.internet2.middleware.shibboleth.xml.Parser;
  * graph of pluggable attribute definitions and data connectors.
  * 
  * @author Walter Hoehn (wassa@columbia.edu)
- *  
  */
 
 public class AttributeResolver {
@@ -83,20 +70,22 @@ public class AttributeResolver {
        public static final String resolverNamespace = "urn:mace:shibboleth:resolver:1.0";
 
        public AttributeResolver(IdPConfig configuration) throws AttributeResolverException {
-               
+
                if (configuration == null || configuration.getResolverConfigLocation() == null) {
                        log.error("No Attribute Resolver configuration file specified.");
                        throw new AttributeResolverException("No Attribute Resolver configuration file specified.");
                }
-               
+
                loadConfig(configuration.getResolverConfigLocation());
        }
-       
+
        public AttributeResolver(String configFileLocation) throws AttributeResolverException {
+
                loadConfig(configFileLocation);
        }
 
        private void loadConfig(String configFile) throws AttributeResolverException {
+
                try {
                        ShibResource config = new ShibResource(configFile, this.getClass());
                        Parser.DOMParser parser = new Parser.DOMParser(true);
@@ -126,8 +115,8 @@ public class AttributeResolver {
                        throw new AttributeResolverException("Cannot load Attribute Resolver.");
                }
 
-               NodeList plugInNodes =
-                       document.getElementsByTagNameNS(resolverNamespace, "AttributeResolver").item(0).getChildNodes();
+               NodeList plugInNodes = document.getElementsByTagNameNS(resolverNamespace, "AttributeResolver").item(0)
+                               .getChildNodes();
                if (plugInNodes.getLength() <= 0) {
                        log.error("Configuration inclues no PlugIn definitions.");
                        throw new AttributeResolverException("Cannot load Attribute Resolver.");
@@ -181,31 +170,25 @@ public class AttributeResolver {
 
        private void verifyPlugIn(ResolutionPlugIn plugIn, Set verifyChain, Set inconsistent) {
 
-               //Short-circuit if we have already found this PlugIn to be inconsistent
-               if (inconsistent.contains(plugIn.getId())) {
-                       return;
-               }
+               // Short-circuit if we have already found this PlugIn to be inconsistent
+               if (inconsistent.contains(plugIn.getId())) { return; }
 
-               //Make sure that we don't have a circular dependency
+               // Make sure that we don't have a circular dependency
                if (verifyChain.contains(plugIn.getId())) {
-                       log.error(
-                               "The PlugIn (" + plugIn.getId() + ") is inconsistent.  It is involved in a circular dependency chain.");
+                       log.error("The PlugIn (" + plugIn.getId()
+                                       + ") is inconsistent.  It is involved in a circular dependency chain.");
                        inconsistent.add(plugIn.getId());
                        return;
                }
 
-               //Recursively go through all DataConnector dependencies and make sure all are registered and consistent.
+               // Recursively go through all DataConnector dependencies and make sure all are registered and consistent.
                List depends = new ArrayList();
                depends.addAll(Arrays.asList(plugIn.getDataConnectorDependencyIds()));
                Iterator dependsIt = depends.iterator();
                while (dependsIt.hasNext()) {
                        String key = (String) dependsIt.next();
                        if (!plugIns.containsKey(key)) {
-                               log.error(
-                                       "The PlugIn ("
-                                               + plugIn.getId()
-                                               + ") is inconsistent.  It depends on a PlugIn ("
-                                               + key
+                               log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent.  It depends on a PlugIn (" + key
                                                + ") that is not registered.");
                                inconsistent.add(plugIn.getId());
                                return;
@@ -213,11 +196,7 @@ public class AttributeResolver {
 
                        ResolutionPlugIn dependent = lookupPlugIn(key);
                        if (!(dependent instanceof DataConnectorPlugIn)) {
-                               log.error(
-                                       "The PlugIn ("
-                                               + plugIn.getId()
-                                               + ") is inconsistent.  It depends on a PlugIn ("
-                                               + key
+                               log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent.  It depends on a PlugIn (" + key
                                                + ") that is mislabeled as an DataConnectorPlugIn.");
                                inconsistent.add(plugIn.getId());
                                return;
@@ -227,11 +206,7 @@ public class AttributeResolver {
                        verifyPlugIn(dependent, verifyChain, inconsistent);
 
                        if (inconsistent.contains(key)) {
-                               log.error(
-                                       "The PlugIn ("
-                                               + plugIn.getId()
-                                               + ") is inconsistent.  It depends on a PlugIn ("
-                                               + key
+                               log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent.  It depends on a PlugIn (" + key
                                                + ") that is inconsistent.");
                                inconsistent.add(plugIn.getId());
                                return;
@@ -239,7 +214,7 @@ public class AttributeResolver {
                }
                verifyChain.remove(plugIn.getId());
 
-               //Recursively go through all AttributeDefinition dependencies and make sure all are registered and consistent.
+               // Recursively go through all AttributeDefinition dependencies and make sure all are registered and consistent.
                depends.clear();
                depends.addAll(Arrays.asList(plugIn.getAttributeDefinitionDependencyIds()));
                dependsIt = depends.iterator();
@@ -247,11 +222,7 @@ public class AttributeResolver {
                        String key = (String) dependsIt.next();
 
                        if (!plugIns.containsKey(key)) {
-                               log.error(
-                                       "The PlugIn ("
-                                               + plugIn.getId()
-                                               + ") is inconsistent.  It depends on a PlugIn ("
-                                               + key
+                               log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent.  It depends on a PlugIn (" + key
                                                + ") that is not registered.");
                                inconsistent.add(plugIn.getId());
                                return;
@@ -259,11 +230,7 @@ public class AttributeResolver {
 
                        ResolutionPlugIn dependent = lookupPlugIn(key);
                        if (!(dependent instanceof AttributeDefinitionPlugIn)) {
-                               log.error(
-                                       "The PlugIn ("
-                                               + plugIn.getId()
-                                               + ") is inconsistent.  It depends on a PlugIn ("
-                                               + key
+                               log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent.  It depends on a PlugIn (" + key
                                                + ") that is mislabeled as an AttributeDefinitionPlugIn.");
                                inconsistent.add(plugIn.getId());
                                return;
@@ -273,11 +240,7 @@ public class AttributeResolver {
                        verifyPlugIn(dependent, verifyChain, inconsistent);
 
                        if (inconsistent.contains(key)) {
-                               log.error(
-                                       "The PlugIn ("
-                                               + plugIn.getId()
-                                               + ") is inconsistent.  It depends on a PlugIn ("
-                                               + key
+                               log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent.  It depends on a PlugIn (" + key
                                                + ") that is inconsistent.");
                                inconsistent.add(plugIn.getId());
                                return;
@@ -285,16 +248,12 @@ public class AttributeResolver {
                }
                verifyChain.remove(plugIn.getId());
 
-               //Check the failover dependency, if there is one.
+               // Check the failover dependency, if there is one.
                if (plugIn instanceof DataConnectorPlugIn) {
                        String key = ((DataConnectorPlugIn) plugIn).getFailoverDependencyId();
                        if (key != null) {
                                if (!plugIns.containsKey(key)) {
-                                       log.error(
-                                               "The PlugIn ("
-                                                       + plugIn.getId()
-                                                       + ") is inconsistent.  It depends on a PlugIn ("
-                                                       + key
+                                       log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent.  It depends on a PlugIn (" + key
                                                        + ") that is not registered.");
                                        inconsistent.add(plugIn.getId());
                                        return;
@@ -302,11 +261,8 @@ public class AttributeResolver {
 
                                ResolutionPlugIn dependent = lookupPlugIn(key);
                                if (!(dependent instanceof DataConnectorPlugIn)) {
-                                       log.error(
-                                               "The PlugIn ("
-                                                       + plugIn.getId()
-                                                       + ") is inconsistent.  It depends on a fail-over PlugIn ("
-                                                       + key
+                                       log.error("The PlugIn (" + plugIn.getId()
+                                                       + ") is inconsistent.  It depends on a fail-over PlugIn (" + key
                                                        + ") that is not a DataConnectorPlugIn.");
                                        inconsistent.add(plugIn.getId());
                                        return;
@@ -316,11 +272,7 @@ public class AttributeResolver {
                                verifyPlugIn(dependent, verifyChain, inconsistent);
 
                                if (inconsistent.contains(key)) {
-                                       log.error(
-                                               "The PlugIn ("
-                                                       + plugIn.getId()
-                                                       + ") is inconsistent.  It depends on a PlugIn ("
-                                                       + key
+                                       log.error("The PlugIn (" + plugIn.getId() + ") is inconsistent.  It depends on a PlugIn (" + key
                                                        + ") that is inconsistent.");
                                        inconsistent.add(plugIn.getId());
                                        return;
@@ -342,6 +294,7 @@ public class AttributeResolver {
        }
 
        private ResolutionPlugIn lookupPlugIn(String id) {
+
                return (ResolutionPlugIn) plugIns.get(id);
        }
 
@@ -352,10 +305,13 @@ public class AttributeResolver {
         *            the <code>Principal</code> for which the attributes should be resolved
         * @param requester
         *            the name of the requesting entity
+        * @param responding
+        *            the name of the entity responding to the request
         * @param attributes
         *            the set of attributes to be resolved
         */
-       public void resolveAttributes(Principal principal, String requester, ResolverAttributeSet attributes) {
+       public void resolveAttributes(Principal principal, String requester, String responder,
+                       ResolverAttributeSet attributes) {
 
                HashMap requestCache = new HashMap();
                ResolverAttributeIterator iterator = attributes.resolverAttributeIterator();
@@ -369,13 +325,11 @@ public class AttributeResolver {
                                } else {
                                        log.info("Resolving attribute: (" + attribute.getName() + ")");
                                        if (attribute.resolved()) {
-                                               log.debug(
-                                                       "Attribute ("
-                                                               + attribute.getName()
+                                               log.debug("Attribute (" + attribute.getName()
                                                                + ") already resolved for this request.  No need for further resolution.");
 
                                        } else {
-                                               resolveAttribute(attribute, principal, requester, requestCache, attributes);
+                                               resolveAttribute(attribute, principal, requester, responder, requestCache, attributes);
                                        }
 
                                        if (!attribute.hasValues()) {
@@ -410,134 +364,98 @@ public class AttributeResolver {
                return (String[]) found.toArray(new String[0]);
        }
 
-       private Attributes resolveConnector(
-               String connector,
-               Principal principal,
-               String requester,
-               Map requestCache,
-               ResolverAttributeSet requestedAttributes)
-               throws ResolutionPlugInException {
+       private Attributes resolveConnector(String connector, Principal principal, String requester, String responder,
+                       Map requestCache, ResolverAttributeSet requestedAttributes) throws ResolutionPlugInException {
 
                DataConnectorPlugIn currentDefinition = (DataConnectorPlugIn) lookupPlugIn(connector);
 
-               //Check to see if we have already resolved the connector during this request
+               // Check to see if we have already resolved the connector during this request
                if (requestCache.containsKey(currentDefinition.getId())) {
-                       log.debug(
-                               "Connector ("
-                                       + currentDefinition.getId()
+                       log.debug("Connector (" + currentDefinition.getId()
                                        + ") already resolved for this request, using cached version");
                        return (Attributes) requestCache.get(currentDefinition.getId());
                }
 
-               //Check to see if we have a cached resolution for this connector
+               // Check to see if we have a cached resolution for this connector
                if (currentDefinition.getTTL() > 0) {
                        Attributes cachedAttributes = resolverCache.getResolvedConnector(principal, currentDefinition.getId());
                        if (cachedAttributes != null) {
-                               log.debug(
-                                       "Connector ("
-                                               + currentDefinition.getId()
+                               log.debug("Connector (" + currentDefinition.getId()
                                                + ") resolution cached from a previous request, using cached version");
                                return cachedAttributes;
                        }
                }
 
-               //Resolve all attribute dependencies
+               // Resolve all attribute dependencies
                String[] attributeDependencies = currentDefinition.getAttributeDefinitionDependencyIds();
                Dependencies depends = new Dependencies();
 
                for (int i = 0; attributeDependencies.length > i; i++) {
-                       log.debug(
-                               "Connector ("
-                                       + currentDefinition.getId()
-                                       + ") depends on attribute ("
-                                       + attributeDependencies[i]
+                       log.debug("Connector (" + currentDefinition.getId() + ") depends on attribute (" + attributeDependencies[i]
                                        + ").");
                        ResolverAttribute dependant = requestedAttributes.getByName(attributeDependencies[i]);
                        if (dependant == null) {
                                dependant = new DependentOnlyResolutionAttribute(attributeDependencies[i]);
                        }
-                       resolveAttribute(dependant, principal, requester, requestCache, requestedAttributes);
+                       resolveAttribute(dependant, principal, requester, responder, requestCache, requestedAttributes);
                        depends.addAttributeResolution(attributeDependencies[i], dependant);
 
                }
 
-               //Resolve all connector dependencies
+               // Resolve all connector dependencies
                String[] connectorDependencies = currentDefinition.getDataConnectorDependencyIds();
                for (int i = 0; connectorDependencies.length > i; i++) {
-                       log.debug(
-                               "Connector ("
-                                       + currentDefinition.getId()
-                                       + ") depends on connector ("
-                                       + connectorDependencies[i]
+                       log.debug("Connector (" + currentDefinition.getId() + ") depends on connector (" + connectorDependencies[i]
                                        + ").");
-                       depends.addConnectorResolution(
-                               connectorDependencies[i],
-                               resolveConnector(connectorDependencies[i], principal, requester, requestCache, requestedAttributes));
+                       depends.addConnectorResolution(connectorDependencies[i], resolveConnector(connectorDependencies[i],
+                                       principal, requester, responder, requestCache, requestedAttributes));
                }
 
-               //Resolve the connector
+               // Resolve the connector
                Attributes resolvedAttributes = null;
                try {
-                       resolvedAttributes = currentDefinition.resolve(principal, requester, depends);
+                       resolvedAttributes = currentDefinition.resolve(principal, requester, responder, depends);
 
-                       //Add attribute resolution to cache
+                       // Add attribute resolution to cache
                        if (currentDefinition.getTTL() > 0) {
-                               resolverCache.cacheConnectorResolution(
-                                       principal,
-                                       currentDefinition.getId(),
-                                       currentDefinition.getTTL(),
-                                       resolvedAttributes);
+                               resolverCache.cacheConnectorResolution(principal, currentDefinition.getId(),
+                                               currentDefinition.getTTL(), resolvedAttributes);
                        }
                } catch (ResolutionPlugInException e) {
                        // Something went wrong, so check for a fail-over...
                        if (currentDefinition.getFailoverDependencyId() != null) {
                                log.warn("Connector (" + currentDefinition.getId() + ") failed, invoking failover dependency");
-                               resolvedAttributes =
-                                       resolveConnector(
-                                               currentDefinition.getFailoverDependencyId(),
-                                               principal,
-                                               requester,
-                                               requestCache,
-                                               requestedAttributes);
+                               resolvedAttributes = resolveConnector(currentDefinition.getFailoverDependencyId(), principal,
+                                               requester, responder, requestCache, requestedAttributes);
                        } else if (currentDefinition.getPropagateErrors()) {
                                throw e;
                        } else {
-                               log.warn(
-                                       "Connector ("
-                                               + currentDefinition.getId()
-                                               + ") returning empty attribute set instead of propagating error: "
-                                               + e);
+                               log.warn("Connector (" + currentDefinition.getId()
+                                               + ") returning empty attribute set instead of propagating error: " + e);
                                resolvedAttributes = new BasicAttributes();
                        }
                }
 
-               //Cache for this request
+               // Cache for this request
                requestCache.put(currentDefinition.getId(), resolvedAttributes);
                return resolvedAttributes;
        }
 
-       private void resolveAttribute(
-               ResolverAttribute attribute,
-               Principal principal,
-               String requester,
-               Map requestCache,
-               ResolverAttributeSet requestedAttributes)
-               throws ResolutionPlugInException {
+       private void resolveAttribute(ResolverAttribute attribute, Principal principal, String requester, String responder,
+                       Map requestCache, ResolverAttributeSet requestedAttributes) throws ResolutionPlugInException {
 
                AttributeDefinitionPlugIn currentDefinition = (AttributeDefinitionPlugIn) lookupPlugIn(attribute.getName());
 
-               //Check to see if we have already resolved the attribute during this request
+               // Check to see if we have already resolved the attribute during this request
                // (this checks dependency-only attributes and attributes resolved with no values
                if (requestCache.containsKey(currentDefinition.getId())) {
-                       log.debug(
-                               "Attribute ("
-                                       + currentDefinition.getId()
+                       log.debug("Attribute (" + currentDefinition.getId()
                                        + ") already resolved for this request, using cached version");
                        attribute.resolveFromCached((ResolverAttribute) requestCache.get(currentDefinition.getId()));
                        return;
                }
 
-               //Check to see if we have already resolved the attribute during this request
+               // Check to see if we have already resolved the attribute during this request
                // (this checks attributes that were submitted to the AR for resolution)
                ResolverAttribute requestedAttribute = requestedAttributes.getByName(currentDefinition.getId());
                if (requestedAttribute != null) {
@@ -546,134 +464,138 @@ public class AttributeResolver {
                        }
                }
 
-               //Check to see if we have a cached resolution for this attribute
+               // Check to see if we have a cached resolution for this attribute
                if (currentDefinition.getTTL() > 0) {
-                       ResolverAttribute cachedAttribute =
-                               resolverCache.getResolvedAttribute(principal, currentDefinition.getId());
+                       ResolverAttribute cachedAttribute = resolverCache
+                                       .getResolvedAttribute(principal, currentDefinition.getId());
                        if (cachedAttribute != null) {
-                               log.debug(
-                                       "Attribute ("
-                                               + currentDefinition.getId()
+                               log.debug("Attribute (" + currentDefinition.getId()
                                                + ") resolution cached from a previous request, using cached version");
                                attribute.resolveFromCached(cachedAttribute);
                                return;
                        }
                }
 
-               //Resolve all attribute dependencies
+               // Resolve all attribute dependencies
                Dependencies depends = new Dependencies();
                String[] attributeDependencies = currentDefinition.getAttributeDefinitionDependencyIds();
 
                boolean dependancyOnly = false;
                for (int i = 0; attributeDependencies.length > i; i++) {
-                       log.debug(
-                               "Attribute (" + attribute.getName() + ") depends on attribute (" + attributeDependencies[i] + ").");
+                       log.debug("Attribute (" + attribute.getName() + ") depends on attribute (" + attributeDependencies[i]
+                                       + ").");
                        ResolverAttribute dependant = requestedAttributes.getByName(attributeDependencies[i]);
                        if (dependant == null) {
                                dependancyOnly = true;
                                dependant = new DependentOnlyResolutionAttribute(attributeDependencies[i]);
                        }
-                       resolveAttribute(dependant, principal, requester, requestCache, requestedAttributes);
+                       resolveAttribute(dependant, principal, requester, responder, requestCache, requestedAttributes);
                        depends.addAttributeResolution(attributeDependencies[i], dependant);
 
                }
 
-               //Resolve all connector dependencies
+               // Resolve all connector dependencies
                String[] connectorDependencies = currentDefinition.getDataConnectorDependencyIds();
                for (int i = 0; connectorDependencies.length > i; i++) {
-                       log.debug(
-                               "Attribute (" + attribute.getName() + ") depends on connector (" + connectorDependencies[i] + ").");
-                       depends.addConnectorResolution(
-                               connectorDependencies[i],
-                               resolveConnector(connectorDependencies[i], principal, requester, requestCache, requestedAttributes));
+                       log.debug("Attribute (" + attribute.getName() + ") depends on connector (" + connectorDependencies[i]
+                                       + ").");
+                       depends.addConnectorResolution(connectorDependencies[i], resolveConnector(connectorDependencies[i],
+                                       principal, requester, responder, requestCache, requestedAttributes));
                }
 
-               //Resolve the attribute
+               // Resolve the attribute
                try {
-                       currentDefinition.resolve(attribute, principal, requester, depends);
+                       currentDefinition.resolve(attribute, principal, requester, responder, depends);
 
-                       //Add attribute resolution to cache
+                       // Add attribute resolution to cache
                        if (currentDefinition.getTTL() > 0) {
-                               resolverCache.cacheAttributeResolution(
-                                       principal,
-                                       attribute.getName(),
-                                       currentDefinition.getTTL(),
-                                       attribute);
+                               resolverCache.cacheAttributeResolution(principal, attribute.getName(), currentDefinition.getTTL(),
+                                               attribute);
                        }
                } catch (ResolutionPlugInException e) {
                        if (currentDefinition.getPropagateErrors()) {
                                throw e;
                        } else {
-                               log.warn(
-                                       "Attribute ("
-                                               + currentDefinition.getId()
-                                               + ") returning no values instead of propagating error: "
-                                               + e);
+                               log.warn("Attribute (" + currentDefinition.getId()
+                                               + ") returning no values instead of propagating error: " + e);
                        }
                }
 
-               //If necessary, cache for this request
+               // If necessary, cache for this request
                if (dependancyOnly || !attribute.hasValues()) {
                        requestCache.put(currentDefinition.getId(), attribute);
                }
        }
 
        private class DuplicatePlugInException extends Exception {
+
                public DuplicatePlugInException(String message) {
+
                        super(message);
                }
        }
 
        class DependentOnlyResolutionAttribute implements ResolverAttribute {
+
                String name;
                ArrayList values = new ArrayList();
                boolean resolved = false;
 
                DependentOnlyResolutionAttribute(String name) {
+
                        this.name = name;
                }
 
                public String getName() {
+
                        return name;
                }
 
                public boolean resolved() {
+
                        return resolved;
                }
 
                public void setResolved() {
+
                        resolved = true;
                }
 
                public void resolveFromCached(ResolverAttribute attribute) {
+
                }
 
                public void setLifetime(long lifetime) {
+
                }
 
                public long getLifetime() {
+
                        return 0;
                }
 
                public void addValue(Object value) {
+
                        values.add(value);
                }
 
                public Iterator getValues() {
+
                        return values.iterator();
                }
 
                public boolean hasValues() {
-                       if (values.isEmpty()) {
-                               return false;
-                       }
+
+                       if (values.isEmpty()) { return false; }
                        return true;
                }
 
                public void registerValueHandler(ValueHandler handler) {
+
                }
 
                public ValueHandler getRegisteredValueHandler() {
+
                        return null;
                }
        }
@@ -682,6 +604,7 @@ public class AttributeResolver {
         * Cleanup resources that won't be released when this object is garbage-collected
         */
        public void destroy() {
+
                resolverCache.destroy();
        }
 }
index ca87014..5244e96 100644 (file)
@@ -1,52 +1,28 @@
-/* 
- * The Shibboleth License, Version 1. 
- * Copyright (c) 2002 
- * University Corporation for Advanced Internet Development, Inc. 
- * All rights reserved
- * 
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions are met:
- * 
- * Redistributions of source code must retain the above copyright notice, this 
- * list of conditions and the following disclaimer.
- * 
- * Redistributions in binary form must reproduce the above copyright notice, 
- * this list of conditions and the following disclaimer in the documentation 
- * and/or other materials provided with the distribution, if any, must include 
- * the following acknowledgment: "This product includes software developed by 
- * the University Corporation for Advanced Internet Development 
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement 
- * may appear in the software itself, if and wherever such third-party 
- * acknowledgments normally appear.
- * 
- * Neither the name of Shibboleth nor the names of its contributors, nor 
- * Internet2, nor the University Corporation for Advanced Internet Development, 
- * Inc., nor UCAID may be used to endorse or promote products derived from this 
- * software without specific prior written permission. For written permission, 
- * please contact shibboleth@shibboleth.org
- * 
- * Products derived from this software may not be called Shibboleth, Internet2, 
- * UCAID, or the University Corporation for Advanced Internet Development, nor 
- * may Shibboleth appear in their name, without prior written permission of the 
- * University Corporation for Advanced Internet Development.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK 
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. 
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY 
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, 
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 package edu.internet2.middleware.shibboleth.aa.attrresolv;
 
 import java.security.Principal;
@@ -54,30 +30,35 @@ import java.security.Principal;
 import javax.naming.directory.Attributes;
 
 /**
- * Defines a Data Connector PlugIn for the AA Attribute Resolver.  Such plugins represent
- * connection points to external data sources from which attribute data is gathered.
+ * Defines a Data Connector PlugIn for the AA Attribute Resolver. Such plugins represent connection points to external
+ * data sources from which attribute data is gathered.
  * 
  * @author Walter Hoehn (wassa@columbia.edu)
  */
 
 public interface DataConnectorPlugIn extends ResolutionPlugIn {
-       
-    /**
-     * Returns the name of a data connector to resolve if this one fails.
-     * 
-     * @return String an Id
-     */
-    public String getFailoverDependencyId();
 
-    /**
-     * Resolves the values of a data connector.
-     * 
-     * @param principal The principal for which the connector should be resolved
-     * @param requester The name of the entity making the resolution request
-     * @param depends Resolution dependencies
-     * @throws ResolutionPlugInException
-     */
-    public Attributes resolve(Principal principal, String requester, Dependencies depends) throws ResolutionPlugInException;
+       /**
+        * Returns the name of a data connector to resolve if this one fails.
+        * 
+        * @return String an Id
+        */
+       public String getFailoverDependencyId();
 
-}
+       /**
+        * Resolves the values of a data connector.
+        * 
+        * @param principal
+        *            The principal for which the connector should be resolved
+        * @param requester
+        *            The name of the entity making the resolution request *
+        * @param responder
+        *            The name of the entity responding to the resolution request
+        * @param depends
+        *            Resolution dependencies
+        * @throws ResolutionPlugInException
+        */
+       public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends)
+                       throws ResolutionPlugInException;
 
+}
index 144c4b5..a4df63e 100644 (file)
@@ -72,6 +72,9 @@ import edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute;
  * @author <a href="mailto:vgoenka@sungardsct.com">Vishal Goenka </a>
  */
 
+/**
+ * @author Walter Hoehn
+ */
 public class CompositeAttributeDefinition extends SimpleBaseAttributeDefinition implements AttributeDefinitionPlugIn {
 
        private static Logger log = Logger.getLogger(CompositeAttributeDefinition.class.getName());
@@ -211,12 +214,12 @@ public class CompositeAttributeDefinition extends SimpleBaseAttributeDefinition
        }
 
        /**
-        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(
-        *      edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute, java.security.Principal, java.lang.String,
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+        *      java.security.Principal, java.lang.String, java.lang.String,
         *      edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
-                       throws ResolutionPlugInException {
+       public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+                       Dependencies depends) throws ResolutionPlugInException {
 
                // Collect attribute values from dependencies
                BasicAttributes attributes = new BasicAttributes();
index ab3be2f..5c3a8db 100644 (file)
@@ -1,50 +1,26 @@
-/* 
- * The Shibboleth License, Version 1. 
- * Copyright (c) 2002 
- * University Corporation for Advanced Internet Development, Inc. 
- * All rights reserved
- * 
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions are met:
- * 
- * Redistributions of source code must retain the above copyright notice, this 
- * list of conditions and the following disclaimer.
- * 
- * Redistributions in binary form must reproduce the above copyright notice, 
- * this list of conditions and the following disclaimer in the documentation 
- * and/or other materials provided with the distribution, if any, must include 
- * the following acknowledgment: "This product includes software developed by 
- * the University Corporation for Advanced Internet Development 
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement 
- * may appear in the software itself, if and wherever such third-party 
- * acknowledgments normally appear.
- * 
- * Neither the name of Shibboleth nor the names of its contributors, nor 
- * Internet2, nor the University Corporation for Advanced Internet Development, 
- * Inc., nor UCAID may be used to endorse or promote products derived from this 
- * software without specific prior written permission. For written permission, 
- * please contact shibboleth@shibboleth.org
- * 
- * Products derived from this software may not be called Shibboleth, Internet2, 
- * UCAID, or the University Corporation for Advanced Internet Development, nor 
- * may Shibboleth appear in their name, without prior written permission of the 
- * University Corporation for Advanced Internet Development.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK 
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. 
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY 
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, 
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 package edu.internet2.middleware.shibboleth.aa.attrresolv.provider;
@@ -61,21 +37,20 @@ import edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugInExcepti
 import edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute;
 
 /**
- * 
  * Wrapper class for custom <code>AttributeDefinitionPlugIn</code> implementations.
  * 
  * @author Walter Hoehn (wassa@columbia.edu)
- *
  */
 public class CustomAttributeDefinition implements ResolutionPlugIn, AttributeDefinitionPlugIn {
 
        private static Logger log = Logger.getLogger(CustomAttributeDefinition.class.getName());
        private AttributeDefinitionPlugIn custom;
 
-    /** The time, in seconds, for which attribute created from this definition should be valid. */
-    protected long lifeTime = -1;
-    
+       /** The time, in seconds, for which attribute created from this definition should be valid. */
+       protected long lifeTime = -1;
+
        public CustomAttributeDefinition(Element e) throws ResolutionPlugInException {
+
                if (!e.getTagName().equals("CustomAttributeDefinition")) {
                        log.error("Incorrect attribute definition configuration: expected <CustomAttributeDefinition> .");
                        throw new ResolutionPlugInException("Failed to initialize Attribute Definition PlugIn.");
@@ -87,45 +62,47 @@ public class CustomAttributeDefinition implements ResolutionPlugIn, AttributeDef
                        throw new ResolutionPlugInException("Failed to initialize Attribute Definition PlugIn.");
                } else {
                        try {
-                               Class[] params = { Class.forName("org.w3c.dom.Element"), };
-                               Object[] passElement = { e };
-                               custom =
-                                       (AttributeDefinitionPlugIn) Class.forName(className).getConstructor(params).newInstance(
+                               Class[] params = {Class.forName("org.w3c.dom.Element"),};
+                               Object[] passElement = {e};
+                               custom = (AttributeDefinitionPlugIn) Class.forName(className).getConstructor(params).newInstance(
                                                passElement);
                        } catch (Exception loaderException) {
-                               log.error(
-                                       "Failed to load Custom Attribute Definition PlugIn implementation class: "
+                               log.error("Failed to load Custom Attribute Definition PlugIn implementation class: "
                                                + loaderException.getMessage());
                                throw new ResolutionPlugInException("Failed to initialize Attribute Definition PlugIn.");
                        }
                }
 
-        String lifeTimeSpec = e.getAttribute("lifeTime");
-        if (lifeTimeSpec != null && !lifeTimeSpec.equals("")) {
-            try {
-                lifeTime = Long.valueOf(lifeTimeSpec).longValue();
-                log.debug("Explicit lifetime set for attribute (" + getId() + ").  Lifetime: (" + lifeTime + ").");
-            } catch (NumberFormatException nfe) {
-                log.error("Bad value for attribute (lifeTime) for Attribute Definition (" + getId() + ").");
-            }
-        }
-    }
+               String lifeTimeSpec = e.getAttribute("lifeTime");
+               if (lifeTimeSpec != null && !lifeTimeSpec.equals("")) {
+                       try {
+                               lifeTime = Long.valueOf(lifeTimeSpec).longValue();
+                               log.debug("Explicit lifetime set for attribute (" + getId() + ").  Lifetime: (" + lifeTime + ").");
+                       } catch (NumberFormatException nfe) {
+                               log.error("Bad value for attribute (lifeTime) for Attribute Definition (" + getId() + ").");
+                       }
+               }
+       }
 
        /**
-        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute, java.security.Principal, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+        *      java.security.Principal, java.lang.String, java.lang.String,
+        *      edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
-               throws ResolutionPlugInException {
-               custom.resolve(attribute, principal, requester, depends);
-        if (lifeTime != -1) {
-            attribute.setLifetime(lifeTime);
-        }
+       public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+                       Dependencies depends) throws ResolutionPlugInException {
+
+               custom.resolve(attribute, principal, requester, responder, depends);
+               if (lifeTime != -1) {
+                       attribute.setLifetime(lifeTime);
+               }
        }
 
        /**
         * @see edu.internet2.middleware.shibboleth.aa.attrresolv.BaseResolutionPlugIn#getId()
         */
        public String getId() {
+
                return custom.getId();
        }
 
@@ -133,6 +110,7 @@ public class CustomAttributeDefinition implements ResolutionPlugIn, AttributeDef
         * @see edu.internet2.middleware.shibboleth.aa.attrresolv.provider.BaseResolutionPlugIn#getTTL()
         */
        public long getTTL() {
+
                return custom.getTTL();
        }
 
@@ -140,6 +118,7 @@ public class CustomAttributeDefinition implements ResolutionPlugIn, AttributeDef
         * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#getAttributeDefinitionDependencyIds()
         */
        public String[] getAttributeDefinitionDependencyIds() {
+
                return custom.getAttributeDefinitionDependencyIds();
        }
 
@@ -147,13 +126,15 @@ public class CustomAttributeDefinition implements ResolutionPlugIn, AttributeDef
         * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#getDataConnectorDependencyIds()
         */
        public String[] getDataConnectorDependencyIds() {
+
                return custom.getDataConnectorDependencyIds();
        }
 
-    /**
-     * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getPropagateErrors()
-     */
-    public boolean getPropagateErrors() {
-        return custom.getPropagateErrors();
-    }
+       /**
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getPropagateErrors()
+        */
+       public boolean getPropagateErrors() {
+
+               return custom.getPropagateErrors();
+       }
 }
index a3bf5ec..0db14a2 100644 (file)
@@ -1,50 +1,26 @@
-/* 
- * The Shibboleth License, Version 1. 
- * Copyright (c) 2002 
- * University Corporation for Advanced Internet Development, Inc. 
- * All rights reserved
- * 
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions are met:
- * 
- * Redistributions of source code must retain the above copyright notice, this 
- * list of conditions and the following disclaimer.
- * 
- * Redistributions in binary form must reproduce the above copyright notice, 
- * this list of conditions and the following disclaimer in the documentation 
- * and/or other materials provided with the distribution, if any, must include 
- * the following acknowledgment: "This product includes software developed by 
- * the University Corporation for Advanced Internet Development 
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement 
- * may appear in the software itself, if and wherever such third-party 
- * acknowledgments normally appear.
- * 
- * Neither the name of Shibboleth nor the names of its contributors, nor 
- * Internet2, nor the University Corporation for Advanced Internet Development, 
- * Inc., nor UCAID may be used to endorse or promote products derived from this 
- * software without specific prior written permission. For written permission, 
- * please contact shibboleth@shibboleth.org
- * 
- * Products derived from this software may not be called Shibboleth, Internet2, 
- * UCAID, or the University Corporation for Advanced Internet Development, nor 
- * may Shibboleth appear in their name, without prior written permission of the 
- * University Corporation for Advanced Internet Development.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK 
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. 
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY 
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, 
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 package edu.internet2.middleware.shibboleth.aa.attrresolv.provider;
@@ -61,11 +37,9 @@ import edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies;
 import edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugInException;
 
 /**
- * 
  * Wrapper class for custom <code>DataConnectorPlugIn</code> implementations.
  * 
  * @author Walter Hoehn (wassa@columbia.edu)
- *
  */
 public class CustomDataConnector implements DataConnectorPlugIn {
 
@@ -73,6 +47,7 @@ public class CustomDataConnector implements DataConnectorPlugIn {
        private DataConnectorPlugIn custom;
 
        public CustomDataConnector(Element e) throws ResolutionPlugInException {
+
                if (!e.getTagName().equals("CustomDataConnector")) {
                        log.error("Incorrect connector configuration: expected <CustomDataConnector> .");
                        throw new ResolutionPlugInException("Failed to initialize Connector PlugIn.");
@@ -84,30 +59,36 @@ public class CustomDataConnector implements DataConnectorPlugIn {
                        throw new ResolutionPlugInException("Failed to initialize Connector PlugIn.");
                } else {
                        try {
-                               Class[] params = { Class.forName("org.w3c.dom.Element"), };
-                               Object[] passElement = { e };
+                               Class[] params = {Class.forName("org.w3c.dom.Element"),};
+                               Object[] passElement = {e};
                                custom = (DataConnectorPlugIn) Class.forName(className).getConstructor(params).newInstance(passElement);
                        } catch (Exception loaderException) {
-                               //Try to be a little smart about logging errors
-                               //For some reason the message is not set on ClassNotFoundException
+                               // Try to be a little smart about logging errors
+                               // For some reason the message is not set on ClassNotFoundException
                                log.error("Failed to load Custom Connector PlugIn implementation class: "
-                                                + ((loaderException.getCause() != null) ? loaderException.getCause().getMessage() : loaderException.toString()));
+                                               + ((loaderException.getCause() != null)
+                                                               ? loaderException.getCause().getMessage()
+                                                               : loaderException.toString()));
                                throw new ResolutionPlugInException("Failed to initialize Connector PlugIn.");
                        }
                }
        }
 
        /**
-        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(Principal)
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(java.security.Principal,
+        *      java.lang.String, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public Attributes resolve(Principal principal, String requester, Dependencies depends) throws ResolutionPlugInException {
-               return custom.resolve(principal, requester, depends);
+       public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends)
+                       throws ResolutionPlugInException {
+
+               return custom.resolve(principal, requester, responder, depends);
        }
 
        /**
         * @see edu.internet2.middleware.shibboleth.aa.attrresolv.BaseResolutionPlugIn#getId()
         */
        public String getId() {
+
                return custom.getId();
        }
 
@@ -115,34 +96,39 @@ public class CustomDataConnector implements DataConnectorPlugIn {
         * @see edu.internet2.middleware.shibboleth.aa.attrresolv.provider.BaseResolutionPlugIn#getTTL()
         */
        public long getTTL() {
+
                return custom.getTTL();
        }
 
-    /**
-     * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getAttributeDefinitionDependencyIds()
-     */
-    public String[] getAttributeDefinitionDependencyIds() {
-        return custom.getAttributeDefinitionDependencyIds();
-    }
-
-    /**
-     * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getDataConnectorDependencyIds()
-     */
-    public String[] getDataConnectorDependencyIds() {
-        return custom.getDataConnectorDependencyIds();
-    }
-    
-    /**
-     * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#getFailoverDependencyId()
-     */
-    public String getFailoverDependencyId() {
-        return custom.getFailoverDependencyId();
-    }
-
-    /**
-     * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getPropagateErrors()
-     */
-    public boolean getPropagateErrors() {
-        return custom.getPropagateErrors();
-    }
+       /**
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getAttributeDefinitionDependencyIds()
+        */
+       public String[] getAttributeDefinitionDependencyIds() {
+
+               return custom.getAttributeDefinitionDependencyIds();
+       }
+
+       /**
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getDataConnectorDependencyIds()
+        */
+       public String[] getDataConnectorDependencyIds() {
+
+               return custom.getDataConnectorDependencyIds();
+       }
+
+       /**
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#getFailoverDependencyId()
+        */
+       public String getFailoverDependencyId() {
+
+               return custom.getFailoverDependencyId();
+       }
+
+       /**
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugIn#getPropagateErrors()
+        */
+       public boolean getPropagateErrors() {
+
+               return custom.getPropagateErrors();
+       }
 }
index 7882ffe..883206f 100644 (file)
@@ -108,12 +108,12 @@ public class FormattedAttributeDefinition extends SimpleBaseAttributeDefinition
        }
 
        /**
-        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(
-        *      edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute, java.security.Principal, java.lang.String,
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+        *      java.security.Principal, java.lang.String, java.lang.String,
         *      edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
-                       throws ResolutionPlugInException {
+       public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+                       Dependencies depends) throws ResolutionPlugInException {
 
                // Resolve all dependencies to arrive at the source values (unformatted)
                Collection results = resolveDependencies(attribute, principal, requester, depends);
index d4097cc..d753237 100644 (file)
@@ -285,7 +285,11 @@ public class JDBCDataConnector extends BaseDataConnector implements DataConnecto
                }
        }
 
-       public Attributes resolve(Principal principal, String requester, Dependencies depends)
+       /**
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(java.security.Principal,
+        *      java.lang.String, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
+        */
+       public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends)
                        throws ResolutionPlugInException {
 
                log.debug("Resolving connector: (" + getId() + ")");
@@ -330,7 +334,7 @@ public class JDBCDataConnector extends BaseDataConnector implements DataConnecto
                try {
                        preparedStatement = conn.prepareStatement(searchVal);
                        preparedStatement.clearParameters();
-                       statementCreator.create(preparedStatement, principal, requester, depends);
+                       statementCreator.create(preparedStatement, principal, requester, responder, depends);
                        rs = preparedStatement.executeQuery();
                        if (!rs.next()) {
                                if (minResultSet == 0) return new BasicAttributes();
@@ -611,8 +615,8 @@ class DefaultStatementCreator implements JDBCStatementCreator {
 
        private static Logger log = Logger.getLogger(DefaultStatementCreator.class.getName());
 
-       public void create(PreparedStatement preparedStatement, Principal principal, String requester, Dependencies depends)
-                       throws JDBCStatementCreatorException {
+       public void create(PreparedStatement preparedStatement, Principal principal, String requester, String responder,
+                       Dependencies depends) throws JDBCStatementCreatorException {
 
                log.debug("Creating prepared statement.  Substituting principal: (" + principal.getName() + ")");
                // Tried using ParameterMetaData to determine param count, but it fails, so...
@@ -666,8 +670,8 @@ class DependencyStatementCreator implements JDBCStatementCreator {
                log.debug("Parameters configured: " + parameters.size());
        }
 
-       public void create(PreparedStatement preparedStatement, Principal principal, String requester, Dependencies depends)
-                       throws JDBCStatementCreatorException {
+       public void create(PreparedStatement preparedStatement, Principal principal, String requester, String responder,
+                       Dependencies depends) throws JDBCStatementCreatorException {
 
                try {
                        log.debug("Creating prepared statement.  Substituting values from dependencies.");
index 16f59bc..98f3bc2 100644 (file)
@@ -1,50 +1,26 @@
-/* 
- * The Shibboleth License, Version 1. 
- * Copyright (c) 2002 
- * University Corporation for Advanced Internet Development, Inc. 
- * All rights reserved
- * 
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions are met:
- * 
- * Redistributions of source code must retain the above copyright notice, this 
- * list of conditions and the following disclaimer.
- * 
- * Redistributions in binary form must reproduce the above copyright notice, 
- * this list of conditions and the following disclaimer in the documentation 
- * and/or other materials provided with the distribution, if any, must include 
- * the following acknowledgment: "This product includes software developed by 
- * the University Corporation for Advanced Internet Development 
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement 
- * may appear in the software itself, if and wherever such third-party 
- * acknowledgments normally appear.
- * 
- * Neither the name of Shibboleth nor the names of its contributors, nor 
- * Internet2, nor the University Corporation for Advanced Internet Development, 
- * Inc., nor UCAID may be used to endorse or promote products derived from this 
- * software without specific prior written permission. For written permission, 
- * please contact shibboleth@shibboleth.org
- * 
- * Products derived from this software may not be called Shibboleth, Internet2, 
- * UCAID, or the University Corporation for Advanced Internet Development, nor 
- * may Shibboleth appear in their name, without prior written permission of the 
- * University Corporation for Advanced Internet Development.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK 
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. 
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY 
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, 
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 package edu.internet2.middleware.shibboleth.aa.attrresolv.provider;
@@ -55,13 +31,14 @@ import java.sql.PreparedStatement;
 import edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies;
 
 /**
- * Definition for the JDBC Statement Creator.  Implementations are responsible for 
- * setting all parameters on the specified prepared statement.
+ * Definition for the JDBC Statement Creator. Implementations are responsible for setting all parameters on the
+ * specified prepared statement.
  * 
  * @author Walter Hoehn (wassa@columbia.edu)
  */
 public interface JDBCStatementCreator {
 
-       void create(PreparedStatement preparedStatement, Principal principal, String requester, Dependencies depends) throws JDBCStatementCreatorException;
+       void create(PreparedStatement preparedStatement, Principal principal, String requester, String responder,
+                       Dependencies depends) throws JDBCStatementCreatorException;
 
 }
index 904388b..10f8c04 100644 (file)
@@ -299,9 +299,10 @@ public class JNDIDirectoryDataConnector extends BaseDataConnector implements Dat
        }
 
        /**
-        * See {@link DataConnectorPlugIn#resolve(Principal, String, Dependencies)}
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(java.security.Principal,
+        *      java.lang.String, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public Attributes resolve(Principal principal, String requester, Dependencies depends)
+       public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends)
                        throws ResolutionPlugInException {
 
                InitialDirContext context = null;
index 60fba68..21d1dbf 100644 (file)
@@ -61,13 +61,21 @@ import edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute;
  * <pre>
  * 
  *  
- *        &lt;ValueMap value=&quot;affiliate&quot;  keyset=&quot;guest, prospect[a-z ]*, friends&quot;                        /&gt;
- *        &lt;ValueMap value=&quot;alum&quot;       keyset=&quot;alum, alumni&quot;                                           /&gt;
- *        &lt;ValueMap value=&quot;employee&quot;   keyset=&quot;employee&quot;                                               /&gt;
- *        &lt;ValueMap value=&quot;faculty&quot;    keyset=&quot;faculty&quot;                                                /&gt;
- *        &lt;ValueMap value=&quot;member&quot;     keyset=&quot;student, faculty, admin[a-z ]*, [a-z ]*admin, employee&quot; /&gt;
- *        &lt;ValueMap value=&quot;staff&quot;      keyset=&quot;admin[a-z ]*, [a-z ]*admin&quot;                             /&gt;
- *        &lt;ValueMap value=&quot;student&quot;    keyset=&quot;student&quot;                                                /&gt;
+ *   
+ *    
+ *     
+ *      
+ *            &lt;ValueMap value=&quot;affiliate&quot;  keyset=&quot;guest, prospect[a-z ]*, friends&quot;                        /&gt;
+ *            &lt;ValueMap value=&quot;alum&quot;       keyset=&quot;alum, alumni&quot;                                           /&gt;
+ *            &lt;ValueMap value=&quot;employee&quot;   keyset=&quot;employee&quot;                                               /&gt;
+ *            &lt;ValueMap value=&quot;faculty&quot;    keyset=&quot;faculty&quot;                                                /&gt;
+ *            &lt;ValueMap value=&quot;member&quot;     keyset=&quot;student, faculty, admin[a-z ]*, [a-z ]*admin, employee&quot; /&gt;
+ *            &lt;ValueMap value=&quot;staff&quot;      keyset=&quot;admin[a-z ]*, [a-z ]*admin&quot;                             /&gt;
+ *            &lt;ValueMap value=&quot;student&quot;    keyset=&quot;student&quot;                                                /&gt;
+ *       
+ *      
+ *     
+ *    
  *   
  *  
  * </pre>
@@ -142,12 +150,12 @@ public class MappedAttributeDefinition extends SimpleBaseAttributeDefinition imp
        }
 
        /**
-        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(
-        *      edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute, java.security.Principal, java.lang.String,
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+        *      java.security.Principal, java.lang.String, java.lang.String,
         *      edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
-                       throws ResolutionPlugInException {
+       public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+                       Dependencies depends) throws ResolutionPlugInException {
 
                // Resolve all dependencies to arrive at the source values (unformatted)
                Collection results = resolveDependencies(attribute, principal, requester, depends);
index a4c2e3d..791ed77 100644 (file)
@@ -172,8 +172,8 @@ public class PersistentIDAttributeDefinition extends BaseAttributeDefinition imp
         * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute,
         *      java.security.Principal, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
-                       throws ResolutionPlugInException {
+       public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+                       Dependencies depends) throws ResolutionPlugInException {
 
                log.debug("Resolving attribute: (" + getId() + ")");
 
index 996780b..ffc78cd 100644 (file)
@@ -112,12 +112,12 @@ public class RegExAttributeDefinition extends SimpleBaseAttributeDefinition impl
        }
 
        /**
-        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(
-        *      edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute, java.security.Principal, java.lang.String,
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+        *      java.security.Principal, java.lang.String, java.lang.String,
         *      edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
-                       throws ResolutionPlugInException {
+       public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+                       Dependencies depends) throws ResolutionPlugInException {
 
                // Resolve all dependencies to arrive at the source values (unformatted)
                Collection results = resolveDependencies(attribute, principal, requester, depends);
index bead6fd..a9ba4bf 100644 (file)
@@ -1,50 +1,26 @@
-/* 
- * The Shibboleth License, Version 1. 
- * Copyright (c) 2002 
- * University Corporation for Advanced Internet Development, Inc. 
- * All rights reserved
- * 
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions are met:
- * 
- * Redistributions of source code must retain the above copyright notice, this 
- * list of conditions and the following disclaimer.
- * 
- * Redistributions in binary form must reproduce the above copyright notice, 
- * this list of conditions and the following disclaimer in the documentation 
- * and/or other materials provided with the distribution, if any, must include 
- * the following acknowledgment: "This product includes software developed by 
- * the University Corporation for Advanced Internet Development 
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement 
- * may appear in the software itself, if and wherever such third-party 
- * acknowledgments normally appear.
- * 
- * Neither the name of Shibboleth nor the names of its contributors, nor 
- * Internet2, nor the University Corporation for Advanced Internet Development, 
- * Inc., nor UCAID may be used to endorse or promote products derived from this 
- * software without specific prior written permission. For written permission, 
- * please contact shibboleth@shibboleth.org
- * 
- * Products derived from this software may not be called Shibboleth, Internet2, 
- * UCAID, or the University Corporation for Advanced Internet Development, nor 
- * may Shibboleth appear in their name, without prior written permission of the 
- * University Corporation for Advanced Internet Development.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK 
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. 
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY 
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, 
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 package edu.internet2.middleware.shibboleth.aa.attrresolv.provider;
@@ -63,24 +39,24 @@ import edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies;
 import edu.internet2.middleware.shibboleth.aa.attrresolv.ResolutionPlugInException;
 
 /**
- * Sample <code>DataConnectorPlugIn</code> implementation.  Echos principal name
- * in EPPN.
+ * Sample <code>DataConnectorPlugIn</code> implementation. Echos principal name in EPPN.
  * 
  * @author Walter Hoehn
- *
  */
 public class SampleConnector extends BaseResolutionPlugIn implements DataConnectorPlugIn {
 
        private static Logger log = Logger.getLogger(SampleConnector.class.getName());
 
        public SampleConnector(Element e) throws ResolutionPlugInException {
+
                super(e);
        }
 
        /**
-        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(Principal)
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(java.security.Principal,
+        *      java.lang.String, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public Attributes resolve(Principal principal, String requester, Dependencies depends) {
+       public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends) {
 
                log.debug("Resolving connector: (" + getId() + ")");
                log.debug(getId() + " resolving for principal: (" + principal.getName() + ")");
@@ -92,10 +68,11 @@ public class SampleConnector extends BaseResolutionPlugIn implements DataConnect
                return attributes;
        }
 
-    /**
-     * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#getFailoverDependencyId()
-     */
-    public String getFailoverDependencyId() {
-        return null;
-    }
+       /**
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#getFailoverDependencyId()
+        */
+       public String getFailoverDependencyId() {
+
+               return null;
+       }
 }
index 958a20b..a708802 100644 (file)
@@ -142,11 +142,12 @@ public class SimpleAttributeDefinition extends SimpleBaseAttributeDefinition imp
        }
 
        /**
-        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ArpAttribute,
-        *      java.security.Principal, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.AttributeDefinitionPlugIn#resolve(edu.internet2.middleware.shibboleth.aa.attrresolv.ResolverAttribute,
+        *      java.security.Principal, java.lang.String, java.lang.String,
+        *      edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public void resolve(ResolverAttribute attribute, Principal principal, String requester, Dependencies depends)
-                       throws ResolutionPlugInException {
+       public void resolve(ResolverAttribute attribute, Principal principal, String requester, String responder,
+                       Dependencies depends) throws ResolutionPlugInException {
 
                log.debug("Resolving attribute: (" + getId() + ")");
                Set results = new LinkedHashSet();
index 01a6872..27fbaa9 100644 (file)
@@ -243,7 +243,8 @@ public class IdPProtocolSupport implements Metadata {
                                attributeSet.add(attribute);
                        }
 
-                       return resolveAttributes(principal, requester, resource, attributeSet);
+                       return resolveAttributes(principal, requester, relyingParty.getIdentityProvider().getProviderId(),
+                                       resource, attributeSet);
 
                } catch (SAMLException e) {
                        log.error("An error occurred while creating attributes for principal (" + principal.getName() + ") :"
@@ -257,10 +258,10 @@ public class IdPProtocolSupport implements Metadata {
                }
        }
 
-       private SAMLAttribute[] resolveAttributes(Principal principal, String requester, URL resource,
+       private SAMLAttribute[] resolveAttributes(Principal principal, String requester, String responder, URL resource,
                        AAAttributeSet attributeSet) throws ArpProcessingException {
 
-               resolver.resolveAttributes(principal, requester, attributeSet);
+               resolver.resolveAttributes(principal, requester, responder, attributeSet);
                arpEngine.filterAttributes(attributeSet, principal, requester, resource);
                return attributeSet.getAttributes();
        }
index eddc82b..313c794 100644 (file)
@@ -70,6 +70,7 @@ public class ResolverTest {
        private static String resolverxml = null;
        private static String idpXml = null;
        private static String requester = null;
+       private static String responder = null;
        private static String user = null;
        private static String resource = null;
        private static URL resourceUrl = null;
@@ -92,7 +93,7 @@ public class ResolverTest {
 
                Principal principal = new LocalPrincipal(user);
 
-               resolver.resolveAttributes(principal, requester, attributeSet);
+               resolver.resolveAttributes(principal, requester, responder, attributeSet);
 
                try {
                        if (arpEngine != null) {
@@ -113,6 +114,7 @@ public class ResolverTest {
                CmdLineParser.Option idpXmlOption = parser.addStringOption('\u0000', "idpXml");
                CmdLineParser.Option userOption = parser.addStringOption('u', "user");
                CmdLineParser.Option requesterOption = parser.addStringOption('r', "requester");
+               CmdLineParser.Option responderOption = parser.addStringOption('i', "responder");
                CmdLineParser.Option resolverxmlOption = parser.addStringOption('\u0000', "resolverxml");
                CmdLineParser.Option fileOption = parser.addStringOption('f', "file"); // deprecated
                CmdLineParser.Option resourceOption = parser.addStringOption('\u0000', "resource");
@@ -146,6 +148,7 @@ public class ResolverTest {
 
                user = (String) parser.getOptionValue(userOption);
                requester = (String) parser.getOptionValue(requesterOption);
+               responder = (String) parser.getOptionValue(responderOption);
                resource = (String) parser.getOptionValue(resourceOption);
 
                configureLogging(debug);
@@ -285,15 +288,16 @@ public class ResolverTest {
                out.println("Options:");
                out.println("  -h, --help                Print usage information");
                out.println("  -d, --debug               Run in debug mode");
-               out.println("  --idpXml=FILEURL       URL of the IdP configuration file. Attributes");
-               out.println("                            will be filtered according to the Attribute Release");
-               out.println("                            Policy (ARP) specified in the configuration file");
+               out.println("  --idpXml=FILEURL          URL of the IdP configuration file. Attributes");
+               out.println("                              will be filtered according to the Attribute Release");
+               out.println("                              Policy (ARP) specified in the configuration file");
                out.println("  --resolverxml=FILEURL     URL of the resolver configuration file. No ARP");
-               out.println("                            filtering will be done");
+               out.println("                              filtering will be done");
                out.println("  --user=USER               User for whom attributes should be resolved");
-               out.println("  --requester=REQUESTER     Name of the requester (SHAR). Emulates");
-               out.println("                            unauthenticated requester if not specified");
+               out.println("  --requester=REQUESTER     Name of the requester (SP). Emulates");
+               out.println("                              unauthenticated requester if not specified");
+               out.println("  --responder=RESPONDER     Name of the responder (IdP).");
                out.println("  --resource=URL            URL of the resource. Only attributes available");
-               out.println("                            to any resource will be returned if not specified");
+               out.println("                              to any resource will be returned if not specified");
        }
 }
index 3c1239d..1f25b15 100644 (file)
@@ -77,7 +77,7 @@ public class FileConnector extends BaseResolutionPlugIn implements DataConnector
        /**
         * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(Principal)
         */
-       public Attributes resolve(Principal principal, String requester, Dependencies depends) {
+       public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends) {
 
                log.debug("Resolving connector: (" + getId() + ")");
                log.debug(getId() + " resolving for principal: (" + principal.getName() + ")");
index a919ef5..e4fa34d 100644 (file)
@@ -96,7 +96,7 @@ public class ResolverTests extends TestCase {
                                        "urn:mace:dir:attribute-def:eduPersonEntitlement",
                                        new Object[]{"urn:mace:example.edu:exampleEntitlement"})});
 
-                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
@@ -128,7 +128,7 @@ public class ResolverTests extends TestCase {
                                                        new AAAttribute("foo", new Object[]{"bar@example.com"}, new ScopedStringValueHandler(
                                                                        "example.edu"))});
 
-                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
                } catch (AttributeResolverException e) {
@@ -204,7 +204,7 @@ public class ResolverTests extends TestCase {
                        AAAttributeSet outputAttributes = new AAAttributeSet(new AAAttribute[]{new AAAttribute("myAffiliation",
                                        new Object[]{"member"})});
 
-                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
                } catch (AttributeResolverException e) {
@@ -234,7 +234,7 @@ public class ResolverTests extends TestCase {
                                        new AAAttribute("urn:mace:dir:attribute-def:eduPersonEntitlement",
                                                        new Object[]{"urn:mace:example.edu:exampleEntitlement"})});
 
-                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
@@ -260,7 +260,7 @@ public class ResolverTests extends TestCase {
                                        "urn:mace:dir:attribute-def:eduPersonScopedAffiliation", new Object[]{"member@example.edu"},
                                        new ScopedStringValueHandler("example.edu"))});
 
-                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
@@ -284,7 +284,7 @@ public class ResolverTests extends TestCase {
 
                        AAAttributeSet outputAttributes = new AAAttributeSet();
 
-                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
@@ -308,7 +308,7 @@ public class ResolverTests extends TestCase {
 
                        AAAttributeSet outputAttributes = new AAAttributeSet();
 
-                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
                } catch (ClassCastException e) {
@@ -339,7 +339,7 @@ public class ResolverTests extends TestCase {
                                        new AAAttribute("urn:mace:dir:attribute-def:eduPersonAffiliation", new Object[]{"member"}),
                                        new AAAttribute("urn:mace:shibboleth:test:eduPersonAffiliation", new Object[]{"member"})});
 
-                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", inputAttributes);
+                       ar.resolveAttributes(new LocalPrincipal("mytestuser"), "shar.example.edu", null, inputAttributes);
 
                        assertEquals("Attribute Resolver returned unexpected attribute set.", inputAttributes, outputAttributes);
 
@@ -378,7 +378,7 @@ public class ResolverTests extends TestCase {
 
                        // Read only the attribute names from the output file. The values are set by the resolver
                        ResolverAttributeSet attrsToBeResolved = attrFile.getResolverAttributes(false);
-                       ar.resolveAttributes(new LocalPrincipal(principal), requester, attrsToBeResolved);
+                       ar.resolveAttributes(new LocalPrincipal(principal), requester, null, attrsToBeResolved);
 
                        // Read the attribute names and values from the output file
                        ResolverAttributeSet expectedAttributes = attrFile.getResolverAttributes(true);
index ae5418d..dfcee2e 100644 (file)
@@ -1,50 +1,26 @@
-/* 
- * The Shibboleth License, Version 1. 
- * Copyright (c) 2002 
- * University Corporation for Advanced Internet Development, Inc. 
- * All rights reserved
- * 
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions are met:
- * 
- * Redistributions of source code must retain the above copyright notice, this 
- * list of conditions and the following disclaimer.
- * 
- * Redistributions in binary form must reproduce the above copyright notice, 
- * this list of conditions and the following disclaimer in the documentation 
- * and/or other materials provided with the distribution, if any, must include 
- * the following acknowledgment: "This product includes software developed by 
- * the University Corporation for Advanced Internet Development 
- * <http://www.ucaid.edu>Internet2 Project. Alternately, this acknowledegement 
- * may appear in the software itself, if and wherever such third-party 
- * acknowledgments normally appear.
- * 
- * Neither the name of Shibboleth nor the names of its contributors, nor 
- * Internet2, nor the University Corporation for Advanced Internet Development, 
- * Inc., nor UCAID may be used to endorse or promote products derived from this 
- * software without specific prior written permission. For written permission, 
- * please contact shibboleth@shibboleth.org
- * 
- * Products derived from this software may not be called Shibboleth, Internet2, 
- * UCAID, or the University Corporation for Advanced Internet Development, nor 
- * may Shibboleth appear in their name, without prior written permission of the 
- * University Corporation for Advanced Internet Development.
- * 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
- * AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK 
- * OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. 
- * IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY 
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, 
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/*
+ * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
+ * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met: Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
+ * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
+ * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
+ * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
+ * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
+ * products derived from this software without specific prior written permission. For written permission, please contact
+ * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
+ * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
+ * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
+ * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
+ * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
+ * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 package edu.internet2.middleware.shibboleth.aa.attrresolv;
@@ -64,20 +40,21 @@ import edu.internet2.middleware.shibboleth.aa.attrresolv.provider.BaseDataConnec
  * <code>DataConnectorPlugIn</code> implementation for use in unit testing.
  * 
  * @author Walter Hoehn
- *
  */
 public class ScopeTestConnector extends BaseDataConnector implements DataConnectorPlugIn {
 
        private static Logger log = Logger.getLogger(ScopeTestConnector.class.getName());
 
        public ScopeTestConnector(Element e) throws ResolutionPlugInException {
+
                super(e);
        }
 
        /**
-        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(Principal)
+        * @see edu.internet2.middleware.shibboleth.aa.attrresolv.DataConnectorPlugIn#resolve(java.security.Principal,
+        *      java.lang.String, java.lang.String, edu.internet2.middleware.shibboleth.aa.attrresolv.Dependencies)
         */
-       public Attributes resolve(Principal principal, String requester, Dependencies depends) {
+       public Attributes resolve(Principal principal, String requester, String responder, Dependencies depends) {
 
                log.debug("Resolving connector: (" + getId() + ")");
                log.debug(getId() + " resolving for principal: (" + principal.getName() + ")");