Interface UserManager

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractSsoUserManager, ActiveDirectoryUserManager, CompositeUserManager, DBUserManager, LDAPUserManager, OidcUserManager, OracleUserManager, Saml2UserManager

public interface UserManager extends Serializable
This interface must be implemented by subclasses to manage users and groups in JMap.
  • Field Details

  • 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

      boolean addUser(User user) throws SecurityException
      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

      boolean addGroup(Group group) throws SecurityException
      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

      boolean deleteUser(String username) throws SecurityException
      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

      boolean deleteGroup(String name) throws SecurityException
      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

      boolean updateUser(User user) throws SecurityException
      Sets new information for a user.
      Parameters:
      user - the new information to set.
      Throws:
      SecurityException
    • getUser

      User getUser(String username) throws SecurityException
      Returns the user that corresponds to the specified username.
      Parameters:
      username - the username to search.
      Returns:
      the corresponding User instance.
      Throws:
      SecurityException
    • getGroup

      Group getGroup(String name) throws SecurityException
      Returns the group that corresponds to the specified group name.
      Parameters:
      name - the name to search.
      Returns:
      the corresponding Group instance.
      Throws:
      SecurityException
    • users

      User[] users() throws SecurityException
      Returns all users managed by the user manager.
      Returns:
      an User array containing all the users.
      Throws:
      SecurityException
    • groups

      Group[] groups() throws SecurityException
      Returns all groups managed by the user manager.
      Returns:
      an Group array containing all the groups
      Throws:
      SecurityException
    • authenticate

      Principal authenticate(String username, String password) throws SecurityException
      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

      boolean addMemberToGroup(Group group, User user) throws SecurityException
      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

      boolean removeMemberFromGroup(Group group, User user) throws SecurityException
      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

      boolean init() throws SecurityException
      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

      void addListener(UserManagerListener listener)
      Adds a listener for user or group changes.
      Parameters:
      listener - the listener object
    • removeListener

      void removeListener(UserManagerListener listener)
      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

      boolean load(Properties properties) throws SecurityException
      Throws:
      SecurityException
    • save

      Properties save()
    • validate

      void validate() throws SecurityException
      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

      default void setFriendlyName(String friendlyName)
      Sets a friendly name for this user manager.
      Parameters:
      friendlyName - a friendly name
      Since:
      7.0 Funafuti
    • getFriendlyName

      default String 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

      default List<Principal> search(String expression)
      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