Interface UserDatabase
- All Known Implementing Classes:
DataSourceUserDatabase,MemoryUserDatabase,SparseUserDatabase
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 TypeMethodDescriptiondefault voidPerform any background processing (e.g. checking for changes in persisted storage) required for the user database.voidclose()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()default booleanIs 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 Details
-
getGroups
-
getId
String getId()- Returns:
- the unique global identifier of this user database.
-
getRoles
-
getUsers
-
close
-
createGroup
-
createRole
-
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
-
findRole
-
findUser
-
open
-
removeGroup
-
removeRole
-
removeUser
-
modifiedGroup
-
modifiedRole
-
modifiedUser
-
save
-
backgroundProcess
default void backgroundProcess()Perform any background processing (e.g. checking for changes in persisted storage) required for the user database. -
isAvailable
default boolean isAvailable()Is the database available.- Returns:
- true
-
isSparse
default 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
-