Class PasswordResetTokenManager


  • public class PasswordResetTokenManager
    extends java.lang.Object
    • Method Detail

      • generateToken

        public java.lang.String generateToken​(org.jivesoftware.openfire.user.User user,
                                              java.lang.String sourceAddress)
                                       throws java.sql.SQLException
        Generates a random token for the user, and persists in the database.
        Parameters:
        user - The user to create the token for
        sourceAddress - The address from which the request was made
        Returns:
        the random token
        Throws:
        java.sql.SQLException - if anything untoward happens
      • getUser

        public java.util.Optional<org.jivesoftware.openfire.user.User> getUser​(java.lang.String token)
                                                                        throws java.sql.SQLException
        Finds the user for the specified token.
        Parameters:
        token - the token to perform the search on
        Returns:
        the user, if any
        Throws:
        java.sql.SQLException - if something untoward happens
      • deleteTokens

        public void deleteTokens​(org.jivesoftware.openfire.user.User user)
                          throws java.sql.SQLException
        Deletes all existing tokens for a user.
        Parameters:
        user - the user whose tokens should be deleted.
        Throws:
        java.sql.SQLException - if something untoward happens
      • getResetRequests

        public java.util.List<PasswordResetTokenManager.ResetRequest> getResetRequests()
        Returns the current list of reset requests - excluding the all important token.
        Returns:
        the list of reset requests.