org.apache.catalina.realm
Class MemoryRealm
- Lifecycle, MBeanRegistration, Realm
Simple implementation of
Realm that reads an XML file to configure
the valid users, passwords, and roles. The file format (and default file
location) are identical to those currently supported by Tomcat 3.X.
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:
- Craig R. McClanahan
protected String | info - Descriptive information about this Realm implementation.
|
protected static String | name - Descriptive information about this Realm implementation.
|
container , controller , debug , digest , digestEncoding , domain , host , info , initialized , lifecycle , md , md5Encoder , md5Helper , mserver , oname , path , sm , started , support , type , validate |
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 collection of valid 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.
|
Digest , addLifecycleListener , addPropertyChangeListener , authenticate , authenticate , authenticate , authenticate , destroy , digest , findLifecycleListeners , findSecurityConstraints , getContainer , getController , getDebug , getDigest , getDigest , getDigestEncoding , getDomain , getInfo , getName , getObjectName , getPassword , getPrincipal , getType , getValidate , hasMessageDigest , hasResourcePermission , hasRole , hasUserDataPermission , init , log , log , main , postDeregister , postRegister , preDeregister , preRegister , removeLifecycleListener , removePropertyChangeListener , setContainer , setController , setDebug , setDigest , setDigestEncoding , setValidate , start , stop |
info
protected final String info
Descriptive information about this Realm implementation.
name
protected static final String name
Descriptive information about this Realm implementation.
authenticate
public Principal authenticate(String username,
String credentials)
Return the Principal associated with the specified username and
credentials, if there is one; otherwise return null
.
- authenticate in interface Realm
- authenticate in interface RealmBase
username
- Username of the Principal to look upcredentials
- Password or other credentials to use in
authenticating this username
getDigester
protected Digester getDigester()
Return a configured Digester
to use for processing
the XML input file, creating a new one if necessary.
getInfo
public String getInfo()
Return descriptive information about this Realm implementation and
the corresponding version number, in the format
<description>/<version>
.
- getInfo in interface Realm
- getInfo in interface RealmBase
getName
protected String getName()
Return a short name for this Realm implementation.
- getName in interface RealmBase
getPassword
protected String getPassword(String username)
Return the password associated with the given principal's user name.
- getPassword in interface RealmBase
getPathname
public String getPathname()
Return the pathname of our XML file containing user definitions.
getPrincipal
protected Principal getPrincipal(String username)
Return the Principal associated with the given user name.
- getPrincipal in interface RealmBase
getPrincipals
protected Map getPrincipals()
Returns the collection of valid principals for this realm.
The keys to the map are Strings, the user names.
- The principals
setPathname
public void setPathname(String pathname)
Set the pathname of our XML file containing user definitions. If a
relative pathname is specified, it is resolved against "catalina.base".
pathname
- The new pathname
Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.