You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2012/12/05 21:21:01 UTC

svn commit: r1417624 [22/38] - in /tomcat/site/trunk/docs/tomcat-8.0-doc: ./ api/ appdev/ appdev/sample/ appdev/sample/docs/ appdev/sample/src/ appdev/sample/src/mypackage/ appdev/sample/web/ appdev/sample/web/WEB-INF/ appdev/sample/web/images/ archite...

Added: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-default.html
URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-default.html?rev=1417624&view=auto
==============================================================================
--- tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-default.html (added)
+++ tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-default.html Wed Dec  5 20:20:35 2012
@@ -0,0 +1,268 @@
+<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Catalina Functional Specifications (8.0.0-dev) - Default Servlet</title><meta name="author" content="Craig McClanahan"><style type="text/css" media="print">
+            .noPrint {display: none;}
+            td#mainBody {width: 100%;}
+        </style><style type="text/css">
+            code {background-color:rgb(224,255,255);padding:0 0.1em;}
+            code.attributeName, code.propertyName {background-color:transparent;}
+        </style><style type="text/css">
+            .wrapped-source code { display: block; background-color: transparent; }
+            .wrapped-source div { margin: 0 0 0 1.25em; }
+            .wrapped-source p { margin: 0 0 0 1.25em; text-indent: -1.25em; }
+        </style><style type="text/css">
+            p.notice {
+                border: 1px solid rgb(255, 0, 0);
+                background-color: rgb(238, 238, 238);
+                color: rgb(0, 51, 102);
+                padding: 0.5em;
+                margin: 1em 2em 1em 1em;
+            }
+        </style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="../images/tomcat.gif" align="right" alt="
+      Catalina Functional Specifications
+    " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 8</font></h1><font face="arial,helvetica,sanserif">Version 8.0.0-dev, Dec 5 2012</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="../images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap class="noPrint"><p><strong>Links</strong></p><ul><li><a href="../index.html">Docs Home</a></li><li><a href="index.html">Functional Specs</a></li><li><a href="http://wiki.apache.org/tomcat/FAQ">FAQ</a></li><li><a href="#comments_section">User Comments</a></li></ul><p><strong>Administrative Apps</strong></p><ul><li><a href="fs-admin-apps.html">Overall Requirements</a></li><li><a href="mbean-names.html">Tomcat MBean Names</a></li><li><a href="fs-admin-objects.html">Ad
 ministered Objects</a></li><li><a href="fs-admin-opers.html">Supported Operations</a></li></ul><p><strong>Internal Servlets</strong></p><ul><li><a href="fs-default.html">Default Servlet</a></li></ul><p><strong>Realm Implementations</strong></p><ul><li><a href="fs-jdbc-realm.html">JDBC Realm</a></li><li><a href="fs-jndi-realm.html">JNDI Realm</a></li><li><a href="fs-memory-realm.html">Memory Realm</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>Default Servlet</h1><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
