org.davesag.generica.core
Class PasswordHelper

java.lang.Object
  extended byorg.davesag.generica.core.PasswordHelper
All Implemented Interfaces:
Serializable

public class PasswordHelper
extends Object
implements Serializable

This PasswordHelper bean represents the information we get from the user at registration that can help them identify themselves if they have lost their password.

Since:
Generica 1.0
Version:
CVS Revision $Id: PasswordHelper.java,v 1.8 2004/04/06 15:40:40 davesag Exp $
Author:
Dave Sag http://www.davesag.com
See Also:
Serialized Form

Field Summary
protected  String theAnswer
          the answer that must match
protected  String theQuestion
          the question to ask
 
Constructor Summary
PasswordHelper()
          null constructor required by hibernate.
PasswordHelper(String q, String a)
          convenience constructor used in testing that takes a question and answer.
 
Method Summary
 String getAnswer()
          get the encrypted answer.
 String getClearTextAnswer()
          get the clear text version of the answer.
 String getQuestion()
          get the question.
 boolean isAnswer(String cta)
          Checks the answer provided with the encrypted answer we have stored.
protected  void setAnswer(String a)
          Set the encrypted answer.
 void setClearTextAnswer(String cta)
          Set the clear text answer.
 void setQuestion(String q)
          Set the question.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theQuestion

protected String theQuestion
the question to ask


theAnswer

protected String theAnswer
the answer that must match

Constructor Detail

PasswordHelper

public PasswordHelper()
null constructor required by hibernate.


PasswordHelper

public PasswordHelper(String q,
                      String a)
convenience constructor used in testing that takes a question and answer.

Parameters:
q - The Question.
a - The Answer.
Method Detail

getQuestion

public String getQuestion()
get the question.

Returns:
The question.
Hibernate Property:
length = "100"

setQuestion

public void setQuestion(String q)
Set the question.

Parameters:
q - The question.

getAnswer

public String getAnswer()
get the encrypted answer.

Returns:
The encrypted answer.
Hibernate Property:
length = "32"

setAnswer

protected void setAnswer(String a)
Set the encrypted answer.

Parameters:
a - The answer to the question.

setClearTextAnswer

public void setClearTextAnswer(String cta)
Set the clear text answer. This answer will be hashed for storage.

Parameters:
cta - The answer to the question in clear text.

getClearTextAnswer

public String getClearTextAnswer()
get the clear text version of the answer. This will always be an empty string.

Returns:
An empty string. Only here for completeness and to satisfy Struts.

isAnswer

public boolean isAnswer(String cta)
Checks the answer provided with the encrypted answer we have stored.

Parameters:
cta - The answer to the question in clear text.
Returns:
True if the answer matched.


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