Interface IUserAccessor

    • Method Detail

      • loadUser

        User loadUser​(java.lang.String username)
               throws java.io.IOException
        Deserialize a user from lower storage.
        Parameters:
        username - The name of the user to be deserialized.
        Returns:
        The user object or null if no such user.
        Throws:
        java.io.IOException - if an exception is raised when interacting with the lower storage.
      • saveUser

        void saveUser​(User user)
               throws java.io.IOException
        Serialize the user object to lower storage.
        Parameters:
        user - The user object that is to be saved.
        Throws:
        java.io.IOException - if an exception is raised when interacting with the lower storage.
      • deleteUser

        boolean deleteUser​(java.lang.String username)
                    throws java.io.IOException
        Delete a user's from lower storage.
        Parameters:
        username - The name of the user to be deleted.
        Returns:
        True if the user is successfully deleted, false if the user does not exists.
        Throws:
        java.io.IOException - if an exception is raised when interacting with the lower storage.
      • listAllUsers

        java.util.List<java.lang.String> listAllUsers()
        List all users existing in the database.
        Returns:
        A list that contains names of all users.
      • reset

        void reset()
        Re-initialize this object.
      • getDirPath

        java.lang.String getDirPath()
        get UserDirPath
        Returns:
        userDirPath