|
||||||||||
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 FormField Summary | |
---|---|
private boolean |
canContact
consent to receive contact |
private String |
dialect
dialect of language |
private String |
forgotPasswordAnswer
password recovery question's answer |
private String |
forgotPasswordQuestion
password recovery question |
private String |
givenName
parent's given name (if known) |
private int |
id
Database ID value |
private String |
language
language |
private String |
mail
email address |
private Date |
mailConfirmed
the date that the eMail address was confirmed |
private Date |
mailConfirmSent
the date that the confirmation mail was sent |
private static int |
MAX_KIDS_NAMES
When showing the parent's name, how many children's names should be displayed before we just start counting them? |
private String |
password
password |
private static long |
serialVersionUID
Java 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 addresspublic 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 wrongMethod 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 AbstractPerson
AbstractPerson.canContact()
public boolean checkPassword(String passwordGuess)
AbstractPerson
checkPassword
in interface AbstractPerson
passwordGuess
- The password which is to be checked
AbstractPerson.checkPassword(java.lang.String)
public boolean forgotPassword(String forgottenPasswordQ, String forgottenPasswordA)
AbstractPerson
AbstractPerson.remindPassword()
throws a
NotFoundException
, this will fail and return false as
well.
forgotPassword
in interface AbstractPerson
forgottenPasswordQ
- 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 AbstractPerson
Parent
,
User
public int getCacheableID() throws NotFoundException
DataRecord
DataRecord.getCacheableID()
or a string identifier (
DataRecord.getCacheableIdent()
or both.
getCacheableID
in interface DataRecord
NotFoundException
- if the item doesn't have a distinct
numeric IDDataRecord.getCacheableID()
public String getCacheableIdent() throws NotFoundException
DataRecord
DataRecord.getCacheableID()
or a string identifier (
DataRecord.getCacheableIdent()
or both.
getCacheableIdent
in interface DataRecord
NotFoundException
- if the item doesn't have a distinct
string identifierDataRecord.getCacheableIdent()
public User[] getChildren()
public String getConfirmationTemplate()
getConfirmationTemplate
in interface AbstractPerson
AbstractPerson.getConfirmationTemplate()
public String getDialect()
AbstractPerson
getDialect
in interface AbstractPerson
AbstractPerson.getDialect()
public String getDisplayName()
AbstractPerson
getDisplayName
in interface AbstractPerson
AbstractPerson.getDisplayName()
public String getForgotPasswordAnswer()
AbstractPerson
getForgotPasswordAnswer
in interface AbstractPerson
AbstractPerson.getForgotPasswordAnswer()
public String getForgotPasswordQuestion()
AbstractPerson
getForgotPasswordQuestion
in interface AbstractPerson
AbstractPerson.getForgotPasswordQuestion()
public GeneralUser[] getFreeChildren()
public String getGivenName()
getGivenName
in interface AbstractPerson
AbstractPerson.getGivenName()
public HashMap<Timestamp,HashMap<String,String>> getHistory(Date after, int limit)
AbstractPerson
getHistory
in interface AbstractPerson
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.
AbstractPerson.getHistory(java.sql.Date,
int)
public int getID()
public String getLanguage()
getLanguage
in interface AbstractPerson
AbstractPerson.getLanguage()
public String getMail()
getMail
in interface AbstractPerson
AbstractPerson.getMail()
public Date getMailConfirmed()
getMailConfirmed
in interface AbstractPerson
AbstractPerson.getMailConfirmed()
public Date getMailConfirmSent()
public String getName()
public String getPassword()
getPassword
in interface AbstractPerson
AbstractPerson.getPassword()
public String getPotentialUserName()
getPotentialUserName
in interface AbstractPerson
AbstractPerson.getPotentialUserName()
public String getResponsibleMail()
getResponsibleMail
in interface AbstractPerson
AbstractPerson.getResponsibleMail()
public String getSubversionRevision()
HasSubversionRevision
Return 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 HasSubversionRevision
HasSubversionRevision.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 AbstractPerson
NotReadyException
- If the password or eMail address hasn't
been setAbstractPerson.remindPassword()
public void rename(String newName) throws GameLogicException, AlreadyUsedException, ForbiddenUserException
AbstractPerson
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.
rename
in interface AbstractPerson
newName
- 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 AbstractPerson
AbstractPerson.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 AbstractPerson
AbstractPerson.sendStaffPasswordReset()
public void sentConfirmationMail()
AbstractPerson
sentConfirmationMail
in interface AbstractPerson
AbstractPerson.sentConfirmationMail()
public void setCanContact(boolean canContact1)
setCanContact
in interface AbstractPerson
canContact1
- 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 AbstractPerson
answer
- WRITEMEAbstractPerson.setForgotPasswordAnswer(java.lang.String)
@Setter(getter="getForgotPasswordQuestion") public void setForgotPasswordQuestion(String question)
AbstractPerson
setForgotPasswordQuestion
in interface AbstractPerson
question
- WRITEMEAbstractPerson.setForgotPasswordQuestion(java.lang.String)
@Setter(getter="getGivenName") public void setGivenName(String givenName1)
setGivenName
in interface AbstractPerson
givenName1
- 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 AbstractPerson
mail1
- the mail to set
GameLogicException
- WRITEMEAbstractPerson.setMail(java.lang.String)
@Setter(getter="getMailConfirmed") public void setMailConfirmed(Date mailConfirmed1)
setMailConfirmed
in interface AbstractPerson
mailConfirmed1
- the mailConfirmed to setAbstractPerson.setMailConfirmed(java.sql.Date)
@Setter(getter="getMailConfirmSent") public void setMailConfirmSent(Date date)
setMailConfirmSent
in interface AbstractPerson
date
- 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 AbstractPerson
password1
- the password to setAbstractPerson.setPassword(java.lang.String)
public void setPasswordAndPasswordRecovery(String question, String answer, String newPassword) throws GameLogicException
setPasswordAndPasswordRecovery
in interface AbstractPerson
question
- 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 AbstractPerson
newForgottenPasswordQuestion
- the questionnewForgottenPasswordAnswer
- the correct answerAbstractPerson.setPasswordRecovery(java.lang.String,
java.lang.String)
public String setRandomPassword()
AbstractPerson
setRandomPassword
in interface AbstractPerson
AbstractPerson.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 |