org.apache.catalina.realm
public class MemoryRealm extends RealmBase
IMPLEMENTATION NOTE: It is assumed that the in-memory collection representing our defined users (and their roles) is initialized at application startup and never modified again. Therefore, no thread synchronization is performed around accesses to the principals collection.
Version: $Revision: 777556 $ $Date: 2009-05-22 16:59:34 +0200 (Fri, 22 May 2009) $
Field Summary | |
---|---|
protected String | info
Descriptive information about this Realm implementation. |
protected static String | name
Descriptive information about this Realm implementation. |
Method Summary | |
---|---|
Principal | authenticate(String username, String credentials)
Return the Principal associated with the specified username and
credentials, if there is one; otherwise return null .
|
protected Digester | getDigester()
Return a configured Digester to use for processing
the XML input file, creating a new one if necessary. |
String | getInfo()
Return descriptive information about this Realm implementation and
the corresponding version number, in the format
<description>/<version> . |
protected String | getName()
Return a short name for this Realm implementation. |
protected String | getPassword(String username)
Return the password associated with the given principal's user name. |
String | getPathname()
Return the pathname of our XML file containing user definitions. |
protected Principal | getPrincipal(String username)
Return the Principal associated with the given user name. |
protected Map | getPrincipals()
Returns the principals for this realm.
|
void | setPathname(String pathname)
Set the pathname of our XML file containing user definitions. |
void | start()
Prepare for active use of the public methods of this Component.
|
void | stop()
Gracefully shut down active use of the public methods of this Component.
|
null
.
Parameters: username Username of the Principal to look up credentials Password or other credentials to use in authenticating this username
Digester
to use for processing
the XML input file, creating a new one if necessary.<description>/<version>
.Returns: The principals, keyed by user name (a String)
Parameters: pathname The new pathname
Throws: LifecycleException if this component detects a fatal error that prevents it from being started
Throws: LifecycleException if this component detects a fatal error that needs to be reported