org.apache.struts.apps.mailreader.dao.impl.memory
Class MemoryUserDatabase

java.lang.Object
  extended by org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUserDatabase
All Implemented Interfaces:
UserDatabase

public class MemoryUserDatabase
extends Object
implements UserDatabase

Concrete implementation of UserDatabase for an in-memory database backed by an XML data file.

Since:
Struts 1.1
Version:
$Rev: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $

Constructor Summary
MemoryUserDatabase()
           
 
Method Summary
 void close()
          Finalize access to the underlying persistence layer.
 User createUser(String username)
          Create and return a new User defined in this user database.
 User findUser(String username)
          Return the existing User with the specified username, if any; otherwise return null.
 User[] findUsers()
          Return the set of Users defined in this user database.
 String getPathname()
           
 boolean isOpen()
          Return true if open() has been called.
 void open()
          Initiate access to the underlying persistence layer.
 void removeUser(User user)
          Remove the specified User from this database.
 void save()
          Save any pending changes to the underlying persistence layer.
 void setPathname(String pathname)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryUserDatabase

public MemoryUserDatabase()
Method Detail

getPathname

public String getPathname()

setPathname

public void setPathname(String pathname)

close

public void close()
           throws Exception
Description copied from interface: UserDatabase

Finalize access to the underlying persistence layer.

Specified by:
close in interface UserDatabase
Throws:
Exception - if a database access error occurs

createUser

public User createUser(String username)
Description copied from interface: UserDatabase

Create and return a new User defined in this user database.

Specified by:
createUser in interface UserDatabase
Parameters:
username - Username of the new user

findUser

public User findUser(String username)
Description copied from interface: UserDatabase

Return the existing User with the specified username, if any; otherwise return null.

Specified by:
findUser in interface UserDatabase
Parameters:
username - Username of the user to retrieve

findUsers

public User[] findUsers()
Description copied from interface: UserDatabase

Return the set of Users defined in this user database.

Specified by:
findUsers in interface UserDatabase

open

public void open()
          throws Exception
Description copied from interface: UserDatabase

Initiate access to the underlying persistence layer.

Specified by:
open in interface UserDatabase
Throws:
Exception - if a database access error occurs

removeUser

public void removeUser(User user)
Description copied from interface: UserDatabase
Remove the specified User from this database.

Specified by:
removeUser in interface UserDatabase
Parameters:
user - User to be removed

save

public void save()
          throws Exception
Description copied from interface: UserDatabase

Save any pending changes to the underlying persistence layer.

Specified by:
save in interface UserDatabase
Throws:
Exception - if a database access error occurs

isOpen

public boolean isOpen()
Description copied from interface: UserDatabase

Return true if open() has been called.

Specified by:
isOpen in interface UserDatabase


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.