MemoryUserDatabase (Struts Apps - Faces Example 1 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.example.memory
Class MemoryUserDatabase

    java.lang.Object
      org.apache.struts.webapp.example.memory.MemoryUserDatabase

All Implemented Interfaces:
  UserDatabase

    public final 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) $
Author:
  Craig R. McClanahan

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

Constructor Detail

### MemoryUserDatabase

    public MemoryUserDatabase()

Method Detail

### getPathname

    public String getPathname()

### setPathname

    public void setPathname(String pathname)

### close

    public void close()
               throws Exception

  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)

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

  Specified by:
    `createUser` in interface `UserDatabase`
  Parameters:
    `username` - Username of the new user
  Throws:
    `IllegalArgumentExceptionif` - the specified username is not unique

### findUser

    public User findUser(String username)

  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()

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

  Specified by:
    `findUsers` in interface `UserDatabase`

### open

    public void open()
              throws Exception

  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)

  Remove the specified `User` from this database.

  Specified by:
    `removeUser` in interface `UserDatabase`
  Parameters:
    `user` - User to be removed
  Throws:
    `IllegalArgumentException` - if the specified user is not associated with this database

### save

    public void save()
              throws Exception

  Save any pending changes to the underlying persistence layer.

  Specified by:
    `save` in interface `UserDatabase`
  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.