Home » apache-tomcat-6.0.26-src » org.apache » tomcat » security » file » [javadoc | source]
org.apache.tomcat.security.file
public final class: FileRealmDatabase [javadoc | source]
java.lang.Object
   org.apache.tomcat.security.file.FileRealmDatabase
In-memory cache of the set of users, groups, and their associated roles, stored in an XML-formatted file that conforms to DTD found in the tomcat-users.dtd file in this directory.
Constructor:
 public FileRealmDatabase() 
 public FileRealmDatabase(InputStream stream) throws IOException, SAXParseException, SAXException 
    Construct a new database initialized from the specified input stream
    Parameters:
    stream - Stream from which to load the contents of this database
    Throws:
    IOException - if an input/output error occurs
    SAXParseException - if a parsing exception occurs
    SAXException - if a processing exception occurs
    exception: IOException - if an input/output error occurs
    exception: SAXParseException - if a parsing exception occurs
    exception: SAXException - if a processing exception occurs
Method from org.apache.tomcat.security.file.FileRealmDatabase Summary:
addGroup,   addRole,   addUser,   createGroup,   createUser,   createUser,   getGroup,   getGroups,   getRoles,   getUser,   getUsers,   hasRole,   read,   remove,   remove,   remove,   reset,   write
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.security.file.FileRealmDatabase Detail:
  void addGroup(FileRealmGroup group) 
    [Package Private] Add this group to the set of defined groups.
  void addRole(String role) 
    [Package Private] Add this role to the set of defined roles.
  void addUser(FileRealmUser user) 
    [Package Private] Add this user to the set of defined users.
 public FileRealmGroup createGroup(String name) 
    Create and return a new group.
 public FileRealmUser createUser(String name,
    String password) 
    Create and return a new user.
 public FileRealmUser createUser(String name,
    byte[] password) 
    Create and return a new user.
 public FileRealmGroup getGroup(String name) 
    Return the group with the specified name, if any.
 public Enumeration getGroups() 
    Return an enumeration of the defined groups in this database.
 public Enumeration getRoles() 
    Return an enumeration of the defined roles in this database.
 public FileRealmUser getUser(String name) 
    Return the user with the specified name, if any.
 public Enumeration getUsers() 
    Return an enumeration of the defined users in this database.
 public boolean hasRole(String role) 
    Is the specified role valid within this database?
 public  void read(InputStream stream) throws IOException, SAXParseException, SAXException 
    Load the contents of this database from the specified input stream. IMPLEMENTATION NOTE: The order of processing (users, groups, and then roles) is important to correctly process XML files with forward references in them.
  void remove(FileRealmGroup group) 
    [Package Private] Remove this group from the set of defined groups.
  void remove(String role) 
    [Package Private] Remove this role from the set of defined roles.
  void remove(FileRealmUser user) 
    [Package Private] Remove this user from the set of defined users.
 public  void reset() 
    Reset the contents of this database so that it can be reused
 public  void write(OutputStream stream) throws IOException 
    Write the contents of this database to the specified output stream, in a format suitable for loading via the read() method.