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

All Implemented Interfaces:
    UserDatabase

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.

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 pathnameOld    The relative or absolute pathname to the file in which our old information is stored while renaming is in progress. 
protected  String pathnameNew    The relative or absolute pathname ot the file in which we write our new information prior to renaming. 
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. 
Constructor:
 public MemoryUserDatabase() 
 public MemoryUserDatabase(String id) 
    Create a new instance with the specified values.
    Parameters:
    id - Unique global identifier of this user database
Method from org.apache.catalina.users.MemoryUserDatabase Summary:
close,   createGroup,   createRole,   createUser,   findGroup,   findRole,   findUser,   getGroups,   getId,   getPathname,   getReadonly,   getRoles,   getStringManager,   getUsers,   isWriteable,   open,   removeGroup,   removeRole,   removeUser,   save,   setPathname,   setReadonly,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.users.MemoryUserDatabase Detail:
 public  void close() throws Exception 
    Finalize access to this user database.
 public Group createGroup(String groupname,
    String description) 
    Create and return a new Group defined in this user database.
 public Role createRole(String rolename,
    String description) 
    Create and return a new Role defined in this user database.
 public User createUser(String username,
    String password,
    String fullName) 
    Create and return a new User defined in this user database.
 public Group findGroup(String groupname) 
    Return the Group with the specified group name, if any; otherwise return null.
 public Role findRole(String rolename) 
    Return the Role with the specified role name, if any; otherwise return null.
 public User findUser(String username) 
    Return the User with the specified user name, if any; otherwise return null.
 public Iterator getGroups() 
    Return the set of Group s defined in this user database.
 public String getId() 
    Return the unique global identifier of this user database.
 public String getPathname() 
    Return the relative or absolute pathname to the persistent storage file.
 public boolean getReadonly() 
    Returning the readonly status of the user database
 public Iterator getRoles() 
    Return the set of Role s defined in this user database.
 StringManager getStringManager() 
    Return the StringManager for use in looking up messages.
 public Iterator getUsers() 
    Return the set of User s defined in this user database.
 public boolean isWriteable() 
    Check for permissions to save this user database to persistent storage location
 public  void open() throws Exception 
    Initialize access to this user database.
 public  void removeGroup(Group group) 
    Remove the specified Group from this user database.
 public  void removeRole(Role role) 
    Remove the specified Role from this user database.
 public  void removeUser(User user) 
    Remove the specified User from this user database.
 public  void save() throws Exception 
    Save any updated information to the persistent storage location for this user database.
 public  void setPathname(String pathname) 
    Set the relative or absolute pathname to the persistent storage file.
 public  void setReadonly(boolean readonly) 
    Setting the readonly status of the user database
 public String toString() 
    Return a String representation of this UserDatabase.