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.
Modifier and Type | Method and Description |
---|---|
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. |
boolean |
isOpen()
Return true if open() has been called.
|
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.
|
User createUser(String username)
Create and return a new User
defined in this user database.
username
- Username of the new userIllegalArgumentException
- if the specified username
is not uniquevoid close() throws Exception
Finalize access to the underlying persistence layer.
Exception
- if a database access error occursUser findUser(String username) throws ExpiredPasswordException
Return the existing User
with the specified username,
if any; otherwise return null
.
username
- Username of the user to retrieveExpiredPasswordException
- if user password has expired
and must be changedboolean isOpen()
Return true if open() has been called.
Exception
- if a database access error occursvoid open() throws Exception
Initiate access to the underlying persistence layer.
Exception
- if a database access error occursvoid removeUser(User user)
User
from this database.user
- User to be removedIllegalArgumentException
- if the specified user is not
associated with this databaseCopyright © 2000–2016 Apache Software Foundation. All rights reserved.