org.apache.catalina.realm
public class UserDatabaseRealm extends RealmBase
Implementation of 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.
Since: 4.1
Version: $Revision: 543691 $ $Date: 2007-06-02 03:37:08 +0200 (Sat, 02 Jun 2007) $
Field Summary | |
---|---|
protected UserDatabase | database
The UserDatabase we will use to authenticate users
and identify associated roles. |
protected String | info
Descriptive information about this Realm implementation. |
protected static String | name
Descriptive information about this Realm implementation. |
protected String | resourceName
The global JNDI name of the UserDatabase resource
we will be utilizing. |
Method Summary | |
---|---|
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. |
String | getResourceName()
Return the global JNDI name of the UserDatabase resource
we will be using. |
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 . |
void | setResourceName(String resourceName)
Set the global JNDI name of the UserDatabase resource
we will be using.
|
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.
|
UserDatabase
we will use to authenticate users
and identify associated roles.UserDatabase
resource
we will be utilizing.<description>/<version>
.UserDatabase
resource
we will be using.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.
Parameters: principal Principal for whom the role is to be checked role Security role to be checked
UserDatabase
resource
we will be using.
Parameters: resourceName The new global JNDI name
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