|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.struts.webapp.example.memory.MemoryUserDatabase
Concrete implementation of UserDatabase for an in-memory
database backed by an XML data file.
| Field Summary | |
private org.apache.commons.logging.Log |
log
Logging output for this user database instance. |
private String |
pathname
Absolute pathname to the persistent file we use for loading and storing persistent data. |
private String |
pathnameNew
|
private String |
pathnameOld
|
private HashMap |
users
The Users associated with this UserDatabase, keyed by username. |
| 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()
|
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 |
| Field Detail |
private org.apache.commons.logging.Log log
private HashMap users
Users associated with this UserDatabase, keyed by username.
private String pathname
private String pathnameOld
private String pathnameNew
| Constructor Detail |
public MemoryUserDatabase()
| Method Detail |
public String getPathname()
public void setPathname(String pathname)
public void close()
throws Exception
UserDatabaseFinalize access to the underlying persistence layer.
close in interface UserDatabaseException - if a database access error occurspublic User createUser(String username)
UserDatabaseCreate and return a new User defined in this user database.
createUser in interface UserDatabaseusername - Username of the new user
public User findUser(String username)
throws ExpiredPasswordException
UserDatabaseReturn the existing User with the specified username,
if any; otherwise return null.
findUser in interface UserDatabaseusername - Username of the user to retrieve
ExpiredPasswordException - if user password has expired
and must be changedpublic User[] findUsers()
UserDatabaseReturn the set of Users defined in this user database.
findUsers in interface UserDatabase
public void open()
throws Exception
UserDatabaseInitiate access to the underlying persistence layer.
open in interface UserDatabaseException - if a database access error occurspublic void removeUser(User user)
UserDatabaseUser from this database.
removeUser in interface UserDatabaseuser - User to be removed
public void save()
throws Exception
UserDatabaseSave any pending changes to the underlying persistence layer.
save in interface UserDatabaseException - if a database access error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||