FileDocCategorySizeDatePackage
UserDatabase.javaAPI DocApache Tomcat 6.0.144925Fri Jul 20 04:20:36 BST 2007org.apache.catalina

UserDatabase

public interface UserDatabase

Abstract representation of a database of {@link User}s and {@link Group}s that can be maintained by an application, along with definitions of corresponding {@link Role}s, and referenced by a {@link Realm} for authentication and access control.

author
Craig R. McClanahan
version
$Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
since
4.1

Fields Summary
Constructors Summary
Methods Summary
public voidclose()
Finalize access to this user database.

exception
Exception if any exception is thrown during closing

public GroupcreateGroup(java.lang.String groupname, java.lang.String description)
Create and return a new {@link Group} defined in this user database.

param
groupname The group name of the new group (must be unique)
param
description The description of this group

public RolecreateRole(java.lang.String rolename, java.lang.String description)
Create and return a new {@link Role} defined in this user database.

param
rolename The role name of the new role (must be unique)
param
description The description of this role

public UsercreateUser(java.lang.String username, java.lang.String password, java.lang.String fullName)
Create and return a new {@link User} defined in this user database.

param
username The logon username of the new user (must be unique)
param
password The logon password of the new user
param
fullName The full name of the new user

public GroupfindGroup(java.lang.String groupname)
Return the {@link Group} with the specified group name, if any; otherwise return null.

param
groupname Name of the group to return

public RolefindRole(java.lang.String rolename)
Return the {@link Role} with the specified role name, if any; otherwise return null.

param
rolename Name of the role to return

public UserfindUser(java.lang.String username)
Return the {@link User} with the specified user name, if any; otherwise return null.

param
username Name of the user to return

public java.util.IteratorgetGroups()
Return the set of {@link Group}s defined in this user database.

public java.lang.StringgetId()
Return the unique global identifier of this user database.

public java.util.IteratorgetRoles()
Return the set of {@link Role}s defined in this user database.

public java.util.IteratorgetUsers()
Return the set of {@link User}s defined in this user database.

public voidopen()
Initialize access to this user database.

exception
Exception if any exception is thrown during opening

public voidremoveGroup(Group group)
Remove the specified {@link Group} from this user database.

param
group The group to be removed

public voidremoveRole(Role role)
Remove the specified {@link Role} from this user database.

param
role The role to be removed

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

param
user The user to be removed

public voidsave()
Save any updated information to the persistent storage location for this user database.

exception
Exception if any exception is thrown during saving