Class ContextUserAuthManager


  • public class ContextUserAuthManager
    extends java.lang.Object
    The Manager that handles all the information related to Users, Roles and authentications corresponding to a particular Context.
    • Constructor Detail

      • ContextUserAuthManager

        public ContextUserAuthManager​(int contextId)
    • Method Detail

      • getUsersModel

        public UsersTableModel getUsersModel()
        Builds a table model for the users.
        Returns:
        the model
      • getContextId

        public int getContextId()
        Gets the context id to which this object corresponds.
        Returns:
        the context id
      • getUsers

        public java.util.List<User> getUsers()
        Gets an unmodifiable view of the list of users.
        Returns:
        the users
      • setUsers

        public void setUsers​(java.util.List<User> users)
        Sets a new list of users for this context. An internal copy of the provided list is stored.
        Parameters:
        users - the users
        Throws:
        java.lang.IllegalArgumentException - (since 2.8.0) if any of the given users is null.
      • addUser

        public void addUser​(User user)
        Adds an user.
        Parameters:
        user - the user
        Throws:
        java.lang.IllegalArgumentException - (since 2.8.0) if the given user is null.
      • removeUser

        public void removeUser​(User user)
        Removes an user.
        Parameters:
        user - the user
        Throws:
        java.lang.IllegalArgumentException - (since 2.8.0) if the given user is null.
      • getUserById

        public User getUserById​(int id)
        Gets the user with a given id.
        Parameters:
        id - the id
        Returns:
        the user by id
      • removeUserById

        public boolean removeUserById​(int id)
        Removes the user with a given id.
        Parameters:
        id - the id
        Returns:
        true, if successful
      • removeAllUsers

        public void removeAllUsers()
        Removes all the users.