| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.util.SimpleDataRecord<Parent>
org.starhope.appius.user.Parent
public class Parent
This class represents the parent of a kid or teen account
User.getParent(), 
Serialized Form| Field Summary | |
|---|---|
| private  boolean | canContactconsent to receive contact | 
| private  String | dialectdialect of language | 
| private  String | forgotPasswordAnswerpassword recovery question's answer | 
| private  String | forgotPasswordQuestionpassword recovery question | 
| private  String | givenNameparent's given name (if known) | 
| private  int | idDatabase ID value | 
| private  String | languagelanguage | 
| private  String | mailemail address | 
| private  Date | mailConfirmedthe date that the eMail address was confirmed | 
| private  Date | mailConfirmSentthe date that the confirmation mail was sent | 
| private static int | MAX_KIDS_NAMESWhen showing the parent's name, how many children's names should be displayed before we just start counting them? | 
| private  String | passwordpassword | 
| private static long | serialVersionUIDJava serialisation unique ID | 
| Fields inherited from class org.starhope.appius.util.SimpleDataRecord | 
|---|
| myLoader, timeLastChanged, timeLastSaved | 
| Constructor Summary | |
|---|---|
| Parent()Create a blank parent record | |
| Parent(String parentMail)Create a new Parent record | |
| Parent(String newMail,
       String newPassword)Create a new parent record and set an initial password at the same time | |
