public interface UserManager
extends java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
USERMANAGER_CONF_HOME |
static java.lang.String |
USERMANAGER_PROPS_FILENAME |
static java.lang.String |
USERMANAGER_PROPS_NAME |
static java.lang.String |
USERNAME_ADMINISTRATOR |
static java.lang.String |
USERNAME_ANONYMOUS |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addGroup(Group group)
Adds a group to the user manager.
|
void |
addListener(UserManagerListener listener)
Adds a listener for user or group changes.
|
boolean |
addMemberToGroup(Group group,
User user)
Adds a user to a group.
|
boolean |
addUser(User user)
Adds a user to the user manager.
|
java.security.Principal |
authenticate(java.lang.String username,
java.lang.String password)
Authenticates a user with the specified username and password.
|
boolean |
deleteGroup(java.lang.String name)
Deletes a group from the user manager.
|
boolean |
deleteUser(java.lang.String username)
Deletes a user from the user manager.
|
void |
destroy()
Closes this UserManager and resets all registered ACL's.
|
default java.lang.String |
getFriendlyName()
Returns the friendly name for this user manager.
|
Group |
getGroup(java.lang.String name)
Returns the group that corresponds to the specified group name.
|
java.lang.String |
getName()
Returns the name of the current UserManager.
|
User |
getUser(java.lang.String username)
Returns the user that corresponds to the specified username.
|
java.lang.String |
getVersion()
Returns the version of the current UserManager.
|
Group[] |
groups()
Returns all groups managed by the user manager.
|
boolean |
init()
This method will be used by the implementor to
do the necessary initialization
|
boolean |
isReadOnly()
Returns whether this user manager is read only.
|
boolean |
load(java.util.Properties properties) |
void |
removeListener(UserManagerListener listener)
Removes a listener for user or group changes.
|
boolean |
removeMemberFromGroup(Group group,
User user)
Removes a user from a group.
|
java.util.Properties |
save() |
default java.util.List<java.security.Principal> |
search(java.lang.String expression)
Search principals (users / groups) that matches the specified string.
|
default void |
setFriendlyName(java.lang.String friendlyName)
Sets a friendly name for this user manager.
|
default boolean |
supportsChangePassword()
Returns whether this user manager supports if users can change their password.
|
boolean |
supportsGroups()
Returns whether this user manager supports groups.
|
boolean |
updateUser(User user)
Sets new information for a user.
|
User[] |
users()
Returns all users managed by the user manager.
|
void |
validate() |
static final java.lang.String USERNAME_ADMINISTRATOR
static final java.lang.String USERNAME_ANONYMOUS
static final java.lang.String USERMANAGER_CONF_HOME
static final java.lang.String USERMANAGER_PROPS_NAME
static final java.lang.String USERMANAGER_PROPS_FILENAME
java.lang.String getName()
java.lang.String getVersion()
boolean addUser(User user) throws SecurityException
user - the corresponding user to be added.SecurityExceptionboolean addGroup(Group group) throws SecurityException
group - the corresponding group to be added.SecurityExceptionboolean deleteUser(java.lang.String username)
throws SecurityException
username - the corresponding user to be deletedSecurityExceptionboolean deleteGroup(java.lang.String name)
throws SecurityException
name - the corresponding group to be added.SecurityExceptionboolean updateUser(User user) throws SecurityException
user - the new information to set.SecurityExceptionUser getUser(java.lang.String username) throws SecurityException
username - the username to search.SecurityExceptionGroup getGroup(java.lang.String name) throws SecurityException
name - the name to search.SecurityExceptionUser[] users() throws SecurityException
SecurityExceptionGroup[] groups() throws SecurityException
SecurityExceptionjava.security.Principal authenticate(java.lang.String username,
java.lang.String password)
throws SecurityException
username - the username to use.password - the password to use.SecurityExceptionboolean addMemberToGroup(Group group, User user) throws SecurityException
group - the corresponding group where the user should be added.user - to be added to the group.SecurityExceptionboolean removeMemberFromGroup(Group group, User user) throws SecurityException
group - the corresponding group where the user should be removed.user - to be removed to the group.SecurityExceptionboolean init()
throws SecurityException
SecurityExceptionboolean isReadOnly()
boolean supportsGroups()
void addListener(UserManagerListener listener)
listener - the listener objectvoid removeListener(UserManagerListener listener)
listener - the listener objectvoid destroy()
boolean load(java.util.Properties properties)
throws SecurityException
SecurityExceptionjava.util.Properties save()
void validate()
throws SecurityException
SecurityExceptiondefault boolean supportsChangePassword()
default void setFriendlyName(java.lang.String friendlyName)
friendlyName - a friendly namedefault java.lang.String getFriendlyName()
default java.util.List<java.security.Principal> search(java.lang.String expression)
expression - the string to match