+<ul><li><a href="#Overview">Overview</a><ol><li><a href="#Introduction">Introduction</a></li><li><a href="#External_Specifications">External Specifications</a></li><li><a href="#Implementation_Requirements">Implementation Requirements</a></li></ol></li><li><a href="#Dependencies">Dependencies</a><ol><li><a href="#Environmental_Dependencies">Environmental Dependencies</a></li><li><a href="#Container_Dependencies">Container Dependencies</a></li></ol></li><li><a href="#Functionality">Functionality</a><ol><li><a href="#Initialization_Functionality">Initialization Functionality</a></li><li><a href="#Per-Request_Functionality">Per-Request Functionality</a></li><li><a href="#Finalization_Functionality">Finalization Functionality</a></li></ol></li><li><a href="#Testable_Assertions">Testable Assertions</a></li></ul>
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Overview"><strong>Overview</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The purpose of the <strong>Default Servlet</strong> is to serve
+    static resources of a web application in response to client requests.
+    As the name implies, it is generally configured as the "default"
+    servlet for a web application, by being mapped to a URL pattern "/".</p>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="External Specifications"><!--()--></a><a name="External_Specifications"><strong>External Specifications</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The following external specifications have provisions which
+    partially define the correct behavior of the default servlet:</p>
+    <ul>
+    <li><a href="http://java.sun.com/products/servlet/download.html">
+        Servlet Specification</a> (Version 2.3 PFD2)</li>
+    <li><a href="http://www.rfc-editor.org/rfc/rfc2046.txt">Multipurpose
+        Internet Mail Extensions (MIME) Part Two: Media Types</a></li>
+    <li><a href="http://www.rfc-editor.org/rfc/rfc2616.txt">Hypertext
+        Transfer Protocol -- HTTP/1.1</a></li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Implementation Requirements"><!--()--></a><a name="Implementation_Requirements"><strong>Implementation Requirements</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The implementation of this functionality shall conform to the
+    following requirements:</p>
+    <ul>
+    <li>Must be implemented as a servlet.</li>
+    <li>Must support configurable parameters for debugging detail level,
+        input buffer size, output buffer size, whether or not to produce
+        directory listings when no welcome file is present, and whether or not
+        modifications are supported via DELETE and PUT.</li>
+    <li>Log debugging and operational messages (suitably internationalized)
+        via the <code>getServletContext().log()</code> method.</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Dependencies"><strong>Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Environmental Dependencies"><!--()--></a><a name="Environmental_Dependencies"><strong>Environmental Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The following environmental dependencies must be met in order for
+    the default servlet to operate correctly:</p>
+    <ul>
+    <li>The default servlet must be registered in the application deployment
+        descriptor (or the default deployment descriptor in file
+        <code>$CATALINA_BASE/conf/web.xml</code>) using a "default servlet"
+        servlet mapping, signified by URL pattern "/".</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Container Dependencies"><!--()--></a><a name="Container_Dependencies"><strong>Container Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>Correct operation of the default servlet depends on the following
+    specific features of the surrounding container:</p>
+    <ul>
+    <li>The container shall provide a servlet context attribute that
+        lists the welcome file names that have been defined for this
+        web application.</li>
+    <li>The container shall provide a servlet context attribute that
+        contains a <code>javax.naming.directory.DirContext</code>
+        implementation representing the static resources of this
+        web application.</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Functionality"><strong>Functionality</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Initialization Functionality"><!--()--></a><a name="Initialization_Functionality"><strong>Initialization Functionality</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The following processing must be performed when the <code>init()</code>
+    method of the default servlet is called:</p>
+    <ul>
+    <li>Process and sanity check configuration parameters.</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Per-Request Functionality"><!--()--></a><a name="Per-Request_Functionality"><strong>Per-Request Functionality</strong></a></font></td></tr><tr><td><blockquote>
+
+
+    <p>For all HTTP request methods, the resource path is determined from
+    the path information provided to this request, either as request attribute
+    <code>javax.servlet.include.path_info</code> (for a request dispatcher
+    access to a static resource) or by calling
+    <code>request.getPathInfo()</code> directly.</p>
+
+    <p>On each HTTP DELETE request processed by this servlet, the following
+    processing shall be performed:</p>
+    <ul>
+    <li>If modifications to the static resources are not allowed (set by a
+        configuration parameter), return HTTP status 403 (forbidden).</li>
+    <li>If an attempt is made to delete a resource from <code>/META-INF</code>
+        or <code>/WEB-INF</code>, return HTTP status 403 (forbidden).</li>
+    <li>If the requested resource does not exist, return HTTP status 404
+        (not found)</li>
+    <li>Unbind the resource from the directory context containing the
+        static resources for this web application.  If successful, return
+        HTTP status 204 (no content).  Otherwise, return HTTP status 405
+        (method not allowed).</li>
+    </ul>
+
+
+    <p>On each HTTP GET request processed by this servlet, the following
+    processing shall be performed:</p>
+    <ul>
+    <li>If the request is for a resource under <code>/META-INF</code> or
+        <code>/WEB-INF</code>, return HTTP status 404 (not found).</li>
+    <li>If the requested resource does not exist, return HTTP status 404
+        (not found).</li>
+    <li>If the requested resource is not a directory, but the resource
+        path ends in "/" or "\", return HTTP status 404 (not found).</li>
+    <li>If the requested resource is a directory:
+        <ul>
+        <li>If the request path does not end with "/", redirect to a
+            corresponding path with "/" appended so that relative references
+            in welcome files are resolved correctly.</li>
+        <li>If one of the specified welcome files exists, redirect to the
+            path for that welcome file so that it will be served explicitly.
+            </li>
+        </ul></li>
+    <li>If the request being processed contains an <code>If-Range</code>
+        header, perform the processing described in the HTTP/1.1 specification
+        to determine whether the client's information is up to date.</li>
+    <li>Determine the content type of the response, by looking up the
+        corresponding MIME type in our servlet context.</li>
+    <li>If the requested resource is a directory:
+        <ul>
+        <li>If directory listings are suppressed, return HTTP status 404
+            (not found).</li>
+        <li>Set the content type to <code>text/html</code>.</li>
+        </ul></li>
+    <li>Determine the range(s) to be returned, based on the existence of
+        any <code>If-Range</code> and <code>Range</code> headers.</li>
+    <li>If the requested resource is a directory, include an <code>ETag</code>
+        header in the response, with the value calculated based on the content
+        of the directory.</li>
+    <li>Include a <code>Last-Modified</code> header in the response documenting
+        the date/time that the resource was last modified.</li>
+    <li>Unless we are processing a HEAD request, include the appropriate
+        content (or content ranges) in the response.</li>
+    </ul>
+
+    <p>On each HTTP HEAD request processed by this servlet, the following
+    processing shall be performed:</p>
+    <ul>
+    <li>Processed identically to an HTTP GET request, except that the data
+        content is not transmitted after the headers.</li>
+    </ul>
+
+    <p>On each HTTP POST request processed by this servlet, the following
+    processing shall be performed:</p>
+    <ul>
+    <li>Processed identically to an HTTP GET request.</li>
+    </ul>
+
+
+    <p>On each HTTP PUT request processed by this servlet, the following
+    processing shall be performed:</p>
+    <ul>
+    <li>If modifications to the static resources are not allowed (set by a
+        configuration parameter), return HTTP status 403 (forbidden).</li>
+    <li>If an attempt is made to delete a resource from <code>/META-INF</code>
+        or <code>/WEB-INF</code>, return HTTP status 403 (forbidden).</li>
+    <li>Create a new resource from the body of this request.</li>
+    <li>Bind or rebind the specified path to the new resource (depending on
+        whether it currently exists or not).  Return HTTP status as follows:
+        <ul>
+        <li>If binding was unsuccessful, return HTTP status 409 (conflict).
+            </li>
+        <li>If binding was successful and the resource did not previously
+            exist, return HTTP status 201 (created).</li>
+        <li>If binding was successful and the resource previously existed,
+            return HTTP status 204 (no content).</li>
+        </ul></li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Finalization Functionality"><!--()--></a><a name="Finalization_Functionality"><strong>Finalization Functionality</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>No specific processing is required when the <code>destroy()</code>
+    method is called:</p>
+
+  </blockquote></td></tr></table>
+
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Testable Assertions"><!--()--></a><a name="Testable_Assertions"><strong>Testable Assertions</strong></a></font></td></tr><tr><td><blockquote>
+
+  <p>In addition the the assertions implied by the functionality requirements
+  listed above, the following additional assertions shall be tested to
+  validate the behavior of the default servlet:</p>
+  <ul>
+  <li>Requests for resources that do not exist in the web application must
+      return HTTP status 404 (not found).</li>
+  <li>The default servlet must operate identically for web applications that
+      are run out of a WAR file directly, or from an unpacked directory
+      structure.</li>
+  <li>If the web application is running out of an unpacked directory
+      structure, the default servlet must recognize cases where the resource
+      has been updated through external means.</li>
+  </ul>
+
+</blockquote></td></tr></table></td></tr><tr class="noPrint"><td width="20%" valign="top" nowrap class="noPrint"></td><td width="80%" valign="top" align="left"><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="comments_section" id="comments_section"><strong>Comments</strong></a></font></td></tr><tr><td><blockquote><p class="notice"><strong>Notice: </strong>This is not a Q&amp;A section.
+              The Apache Comments System is explained
+              <a href="/tomcat-8.0-doc/comments.html">here</a>.
+              Comments should be pointed towards suggestions on improving the documentation
+              or server, and may be removed again by our moderators if they are either
+              implemented or considered invalid/off-topic.
+              Questions on how to manage Apache Tomcat should be directed
+              to our <a href="http://tomcat.apache.org/lists.html">mailing lists</a>.</p><script type="text/javascript"><!--//--><![CDATA[//><!--
+              var comments_shortname = 'tomcat';
+              var comments_identifier = 'http://tomcat.apache.org/tomcat-8.0-doc/funcspecs/fs-default.html';
+              (function(w, d) {
+                  if (w.location.hostname.toLowerCase() == "tomcat.apache.org") {
+                      d.write('<div id="comments_thread"><\/div>');
+                      var s = d.createElement('script');
+                      s.type = 'text/javascript';
+                      s.async = true;
+                      s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
+                      (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
+                  }
+                  else {
+                      d.write('<div id="comments_thread"><strong>Comments are disabled for this page at the moment.</strong><\/div>');
+                  }
+              })(window, document);
+              //--><!]]></script></blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
+        Copyright &copy; 1999-2012, Apache Software Foundation
+        </em></font></div></td></tr></table></body></html>
\ No newline at end of file

Propchange: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-default.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-default.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jdbc-realm.html
URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jdbc-realm.html?rev=1417624&view=auto
==============================================================================
--- tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jdbc-realm.html (added)
+++ tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jdbc-realm.html Wed Dec  5 20:20:35 2012
@@ -0,0 +1,264 @@
+<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Catalina Functional Specifications (8.0.0-dev) - JDBCRealm</title><meta name="author" content="Craig McClanahan"><style type="text/css" media="print">
+            .noPrint {display: none;}
+            td#mainBody {width: 100%;}
+        </style><style type="text/css">
+            code {background-color:rgb(224,255,255);padding:0 0.1em;}
+            code.attributeName, code.propertyName {background-color:transparent;}
+        </style><style type="text/css">
+            .wrapped-source code { display: block; background-color: transparent; }
+            .wrapped-source div { margin: 0 0 0 1.25em; }
+            .wrapped-source p { margin: 0 0 0 1.25em; text-indent: -1.25em; }
+        </style><style type="text/css">
+            p.notice {
+                border: 1px solid rgb(255, 0, 0);
+                background-color: rgb(238, 238, 238);
+                color: rgb(0, 51, 102);
+                padding: 0.5em;
+                margin: 1em 2em 1em 1em;
+            }
+        </style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="../images/tomcat.gif" align="right" alt="
+      Catalina Functional Specifications
+    " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 8</font></h1><font face="arial,helvetica,sanserif">Version 8.0.0-dev, Dec 5 2012</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="../images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap class="noPrint"><p><strong>Links</strong></p><ul><li><a href="../index.html">Docs Home</a></li><li><a href="index.html">Functional Specs</a></li><li><a href="http://wiki.apache.org/tomcat/FAQ">FAQ</a></li><li><a href="#comments_section">User Comments</a></li></ul><p><strong>Administrative Apps</strong></p><ul><li><a href="fs-admin-apps.html">Overall Requirements</a></li><li><a href="mbean-names.html">Tomcat MBean Names</a></li><li><a href="fs-admin-objects.html">Ad
 ministered Objects</a></li><li><a href="fs-admin-opers.html">Supported Operations</a></li></ul><p><strong>Internal Servlets</strong></p><ul><li><a href="fs-default.html">Default Servlet</a></li></ul><p><strong>Realm Implementations</strong></p><ul><li><a href="fs-jdbc-realm.html">JDBC Realm</a></li><li><a href="fs-jndi-realm.html">JNDI Realm</a></li><li><a href="fs-memory-realm.html">Memory Realm</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>JDBCRealm</h1><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
+<ul><li><a href="#Overview">Overview</a><ol><li><a href="#Introduction">Introduction</a></li><li><a href="#External_Specifications">External Specifications</a></li><li><a href="#Implementation_Requirements">Implementation Requirements</a></li></ol></li><li><a href="#Dependencies">Dependencies</a><ol><li><a href="#Environmental_Dependencies">Environmental Dependencies</a></li><li><a href="#Container_Dependencies">Container Dependencies</a></li></ol></li><li><a href="#Functionality">Functionality</a><ol><li><a href="#Overview_of_Operation">Overview of Operation</a></li><li><a href="#Detailed_Functional_Requirements">Detailed Functional Requirements</a></li></ol></li><li><a href="#Testable_Assertions">Testable Assertions</a></li></ul>
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Overview"><strong>Overview</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The purpose of the <strong>JDBCRealm</strong> implementation is to
+    provide a mechanism by which Tomcat can acquire information needed
+    to authenticate web application users, and define their security roles,
+    from a relational database accessed via JDBC APIs.  For integration
+    with Catalina, the resulting class(es) must implement the
+    <code>org.apache.catalina.Realm</code> interface.</p>
+
+    <p>This specification reflects a combination of functionality that is
+    already present in the <code>org.apache.catalina.realm.JDBCRealm</code>
+    class, as well as requirements for enhancements that have been
+    discussed.  Where appropriate, requirements statements are marked
+    <em>[Current]</em> and <em>[Requested]</em> to distinguish them.</p>
+
+    <p>The current status of this functional specification is
+    <strong>PROPOSED</strong>.  It has not yet been discussed and
+    agreed to on the TOMCAT-DEV mailing list.</p>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="External Specifications"><!--()--></a><a name="External_Specifications"><strong>External Specifications</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The implementation of this functionality depends on the following
+    external specifications:</p>
+    <ul>
+    <li><a href="http://java.sun.com/products/jdbc/">Java Database
+        Connectivity</a> (version 2.0 or later)</li>
+    <li><a href="http://java.sun.com/products/jdbc/">Java Database
+        Connectivity Optional Package</a> (version 2.0 or later)</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Implementation Requirements"><!--()--></a><a name="Implementation_Requirements"><strong>Implementation Requirements</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The implementation of this functionality shall conform to the
+    following requirements:</p>
+    <ul>
+    <li>Be realized in one or more implementation classes.</li>
+    <li>Implement the <code>org.apache.catalina.Realm</code> interface.
+        [Current]</li>
+    <li>Implement the <code>org.apache.catalina.Lifecycle</code>
+        interface.  [Current]</li>
+    <li>Subclass the <code>org.apache.catalina.realm.RealmBase</code>
+        base class.</li>
+    <li>Live in the <code>org.apache.catalina.realm</code> package.
+        [Current]</li>
+    <li>Support a configurable debugging detail level. [Current]</li>
+    <li>Log debugging and operational messages (suitably internationalized)
+        via the <code>getContainer().log()</code> method. [Current]</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Dependencies"><strong>Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Environmental Dependencies"><!--()--></a><a name="Environmental_Dependencies"><strong>Environmental Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The following environmental dependencies must be met in order for
+    JDBCRealm to operate correctly:</p>
+    <ul>
+    <li>The desire to utilize JDBCRealm must be registered in
+        <code>$CATALINA_BASE/conf/server.xml</code>, in a
+        <code>&lt;Realm&gt;</code> element that is nested inside a
+        corresponding <code>&lt;Engine&gt;</code>, <code>&lt;Host&gt;</code>,
+        or <code>&lt;Context&gt;</code> element.</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Container Dependencies"><!--()--></a><a name="Container_Dependencies"><strong>Container Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>Correct operation of JDBCRealm depends on the following
+    specific features of the surrounding container:</p>
+    <ul>
+    <li>Interactions with <code>JDBCRealm</code> will be initiated by
+        the appropriate <code>Authenticator</code> implementation, based
+        on the login method that is selected.</li>
+    <li><code>JDBCRealm</code> must have the JDBC standard API classes
+        available to it.  For a JDK 1.2 or later container, these APIs
+        are included in the standard platform.</li>
+    <li>When connection pooling is implemented, <code>JDBCRealm</code>
+        must have the JDBC Optional Package (version 2.0 or later) APIs
+        available to it.  This library is available as a separate
+        download (and will be included in Tomcat binary distributions).</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Functionality"><strong>Functionality</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Overview of Operation"><!--()--></a><a name="Overview_of_Operation"><strong>Overview of Operation</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The main purpose of <code>JDBCRealm</code> is to allow Catalina to
+    authenticate users, and look up the corresponding security roles, from
+    the information found in a relational database accessed via JDBC APIs.
+    For maximum flexibility, the details of how this is done (for example,
+    the names of the required tables and columns) should be configurable.</p>
+
+    <p>Each time that Catalina needs to authenticate a user, it will call
+    the <code>authenticate()</code> method of this Realm implementation,
+    passing the username and password that were specified by the user.  If
+    we find the user in the database (and match on the password), we accumulate
+    all of the security roles that are defined for this user, and create a
+    new <code>GenericPrincipal</code> object to be returned.  If the user
+    is not authenticated, we return <code>null</code> instead.  The
+    <code>GenericUser</code> object caches the set of security roles that
+    were owned by this user at the time of authentication, so that calls to
+    <code>isUserInRole()</code> can be answered without going back to the
+    database every time.</p>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Detailed Functional Requirements"><!--()--></a><a name="Detailed_Functional_Requirements"><strong>Detailed Functional Requirements</strong></a></font></td></tr><tr><td><blockquote>
+
+
+    <h3>Configurable Properties</h3>
+
+    <p>The implementation shall support the following properties
+    that can be configured with JavaBeans property setters:</p>
+    <ul>
+    <li>Configuration parameters defining the JDBC driver to use, the
+        database connection URL to be accessed, and the username/password
+        to use for logging in. [Current]</li>
+    <li>Configuration parameters describing the connection pool to be
+        created to support simultaneous authentications. [Requested]</li>
+    <li>Name of the tables to be searched for users and roles. [Current]</li>
+    <li>Name of the columns to be used for usernames, passwords, and
+        role names.  [Current]</li>
+    </ul>
+
+    <h3>Lifecycle Functionality</h3>
+
+    <p>The following processing must be performed when the <code>start()</code>
+    method is called:</p>
+    <ul>
+    <li>Establish a connection to the configured database, using the
+        configured username and password.  [Current]</li>
+    <li>Configure and establish a connection pool of connections to the
+        database.  [Requested]</li>
+    </ul>
+
+    <p>The following processing must be performed when the <code>stop()</code>
+    method is called:</p>
+    <ul>
+    <li>Close any opened connections to the database.</li>
+    </ul>
+
+
+    <h3>Method authenticate() Functionality</h3>
+
+    <p>When <code>authenticate()</code> is called, the following processing
+    is required:</p>
+    <ul>
+    <li>Acquire the one and only connection [Current] or acquire a connection
+        from the connection pool [Requested].</li>
+    <li>Select the one and only row from the user's table for this user,
+        and retrieve the corresponding password column.  If zero rows (or
+        more than one row) are found, return <code>null</code>.</li>
+    <li>Authenticate the user by comparing the (possibly encrypted) password
+        value that was received against the password presented by the user.
+        If there is no match, return <code>null</code>.</li>
+    <li>Acquire a <code>List</code> of the security roles assigned to the
+        authenticated user by selecting from the roles table.</li>
+    <li>Construct a new instance of class
+        <code>org.apache.catalina.realm.GenericPrincipal</code>, passing as
+        constructor arguments:  this realm instance, the authenticated
+        username, and a <code>List</code> of the security roles associated
+        with this user.</li>
+    <li><strong>WARNING</strong> - Do not attempt to cache and reuse previous
+        <code>GenericPrincipal</code> objects for a particular user, because
+        the information in the directory server might have changed since the
+        last time this user was authenticated.</li>
+    <li>Return the newly constructed <code>GenericPrincipal</code>.</li>
+    </ul>
+
+
+    <h3>Method hasRole() Functionality</h3>
+
+    <p>When <code>hasRole()</code> is called, the following processing
+    is required:</p>
+    <ul>
+    <li>The <code>principal</code> that is passed as an argument SHOULD
+        be one that we returned (instanceof class
+        <code>org.apache.catalina.realm.GenericPrincipal</code>, with a
+        <code>realm</code> property that is equal to our instance.</li>
+    <li>If the passed <code>principal</code> meets these criteria, check
+        the specified role against the list returned by
+        <code>getRoles()</code>, and return <code>true</code> if the
+        specified role is included; otherwise, return <code>false</code>.</li>
+    <li>If the passed <code>principal</code> does not meet these criteria,
+        return <code>false</code>.</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Testable Assertions"><!--()--></a><a name="Testable_Assertions"><strong>Testable Assertions</strong></a></font></td></tr><tr><td><blockquote>
+
+  <p>In addition the the assertions implied by the functionality requirements
+  listed above, the following additional assertions shall be tested to
+  validate the behavior of <code>JDBCRealm</code>:</p>
+  <ul>
+  </ul>
+
+</blockquote></td></tr></table></td></tr><tr class="noPrint"><td width="20%" valign="top" nowrap class="noPrint"></td><td width="80%" valign="top" align="left"><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="comments_section" id="comments_section"><strong>Comments</strong></a></font></td></tr><tr><td><blockquote><p class="notice"><strong>Notice: </strong>This is not a Q&amp;A section.
+              The Apache Comments System is explained
+              <a href="/tomcat-8.0-doc/comments.html">here</a>.
+              Comments should be pointed towards suggestions on improving the documentation
+              or server, and may be removed again by our moderators if they are either
+              implemented or considered invalid/off-topic.
+              Questions on how to manage Apache Tomcat should be directed
+              to our <a href="http://tomcat.apache.org/lists.html">mailing lists</a>.</p><script type="text/javascript"><!--//--><![CDATA[//><!--
+              var comments_shortname = 'tomcat';
+              var comments_identifier = 'http://tomcat.apache.org/tomcat-8.0-doc/funcspecs/fs-jdbc-realm.html';
+              (function(w, d) {
+                  if (w.location.hostname.toLowerCase() == "tomcat.apache.org") {
+                      d.write('<div id="comments_thread"><\/div>');
+                      var s = d.createElement('script');
+                      s.type = 'text/javascript';
+                      s.async = true;
+                      s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
+                      (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
+                  }
+                  else {
+                      d.write('<div id="comments_thread"><strong>Comments are disabled for this page at the moment.</strong><\/div>');
+                  }
+              })(window, document);
+              //--><!]]></script></blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
+        Copyright &copy; 1999-2012, Apache Software Foundation
+        </em></font></div></td></tr></table></body></html>
\ No newline at end of file

Propchange: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jdbc-realm.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jdbc-realm.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jndi-realm.html
URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jndi-realm.html?rev=1417624&view=auto
==============================================================================
--- tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jndi-realm.html (added)
+++ tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jndi-realm.html Wed Dec  5 20:20:35 2012
@@ -0,0 +1,415 @@
+<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Catalina Functional Specifications (8.0.0-dev) - JNDIRealm</title><meta name="author" content="Craig McClanahan"><style type="text/css" media="print">
+            .noPrint {display: none;}
+            td#mainBody {width: 100%;}
+        </style><style type="text/css">
+            code {background-color:rgb(224,255,255);padding:0 0.1em;}
+            code.attributeName, code.propertyName {background-color:transparent;}
+        </style><style type="text/css">
+            .wrapped-source code { display: block; background-color: transparent; }
+            .wrapped-source div { margin: 0 0 0 1.25em; }
+            .wrapped-source p { margin: 0 0 0 1.25em; text-indent: -1.25em; }
+        </style><style type="text/css">
+            p.notice {
+                border: 1px solid rgb(255, 0, 0);
+                background-color: rgb(238, 238, 238);
+                color: rgb(0, 51, 102);
+                padding: 0.5em;
+                margin: 1em 2em 1em 1em;
+            }
+        </style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="../images/tomcat.gif" align="right" alt="
+      Catalina Functional Specifications
+    " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 8</font></h1><font face="arial,helvetica,sanserif">Version 8.0.0-dev, Dec 5 2012</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="../images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap class="noPrint"><p><strong>Links</strong></p><ul><li><a href="../index.html">Docs Home</a></li><li><a href="index.html">Functional Specs</a></li><li><a href="http://wiki.apache.org/tomcat/FAQ">FAQ</a></li><li><a href="#comments_section">User Comments</a></li></ul><p><strong>Administrative Apps</strong></p><ul><li><a href="fs-admin-apps.html">Overall Requirements</a></li><li><a href="mbean-names.html">Tomcat MBean Names</a></li><li><a href="fs-admin-objects.html">Ad
 ministered Objects</a></li><li><a href="fs-admin-opers.html">Supported Operations</a></li></ul><p><strong>Internal Servlets</strong></p><ul><li><a href="fs-default.html">Default Servlet</a></li></ul><p><strong>Realm Implementations</strong></p><ul><li><a href="fs-jdbc-realm.html">JDBC Realm</a></li><li><a href="fs-jndi-realm.html">JNDI Realm</a></li><li><a href="fs-memory-realm.html">Memory Realm</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>JNDIRealm</h1><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
+<ul><li><a href="#Overview">Overview</a><ol><li><a href="#Introduction">Introduction</a></li><li><a href="#External_Specifications">External Specifications</a></li><li><a href="#Implementation_Requirements">Implementation Requirements</a></li></ol></li><li><a href="#Dependencies">Dependencies</a><ol><li><a href="#Environmental_Dependencies">Environmental Dependencies</a></li><li><a href="#Container_Dependencies">Container Dependencies</a></li></ol></li><li><a href="#Functionality">Functionality</a><ol><li><a href="#Operational_Modes">Operational Modes</a></li><li><a href="#Administrator_Login_Mode_Functionality">Administrator Login Mode Functionality</a></li><li><a href="#Username_Login_Mode_Functionality">Username Login Mode Functionality</a></li></ol></li><li><a href="#Testable_Assertions">Testable Assertions</a></li></ul>
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Overview"><strong>Overview</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The purpose of the <strong>JNDIRealm</strong> implementation is to
+    provide a mechanism by which Tomcat can acquire information needed
+    to authenticate web application users, and define their security roles,
+    from a directory server or other service accessed via JNDI APIs.  For
+    integration with Catalina, this class must implement the
+    <code>org.apache.catalina.Realm</code> interface.</p>
+
+    <p>This specification reflects a combination of functionality that is
+    already present in the <code>org.apache.catalina.realm.JNDIRealm</code>
+    class, as well as requirements for enhancements that have been
+    discussed.  Where appropriate, requirements statements are marked
+    <em>[Current]</em> and <em>[Requested]</em> to distinguish them.</p>
+
+    <p>The current status of this functional specification is
+    <strong>PROPOSED</strong>.  It has not yet been discussed and
+    agreed to on the TOMCAT-DEV mailing list.</p>
+
+    <p>The code in the current version of <code>JNDIRealm</code>, and the
+    ideas expressed in this functional specification, are the results of
+    contributions from many individuals, including (alphabetically):</p>
+    <ul>
+    <li>Holman, John &lt;j.g.holman@qmw.ac.uk&gt;</li>
+    <li>Lockhart, Ellen &lt;elockhart@home.com&gt;</li>
+    <li>McClanahan, Craig &lt;craigmcc@apache.org&gt;</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="External Specifications"><!--()--></a><a name="External_Specifications"><strong>External Specifications</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The implementation of this functionality depends on the following
+    external specifications:</p>
+    <ul>
+    <li><a href="http://java.sun.com/products/jndi/">Java Naming and
+        Directory Interface</a> (version 1.2.1 or later)</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Implementation Requirements"><!--()--></a><a name="Implementation_Requirements"><strong>Implementation Requirements</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The implementation of this functionality shall conform to the
+    following requirements:</p>
+    <ul>
+    <li>Be realized in one or more implementation classes.</li>
+    <li>Implement the <code>org.apache.catalina.Realm</code> interface.
+        [Current]</li>
+    <li>Implement the <code>org.apache.catalina.Lifecycle</code>
+        interface.  [Current]</li>
+    <li>Subclass the <code>org.apache.catalina.realm.RealmBase</code>
+        base class.</li>
+    <li>Live in the <code>org.apache.catalina.realm</code> package.
+        [Current]</li>
+    <li>Support a configurable debugging detail level. [Current]</li>
+    <li>Log debugging and operational messages (suitably internationalized)
+        via the <code>getContainer().log()</code> method. [Current]</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Dependencies"><strong>Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Environmental Dependencies"><!--()--></a><a name="Environmental_Dependencies"><strong>Environmental Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The following environmental dependencies must be met in order for
+    JNDIRealm to operate correctly:</p>
+    <ul>
+    <li>The desire to utilize JNDIRealm must be registered in
+        <code>$CATALINA_BASE/conf/server.xml</code>, in a
+        <code>&lt;Realm&gt;</code> element that is nested inside a
+        corresponding <code>&lt;Engine&gt;</code>, <code>&lt;Host&gt;</code>,
+        or <code>&lt;Context&gt;</code> element.</li>
+    <li>If the <em>Administrator Login</em> operational mode is selected,
+        the configured administrator username and password must be configured
+        in the corresponding directory server.</li>
+    <li>If the <em>Username Login</em> operational mode is selected,
+        the corresponding directory server must be configured to accept
+        logins with the username and password that will be passed to
+        <code>JNDIRealm</code> by the appropriate <code>Authenticator</code>.
+        </li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Container Dependencies"><!--()--></a><a name="Container_Dependencies"><strong>Container Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>Correct operation of JNDIRealm depends on the following
+    specific features of the surrounding container:</p>
+    <ul>
+    <li>Interactions with <code>JNDIRealm</code> will be initiated by
+        the appropriate <code>Authenticator</code> implementation, based
+        on the login method that is selected.</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Functionality"><strong>Functionality</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Operational Modes"><!--()--></a><a name="Operational_Modes"><strong>Operational Modes</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The completed <code>JNDIRealm</code> must support two major operational
+    modes in order to support all of the required use cases.  For the purposes
+    of this document, the modes are called <em>administrator login</em> and
+    <em>Username Login</em>.  They are described further in the following
+    paragraphs.</p>
+
+    <p>For <em>Administrator Login</em> mode, <code>JNDIRealm</code> will be
+    configured to establish one or more connections (using a connection pool)
+    to an appropriate directory server, using JNDI APIs, under a "system
+    administrator" username and password.  This is similar to the approach
+    normally used to configure <code>JDBCRealm</code> to access authentication
+    and access control information in a database.  It is assumed that the
+    system administrator username and password that are configured provide
+    sufficient privileges within the directory server to read (but not modify)
+    the username, password, and assigned roles for each valid user of the
+    web application associated with this <code>Realm</code>.  The password
+    can be stored in cleartext, or in one of the digested modes supported by
+    the <code>org.apache.catalina.realm.RealmBase</code> base class.</p>
+
+    <p>For <em>Username Login</em> mode, <code>JNDIRealm</code> does not
+    normally remain connected to the directory server.  Instead, whenever a
+    user is to be authenticated, a connection to the directory server
+    (using the username and password received from the authenticator) is
+    attempted.  If this connection is successful, the user is assumed to be
+    successfully authenticated.  This connection is then utilized to read
+    the corresponding security roles associated with this user, and the
+    connection is then broken.</p>
+
+    <p><strong>NOTE</strong> - <em>Username Login</em> mode cannot be used
+    if you have selected login method <code>DIGEST</code> in your web
+    application deployment descriptor (<code>web.xml</code>) file.  This
+    restriction exists because the cleartext password is never available
+    to the container, so it is not possible to bind to the directory server
+    using the user's username and password.</p>
+
+    <p>Because these operational modes work so differently, the functionality
+    for each mode will be described separately.  Whether or not both modes
+    are actually supported by a single class (versus a class per mode) is
+    an implementation detail left to the designer.</p>
+
+    <p><strong>NOTE</strong> - The current implementation only implements
+    part of the <em>Administrator Lookup</em> mode requirements.  It does
+    not support the <em>Username Lookup</em> mode at all, at this point.</p>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Administrator Login Mode Functionality"><!--()--></a><a name="Administrator_Login_Mode_Functionality"><strong>Administrator Login Mode Functionality</strong></a></font></td></tr><tr><td><blockquote>
+
+
+    <h3>Configurable Properties</h3>
+
+    <p>The implementation shall support the following properties
+    that can be configured with JavaBeans property setters:</p>
+    <ul>
+    <li><code>connectionURL</code> - URL of the directory server we will
+        be contacting.</li>
+    <li><code>contextFactory</code> - Fully qualified class name of the JNDI
+        context factory used to retrieve our InitialContext.
+        [com.sun.jndi.ldap.LdapCtxFactory]</li>
+    <li>Additional configuration properties required to establish the
+        appropriate connection.  [Requested]</li>
+    <li>Connection pool configuration properties.  [Requested]</li>
+    <li>Configuration properties defining how a particular user is
+        authenticated.  The following capabilities should be supported:
+        <ul>
+        <li>Substitute the specified username into a string.  [Requested]</li>
+        <li>Retrieve the distinguished name (DN) of an authorized user via an
+            LDAP search string with a replacement placeholder for the
+            username, and comparison of the password to a configurable
+            attribute retrieved from the search result.  [Current]</li>
+        </ul></li>
+    <li>Configuration properties defining how the roles associated with a
+        particular authenticated user can be retrieved.  The following
+        approaches should be supported:
+        <ul>
+        <li>Retrieve a specified attribute (possibly multi-valued)
+            from an LDAP search expression,
+            with a replacement placeholder for the DN of the user.
+            [Current]</li>
+        <li>Retrieve a set of role names that are defined implicitly (by
+            selecting principals that match a search pattern) rather than
+            explicitly (by finding a particular attribute value).
+            [Requested]</li>
+        </ul></li>
+    </ul>
+
+    <h3>Lifecycle Functionality</h3>
+
+    <p>The following processing must be performed when the <code>start()</code>
+    method is called:</p>
+    <ul>
+    <li>Establish a connection to the configured directory server, using the
+        configured system administrator username and password.  [Current]</li>
+    <li>Configure and establish a connection pool of connections to the
+        directory server.  [Requested]</li>
+    </ul>
+
+    <p>The following processing must be performed when the <code>stop()</code>
+    method is called:</p>
+    <ul>
+    <li>Close any opened connections to the directory server.</li>
+    </ul>
+
+
+    <h3>Method authenticate() Functionality</h3>
+
+    <p>When <code>authenticate()</code> is called, the following processing
+    is required:</p>
+    <ul>
+    <li>Acquire the one and only connection [Current] or acquire a connection
+        from the connection pool [Requested].</li>
+    <li>Authenticate the user by retrieving the user's Distinguished Name,
+        based on the specified username and password.</li>
+    <li>If the user was not authenticated, release the allocated connection
+        and return <code>null</code>.</li>
+    <li>Acquire a <code>List</code> of the security roles assigned to the
+        authenticated user.</li>
+    <li>Construct a new instance of class
+        <code>org.apache.catalina.realm.GenericPrincipal</code>, passing as
+        constructor arguments:  this realm instance, the authenticated
+        username, and a <code>List</code> of the security roles associated
+        with this user.</li>
+    <li><strong>WARNING</strong> - Do not attempt to cache and reuse previous
+        <code>GenericPrincipal</code> objects for a particular user, because
+        the information in the directory server might have changed since the
+        last time this user was authenticated.</li>
+    <li>Return the newly constructed <code>GenericPrincipal</code>.</li>
+    </ul>
+
+
+    <h3>Method hasRole() Functionality</h3>
+
+    <p>When <code>hasRole()</code> is called, the following processing
+    is required:</p>
+    <ul>
+    <li>The <code>principal</code> that is passed as an argument SHOULD
+        be one that we returned (instanceof class
+        <code>org.apache.catalina.realm.GenericPrincipal</code>, with a
+        <code>realm</code> property that is equal to our instance.</li>
+    <li>If the passed <code>principal</code> meets these criteria, check
+        the specified role against the list returned by
+        <code>getRoles()</code>, and return <code>true</code> if the
+        specified role is included; otherwise, return <code>false</code>.</li>
+    <li>If the passed <code>principal</code> does not meet these criteria,
+        return <code>false</code>.</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Username Login Mode Functionality"><!--()--></a><a name="Username_Login_Mode_Functionality"><strong>Username Login Mode Functionality</strong></a></font></td></tr><tr><td><blockquote>
+
+    <h3>Configurable Properties</h3>
+
+    <p>The implementation shall support the following properties
+    that can be configured with JavaBeans property setters:</p>
+    <ul>
+    <li><code>connectionURL</code> - URL of the directory server we will
+        be contacting.</li>
+    <li><code>contextFactory</code> - Fully qualified class name of the JNDI
+        context factory used to retrieve our InitialContext.
+        [com.sun.jndi.ldap.LdapCtxFactory]</li>
+    <li>Additional configuration properties required to establish the
+        appropriate connection.  [Requested]</li>
+    <li>Connection pool configuration properties.  [Requested]</li>
+    <li>Configuration properties defining if and how a user might be looked
+        up before binding to the directory server.  The following approaches
+        should be supported:
+        <ul>
+        <li>No previous lookup is required - username specified by the user
+            is the same as that used to authenticate to the directory
+            server.</li>
+        <li>Substitute the specified username into a string.</li>
+        <li>Search the directory server based on configured criteria to
+            retrieve the distinguished name of the user, then attempt to
+            bind with that distinguished name.</li>
+        </ul></li>
+    <li>Configuration properties defining how the roles associated with a
+        particular authenticated user can be retrieved.  The following
+        approaches should be supported:
+        <ul>
+        <li>Retrieve a specified attribute (possibly multi-valued)
+            from an LDAP search expression,
+            with a replacement placeholder for the DN of the user.
+            [Current]</li>
+        </ul></li>
+    </ul>
+
+    <h3>Lifecycle Functionality</h3>
+
+    <p>The following processing must be performed when the <code>start()</code>
+    method is called:</p>
+    <ul>
+    <li>None required.</li>
+    </ul>
+
+    <p>The following processing must be performed when the <code>stop()</code>
+    method is called:</p>
+    <ul>
+    <li>None required.</li>
+    </ul>
+
+
+    <h3>Method authenticate() Functionality</h3>
+
+    <p>When <code>authenticate()</code> is called, the following processing
+    is required:</p>
+    <ul>
+    <li>Attempt to bind to the directory server, using the username and
+        password provided by the user.</li>
+    <li>If the user was not authenticated, release the allocated connection
+        and return <code>null</code>.</li>
+    <li>Acquire a <code>List</code> of the security roles assigned to the
+        authenticated user.</li>
+    <li>Construct a new instance of class
+        <code>org.apache.catalina.realm.GenericPrincipal</code>, passing as
+        constructor arguments:  this realm instance, the authenticated
+        username, and a <code>List</code> of the security roles associated
+        with this user.</li>
+    <li><strong>WARNING</strong> - Do not attempt to cache and reuse previous
+        <code>GenericPrincipal</code> objects for a particular user, because
+        the information in the directory server might have changed since the
+        last time this user was authenticated.</li>
+    <li>Return the newly constructed <code>GenericPrincipal</code>.</li>
+    </ul>
+
+
+    <h3>Method hasRole() Functionality</h3>
+
+    <p>When <code>hasRole()</code> is called, the following processing
+    is required:</p>
+    <ul>
+    <li>The <code>principal</code> that is passed as an argument SHOULD
+        be one that we returned (instanceof class
+        <code>org.apache.catalina.realm.GenericPrincipal</code>, with a
+        <code>realm</code> property that is equal to our instance.</li>
+    <li>If the passed <code>principal</code> meets these criteria, check
+        the specified role against the list returned by
+        <code>getRoles()</code>, and return <code>true</code> if the
+        specified role is included; otherwise, return <code>false</code>.</li>
+    <li>If the passed <code>principal</code> does not meet these criteria,
+        return <code>false</code>.</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Testable Assertions"><!--()--></a><a name="Testable_Assertions"><strong>Testable Assertions</strong></a></font></td></tr><tr><td><blockquote>
+
+  <p>In addition the the assertions implied by the functionality requirements
+  listed above, the following additional assertions shall be tested to
+  validate the behavior of <code>JNDIRealm</code>:</p>
+  <ul>
+  </ul>
+
+</blockquote></td></tr></table></td></tr><tr class="noPrint"><td width="20%" valign="top" nowrap class="noPrint"></td><td width="80%" valign="top" align="left"><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="comments_section" id="comments_section"><strong>Comments</strong></a></font></td></tr><tr><td><blockquote><p class="notice"><strong>Notice: </strong>This is not a Q&amp;A section.
+              The Apache Comments System is explained
+              <a href="/tomcat-8.0-doc/comments.html">here</a>.
+              Comments should be pointed towards suggestions on improving the documentation
+              or server, and may be removed again by our moderators if they are either
+              implemented or considered invalid/off-topic.
+              Questions on how to manage Apache Tomcat should be directed
+              to our <a href="http://tomcat.apache.org/lists.html">mailing lists</a>.</p><script type="text/javascript"><!--//--><![CDATA[//><!--
+              var comments_shortname = 'tomcat';
+              var comments_identifier = 'http://tomcat.apache.org/tomcat-8.0-doc/funcspecs/fs-jndi-realm.html';
+              (function(w, d) {
+                  if (w.location.hostname.toLowerCase() == "tomcat.apache.org") {
+                      d.write('<div id="comments_thread"><\/div>');
+                      var s = d.createElement('script');
+                      s.type = 'text/javascript';
+                      s.async = true;
+                      s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
+                      (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
+                  }
+                  else {
+                      d.write('<div id="comments_thread"><strong>Comments are disabled for this page at the moment.</strong><\/div>');
+                  }
+              })(window, document);
+              //--><!]]></script></blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
+        Copyright &copy; 1999-2012, Apache Software Foundation
+        </em></font></div></td></tr></table></body></html>
\ No newline at end of file

Propchange: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jndi-realm.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-jndi-realm.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-memory-realm.html
URL: http://svn.apache.org/viewvc/tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-memory-realm.html?rev=1417624&view=auto
==============================================================================
--- tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-memory-realm.html (added)
+++ tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-memory-realm.html Wed Dec  5 20:20:35 2012
@@ -0,0 +1,251 @@
+<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Catalina Functional Specifications (8.0.0-dev) - MemoryRealm</title><meta name="author" content="Craig McClanahan"><style type="text/css" media="print">
+            .noPrint {display: none;}
+            td#mainBody {width: 100%;}
+        </style><style type="text/css">
+            code {background-color:rgb(224,255,255);padding:0 0.1em;}
+            code.attributeName, code.propertyName {background-color:transparent;}
+        </style><style type="text/css">
+            .wrapped-source code { display: block; background-color: transparent; }
+            .wrapped-source div { margin: 0 0 0 1.25em; }
+            .wrapped-source p { margin: 0 0 0 1.25em; text-indent: -1.25em; }
+        </style><style type="text/css">
+            p.notice {
+                border: 1px solid rgb(255, 0, 0);
+                background-color: rgb(238, 238, 238);
+                color: rgb(0, 51, 102);
+                padding: 0.5em;
+                margin: 1em 2em 1em 1em;
+            }
+        </style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="../images/tomcat.gif" align="right" alt="
+      Catalina Functional Specifications
+    " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 8</font></h1><font face="arial,helvetica,sanserif">Version 8.0.0-dev, Dec 5 2012</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="../images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap class="noPrint"><p><strong>Links</strong></p><ul><li><a href="../index.html">Docs Home</a></li><li><a href="index.html">Functional Specs</a></li><li><a href="http://wiki.apache.org/tomcat/FAQ">FAQ</a></li><li><a href="#comments_section">User Comments</a></li></ul><p><strong>Administrative Apps</strong></p><ul><li><a href="fs-admin-apps.html">Overall Requirements</a></li><li><a href="mbean-names.html">Tomcat MBean Names</a></li><li><a href="fs-admin-objects.html">Ad
 ministered Objects</a></li><li><a href="fs-admin-opers.html">Supported Operations</a></li></ul><p><strong>Internal Servlets</strong></p><ul><li><a href="fs-default.html">Default Servlet</a></li></ul><p><strong>Realm Implementations</strong></p><ul><li><a href="fs-jdbc-realm.html">JDBC Realm</a></li><li><a href="fs-jndi-realm.html">JNDI Realm</a></li><li><a href="fs-memory-realm.html">Memory Realm</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>MemoryRealm</h1><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
+<ul><li><a href="#Overview">Overview</a><ol><li><a href="#Introduction">Introduction</a></li><li><a href="#External_Specifications">External Specifications</a></li><li><a href="#Implementation_Requirements">Implementation Requirements</a></li></ol></li><li><a href="#Dependencies">Dependencies</a><ol><li><a href="#Environmental_Dependencies">Environmental Dependencies</a></li><li><a href="#Container_Dependencies">Container Dependencies</a></li></ol></li><li><a href="#Functionality">Functionality</a><ol><li><a href="#Overview_of_Operation">Overview of Operation</a></li><li><a href="#Detailed_Functional_Requirements">Detailed Functional Requirements</a></li></ol></li><li><a href="#Testable_Assertions">Testable Assertions</a></li></ul>
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Overview"><strong>Overview</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The purpose of the <strong>MemoryRealm</strong> implementation is to
+    provide a mechanism by which Tomcat can acquire information needed
+    to authenticate web application users, and define their security roles,
+    from a simple text-based configuration file in XML format.  This is
+    intended to simplify the initial installation and operation of Tomcat,
+    without the complexity of configuring a database or directory server
+    based Realm.  It is not intended for production use.</p>
+
+    <p>This specification reflects a combination of functionality that is
+    already present in the <code>org.apache.catalina.realm.MemoryRealm</code>
+    class, as well as requirements for enhancements that have been
+    discussed.  Where appropriate, requirements statements are marked
+    <em>[Current]</em> and <em>[Requested]</em> to distinguish them.</p>
+
+    <p>The current status of this functional specification is
+    <strong>PROPOSED</strong>.  It has not yet been discussed and
+    agreed to on the TOMCAT-DEV mailing list.</p>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="External Specifications"><!--()--></a><a name="External_Specifications"><strong>External Specifications</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The implementation of this functionality depends on the following
+    external specifications:</p>
+    <ul>
+    <li>None</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Implementation Requirements"><!--()--></a><a name="Implementation_Requirements"><strong>Implementation Requirements</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The implementation of this functionality shall conform to the
+    following requirements:</p>
+    <ul>
+    <li>Be realized in one or more implementation classes.</li>
+    <li>Implement the <code>org.apache.catalina.Realm</code> interface.
+        [Current]</li>
+    <li>Implement the <code>org.apache.catalina.Lifecycle</code>
+        interface.  [Current]</li>
+    <li>Subclass the <code>org.apache.catalina.realm.RealmBase</code>
+        base class.</li>
+    <li>Live in the <code>org.apache.catalina.realm</code> package.
+        [Current]</li>
+    <li>Support a configurable debugging detail level. [Current]</li>
+    <li>Log debugging and operational messages (suitably internationalized)
+        via the <code>getContainer().log()</code> method. [Current]</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Dependencies"><strong>Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Environmental Dependencies"><!--()--></a><a name="Environmental_Dependencies"><strong>Environmental Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The following environmental dependencies must be met in order for
+    MemoryRealm to operate correctly:</p>
+    <ul>
+    <li>The desire to utilize MemoryRealm must be registered in
+        <code>$CATALINA_BASE/conf/server.xml</code>, in a
+        <code>&lt;Realm&gt;</code> element that is nested inside a
+        corresponding <code>&lt;Engine&gt;</code>, <code>&lt;Host&gt;</code>,
+        or <code>&lt;Context&gt;</code> element.  (This is already
+        included in the default <code>server.xml</code> file.)</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Container Dependencies"><!--()--></a><a name="Container_Dependencies"><strong>Container Dependencies</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>Correct operation of MemoryRealm depends on the following
+    specific features of the surrounding container:</p>
+    <ul>
+    <li>Interactions with <code>MemoryRealm</code> will be initiated by
+        the appropriate <code>Authenticator</code> implementation, based
+        on the login method that is selected.</li>
+    <li><code>MemoryRealm</code> must have an XML parser compatible with
+        the JAXP/1.1 APIs available to it.  This is normally accomplished
+        by placing the corresponding JAR files in directory
+        <code>$CATALINA_HOME/lib</code>.</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Functionality"><strong>Functionality</strong></a></font></td></tr><tr><td><blockquote>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Overview of Operation"><!--()--></a><a name="Overview_of_Operation"><strong>Overview of Operation</strong></a></font></td></tr><tr><td><blockquote>
+
+    <p>The main purpose of <code>MemoryRealm</code> is to allow Catalina to
+    authenticate users, and look up the corresponding security roles, from
+    the information found in an XML-format configuration file.  The format
+    of this file is described below.  When a <code>MemoryRealm</code>
+    instance is started, it will read the contents of this XML file and create
+    an "in memory database" of all the valid users and their associated
+    security roles.</p>
+
+    <p>Each time that Catalina needs to authenticate a user, it will call
+    the <code>authenticate()</code> method of this Realm implementation,
+    passing the username and password that were specified by the user.  If
+    we find the user in the database (and match on the password), we accumulate
+    all of the security roles that are defined for this user, and create a
+    new <code>GenericPrincipal</code> object to be returned.  If the user
+    is not authenticated, we return <code>null</code> instead.  The
+    <code>GenericUser</code> object caches the set of security roles that
+    were owned by this user at the time of authentication, so that calls to
+    <code>isUserInRole()</code> can be answered without going back to the
+    database every time.</p>
+
+  </blockquote></td></tr></table>
+
+
+  <table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#828DA6"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Detailed Functional Requirements"><!--()--></a><a name="Detailed_Functional_Requirements"><strong>Detailed Functional Requirements</strong></a></font></td></tr><tr><td><blockquote>
+
+
+    <h3>Configurable Properties</h3>
+
+    <p>The implementation shall support the following properties
+    that can be configured with JavaBeans property setters:</p>
+    <ul>
+    <li>Configurable debugging detail level.</li>
+    <li>Configurable file pathname (absolute or relative to
+        <code>$CATALINA_BASE</code> of the XML file containing our
+        defined users.  [<code>conf/tomcat-users.xml</code>].</li>
+    </ul>
+
+    <h3>Lifecycle Functionality</h3>
+
+    <p>The following processing must be performed when the <code>start()</code>
+    method is called:</p>
+    <ul>
+    <li>Open and parse the specified XML file.</li>
+    <li>Create an in-memory database representation of the XML file
+        contents.</li>
+    <li><strong>NOTE</strong> - There is no requirement to recognize
+        subsequent changes to the contents of the XML file.</li>
+    </ul>
+
+    <p>The following processing must be performed when the <code>stop()</code>
+    method is called:</p>
+    <ul>
+    <li>Release object references to the in-memory database representation.</li>
+    </ul>
+
+
+    <h3>Method authenticate() Functionality</h3>
+
+    <p>When <code>authenticate()</code> is called, the following processing
+    is required:</p>
+    <ul>
+    <li>Select the one and only "user" instance from the in-memory database,
+        based on matching the specified username.  If there is no such
+        instance, return <code>null</code>.</li>
+    <li>Authenticate the user by comparing the (possibly encrypted) password
+        value that was received against the password presented by the user.
+        If there is no match, return <code>null</code>.</li>
+    <li>Construct a new instance of class
+        <code>org.apache.catalina.realm.GenericPrincipal</code> (if not
+        already using this as the internal database representation) that
+        contains the authenticated username and a <code>List</code> of the
+        security roles associated with this user.</li>
+    <li>Return the newly constructed <code>GenericPrincipal</code>.</li>
+    </ul>
+
+
+    <h3>Method hasRole() Functionality</h3>
+
+    <p>When <code>hasRole()</code> is called, the following processing
+    is required:</p>
+    <ul>
+    <li>The <code>principal</code> that is passed as an argument SHOULD
+        be one that we returned (instanceof class
+        <code>org.apache.catalina.realm.GenericPrincipal</code>, with a
+        <code>realm</code> property that is equal to our instance.</li>
+    <li>If the passed <code>principal</code> meets these criteria, check
+        the specified role against the list returned by
+        <code>getRoles()</code>, and return <code>true</code> if the
+        specified role is included; otherwise, return <code>false</code>.</li>
+    <li>If the passed <code>principal</code> does not meet these criteria,
+        return <code>false</code>.</li>
+    </ul>
+
+  </blockquote></td></tr></table>
+
+</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Testable Assertions"><!--()--></a><a name="Testable_Assertions"><strong>Testable Assertions</strong></a></font></td></tr><tr><td><blockquote>
+
+  <p>In addition the the assertions implied by the functionality requirements
+  listed above, the following additional assertions shall be tested to
+  validate the behavior of <code>MemoryRealm</code>:</p>
+  <ul>
+  </ul>
+
+</blockquote></td></tr></table></td></tr><tr class="noPrint"><td width="20%" valign="top" nowrap class="noPrint"></td><td width="80%" valign="top" align="left"><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="comments_section" id="comments_section"><strong>Comments</strong></a></font></td></tr><tr><td><blockquote><p class="notice"><strong>Notice: </strong>This is not a Q&amp;A section.
+              The Apache Comments System is explained
+              <a href="/tomcat-8.0-doc/comments.html">here</a>.
+              Comments should be pointed towards suggestions on improving the documentation
+              or server, and may be removed again by our moderators if they are either
+              implemented or considered invalid/off-topic.
+              Questions on how to manage Apache Tomcat should be directed
+              to our <a href="http://tomcat.apache.org/lists.html">mailing lists</a>.</p><script type="text/javascript"><!--//--><![CDATA[//><!--
+              var comments_shortname = 'tomcat';
+              var comments_identifier = 'http://tomcat.apache.org/tomcat-8.0-doc/funcspecs/fs-memory-realm.html';
+              (function(w, d) {
+                  if (w.location.hostname.toLowerCase() == "tomcat.apache.org") {
+                      d.write('<div id="comments_thread"><\/div>');
+                      var s = d.createElement('script');
+                      s.type = 'text/javascript';
+                      s.async = true;
+                      s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
+                      (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
+                  }
+                  else {
+                      d.write('<div id="comments_thread"><strong>Comments are disabled for this page at the moment.</strong><\/div>');
+                  }
+              })(window, document);
+              //--><!]]></script></blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
+        Copyright &copy; 1999-2012, Apache Software Foundation
+        </em></font></div></td></tr></table></body></html>
\ No newline at end of file

Propchange: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-memory-realm.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tomcat/site/trunk/docs/tomcat-8.0-doc/funcspecs/fs-memory-realm.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org