Interface UserStorage


public interface UserStorage
FIRSTspirit User management.
Since:
4.0
  • Method Details

    • createUser

      User createUser(String loginName, String password) throws DuplicateUserException
      Create a new user.
      Parameters:
      loginName - the login name
      password - the password
      Returns:
      the created user
      Throws:
      DuplicateUserException - if the user already exists with the given loginName
      SecurityException - if the user isn't the server admin
      Since:
      4.0
    • getUsers

      List<User> getUsers()
      Returns an unmodifiable lazy list of all User objects. Use with care: methods like contains() or toString() will request all users!
      Returns:
      lazy users list
      Since:
      4.0
    • getUsers

      List<User> getUsers(UserStorage.Order orderBy, boolean ascending)
      Returns an unmodifiable list of all users.
      Returns:
      the users
      Since:
      4.0
    • getDeactivatedUsers

      List<User> getDeactivatedUsers()
      Returns an unmodifiable lazy list of all deactivated users. Use with care: methods like contains() or toString() will request all users!
      Returns:
      lazy users list
      Since:
      4.0.90
    • getDeactivatedUsers

      List<User> getDeactivatedUsers(UserStorage.Order orderBy, boolean ascending)
      Returns an unmodifiable list of all deactivated users.
      Returns:
      the users
      Since:
      4.0.90
    • findUsers

      List<User> findUsers(String pattern)
      Returns an unmodifiable list of users, which matches the given pattern.
      Parameters:
      pattern - pattern to search in user's name. Search is done by substring comparison (no wildcards allowed)
      Returns:
      found users
      Since:
      4.0
    • findUsers

      List<User> findUsers(String pattern, UserStorage.Order orderBy, boolean ascending)
      Returns an unmodifiable list of users, which matches the given pattern.
      Parameters:
      pattern - pattern to search in user's name.
      ascending -
      Returns:
      found users
      Since:
      4.0
    • setUser

      void setUser(User user)
      Write back a user to server.
      Parameters:
      user - the user to write
      Throws:
      SecurityException - if the user isn't the server admin
      Since:
      4.0
    • removeUser

      boolean removeUser(User user)
      Returns true if the given user could be deleted. Otherwise the user is either already deleted or currently logged in.
      Parameters:
      user - the user to delete
      Returns:
      true if the user could be deleted, false otherwise.
      Throws:
      SecurityException - if the user isn't the server admin
      Since:
      4.0
    • getUserByID

      @Nullable @Nullable User getUserByID(long id)
      Gets the user with the specified ID
      Parameters:
      id - to specifiy the user
      Returns:
      user with the specified ID or null if no user exists
      Since:
      4.0
    • getUsersByID

      @NotNull @NotNull List<User> getUsersByID(Long[] ids)
      Returns users with the given ids. Not existing user-ids will be ignored.
      Parameters:
      ids - user-ids.
      Returns:
      users with the given ids.
      Since:
      4.0
    • getUserByLogin

      @Nullable @Nullable User getUserByLogin(String login)
      Gets the user with the specified login name.
      Parameters:
      login - to specifiy the user
      Returns:
      user with the specified login name or null if no user exists
      Since:
      4.0
    • refreshUsers

      void refreshUsers()
      Refreshs the internal user cache.
      Since:
      4.0