Helps to actually set the parameter.
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / common / ServiceProviderMapper.java
index a451d33..50f55b4 100644 (file)
@@ -134,12 +134,15 @@ public class ServiceProviderMapper {
                if (provider != null) {
                        EntitiesDescriptor parent = provider.getEntitiesDescriptor();
                        while (parent != null) {
-                               if (relyingParties.containsKey(parent.getName())) {
-                                       log.info("Found matching Relying Party for group (" + parent.getName() + ").");
-                                       return (RelyingParty) relyingParties.get(parent.getName());
-                               } else {
-                                       log.debug("Provider is a member of group (" + parent.getName()
-                                                       + "), but no matching Relying Party was found.");
+                               if (parent.getName() != null) {
+                                       if (relyingParties.containsKey(parent.getName())) {
+                                               log.info("Found matching Relying Party for group (" + parent.getName() + ").");
+                                               return (RelyingParty) relyingParties.get(parent.getName());
+                                       }
+                                       else {
+                                               log.debug("Provider is a member of group (" + parent.getName()
+                                                               + "), but no matching Relying Party was found.");
+                                       }
                                }
                                parent = parent.getEntitiesDescriptor();
                        }
@@ -217,6 +220,7 @@ public class ServiceProviderMapper {
                private boolean passThruIsOverriden = false;
                private boolean forceAttributePush = false;
                private boolean forceAttributeNoPush = false;
+               private boolean singleAssertion = false;
                private boolean defaultToPOST = true;
                private boolean wantsAssertionsSigned = false;
                private int preferredArtifactType = 1;
@@ -283,6 +287,16 @@ public class ServiceProviderMapper {
                                log.debug("Relying party defaults to Artifact profile.");
                        }
 
+                       attribute = ((Element) partyConfig).getAttribute("singleAssertion");
+                       if (attribute != null && !attribute.equals("")) {
+                               singleAssertion = Boolean.valueOf(attribute).booleanValue();
+                       }
+                       if (singleAssertion) {
+                               log.debug("Relying party defaults to a single assertion when pushing attributes.");
+                       } else {
+                               log.debug("Relying party defaults to multiple assertions when pushing attributes.");
+                       }
+                       
                        // Relying Party wants assertions signed?
                        attribute = ((Element) partyConfig).getAttribute("signAssertions");
                        if (attribute != null && !attribute.equals("")) {
@@ -451,6 +465,10 @@ public class ServiceProviderMapper {
                        return forceAttributeNoPush;
                }
 
+               public boolean singleAssertion() {
+                       return singleAssertion;
+               }
+               
                public boolean defaultToPOSTProfile() {
 
                        return defaultToPOST;
@@ -508,7 +526,6 @@ public class ServiceProviderMapper {
                                return credential;
                        }
                }
-
        }
 
        /**
@@ -577,6 +594,11 @@ public class ServiceProviderMapper {
                        return wrapped.forceAttributeNoPush();
                }
 
+               public boolean singleAssertion() {
+                       
+                       return wrapped.singleAssertion();
+               }
+               
                public boolean defaultToPOSTProfile() {
 
                        return wrapped.defaultToPOSTProfile();
@@ -669,6 +691,11 @@ public class ServiceProviderMapper {
                        return false;
                }
 
+               public boolean singleAssertion() {
+                       
+                       return false;
+               }
+               
                public boolean defaultToPOSTProfile() {
 
                        return true;