org.davesag.generica.controller
Interface PasswordHelperController

All Superinterfaces:
ActionController, Controller

public interface PasswordHelperController
extends ActionController

An implementation of the PasswordHelperController interface must be able to tell if the user provided exists, if an answer to the password helper question was provided, if that answer is correct and it must also be able to reset the user's password.

Since:
Generica 1.0
Version:
CVS Revision $Id: PasswordHelperController.java,v 1.2 2004/03/30 10:12:56 norm Exp $
Author:
Dave Sag http://www.davesag.com

Method Summary
 User getValidUser()
          Checks if the username in the form provided is a valid username.
 boolean isAnswerCorrect(User user)
          Checks the user's answer against the answer in the form.
 boolean isAnswerSupplied()
          Checks the form to see if an answer was supplied.
 void resetPassword(User user)
          Resets the user's password and does whatever else you need it to do.
 
Methods inherited from interface org.davesag.generica.controller.ActionController
setAction
 
Methods inherited from interface org.davesag.generica.controller.Controller
setForm, setRequest, setResponse
 

Method Detail

isAnswerSupplied

public boolean isAnswerSupplied()
                         throws Exception
Checks the form to see if an answer was supplied.

Returns:
true if there is an answer in the form.
Throws:
Exception - if anything went wrong.

getValidUser

public User getValidUser()
                  throws Exception
Checks if the username in the form provided is a valid username.

Returns:
the User object if the username from the form provided is valid, null if not.
Throws:
Exception - if anything went wrong.

isAnswerCorrect

public boolean isAnswerCorrect(User user)
                        throws Exception
Checks the user's answer against the answer in the form.

Parameters:
user - The user to check against.
Returns:
true if the answer matched the user's answer.
Throws:
Exception - if anything went wrong.

resetPassword

public void resetPassword(User user)
                   throws Exception
Resets the user's password and does whatever else you need it to do. Usually an implementation of this method will also invaidate the new password thus telling the user interface that the user must manually reenter a new password after their first login with the new password.

Parameters:
user - The user whose password must be reset.
Throws:
Exception - if anything went wrong.


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.