Package org.apache.catalina
Interface UserDatabase
- 
- All Known Implementing Classes:
- DataSourceUserDatabase,- MemoryUserDatabase,- SparseUserDatabase
 
 public interface UserDatabaseAbstract representation of a database ofUsers andGroups that can be maintained by an application, along with definitions of correspondingRoles, and referenced by aRealmfor authentication and access control.- Since:
- 4.1
- Author:
- Craig R. McClanahan
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidbackgroundProcess()Perform any background processing (e.g. checking for changes in persisted storage) required for the user database.voidclose()Finalize access to this user database.GroupcreateGroup(java.lang.String groupname, java.lang.String description)Create and return a newGroupdefined in this user database.RolecreateRole(java.lang.String rolename, java.lang.String description)Create and return a newRoledefined in this user database.UsercreateUser(java.lang.String username, java.lang.String password, java.lang.String fullName)Create and return a newUserdefined in this user database.GroupfindGroup(java.lang.String groupname)RolefindRole(java.lang.String rolename)UserfindUser(java.lang.String username)java.util.Iterator<Group>getGroups()java.lang.StringgetId()java.util.Iterator<Role>getRoles()java.util.Iterator<User>getUsers()default booleanisAvailable()Is the database available.default booleanisSparse()Is the database data loaded on demand.default voidmodifiedGroup(Group group)Signal the specifiedGroupfrom this user database has been modified.default voidmodifiedRole(Role role)Signal the specifiedRolefrom this user database has been modified.default voidmodifiedUser(User user)Signal the specifiedUserfrom this user database has been modified.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 Detail- 
getGroupsjava.util.Iterator<Group> getGroups() - Returns:
- the set of Groups defined in this user database.
 
 - 
getIdjava.lang.String getId() - Returns:
- the unique global identifier of this user database.
 
 - 
getRolesjava.util.Iterator<Role> getRoles() - Returns:
- the set of Roles defined in this user database.
 
 - 
getUsersjava.util.Iterator<User> getUsers() - Returns:
- the set of Users defined in this user database.
 
 - 
closevoid close() throws java.lang.ExceptionFinalize access to this user database.- Throws:
- java.lang.Exception- if any exception is thrown during closing
 
 - 
createGroupGroup createGroup(java.lang.String groupname, java.lang.String description) 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
 
 - 
createRoleRole createRole(java.lang.String rolename, java.lang.String description) 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
 
 - 
createUserUser createUser(java.lang.String username, java.lang.String password, java.lang.String fullName) 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 user
- fullName- The full name of the new user
- Returns:
- The new user
 
 - 
findGroupGroup findGroup(java.lang.String groupname) - Parameters:
- groupname- Name of the group to return
- Returns:
- the Groupwith the specified group name, if any; otherwise returnnull.
 
 - 
findRoleRole findRole(java.lang.String rolename) - Parameters:
- rolename- Name of the role to return
- Returns:
- the Rolewith the specified role name, if any; otherwise returnnull.
 
 - 
findUserUser findUser(java.lang.String username) - Parameters:
- username- Name of the user to return
- Returns:
- the Userwith the specified user name, if any; otherwise returnnull.
 
 - 
openvoid open() throws java.lang.Exception Initialize access to this user database.- Throws:
- java.lang.Exception- if any exception is thrown during opening
 
 - 
removeGroupvoid removeGroup(Group group) Remove the specifiedGroupfrom this user database.- Parameters:
- group- The group to be removed
 
 - 
removeRolevoid removeRole(Role role) Remove the specifiedRolefrom this user database.- Parameters:
- role- The role to be removed
 
 - 
removeUservoid removeUser(User user) Remove the specifiedUserfrom this user database.- Parameters:
- user- The user to be removed
 
 - 
modifiedGroupdefault void modifiedGroup(Group group) Signal the specifiedGroupfrom this user database has been modified.- Parameters:
- group- The group that has been modified
 
 - 
modifiedRoledefault void modifiedRole(Role role) Signal the specifiedRolefrom this user database has been modified.- Parameters:
- role- The role that has been modified
 
 - 
modifiedUserdefault void modifiedUser(User user) Signal the specifiedUserfrom this user database has been modified.- Parameters:
- user- The user that has been modified
 
 - 
savevoid save() throws java.lang.Exception Save any updated information to the persistent storage location for this user database.- Throws:
- java.lang.Exception- if any exception is thrown during saving
 
 - 
backgroundProcessdefault void backgroundProcess() Perform any background processing (e.g. checking for changes in persisted storage) required for the user database.
 - 
isAvailabledefault boolean isAvailable() Is the database available.- Returns:
- true
 
 - 
isSparsedefault boolean isSparse() Is the database data loaded on demand. This is used to avoid eager loading of the full database data, for example for JMX registration of all objects.- Returns:
- false
 
 
- 
 
-