Re-implemented remaining config options for HS.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 13 Feb 2004 20:24:53 +0000 (20:24 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Fri, 13 Feb 2004 20:24:53 +0000 (20:24 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@895 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/hs/HSConfig.java
src/schemas/origin.xsd

index 0838bb5..a4af8b1 100644 (file)
@@ -63,9 +63,6 @@ public class HSConfig extends ShibbolethOriginConfig {
        public HSConfig(Element config) throws ShibbolethConfigurationException {
                super(config);
 
-               //TODO need to make authHeaderName configurable
-               //TODO need to make max threads configurable
-
                String attribute = ((Element) config).getAttribute("AAUrl");
                if (attribute == null || attribute.equals("")) {
                        log.error("Global Attribute Authority URL not set.  Add an (AAUrl) attribute to <ShibbolethOriginConfig>.");
@@ -93,6 +90,26 @@ public class HSConfig extends ShibbolethOriginConfig {
                        log.error("(defaultAuthMethod) attribute to is not a valid URI.");
                        throw new ShibbolethConfigurationException("Required configuration is invalid.");
                }
+
+               attribute = ((Element) config).getAttribute("maxHSThreads");
+               if (attribute != null && !attribute.equals("")) {
+                       try {
+                               maxThreads = Integer.parseInt(attribute);
+                       } catch (NumberFormatException e) {
+                               log.error("(maxHSThreads) attribute to is not a valid integer.");
+                               throw new ShibbolethConfigurationException("Configuration is invalid.");
+                       }
+               }
+
+               attribute = ((Element) config).getAttribute("authHeaderName");
+               if (attribute != null && !attribute.equals("")) {
+                       authHeaderName = attribute;
+               }
+
+               log.debug("Global config: (AAUrl) = (" + getAAUrl() + ").");
+               log.debug("Global config: (defaultAuthMethod) = (" + getDefaultAuthMethod() + ").");
+               log.debug("Global config: (maxHSThreads) = (" + getMaxThreads() + ").");
+               log.debug("Global config: (authHeaderName) = (" + getAuthHeaderName() + ").");
        }
 
        public int getMaxThreads() {
@@ -102,11 +119,11 @@ public class HSConfig extends ShibbolethOriginConfig {
        public String getAuthHeaderName() {
                return authHeaderName;
        }
-       
+
        public URI getDefaultAuthMethod() {
                return defaultAuthMethod;
        }
-       
+
        public URL getAAUrl() {
                return AAUrl;
        }
index 892f27b..3fdc28c 100644 (file)
@@ -53,6 +53,8 @@
                        <xs:attribute name="defaultRelyingParty" type="xs:anyURI" use="required"/>
                        <xs:attribute name="defaultAuthMethod" type="xs:string" use="optional" default="urn:oasis:names:tc:SAML:1.0:am:unspecified"/>
                        <xs:attribute name="passThruErrors" type="xs:boolean" use="optional" default="false"/>
+                       <xs:attribute name="authHeaderName" type="xs:string" use="optional"/>
+                       <xs:attribute name="maxHSThreads" type="xs:integer" use="optional"/>
                </xs:complexType>
        </xs:element>
 </xs:schema>