org.starhope.appius.user
Interface AbstractPerson

All Known Implementing Classes:
Parent, User

public interface AbstractPerson

WRITEME: Document this type.

Author:
brpocock@star-hope.org

Method Summary
 boolean canContact()
          Can this person be contacted for marketing and other purposes?
 boolean checkPassword(String passwordGuess)
          Returns true if the password is correct.
 boolean forgotPassword(String forgottenPasswordQ, String forgottenPasswordA)
          Send the user their forgotten password if they know the answer to their secret question.
 String getApprovalCookie()
          Get a cookie object for sending mail.
 String getConfirmationTemplate()
          Get the filename of the eMail template file to be used to confirm this person's account
 String getDialect()
          Get this person's preferred language-dialect.
 String getDisplayName()
          Get the name to be displayed in user interface for this person.
 String getForgotPasswordAnswer()
          Get the forgotten password question
 String getForgotPasswordQuestion()
          Get the forgotten password question
 String getGivenName()
           
 HashMap<Timestamp,HashMap<String,String>> getHistory(Date after, int limit)
          Returns the historical contents of this user's record.
 String getLanguage()
           
 String getMail()
           
 Date getMailConfirmed()
           
 String getPassword()
           
 String getPotentialUserName()
           Get an user name suggestion for this person
 String getResponsibleMail()
          Get the eMail address of a responsible person: either the player, or the parent.
 void remindPassword()
          WRITEME: Document this method brpocock@star-hope.org
 void rename(String newName)
           Rename the user account, updating all necessary related records.
 void sendConfirmationMail()
          Sends confirmation mail to whomever should receive it
 void sendStaffPasswordReset()
          Sends mail to user or parent when a staff member resets their password.
 void sentConfirmationMail()
          WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)
 void setCanContact(boolean canContact1)
           
 void setForgotPasswordAnswer(String answer)
          WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)
 void setForgotPasswordQuestion(String question)
          WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)
 void setGivenName(String givenName1)
           
 void setMail(String mail1)
           
 void setMailConfirmed(Date mailConfirmed1)
           
 void setMailConfirmSent(Date date)
           
 void setPassword(String password1)
          Changes the person's password
 void setPasswordAndPasswordRecovery(String question, String answer, String newPassword)
           
 void setPasswordRecovery(String forgottenPasswordQuestion, String forgottenPasswordAnswer)
          Set the password-recovery question and answer pair
 String setRandomPassword()
          WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)
 

Method Detail

canContact

boolean canContact()
Can this person be contacted for marketing and other purposes?

Returns:
true, if this person permits communications of that sort

checkPassword

boolean checkPassword(String passwordGuess)
Returns true if the password is correct. Returns false if password is not set or the guess was blank.

Parameters:
passwordGuess - The password which is to be checked
Returns:
true, if the password is correct and not null

forgotPassword

boolean forgotPassword(String forgottenPasswordQ,
                       String forgottenPasswordA)
Send the user their forgotten password if they know the answer to their secret question. If remindPassword() throws a NotFoundException, this will fail and return false as well.

Parameters:
forgottenPasswordQ - The question being answered
forgottenPasswordA - The answer provided
Returns:
true if answer is correct (also calls remindPassword()); and false if it is not

getApprovalCookie

String getApprovalCookie()
Get a cookie object for sending mail. Cookies are generated differently between User and Parent.

Returns:
an opaque string that identifies the user uniquely
See Also:
Parent, User

getConfirmationTemplate

String getConfirmationTemplate()
Get the filename of the eMail template file to be used to confirm this person's account

Returns:
the template filename to be used for confirming this account

getDialect

String getDialect()
Get this person's preferred language-dialect.

Returns:
the dialect

getDisplayName

String getDisplayName()
Get the name to be displayed in user interface for this person. This should give the person's given name, but if that information is unavailable, fall back upon other unique identifier such as their avatar label

Returns:
the display name

getForgotPasswordAnswer

String getForgotPasswordAnswer()
Get the forgotten password question

Returns:
the question to ask

