UserDatabase (Struts Apps - Faces Example 2 1.3.10 API)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts.webapp.example2
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: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $
Author:
  Craig R. McClanahan

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 `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

    User createUser(String username)

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

  Parameters:
    `username` - Username of the new user
  Throws:
    `IllegalArgumentExceptionif` - the specified username is not unique

### close

    void close()
               throws Exception

  Finalize access to the underlying persistence layer.

  Throws:
    `Exception` - if a database access error occurs

### findUser

    User findUser(String username)

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

  Parameters:
    `username` - Username of the user to retrieve

### findUsers

    User[] findUsers()

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

### open

    void open()
              throws Exception

  Initiate access to the underlying persistence layer.

  Throws:
    `Exception` - if a database access error occurs

### removeUser

    void removeUser(User user)

  Remove the specified `User` from this database.

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

### save

    void save()
              throws Exception

  Save any pending changes to the underlying persistence layer.

  Throws:
    `Exception` - if a database access error occurs

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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