Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » realm » [javadoc | source]
org.apache.catalina.realm
public class: UserDatabaseRealm [javadoc | source]
java.lang.Object
   org.apache.catalina.realm.RealmBase
      org.apache.catalina.realm.UserDatabaseRealm

All Implemented Interfaces:
    Realm, MBeanRegistration, Lifecycle

Implementation of org.apache.catalina.Realm that is based on an implementation of UserDatabase made available through the global JNDI resources configured for this instance of Catalina. Set the resourceName parameter to the global JNDI resources name for the configured instance of UserDatabase that we should consult.

Field Summary
protected  UserDatabase database    The UserDatabase we will use to authenticate users and identify associated roles. 
protected final  String info    Descriptive information about this Realm implementation. 
protected static final  String name    Descriptive information about this Realm implementation. 
protected  String resourceName    The global JNDI name of the UserDatabase resource we will be utilizing. 
Fields inherited from org.apache.catalina.realm.RealmBase:
container,  containerLog,  digest,  digestEncoding,  info,  lifecycle,  md,  md5Encoder,  md5Helper,  sm,  started,  support,  validate,  allRolesMode,  type,  domain,  host,  path,  oname,  controller,  mserver,  initialized
Method from org.apache.catalina.realm.UserDatabaseRealm Summary:
getInfo,   getName,   getPassword,   getPrincipal,   getResourceName,   hasRole,   setResourceName,   start,   stop
Methods from org.apache.catalina.realm.RealmBase:
Digest,   addLifecycleListener,   addPropertyChangeListener,   authenticate,   authenticate,   authenticate,   authenticate,   backgroundProcess,   destroy,   digest,   findLifecycleListeners,   findSecurityConstraints,   getAllRolesMode,   getContainer,   getController,   getDigest,   getDigest,   getDigestEncoding,   getDomain,   getInfo,   getName,   getObjectName,   getPassword,   getPrincipal,   getPrincipal,   getType,   getValidate,   hasMessageDigest,   hasResourcePermission,   hasRole,   hasUserDataPermission,   init,   main,   postDeregister,   postRegister,   preDeregister,   preRegister,   removeLifecycleListener,   removePropertyChangeListener,   setAllRolesMode,   setContainer,   setController,   setDigest,   setDigestEncoding,   setValidate,   start,   stop
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.realm.UserDatabaseRealm Detail:
 public 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.
 protected Principal getPrincipal(String username) 
    Return the Principal associated with the given user name.
 public String getResourceName() 
    Return the global JNDI name of the UserDatabase resource we will be using.
 public boolean hasRole(Principal principal,
    String role) 
    Return true if the specified Principal has the specified security role, within the context of this Realm; otherwise return false. This implementation returns true if the User has the role, or if any Group that the User is a member of has the role.
 public  void setResourceName(String resourceName) 
    Set the global JNDI name of the UserDatabase resource we will be using.
 public synchronized  void start() throws LifecycleException 
    Prepare for active use of the public methods of this Component.
 public synchronized  void stop() throws LifecycleException 
    Gracefully shut down active use of the public methods of this Component.