getForgotPasswordQuestion

String getForgotPasswordQuestion()
Get the forgotten password question

Returns:
the question to ask

getGivenName

String getGivenName()
Returns:
the givenName

getHistory

HashMap<Timestamp,HashMap<String,String>> getHistory(Date after,
                                                     int limit)
Returns the historical contents of this user's record.

Parameters:
after - If non-null, specifies the date after which we want to view records. To see all records, back to the creation of the user record, supply a null.
limit - If this is a positive number, it limits the results to this number of records.
Returns:
A map of timestamps to key/value pairs. All values are expressed as strings (even though they may have numeric, enumerative, or date / date-time types in the database), since this is primarily (only?) for human-viewable auditing.

getLanguage

String getLanguage()
Returns:
the language

getMail

String getMail()
Returns:
the mail

getMailConfirmed

Date getMailConfirmed()
Returns:
the mailConfirmed

getPassword

String getPassword()
Returns:
the user's cleartext password, if available. If the password storage mechanism does not permit cleartext retrieval, returns a null.

getPotentialUserName

String getPotentialUserName()

Get an user name suggestion for this person

XXX This belongs in User, only.

Returns:
a user name that could be used

getResponsibleMail

String getResponsibleMail()
Get the eMail address of a responsible person: either the player, or the parent. Currently, kids 13-17 return their own mail.

Returns:
the eMail address

remindPassword

void remindPassword()
                    throws NotReadyException
WRITEME: Document this method brpocock@star-hope.org

Throws:
NotReadyException - WRITEME

rename

void rename(String newName)
            throws GameLogicException,
                   AlreadyUsedException,
                   ForbiddenUserException

Rename the user account, updating all necessary related records. Note, in particular, that Smartfox is wholly dependant upon user names, so all records related to Smartfox must be updated!

If the user is currently online, this will fuck up hilariously, I think.

Parameters:
newName - The new user name
Throws:
GameLogicException - if the user is online (and therefore can't be renamed)
ForbiddenUserException - WRITEME
AlreadyUsedException - WRITEME

sendConfirmationMail

void sendConfirmationMail()
Sends confirmation mail to whomever should receive it


sendStaffPasswordReset

void sendStaffPasswordReset()
Sends mail to user or parent when a staff member resets their password.


sentConfirmationMail

void sentConfirmationMail()
WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)


setCanContact

void setCanContact(boolean canContact1)
Parameters:
canContact1 - if true, the user has explicitly given us their legal consent to be contacted for marketing and other options.

setForgotPasswordAnswer

void setForgotPasswordAnswer(String answer)
WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)

Parameters:
answer - WRITEME

setForgotPasswordQuestion

void setForgotPasswordQuestion(String question)
WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)

Parameters:
question - WRITEME

setGivenName

void setGivenName(String givenName1)
Parameters:
givenName1 - the givenName to set

setMail

void setMail(String mail1)
             throws GameLogicException
Parameters:
mail1 - the mail to set
Throws:
GameLogicException - WRITEME

setMailConfirmed

void setMailConfirmed(Date mailConfirmed1)
Parameters:
mailConfirmed1 - the mailConfirmed to set

setMailConfirmSent

void setMailConfirmSent(Date date)
Parameters:
date - the date on which the mail confirmation message was sent

setPassword

void setPassword(String password1)
Changes the person's password

Parameters:
password1 - the password to set

setPasswordAndPasswordRecovery

void setPasswordAndPasswordRecovery(String question,
                                    String answer,
                                    String newPassword)
                                    throws GameLogicException
Parameters:
question - WRITEME
answer - WRITEME
newPassword - WRITEME
Throws:
GameLogicException - WRITEME

setPasswordRecovery

void setPasswordRecovery(String forgottenPasswordQuestion,
                         String forgottenPasswordAnswer)
Set the password-recovery question and answer pair

Parameters:
forgottenPasswordQuestion - the question
forgottenPasswordAnswer - the correct answer

setRandomPassword

String setRandomPassword()
WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009)

Returns:
WRITEME