AA compiles again.
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / common / ShibbolethOriginConfig.java
index 9d6c7a0..4e77647 100644 (file)
@@ -52,67 +52,49 @@ import java.io.PrintStream;
 import java.util.Properties;
 
 import org.apache.log4j.Logger;
-import org.opensaml.SAMLAuthenticationStatement;
 import org.w3c.dom.Element;
 
-import edu.internet2.middleware.shibboleth.hs.HSConfigurationException;
 
 /**
  * @author Walter Hoehn
  *  
  */
-public class ShibbolethOriginConfig {
+public abstract class ShibbolethOriginConfig {
 
        public static final String originConfigNamespace = "urn:mace:shibboleth:origin:1.0";
 
        private static Logger log = Logger.getLogger(ShibbolethOriginConfig.class.getName());
        protected Properties properties = new Properties();
 
-       public ShibbolethOriginConfig(Element config) throws HSConfigurationException {
+       public ShibbolethOriginConfig(Element config) throws ShibbolethConfigurationException {
+
+               //TODO more generic
 
                if (!config.getTagName().equals("ShibbolethOriginConfig")) {
-                       throw new HSConfigurationException("Unexpected configuration data.  <ShibbolethOriginConfig> is needed.");
+                       throw new ShibbolethConfigurationException("Unexpected configuration data.  <ShibbolethOriginConfig> is needed.");
                }
 
-               //Set defaults
-               //TODO need a way to set this
-               properties.setProperty("edu.internet2.middleware.shibboleth.hs.HandleServlet.username", "REMOTE_USER");
-               //TODO need a way to set this, remember to test for number format
-               properties.setProperty("edu.internet2.middleware.shibboleth.hs.HandleServlet.maxThreads", "5");
-
                log.debug("Loading global configuration properties.");
 
                String attribute = ((Element) config).getAttribute("providerId");
                if (attribute == null || attribute.equals("")) {
                        log.error("Global providerId not set.  Add a (providerId) attribute to <ShibbolethOriginConfig>.");
-                       throw new HSConfigurationException("Required configuration not specified.");
-               }
+                       throw new ShibbolethConfigurationException("Required configuration not specified.");
+               } //TODO should not be under hs namespace
                properties.setProperty("edu.internet2.middleware.shibboleth.hs.HandleServlet.providerId", attribute);
 
                attribute = ((Element) config).getAttribute("defaultRelyingParty");
                if (attribute == null || attribute.equals("")) {
                        log.error("Global providerId not set.  Add a (defaultRelyingParty) attribute to <ShibbolethOriginConfig>.");
-                       throw new HSConfigurationException("Required configuration not specified.");
+                       throw new ShibbolethConfigurationException("Required configuration not specified.");
                }
                properties.setProperty(
                        "edu.internet2.middleware.shibboleth.common.RelyingParty.defaultRelyingParty",
                        attribute);
 
-               attribute = ((Element) config).getAttribute("AAUrl");
-               if (attribute == null || attribute.equals("")) {
-                       log.error("Global providerId not set.  Add a (AAUrl) attribute to <ShibbolethOriginConfig>.");
-                       throw new HSConfigurationException("Required configuration not specified.");
-               }
-               properties.setProperty("edu.internet2.middleware.shibboleth.hs.HandleServlet.AAUrl", attribute);
-
-               attribute = ((Element) config).getAttribute("defaultAuthMethod");
-               if (attribute == null || attribute.equals("")) {
-                       properties.setProperty(
-                               "edu.internet2.middleware.shibboleth.hs.HandleServlet.defaultAuthMethod",
-                               "urn:oasis:names:tc:SAML:1.0:am:unspecified");
-               }
-               properties.setProperty("edu.internet2.middleware.shibboleth.hs.HandleServlet.defaultAuthMethod", attribute);
+       }
 
+       protected void dumpPropertiesToLog() {
                if (log.isDebugEnabled()) {
                        ByteArrayOutputStream debugStream = new ByteArrayOutputStream();
                        PrintStream debugPrinter = new PrintStream(debugStream);