Added javadoc.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 5 Feb 2004 07:36:55 +0000 (07:36 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 5 Feb 2004 07:36:55 +0000 (07:36 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@885 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/AARelyingParty.java
src/edu/internet2/middleware/shibboleth/common/OriginComponent.java
src/edu/internet2/middleware/shibboleth/hs/HSRelyingParty.java

index a715c0a..8118083 100644 (file)
@@ -49,10 +49,17 @@ package edu.internet2.middleware.shibboleth.aa;
 import edu.internet2.middleware.shibboleth.common.RelyingParty;
 
 /**
+ * Defines a method for obtaining data that is bound to a <code>RelyingParty</code>
+ * and is needed by the Shibboloeth Attribute Authority.
+ * 
  * @author Walter Hoehn
  */
 public interface AARelyingParty extends RelyingParty {
-       
+
+       /**
+        * A boolean indication of whether internal errors should be transmitted to
+        * this <code>RelyingParty</code>
+        */
        public boolean passThruErrors();
-       
+
 }
\ No newline at end of file
index 0fbec9d..0610522 100644 (file)
@@ -63,90 +63,99 @@ import org.xml.sax.SAXParseException;
 import org.w3c.dom.Document;
 
 /**
+ * Shared functionality for origin components.
+ * 
  * @author Walter Hoehn
  */
 public abstract class OriginComponent extends HttpServlet {
 
        private static Logger log = Logger.getLogger(OriginComponent.class.getName());
-        private static Document originConfig = null;
-
-        /* synchronized to make sure only one thread attempts to parse the config file */
-        protected synchronized Document getOriginConfig () throws ShibbolethConfigurationException
-        {
-            if (originConfig != null)
-            {
-                return originConfig;
-            }
-
-            DOMParser parser = new DOMParser();
-
-            try {
-                parser.setFeature("http://xml.org/sax/features/validation", true);
-                parser.setFeature("http://apache.org/xml/features/validation/schema", true);
-
-                parser.setEntityResolver(
-                        new EntityResolver() {
-                            public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
-                                log.debug("Resolving entity for System ID: " + systemId);
-                                if (systemId != null) {
-                                    StringTokenizer tokenString = new StringTokenizer(systemId, "/");
-                                    String xsdFile = "";
-                                    while (tokenString.hasMoreTokens()) {
-                                        xsdFile = tokenString.nextToken();
-                                    }
-                                    if (xsdFile.endsWith(".xsd")) {
-                                        InputStream stream;
-                                        try {
-                                            stream = new ShibResource("/schemas/" + xsdFile, this.getClass()).getInputStream();
-                                        } catch (IOException ioe) {
-                                            log.error("Error loading schema: " + xsdFile + ": " + ioe);
-                                            return null;
-                                        }
-                                        if (stream != null) {
-                                            return new InputSource(stream);
-                                        }
-                                    }
-                                }
-                                return null;
-                            }
-                        });
-
-                parser.setErrorHandler(new ErrorHandler() {
-                    public void error(SAXParseException arg0) throws SAXException {
-                        throw new SAXException("Error parsing xml file: " + arg0);
-                    }
-                    public void fatalError(SAXParseException arg0) throws SAXException {
-                        throw new SAXException("Error parsing xml file: " + arg0);
-                    }
-                    public void warning(SAXParseException arg0) throws SAXException {
-                        throw new SAXException("Error parsing xml file: " + arg0);
-                    }
-                });
-
-            } catch (SAXException e) {
-                log.error("Unable to setup a workable XML parser: " + e);
-                throw new ShibbolethConfigurationException("Unable to setup a workable XML parser.");
-            }
-
-            String originConfigFile = getInitParameter("OriginConfigFile");
-            if (originConfigFile == null) {
-                originConfigFile = "/conf/origin.xml";
-            }
-
-            log.debug("Loading Configuration from (" + originConfigFile + ").");
-
-            try {
-                parser.parse(new InputSource(new ShibResource(originConfigFile, this.getClass()).getInputStream()));
-            } catch (SAXException e) {
-                log.error("Error while parsing origin configuration: " + e);
-                throw new ShibbolethConfigurationException("Error while parsing origin configuration.");
-            } catch (IOException e) {
-                log.error("Could not load origin configuration: " + e);
-                throw new ShibbolethConfigurationException("Could not load origin configuration.");
-            }
-
-            originConfig = parser.getDocument();
-
-            return originConfig;
-        }
+       private static Document originConfig = null;
+
+       /**
+        * Loads the Origin Configuration file into a DOM tree.
+        * 
+        * @return the DOM Document
+        * @throws ShibbolethConfigurationException
+        *             if there was an error loading the file
+        */
+       protected synchronized Document getOriginConfig() throws ShibbolethConfigurationException {
+               /*
+                * synchronized to make sure only one thread attempts to parse the
+                * config file
+                */
+               if (originConfig != null) {
+                       return originConfig;
+               }
+
+               DOMParser parser = new DOMParser();
+
+               try {
+                       parser.setFeature("http://xml.org/sax/features/validation", true);
+                       parser.setFeature("http://apache.org/xml/features/validation/schema", true);
+
+                       parser.setEntityResolver(new EntityResolver() {
+                               public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
+                                       log.debug("Resolving entity for System ID: " + systemId);
+                                       if (systemId != null) {
+                                               StringTokenizer tokenString = new StringTokenizer(systemId, "/");
+                                               String xsdFile = "";
+                                               while (tokenString.hasMoreTokens()) {
+                                                       xsdFile = tokenString.nextToken();
+                                               }
+                                               if (xsdFile.endsWith(".xsd")) {
+                                                       InputStream stream;
+                                                       try {
+                                                               stream = new ShibResource("/schemas/" + xsdFile, this.getClass()).getInputStream();
+                                                       } catch (IOException ioe) {
+                                                               log.error("Error loading schema: " + xsdFile + ": " + ioe);
+                                                               return null;
+                                                       }
+                                                       if (stream != null) {
+                                                               return new InputSource(stream);
+                                                       }
+                                               }
+                                       }
+                                       return null;
+                               }
+                       });
+
+                       parser.setErrorHandler(new ErrorHandler() {
+                               public void error(SAXParseException arg0) throws SAXException {
+                                       throw new SAXException("Error parsing xml file: " + arg0);
+                               }
+                               public void fatalError(SAXParseException arg0) throws SAXException {
+                                       throw new SAXException("Error parsing xml file: " + arg0);
+                               }
+                               public void warning(SAXParseException arg0) throws SAXException {
+                                       throw new SAXException("Error parsing xml file: " + arg0);
+                               }
+                       });
+
+               } catch (SAXException e) {
+                       log.error("Unable to setup a workable XML parser: " + e);
+                       throw new ShibbolethConfigurationException("Unable to setup a workable XML parser.");
+               }
+
+               String originConfigFile = getInitParameter("OriginConfigFile");
+               if (originConfigFile == null) {
+                       originConfigFile = "/conf/origin.xml";
+               }
+
+               log.debug("Loading Configuration from (" + originConfigFile + ").");
+
+               try {
+                       parser.parse(new InputSource(new ShibResource(originConfigFile, this.getClass()).getInputStream()));
+               } catch (SAXException e) {
+                       log.error("Error while parsing origin configuration: " + e);
+                       throw new ShibbolethConfigurationException("Error while parsing origin configuration.");
+               } catch (IOException e) {
+                       log.error("Could not load origin configuration: " + e);
+                       throw new ShibbolethConfigurationException("Could not load origin configuration.");
+               }
+
+               originConfig = parser.getDocument();
+
+               return originConfig;
+       }
 }
