Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts.examples.mailreader
Interface UserDatabase

All Known Implementing Classes:
  MemoryUserDatabase

public interface UserDatabase

A Data Access Object (DAO) interface describing the available operations for retrieving and storing `User`s (and their associated `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.

Since:
  Struts 1.1
Version:
  $Rev: 54929 $ $Date: 2004-10-16 09:38:42 -0700 (Sat, 16 Oct 2004) $

Method Summary
`void` | `close()` Finalize access to the underlying persistence layer.
`User` | `createUser(java.lang.String username)` Create and return a new `User` defined in this user database.
`User` | `findUser(java.lang.String username)` Return the existing `User` with the specified username, if any; otherwise return `null`.
`User[]` | `findUsers()` Return the set of `User`s defined in this user database.
`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.

Method Detail

### createUser

    public User createUser(java.lang.String username)

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

  Parameters:
    `username` - Username of the new user
  Throws:
    `java.lang.IllegalArgumentException` - if the specified username is not unique

### close

    public void close()
               throws java.lang.Exception

  Finalize access to the underlying persistence layer.

  Throws:
    `java.lang.Exception` - if a database access error occurs

### findUser

    public User findUser(java.lang.String username)
                  throws ExpiredPasswordException

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

  Parameters:
    `username` - Username of the user to retrieve
  Throws:
    `ExpiredPasswordException` - if user password has expired and must be changed

### findUsers

    public User[] findUsers()

  Return the set of `User`s defined in this user database.

### open

    public void open()
              throws java.lang.Exception

  Initiate access to the underlying persistence layer.

  Throws:
    `java.lang.Exception` - if a database access error occurs

### removeUser

    public void removeUser(User user)

  Remove the specified `User` from this database.
  Parameters:
    `user` - User to be removed
  Throws:
    `java.lang.IllegalArgumentException` - if the specified user is not associated with this database

### save

    public void save()
              throws java.lang.Exception

  Save any pending changes to the underlying persistence layer.

  Throws:
    `java.lang.Exception` - if a database access error occurs

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2004 - The Apache Software Foundation