| java.lang.Object org.apache.catalina.users.MemoryUserDatabase
MemoryUserDatabase | public class MemoryUserDatabase implements UserDatabase(Code) | | Concrete implementation of
UserDatabase that loads all
defined users, groups, and roles into an in-memory data structure,
and uses a specified XML file for its persistent storage.
author: Craig R. McClanahan version: $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $ since: 4.1 |
Field Summary | |
protected HashMap | groups The set of
Group s defined in this database, keyed by
group name. | protected String | id The unique global identifier of this user database. | protected String | pathname The relative (to catalina.base ) or absolute pathname to
the XML file in which we will save our persistent information. | protected String | pathnameNew The relative or absolute pathname ot the file in which we write
our new information prior to renaming. | protected String | pathnameOld The relative or absolute pathname to the file in which our old
information is stored while renaming is in progress. | protected boolean | readonly A flag, indicating if the user database is read only. | protected HashMap | roles The set of
Role s defined in this database, keyed by
role name. | protected HashMap | users The set of
User s defined in this database, keyed by
user name. |
groups | protected HashMap groups(Code) | | The set of
Group s defined in this database, keyed by
group name.
|
id | protected String id(Code) | | The unique global identifier of this user database.
|
pathname | protected String pathname(Code) | | The relative (to catalina.base ) or absolute pathname to
the XML file in which we will save our persistent information.
|
pathnameNew | protected String pathnameNew(Code) | | The relative or absolute pathname ot the file in which we write
our new information prior to renaming.
|
pathnameOld | protected String pathnameOld(Code) | | The relative or absolute pathname to the file in which our old
information is stored while renaming is in progress.
|
readonly | protected boolean readonly(Code) | | A flag, indicating if the user database is read only.
|
roles | protected HashMap roles(Code) | | The set of
Role s defined in this database, keyed by
role name.
|
users | protected HashMap users(Code) | | The set of
User s defined in this database, keyed by
user name.
|
MemoryUserDatabase | public MemoryUserDatabase()(Code) | | Create a new instance with default values.
|
MemoryUserDatabase | public MemoryUserDatabase(String id)(Code) | | Create a new instance with the specified values.
Parameters: id - Unique global identifier of this user database |
close | public void close() throws Exception(Code) | | Finalize access to this user database.
exception: Exception - if any exception is thrown during closing |
createGroup | public Group createGroup(String groupname, String description)(Code) | | Create and return a new
Group defined in this user database.
Parameters: groupname - The group name of the new group (must be unique) Parameters: description - The description of this group |
createRole | public Role createRole(String rolename, String description)(Code) | | Create and return a new
Role defined in this user database.
Parameters: rolename - The role name of the new group (must be unique) Parameters: description - The description of this group |
createUser | public User createUser(String username, String password, String fullName)(Code) | | Create and return a new
User defined in this user database.
Parameters: username - The logon username of the new user (must be unique) Parameters: password - The logon password of the new user Parameters: fullName - The full name of the new user |
findGroup | public Group findGroup(String groupname)(Code) | | Return the
Group with the specified group name, if any;
otherwise return null .
Parameters: groupname - Name of the group to return |
findRole | public Role findRole(String rolename)(Code) | | Return the
Role with the specified role name, if any;
otherwise return null .
Parameters: rolename - Name of the role to return |
findUser | public User findUser(String username)(Code) | | Return the
User with the specified user name, if any;
otherwise return null .
Parameters: username - Name of the user to return |
getGroups | public Iterator getGroups()(Code) | | Return the set of
Group s defined in this user database.
|
getId | public String getId()(Code) | | Return the unique global identifier of this user database.
|
getPathname | public String getPathname()(Code) | | Return the relative or absolute pathname to the persistent storage file.
|
getReadonly | public boolean getReadonly()(Code) | | Returning the readonly status of the user database
|
getRoles | public Iterator getRoles()(Code) | | Return the set of
Role s defined in this user database.
|
getStringManager | StringManager getStringManager()(Code) | | Return the StringManager for use in looking up messages.
|
getUsers | public Iterator getUsers()(Code) | | Return the set of
User s defined in this user database.
|
isWriteable | public boolean isWriteable()(Code) | | Check for permissions to save this user database
to persistent storage location
|
open | public void open() throws Exception(Code) | | Initialize access to this user database.
exception: Exception - if any exception is thrown during opening |
removeGroup | public void removeGroup(Group group)(Code) | | Remove the specified
Group from this user database.
Parameters: group - The group to be removed |
removeRole | public void removeRole(Role role)(Code) | | Remove the specified
Role from this user database.
Parameters: role - The role to be removed |
removeUser | public void removeUser(User user)(Code) | | Remove the specified
User from this user database.
Parameters: user - The user to be removed |
save | public void save() throws Exception(Code) | | Save any updated information to the persistent storage location for
this user database.
exception: Exception - if any exception is thrown during saving |
setPathname | public void setPathname(String pathname)(Code) | | Set the relative or absolute pathname to the persistent storage file.
Parameters: pathname - The new pathname |
setReadonly | public void setReadonly(boolean readonly)(Code) | | Setting the readonly status of the user database
Parameters: pathname - The new pathname |
toString | public String toString()(Code) | | Return a String representation of this UserDatabase.
|
|
|