FileDocCategorySizeDatePackage
UserDatabase.javaAPI DocExample5200Sun Mar 07 19:48:42 GMT 2004org.apache.struts.webapp.example

UserDatabase

public interface UserDatabase

A Data Access Object (DAO) interface describing the available operations for retrieving and storing {@link User}s (and their associated {@link Subscription}s) in some persistence layer whose characteristics are not specified here. One or more implementations will be created to perform the actual I/O that is required.

author
Craig R. McClanahan
version
$Revision: 1.1 $ $Date: 2002/03/05 04:23:57 $
since
Struts 1.1

Fields Summary
Constructors Summary
Methods Summary
public voidclose()

Finalize access to the underlying persistence layer.

exception
Exception if a database access error occurs

public UsercreateUser(java.lang.String username)

Create and return a new {@link User} defined in this user database.

param
username Username of the new user
exception
IllegalArgumentExceptionif the specified username is not unique

public UserfindUser(java.lang.String username)

Return the existing {@link User} with the specified username, if any; otherwise return null.

param
username Username of the user to retrieve

public User[]findUsers()

Return the set of {@link User}s defined in this user database.

public voidopen()

Initiate access to the underlying persistence layer.

exception
Exception if a database access error occurs

public voidremoveUser(User user)
Remove the specified {@link User} from this database.

param
user User to be removed
exception
IllegalArgumentException if the specified user is not associated with this database

public voidsave()

Save any pending changes to the underlying persistence layer.

exception
Exception if a database access error occurs