Package org.apache.catalina
Interface UserDatabase
- All Known Implementing Classes:
MemoryUserDatabase
public interface UserDatabase
Abstract representation of a database of
Users and Groups
that can be maintained by an application, along with definitions of
corresponding Roles, and referenced by a Realm for
authentication and access control.- Since:
- 4.1
- Author:
- Craig R. McClanahan
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Finalize access to this user database.createGroup(String groupname, String description) Create and return a newGroupdefined in this user database.createRole(String rolename, String description) Create and return a newRoledefined in this user database.createUser(String username, String password, String fullName) Create and return a newUserdefined in this user database.getId()getRoles()getUsers()voidopen()Initialize access to this user database.voidremoveGroup(Group group) Remove the specifiedGroupfrom this user database.voidremoveRole(Role role) Remove the specifiedRolefrom this user database.voidremoveUser(User user) Remove the specifiedUserfrom this user database.voidsave()Save any updated information to the persistent storage location for this user database.
-
Method Details
-
getGroups
- Returns:
- the set of
Groups defined in this user database.
-
getId
String getId()- Returns:
- the unique global identifier of this user database.
-
getRoles
- Returns:
- the set of
Roles defined in this user database.
-
getUsers
- Returns:
- the set of
Users defined in this user database.
-
close
Finalize access to this user database.- Throws:
Exception- if any exception is thrown during closing
-
createGroup
Create and return a newGroupdefined in this user database.- Parameters:
groupname- The group name of the new group (must be unique)description- The description of this group- Returns:
- The new group
-
createRole
Create and return a newRoledefined in this user database.- Parameters:
rolename- The role name of the new role (must be unique)description- The description of this role- Returns:
- The new role
-
createUser
Create and return a newUserdefined in this user database.- Parameters:
username- The logon username of the new user (must be unique)password- The logon password of the new userfullName- The full name of the new user- Returns:
- The new user
-
findGroup
- Parameters:
groupname- Name of the group to return- Returns:
- the
Groupwith the specified group name, if any; otherwise returnnull.
-
findRole
- Parameters:
rolename- Name of the role to return- Returns:
- the
Rolewith the specified role name, if any; otherwise returnnull.
-
findUser
- Parameters:
username- Name of the user to return- Returns:
- the
Userwith the specified user name, if any; otherwise returnnull.
-
open
Initialize access to this user database.- Throws:
Exception- if any exception is thrown during opening
-
removeGroup
Remove the specifiedGroupfrom this user database.- Parameters:
group- The group to be removed
-
removeRole
Remove the specifiedRolefrom this user database.- Parameters:
role- The role to be removed
-
removeUser
Remove the specifiedUserfrom this user database.- Parameters:
user- The user to be removed
-
save
Save any updated information to the persistent storage location for this user database.- Throws:
Exception- if any exception is thrown during saving
-