Package com.kheops.jmap.server.security
Interface UserManager
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractSsoUserManager
,ActiveDirectoryUserManager
,CompositeUserManager
,DBUserManager
,LDAPUserManager
,OidcUserManager
,OracleUserManager
,Saml2UserManager
This interface must be implemented by subclasses to manage users and groups in JMap.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
Adds a user to the user manager.authenticate
(String username, String password) Authenticates a user with the specified username and password.boolean
deleteGroup
(String name) Deletes a group from the user manager.boolean
deleteUser
(String username) Deletes a user from the user manager.void
destroy()
Closes this UserManager and resets all registered ACL's.default String
Returns the friendly name for this user manager.Returns the group that corresponds to the specified group name.getName()
Returns the name of the current UserManager.Returns the user that corresponds to the specified username.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 initializationboolean
Returns whether this user manager is read only.boolean
load
(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.save()
Search principals (users / groups) that matches the specified string.default void
setFriendlyName
(String friendlyName) Sets a friendly name for this user manager.default boolean
Returns whether this user manager supports if users can change their password.boolean
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()
-
Field Details
-
USERNAME_ADMINISTRATOR
- See Also:
-
USERNAME_ANONYMOUS
- See Also:
-
USERMANAGER_CONF_HOME
-
USERMANAGER_PROPS_NAME
- See Also:
-
USERMANAGER_PROPS_FILENAME
-
-
Method Details
-
getName
String getName()Returns the name of the current UserManager.- Returns:
- the name of the current UserManager.
-
getVersion
String getVersion()Returns the version of the current UserManager.- Returns:
- the version of the current UserManager.
-
addUser
Adds a user to the user manager.- Parameters:
user
- the corresponding user to be added.- Returns:
- true if the user was added successfully.
- Throws:
SecurityException
-
addGroup
Adds a group to the user manager.- Parameters:
group
- the corresponding group to be added.- Returns:
- true if the group was added successfully.
- Throws:
SecurityException
-
deleteUser
Deletes a user from the user manager.- Parameters:
username
- the corresponding user to be deleted- Returns:
- true if the user was deleted successfully.
- Throws:
SecurityException
-
deleteGroup
Deletes a group from the user manager.- Parameters:
name
- the corresponding group to be added.- Returns:
- true if the group was deleted successfully.
- Throws:
SecurityException
-
updateUser
Sets new information for a user.- Parameters:
user
- the new information to set.- Throws:
SecurityException
-
getUser
Returns the user that corresponds to the specified username.- Parameters:
username
- the username to search.- Returns:
- the corresponding User instance.
- Throws:
SecurityException
-
getGroup
Returns the group that corresponds to the specified group name.- Parameters:
name
- the name to search.- Returns:
- the corresponding Group instance.
- Throws:
SecurityException
-
users
Returns all users managed by the user manager.- Returns:
- an User array containing all the users.
- Throws:
SecurityException
-
groups
Returns all groups managed by the user manager.- Returns:
- an Group array containing all the groups
- Throws:
SecurityException
-
authenticate
Authenticates a user with the specified username and password.- Parameters:
username
- the username to use.password
- the password to use.- Returns:
- if the authentication was successful, the user that corresponds to the specified username is returned. Otherwise, null is returned.
- Throws:
SecurityException
-
addMemberToGroup
Adds a user to a group.- Parameters:
group
- the corresponding group where the user should be added.user
- to be added to the group.- Throws:
SecurityException
-
removeMemberFromGroup
Removes a user from a group.- Parameters:
group
- the corresponding group where the user should be removed.user
- to be removed to the group.- Throws:
SecurityException
-
init
This method will be used by the implementor to do the necessary initialization- Throws:
SecurityException
-
isReadOnly
boolean isReadOnly()Returns whether this user manager is read only.- Returns:
- true if read only, false otherwise
-
supportsGroups
boolean supportsGroups()Returns whether this user manager supports groups.- Returns:
- true if groups are supported, false otherwise
-
addListener
Adds a listener for user or group changes.- Parameters:
listener
- the listener object
-
removeListener
Removes a listener for user or group changes.- Parameters:
listener
- the listener object
-
destroy
void destroy()Closes this UserManager and resets all registered ACL's. -
load
- Throws:
SecurityException
-
save
Properties save() -
validate
- Throws:
SecurityException
-
supportsChangePassword
default boolean supportsChangePassword()Returns whether this user manager supports if users can change their password.- Returns:
- true if change password is supported, false otherwise
- Since:
- 7.0 Edinburgh
-
setFriendlyName
Sets a friendly name for this user manager.- Parameters:
friendlyName
- a friendly name- Since:
- 7.0 Funafuti
-
getFriendlyName
Returns the friendly name for this user manager. If none sets, it returns the name of this user manager.- Returns:
- friendly name
- Since:
- 7.0 Funafuti
-
search
Search principals (users / groups) that matches the specified string.- Parameters:
expression
- the string to match- Returns:
- a list of matching principal(s)
- Since:
- 7.0 Kathmandu HF9
-