index 38d539a..34c05f2 100644 (file)
@@ -52,12 +52,41 @@ import java.net.URL;
 import edu.internet2.middleware.shibboleth.common.RelyingParty;
 
 /**
+ * Defines a method for obtaining data that is bound to a <code>RelyingParty</code>
+ * and is needed by the Shibboloeth Handle Service.
+ * 
  * @author Walter Hoehn
  */
 public interface HSRelyingParty extends RelyingParty {
 
+       /**
+        * Returns the id of the name format that should be used in authentication
+        * assertions issued to this <code>RelyingParty</code>.
+        * 
+        * @return the id for the format
+        */
        public String getHSNameFormatId();
+
+       /**
+        * A boolean indication of whether this <code>RelyingParty</code> is
+        * running <= Shibboleth v1.1 .  Used to ensure backward compatibility.
+        */
        public boolean isLegacyProvider();
+
+       /**
+        * Returns the location of the Shibboleth Attribute Authority that should
+        * answer requests for this <code>RelyingParty</code>.
+        * 
+        * @return the URL
+        */
        public URL getAAUrl();
+
+       /**
+        * The authentication method that should be included in assertions to the
+        * <code>RelyingParty</code>, if one is not found in HTTP request
+        * headers.
+        * 
+        * @return the identifier for the method
+        */
        public URI getDefaultAuthMethod();
 }