AllPasswordRecoveries

public class AllPasswordRecoveries

Implementation of DAO interface that utilizes a MDS back-end for storage. Class responsible for handling PasswordRecoveries.

Methods

add

public void add(PasswordRecovery passwordRecovery)

Adds given PasswordRecovery provided tha one doesn’t exist yet for the user

Parameters:
  • passwordRecovery – to be added

allRecoveries

public List<PasswordRecovery> allRecoveries()

Returns all PasswordRecoveries

Returns:list that contains recoveries

createRecovery

public PasswordRecovery createRecovery(String username, String email, String token, DateTime expirationDate, Locale locale)

Creates PasswordRecovery for given informations and return it

Parameters:
  • username – for recovery
  • email – for recovery
  • token – for recovery
  • expirationDate – for recovery
  • locale – for recovery
Returns:

recovery with given informations

findForToken

public PasswordRecovery findForToken(String token)

Gets PasswordRecovery for given token

Parameters:
  • token – for recovery
Returns:

recovery for given token or null in case when token is a null

findForUser

public PasswordRecovery findForUser(String username)

Gets PasswordRecovery for user with given name

Parameters:
  • username – name of user
Returns:

recovery for given name or null in case when username is a null

getExpired

public List<PasswordRecovery> getExpired()

Returns all expired PasswordRecoveries

Returns:list that contains recoveries

remove

public void remove(PasswordRecovery passwordRecovery)

Deletes given PasswordRecovery

Parameters:
  • passwordRecovery – to be removed

setDataService

public void setDataService(PasswordRecoveriesDataService dataService)

update

public void update(PasswordRecovery passwordRecovery)

Updates given PasswordRecovery

Parameters:
  • passwordRecovery – to be updated