| 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. | 
| static Parent | getByApprovalCookie(String cookie)Deprecated. Use Nomenclator.getParentByApprovalCookie(String)instead | 
| static Parent | getByID(int id)Deprecated. Use Nomenclator.getParentByID(int)instead | 
| static Parent | getByMail(String mail)Deprecated. Use Nomenclator.getParentByMail(String)instead | 
|  int | getCacheableID()Note that all records must have either a numeric ID ( DataRecord.getCacheableID()or a string identifier (DataRecord.getCacheableIdent()or both. | 
|  String | getCacheableIdent()Note that all records must have either a numeric ID ( DataRecord.getCacheableID()or a string identifier (DataRecord.getCacheableIdent()or both. | 
|  User[] | getChildren() | 
|  String | getConfirmationTemplate()Get the name of the template file to be used to confirm accounts of this type. | 
|  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 | 
|  GeneralUser[] | getFreeChildren() | 
|  String | getGivenName() | 
|  HashMap<Timestamp,HashMap<String,String>> | getHistory(Date after,
           int limit)Returns the historical contents of this user's record. | 
|  int | getID()Return the parent record's database ID | 
|  String | getLanguage() | 
|  String | getMail() | 
|  Date | getMailConfirmed() | 
|  Date | getMailConfirmSent() | 
|  String | getName()Get the given name of the parent | 
| static Parent | getOrCreateByMail(String parentMail) | 
|  String | getPassword() | 
|  String | getPotentialUserName()This is an overriding method. | 
|  String | getResponsibleMail()This is an overriding method. | 
|  String | getSubversionRevision()Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence. | 
|  boolean | hasBannedKids() | 
| private  void | insert()Insert a new parent record into the database, saving the parent eMail address and password. | 
|  boolean | isRegistered() | 
|  void | mailIsConfirmed()assert that the mail | 
|  void | remindPassword()This is an overriding method. | 
|  void | rename(String newName)Rename the user account, updating all necessary related records. | 
|  void | requestApproval(User user) | 
|  void | sendConfirmationMail()Sends confirmation mail to whomever should receive it | 
|  void | sendNotificationForChild(User sessionUser)Send a notification to the parent that their child has registered an account, giving instructions on how to approve the account. | 
|  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 | setDialect(String newDialect) | 
|  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 | setID(int int1) | 
|  void | setLanguage(String newLanguage) | 
|  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 newForgottenPasswordQuestion,
                    String newForgottenPasswordAnswer)Set the password-recovery question and answer pair | 
|  String | setRandomPassword()WRITEME: document this method (brpocock@star-hope.org, Sep 25, 2009) | 
|  org.json.JSONObject | toJSON()This is an overriding method. | 
|  String | toString() | 
| Methods inherited from class org.starhope.appius.util.SimpleDataRecord | 
|---|
| changed, checkStale, compareTo, equals, finalize, getRecordLoader, getTimeLastChanged, getTimeLastSaved, hashCode, isBeingLoaded, markAsLoaded, markAsSaved, markForReload, onRemove, onRetrieve, onStore, save, setRecordLoader | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, getClass, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
private static final int MAX_KIDS_NAMES
private static final long serialVersionUID
private boolean canContact
private String dialect
private String forgotPasswordAnswer
private String forgotPasswordQuestion
private String givenName
private int id
private String language
private String mail
private Date mailConfirmed
private Date mailConfirmSent
private String password
| Constructor Detail | 
|---|
public Parent()
public Parent(String parentMail)
       throws AlreadyExistsException
parentMail - the address of the parent
AlreadyExistsException - if a parent record already exists
             with the given eMail address
public Parent(String newMail,
              String newPassword)
       throws PrivilegeRequiredException,
              AlreadyExistsException
newMail - mail addressnewPassword - password
AlreadyExistsException - if the user has an existing
             account, and they know the password
PrivilegeRequiredException - if the mail exists, but the
             password is wrong| Method Detail | 
|---|
@Deprecated
public static Parent getByApprovalCookie(String cookie)
                                  throws NotFoundException,
                                         IOException
Nomenclator.getParentByApprovalCookie(String)
             instead
cookie - the approval cookie uniquely identifying the
            desired Parent
NotFoundException - if the cookie does not uniquely
             identify any Parent
IOException - if the contents of the approval cookie can't
             be decoded@Deprecated public static Parent getByID(int id)
Nomenclator.getParentByID(int) instead
id - database ID number
@Deprecated public static Parent getByMail(String mail)
Nomenclator.getParentByMail(String)
             instead
mail - The parent's eMail address
public static Parent getOrCreateByMail(String parentMail)
parentMail - the mail address for the parent
public boolean canContact()
AbstractPerson
canContact in interface AbstractPersonAbstractPerson.canContact()public boolean checkPassword(String passwordGuess)
AbstractPerson
checkPassword in interface AbstractPersonpasswordGuess - The password which is to be checked
AbstractPerson.checkPassword(java.lang.String)
public boolean forgotPassword(String forgottenPasswordQ,
                              String forgottenPasswordA)
AbstractPersonAbstractPerson.remindPassword() throws a
 NotFoundException, this will fail and return false as
 well.
forgotPassword in interface AbstractPersonforgottenPasswordQ - The question being answeredforgottenPasswordA - The answer provided
AbstractPerson.remindPassword()); and false if it is notAbstractPerson.forgotPassword(java.lang.String,
      java.lang.String)public String getApprovalCookie()
AbstractPerson
getApprovalCookie in interface AbstractPersonParent, 
User
public int getCacheableID()
                   throws NotFoundException
DataRecordDataRecord.getCacheableID() or a string identifier (
 DataRecord.getCacheableIdent() or both.
getCacheableID in interface DataRecordNotFoundException - if the item doesn't have a distinct
             numeric IDDataRecord.getCacheableID()
public String getCacheableIdent()
                         throws NotFoundException
DataRecordDataRecord.getCacheableID() or a string identifier (
 DataRecord.getCacheableIdent() or both.
getCacheableIdent in interface DataRecordNotFoundException - if the item doesn't have a distinct
             string identifierDataRecord.getCacheableIdent()public User[] getChildren()
public String getConfirmationTemplate()
getConfirmationTemplate in interface AbstractPersonAbstractPerson.getConfirmationTemplate()public String getDialect()
AbstractPerson
getDialect in interface AbstractPersonAbstractPerson.getDialect()public String getDisplayName()
AbstractPerson
getDisplayName in interface AbstractPersonAbstractPerson.getDisplayName()public String getForgotPasswordAnswer()
AbstractPerson
getForgotPasswordAnswer in interface AbstractPersonAbstractPerson.getForgotPasswordAnswer()public String getForgotPasswordQuestion()
AbstractPerson
getForgotPasswordQuestion in interface AbstractPersonAbstractPerson.getForgotPasswordQuestion()public GeneralUser[] getFreeChildren()
public String getGivenName()
getGivenName in interface AbstractPersonAbstractPerson.getGivenName()
public HashMap<Timestamp,HashMap<String,String>> getHistory(Date after,
                                                            int limit)
AbstractPerson
getHistory in interface AbstractPersonafter - 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.
AbstractPerson.getHistory(java.sql.Date,
      int)public int getID()
public String getLanguage()
getLanguage in interface AbstractPersonAbstractPerson.getLanguage()public String getMail()
getMail in interface AbstractPersonAbstractPerson.getMail()public Date getMailConfirmed()
getMailConfirmed in interface AbstractPersonAbstractPerson.getMailConfirmed()public Date getMailConfirmSent()
public String getName()
public String getPassword()
getPassword in interface AbstractPersonAbstractPerson.getPassword()public String getPotentialUserName()
getPotentialUserName in interface AbstractPersonAbstractPerson.getPotentialUserName()public String getResponsibleMail()
getResponsibleMail in interface AbstractPersonAbstractPerson.getResponsibleMail()public String getSubversionRevision()
HasSubversionRevisionReturn the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
As an example,the Subversion revision string for this file is "$Rev: 1968 $"
 
 @Override
 public String getSubversionRevision () {
        return "$Rev: ";
 }
 
getSubversionRevision in interface HasSubversionRevisionHasSubversionRevision.getSubversionRevision()public boolean hasBannedKids()
private void insert()
             throws AlreadyExistsException
AlreadyExistsException - if the record already existspublic boolean isRegistered()
public void mailIsConfirmed()
public void remindPassword()
                    throws NotReadyException
remindPassword in interface AbstractPersonNotReadyException - If the password or eMail address hasn't
             been setAbstractPerson.remindPassword()
public void rename(String newName)
            throws GameLogicException,
                   AlreadyUsedException,
                   ForbiddenUserException
AbstractPersonRename 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.
rename in interface AbstractPersonnewName - The new user name
GameLogicException - if the user is online (and therefore can't be renamed)
AlreadyUsedException - WRITEME
ForbiddenUserException - WRITEMEAbstractPerson.rename(java.lang.String)public void requestApproval(User user)
user - send a notification for the given child user, to
            request parental approvalpublic void sendConfirmationMail()
AbstractPerson
sendConfirmationMail in interface AbstractPersonAbstractPerson.sendConfirmationMail()public void sendNotificationForChild(User sessionUser)
Send a notification to the parent that their child has registered an account, giving instructions on how to approve the account.
sessionUser - the user who is a child of this parentpublic void sendStaffPasswordReset()
AbstractPerson
sendStaffPasswordReset in interface AbstractPersonAbstractPerson.sendStaffPasswordReset()public void sentConfirmationMail()
AbstractPerson
sentConfirmationMail in interface AbstractPersonAbstractPerson.sentConfirmationMail()public void setCanContact(boolean canContact1)
setCanContact in interface AbstractPersoncanContact1 - if true, the user has explicitly given us
        their legal consent to be contacted for marketing and
        other options.AbstractPerson.setCanContact(boolean)@Setter(getter="getDialect") public void setDialect(String newDialect)
newDialect - the dialect to set@Setter(getter="getForgotPasswordAnswer") public void setForgotPasswordAnswer(String answer)
AbstractPerson
setForgotPasswordAnswer in interface AbstractPersonanswer - WRITEMEAbstractPerson.setForgotPasswordAnswer(java.lang.String)@Setter(getter="getForgotPasswordQuestion") public void setForgotPasswordQuestion(String question)
AbstractPerson
setForgotPasswordQuestion in interface AbstractPersonquestion - WRITEMEAbstractPerson.setForgotPasswordQuestion(java.lang.String)@Setter(getter="getGivenName") public void setGivenName(String givenName1)
setGivenName in interface AbstractPersongivenName1 - the givenName to setAbstractPerson.setGivenName(java.lang.String)@Setter(getter="getID") public void setID(int int1)
int1 - new id@Setter(getter="getLanguage") public void setLanguage(String newLanguage)
newLanguage - the language to set
@Setter(getter="getMail")
public void setMail(String mail1)
             throws GameLogicException
setMail in interface AbstractPersonmail1 - the mail to set
GameLogicException - WRITEMEAbstractPerson.setMail(java.lang.String)@Setter(getter="getMailConfirmed") public void setMailConfirmed(Date mailConfirmed1)
setMailConfirmed in interface AbstractPersonmailConfirmed1 - the mailConfirmed to setAbstractPerson.setMailConfirmed(java.sql.Date)@Setter(getter="getMailConfirmSent") public void setMailConfirmSent(Date date)
setMailConfirmSent in interface AbstractPersondate - the date on which the mail confirmation message was sentAbstractPerson.setMailConfirmSent(java.sql.Date)@Setter(getter="getPassword") public void setPassword(String password1)
AbstractPerson
setPassword in interface AbstractPersonpassword1 - the password to setAbstractPerson.setPassword(java.lang.String)
public void setPasswordAndPasswordRecovery(String question,
                                           String answer,
                                           String newPassword)
                                    throws GameLogicException
setPasswordAndPasswordRecovery in interface AbstractPersonquestion - WRITEMEanswer - WRITEMEnewPassword - WRITEME
GameLogicException - WRITEMEAbstractPerson.setPasswordAndPasswordRecovery(java.lang.String,
      java.lang.String, java.lang.String)
public void setPasswordRecovery(String newForgottenPasswordQuestion,
                                String newForgottenPasswordAnswer)
AbstractPerson
setPasswordRecovery in interface AbstractPersonnewForgottenPasswordQuestion - the questionnewForgottenPasswordAnswer - the correct answerAbstractPerson.setPasswordRecovery(java.lang.String,
      java.lang.String)public String setRandomPassword()
AbstractPerson
setRandomPassword in interface AbstractPersonAbstractPerson.setRandomPassword()public org.json.JSONObject toJSON()
CastsToJSON.toJSON()public String toString()
toString in class SimpleDataRecord<Parent>SimpleDataRecord.toString()| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||