org.apache.catalina.Realm that is based on an implementation of UserDatabase made
available through the JNDI resources configured for this instance of Catalina. Set the resourceName
parameter to the JNDI resources name for the configured instance of UserDatabase that we should consult.
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| protected volatile UserDatabase | database
The |
| private final Object | |
| private boolean | localJndiResource
Obtain the UserDatabase from the context (rather than global) JNDI. |
| protected String | resourceName
The global JNDI name of the |
| private boolean | useStaticPrincipal
Use a static principal disconnected from the database. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | Returns: true if a local JNDI context will be used, false if the the global JNDI context will be
usedDetermines whether this Realm is configured to obtain the associated |
| protected String | getPassword(String
The user name username)Implements abstract org. Get the password for the specified user. |
| protected Principal | getPrincipal(String
The user name username)Implements abstract org. Get the principal associated with the specified user. |
| public String | |
| public static String[] | |
| private UserDatabase | |
| public boolean | |
| public boolean | isAvailable()
Overrides default org. Return the availability of the realm for authentication. |
| public void | setLocalJndiResource(boolean
true to use a local JNDI context, false to use the global JNDI contextConfigure whether this Realm obtains the associated |
| public void | setResourceName(String
The new global JNDI name resourceName)Set the global JNDI name of the |
| public void | setUseStaticPrincipal(boolean
the new value useStaticPrincipal)Allows using a static principal disconnected from the user database. |
| protected void | startInternal()
Overrides org. Prepare for the beginning of active use of the public methods of this component and implement the requirements of
|
| protected void | stopInternal()
Overrides org. Gracefully terminate the active use of the public methods of this component and implement the requirements of
|
| database | back to summary |
|---|---|
| protected volatile UserDatabase database The | |
| databaseLock | back to summary |
|---|---|
| private final Object databaseLock | |
| localJndiResource | back to summary |
|---|---|
| private boolean localJndiResource Obtain the UserDatabase from the context (rather than global) JNDI. | |
| resourceName | back to summary |
|---|---|
| protected String resourceName The global JNDI name of the | |
| useStaticPrincipal | back to summary |
|---|---|
| private boolean useStaticPrincipal Use a static principal disconnected from the database. This prevents live updates to users and roles having an effect on authenticated principals, but reduces use of the database. | |
| UserDatabaseRealm | back to summary |
|---|---|
| public UserDatabaseRealm() | |
| backgroundProcess | back to summary |
|---|---|
| public void backgroundProcess() Overrides org. Implements org. Calls
| |
| getLocalJndiResource | back to summary |
|---|---|
| public boolean getLocalJndiResource() Determines whether this Realm is configured to obtain the associated
| |
| getPassword | back to summary |
|---|---|
| protected String getPassword(String username) Implements abstract org. Doc from org. Get the password for the specified user. | |
| getPrincipal | back to summary |
|---|---|
| protected Principal getPrincipal(String username) Implements abstract org. Doc from org. Get the principal associated with the specified user. | |
| getResourceName | back to summary |
|---|---|
public String getResourceName()
| |
| getRoles | back to summary |
|---|---|
| public static String[] getRoles(User user) | |
| getUserDatabase | back to summary |
|---|---|
| private UserDatabase getUserDatabase() | |
| getUseStaticPrincipal | back to summary |
|---|---|
public boolean getUseStaticPrincipal()
| |
| isAvailable | back to summary |
|---|---|
| public boolean isAvailable() Overrides default org. Doc from org. Return the availability of the realm for authentication.
| |
| setLocalJndiResource | back to summary |
|---|---|
| public void setLocalJndiResource(boolean localJndiResource) Configure whether this Realm obtains the associated
| |
| setResourceName | back to summary |
|---|---|
| public void setResourceName(String resourceName) Set the global JNDI name of the
| |
| setUseStaticPrincipal | back to summary |
|---|---|
| public void setUseStaticPrincipal(boolean useStaticPrincipal) Allows using a static principal disconnected from the user database.
| |
| startInternal | back to summary |
|---|---|
| protected void startInternal() throws LifecycleException Overrides org. Doc from org. Prepare for the beginning of active use of the public methods of this component and implement the requirements of
| |
| stopInternal | back to summary |
|---|---|
| protected void stopInternal() throws LifecycleException Overrides org. Doc from org. Gracefully terminate the active use of the public methods of this component and implement the requirements of
| |
| Modifier and Type | Field and Description |
|---|---|
| private final transient UserDatabase | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | |
| public boolean | hasRole(String
Role to be tested role)Overrides org. Does the user represented by this Principal possess the specified role? |
| private Object | Returns: The object to serialize instead of this objectHides org. Magic method from |
| database | back to summary |
|---|---|
| private final transient UserDatabase database | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. | |
| UserDatabasePrincipal | back to summary |
|---|---|
| public UserDatabasePrincipal(User user, UserDatabase database) | |
| getRoles | back to summary |
|---|---|
| public String[] getRoles() Overrides org.
| |
| hasRole | back to summary |
|---|---|
| public boolean hasRole(String role) Overrides org. Doc from org. Does the user represented by this Principal possess the specified role? | |
| writeReplace | back to summary |
|---|---|
| private Object writeReplace() throws ObjectStreamException Hides org. Magic method from
| |